/* ============================================================
   CMS La Camara - Public Site Styles
   ============================================================ */

:root {
    --primary: #29316D;
    --primary-light: #3a4490;
    --accent: #6E3A84;
    --accent-light: #8a52a0;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
    --max-width: 1440px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-800);
    background: var(--white);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 1200px;
}

/* --- Header --- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 90px;
    position: relative;
    transition: height 0.3s ease;
}

.site-header.scrolled .header-inner {
    height: 60px;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    max-height: 75px;
    width: auto;
    transition: max-height 0.3s ease;
}

.site-header.scrolled .logo-img {
    max-height: 50px;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.main-nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.nav-list .nav-link {
    padding: 8px 16px;
    color: var(--gray-700);
    font-size: 15.5px;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-list .nav-link:hover {
    color: var(--primary);
    background: rgba(41,49,109,0.05);
}

/* Search */
.search-wrapper {
    display: flex;
    align-items: center;
}

.search-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--gray-700);
    transition: var(--transition);
}

.search-toggle:hover {
    color: var(--primary);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0;
}

.search-close {
    display: none;
}

.search-input {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
    width: 200px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary);
    width: 260px;
}

.search-btn {
    padding: 8px 12px;
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn svg {
    display: block;
}

.search-btn:hover {
    background: var(--primary-light);
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    transition: var(--transition);
}

/* --- Main Content --- */
.main-content {
    min-height: 60vh;
}

.section {
    padding: 48px 0;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 32px;
}

.section-desc {
    color: var(--gray-600);
    margin-bottom: 24px;
    font-size: 16px;
}

/* --- Hero --- */
.hero-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Category Hero (banner con imagen) --- */
.category-hero {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.category-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(20, 24, 54, 0.45), rgba(20, 24, 54, 0.65));
}

.category-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 24px;
}

.category-hero-title {
    font-size: 44px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 14px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.category-hero-desc {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .category-hero {
        height: 280px;
    }
    .category-hero-title {
        font-size: 30px;
    }
    .category-hero-desc {
        font-size: 16px;
    }
}

/* --- News Grid --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.news-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-body {
    padding: 20px;
}

.news-card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 8px;
}

.news-card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.news-card-title a {
    color: var(--gray-900);
}

.news-card-title a:hover {
    color: var(--primary);
}

.news-card-excerpt {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    line-height: 1.5;
}

.news-card-date {
    font-size: 12px;
    color: var(--gray-500);
}

/* --- Benefits --- */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.benefit-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.benefit-card-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.benefit-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.benefit-card:hover .benefit-card-image img {
    transform: scale(1.05);
}

.benefit-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
}

.benefit-card-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.benefit-card-desc {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.55;
    margin-bottom: 14px;
}

/* Descripción con "ver más": por defecto se oculta el texto completo. */
.benefit-card-desc .benefit-desc-full {
    display: none;
}

.benefit-card-desc.expanded .benefit-desc-short {
    display: none;
}

.benefit-card-desc.expanded .benefit-desc-full {
    display: inline;
}

.benefit-desc-toggle {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.benefit-desc-toggle:hover {
    text-decoration: underline;
}

.benefit-card-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200);
}

.benefit-card-business {
    display: flex;
    align-items: center;
    gap: 10px;
}

.benefit-business-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    flex: 0 0 auto;
}

.benefit-business-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.2;
}

.benefit-card-address {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.4;
    margin-top: 10px;
}

.benefit-card-address svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--accent);
}

.benefit-card-website,
.benefit-card-phone {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
    word-break: break-word;
}

.benefit-card-website svg,
.benefit-card-phone svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--accent);
}

/* --- Home Layout (main + sidebar) --- */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

.home-main .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 90px;
}

.sidebar-block {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--white);
    background: var(--primary);
    padding: 12px 16px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li + li {
    border-top: 1px solid var(--gray-100);
}

.sidebar-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--gray-800);
    font-size: 14px;
    font-weight: 500;
}

.sidebar-list a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.sidebar-count {
    flex-shrink: 0;
    min-width: 24px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    border-radius: 12px;
    padding: 1px 8px;
}

.sidebar-list a:hover .sidebar-count {
    background: var(--accent);
    color: var(--white);
}

@media (max-width: 900px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .home-sidebar {
        position: static;
    }
}

/* --- Aviso de vista previa (borrador / programada) --- */
.preview-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff8e1;
    border: 1px solid #f5d97a;
    border-left: 4px solid #e0a800;
    color: #7a5b00;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.5;
}

.preview-notice-icon {
    font-size: 18px;
    line-height: 1.4;
}

/* --- Article Single --- */
.article-single {
    padding: 48px 0;
}

.article-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.article-featured-image {
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    display: block;
}

/* Content area styling (from TinyMCE) */
.content-area {
    font-size: 18px;
    line-height: 1.8;
    color: var(--gray-800);
}

.content-area h2 { font-size: 26px; margin: 32px 0 16px; color: var(--gray-900); }
.content-area h3 { font-size: 22px; margin: 24px 0 12px; color: var(--gray-900); }
.content-area p { margin-bottom: 16px; }
.content-area img { border-radius: var(--radius); margin: 16px 0; }
.content-area video,
.content-area iframe { max-width: 100%; }
.content-area video { width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0; display: block; }
.content-area figure { max-width: 100%; margin: 16px 0; }
.content-area figure img { margin: 0; }
.content-area ul, .content-area ol { margin: 16px 0; padding-left: 24px; }
.content-area li { margin-bottom: 8px; }
.content-area blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--gray-50);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--gray-700);
}
.content-area table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.content-area th, .content-area td { padding: 10px 14px; border: 1px solid var(--gray-200); text-align: left; }
.content-area th { background: var(--gray-50); font-weight: 600; }

/* ============================================================
   Bloques de WordPress / Gutenberg dentro del contenido
   (contenido migrado: wp-block-*, alignments, columnas, galerías)
   ============================================================ */

/* Imágenes de bloque */
.content-area .wp-block-image,
.content-area figure.wp-block-image {
    margin: 24px 0;
}

.content-area .wp-block-image img,
.content-area figure img {
    height: auto;
    border-radius: var(--radius);
}

/* Imagen redimensionada por el editor: respeta su ancho pero sin desbordar */
.content-area .wp-block-image.is-resized img,
.content-area img.is-resized {
    max-width: 100%;
}

/* Epígrafes / captions */
.content-area figcaption,
.content-area .wp-block-image figcaption,
.content-area .wp-caption-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gray-600);
    text-align: center;
    margin-top: 8px;
}

.content-area .wp-caption {
    max-width: 100%;
}

/* Alineaciones (Gutenberg y editor clásico) */
.content-area .aligncenter,
.content-area figure.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.content-area img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.content-area .alignleft {
    float: left;
    margin: 6px 24px 16px 0;
    max-width: 50%;
}

.content-area .alignright {
    float: right;
    margin: 6px 0 16px 24px;
    max-width: 50%;
}

/* Bloques anchos / a todo el ancho (salen del contenedor) */
.content-area .alignwide {
    margin-left: calc(50% - 46vw);
    margin-right: calc(50% - 46vw);
    max-width: 92vw;
    width: 92vw;
}

.content-area .alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.content-area .alignwide img,
.content-area .alignfull img {
    width: 100%;
}

/* Columnas */
.content-area .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 24px 0;
    align-items: flex-start;
}

.content-area .wp-block-column {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

/* Si el editor fijó un ancho (flex-basis inline), respetar la proporción sin crecer */
.content-area .wp-block-column[style*="flex-basis"] {
    flex-grow: 0;
}

.content-area .wp-block-column > *:first-child { margin-top: 0; }
.content-area .wp-block-column > *:last-child { margin-bottom: 0; }

/* WordPress apila las columnas en pantallas chicas */
@media (max-width: 781px) {
    .content-area .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-direction: column;
    }
    .content-area .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
        flex-basis: 100% !important;
    }
}

/* Galerías (Gutenberg nuevo y clásico) */
.content-area .wp-block-gallery,
.content-area .blocks-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

.content-area .wp-block-gallery .wp-block-image,
.content-area .wp-block-gallery figure,
.content-area .blocks-gallery-item {
    flex: 1 1 200px;
    margin: 0;
}

.content-area .wp-block-gallery img,
.content-area .blocks-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Sugerencia de columnas fijas del editor */
.content-area .wp-block-gallery.columns-2 .wp-block-image { flex-basis: calc(50% - 6px); }
.content-area .wp-block-gallery.columns-3 .wp-block-image { flex-basis: calc(33.333% - 8px); }
.content-area .wp-block-gallery.columns-4 .wp-block-image { flex-basis: calc(25% - 9px); }

/* Embeds responsivos */
.content-area .wp-block-embed__wrapper {
    position: relative;
    padding-top: 56.25%;
}
.content-area .wp-block-embed__wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Botones de Gutenberg */
.content-area .wp-block-button__link {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
}

/* Todas las imágenes del contenido invitan a ampliarse */
.content-area img {
    cursor: zoom-in;
}

/* ============================================================
   Lightbox (ampliar imágenes del contenido en el sitio)
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    cursor: zoom-out;
}

.lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-figure {
    margin: 0;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox-overlay img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
    max-width: 800px;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
}

/* --- Gallery Public --- */
.article-gallery {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.article-gallery h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.gallery-grid-public {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-item-public {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-item-public img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item-public:hover img {
    transform: scale(1.05);
}

/* --- Share Buttons --- */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    color: var(--white);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-twitter { background: #000000; }
.share-telegram { background: #229ED9; }
.share-native { background: var(--primary); }

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* --- Page Content --- */
.page-content {
    padding: 48px 0;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 24px;
}

.page-featured-image {
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
}

.page-featured-image img {
    width: 100%;
    display: block;
}

/* --- Search --- */
.search-filters {
    margin-bottom: 32px;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-row .form-input,
.filter-row .form-select {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-result-item {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.search-result-item h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.search-result-excerpt {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.search-result-category {
    color: var(--accent);
    font-weight: 600;
}

/* --- Archive --- */
.archive-sidebar {
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

.archive-sidebar h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--gray-800);
}

.archive-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.archive-list a {
    display: inline-block;
    padding: 6px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    font-size: 13px;
    color: var(--gray-700);
}

.archive-list a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.pagination a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* --- Footer --- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.85);
    padding: 48px 0 0;
}

/* Logos de entidades asociadas (arriba del bloque azul) */
.footer-logos {
    background: var(--white);
    padding: 28px 0;
    margin-top: 48px;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.footer-logos-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 48px;
}

.footer-logo-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-item img {
    max-height: 64px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-logo-item:hover img {
    opacity: 1;
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .footer-logos-grid {
        flex-direction: column;
        gap: 28px;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
}

.footer-info {
    max-width: 400px;
}

.footer-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.6;
}

.footer-heading {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav a {
    display: block;
    padding: 4px 0;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.footer-nav a:hover {
    color: var(--white);
}

/* --- Footer social icons --- */
.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.footer-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: var(--white);
    transition: var(--transition);
}

.footer-social-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.footer-social-btn:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 20px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.footer-bottom p {
    margin: 0;
}

.footer-credit a {
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

.footer-credit a:hover {
    color: var(--white);
}

/* --- Buttons (public) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* --- Responsive --- */
/* Entre ~981px y 1180px achicamos el buscador para que no se superponga con el
   menú, y juntamos un poco los ítems del menú (menos gap y padding). */
@media (max-width: 1180px) {
    .logo-img {
        max-height: 55px;
    }

    .search-input {
        width: 140px;
    }

    .search-input:focus {
        width: 170px;
    }

    .nav-list {
        gap: 0;
    }

    .nav-list .nav-link {
        padding: 8px 10px;
        font-size: 15px;
    }
}

@media (max-width: 980px) {
    .header-inner {
        flex-wrap: nowrap;
        height: 60px;
        padding: 0;
    }

    .site-header.scrolled .header-inner {
        height: 50px;
    }

    .site-logo {
        flex: 1;
    }

    .logo-img {
        max-height: 55px;
    }

    .site-header.scrolled .logo-img {
        max-height: 45px;
    }

    .container {
        padding: 0 10px;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 60px; /* fallback, JS overrides */
        left: 0;
        right: 0;
        transform: none;
        background: var(--white);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 99;
        order: 3;
    }

    .main-nav.open {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        padding: 10px 0;
    }

    .nav-list li {
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-list li:last-child {
        border-bottom: none;
    }

    .nav-list .nav-link {
        display: block;
        font-size: 17px;
        padding: 16px 20px;
        text-align: right;
        border-radius: 0;
        border-bottom: none;
    }

    /* Mobile: hide the inline search form, show the toggle icon */
    .search-form {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--white);
        z-index: 200;
        padding: 10px 16px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.15);
        gap: 0;
    }

    .search-form.open {
        display: flex;
    }

    .search-form.open .search-input {
        flex: 1;
        width: auto;
        border-radius: var(--radius) 0 0 var(--radius);
        font-size: 16px;
        height: 40px;
    }

    .search-form.open .search-btn {
        height: 40px;
        width: 44px;
        border-radius: 0 var(--radius) var(--radius) 0;
    }

    .search-form.open .search-close {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 28px;
        color: var(--gray-600);
        cursor: pointer;
        padding: 0 4px 0 12px;
        line-height: 1;
    }

    .search-toggle {
        display: flex;
        order: 3;
    }

    .search-wrapper {
        order: 3;
    }

    .mobile-toggle {
        display: flex;
        order: 4;
    }

    .hero-title { font-size: 28px; }
    .article-title { font-size: 26px; }
    .page-title { font-size: 26px; }
    .section-title { font-size: 22px; }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        justify-content: center;
        text-align: center;
    }

    .filter-row {
        flex-direction: column;
    }

    .share-buttons {
        justify-content: center;
    }
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card {
    animation: fadeIn 0.4s ease forwards;
}

.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.2s; }
.news-card:nth-child(4) { animation-delay: 0.3s; }

/* ---- Contact form ---- */
.contact-page .contact-intro { color: #555; margin-bottom: 24px; }
.contact-form .form-row { margin-bottom: 18px; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; color: #333; }
.contact-form .req { color: #c0392b; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary, #29316D);
    box-shadow: 0 0 0 3px rgba(41, 49, 109, .12);
}
.contact-form .field-error { color: #c0392b; font-size: 13px; display: block; margin-top: 4px; }
.btn-contact {
    background: var(--primary, #29316D);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.btn-contact:hover { opacity: .92; }
.form-alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; }
.form-alert-success { background: #e7f6ec; color: #1e7e45; border: 1px solid #b6e2c5; }
.form-alert-error { background: #fdecea; color: #b93a2b; border: 1px solid #f5c6c0; }

/* ---- Home carousel ---- */
.carousel {
    position: relative; width: 100%; overflow: hidden; background: #0b0b0b;
    cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.carousel.dragging { cursor: grabbing; }
.carousel-track { position: relative; width: 100%; }

.carousel-slide {
    position: absolute; top: 0; left: 0; width: 100%;
    opacity: 0; transition: opacity .7s ease; pointer-events: none;
    text-decoration: none; display: block;
}
.carousel-slide.active { position: relative; opacity: 1; pointer-events: auto; }

/* Skeleton shimmer estilo Facebook mientras carga la imagen */
.carousel-slide::before {
    content: ""; position: absolute; inset: 0; z-index: 1; background: #1c1f26;
    background-image: linear-gradient(100deg,
        rgba(255,255,255,0) 20%, rgba(255,255,255,.07) 40%,
        rgba(255,255,255,.13) 50%, rgba(255,255,255,.07) 60%, rgba(255,255,255,0) 80%);
    background-size: 200% 100%;
    animation: carousel-shimmer 1.4s infinite linear;
    opacity: 1; transition: opacity .45s ease;
}
.carousel-slide.img-loaded::before { opacity: 0; animation: none; }
@keyframes carousel-shimmer {
    0%   { background-position: 150% 0; }
    100% { background-position: -50% 0; }
}

/* La imagen aparece con un fade + leve zoom cuando ya cargó */
.carousel-slide img {
    position: relative; z-index: 2;
    width: 100%; height: auto; display: block;
    max-height: 72vh; object-fit: cover;
    opacity: 0; transform: scale(1.04);
    transition: opacity .7s ease, transform 1.4s ease;
    -webkit-user-drag: none; user-select: none;
}
.carousel-slide.img-loaded img { opacity: 1; transform: none; }

.carousel-caption {
    position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end;
    padding: 4%; pointer-events: none;
}
.caption-left   { justify-content: flex-start; }
.caption-center { justify-content: center; text-align: center; }
.caption-right  { justify-content: flex-end; text-align: right; }
.carousel-caption-inner {
    background: rgba(0, 0, 0, .45); color: #fff;
    padding: 16px 24px; border-radius: 8px; max-width: 60%;
    font-size: clamp(1rem, 2.4vw, 1.9rem); font-weight: 600; line-height: 1.3;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .6s ease .25s, transform .7s cubic-bezier(.2, .7, .2, 1) .25s;
}
/* El texto entra desde su costado (o desde abajo si está centrado) */
.caption-left   .carousel-caption-inner { transform: translateX(-48px); }
.caption-right  .carousel-caption-inner { transform: translateX(48px); }
.caption-center .carousel-caption-inner { transform: translateY(30px); }
.carousel-slide.active .carousel-caption-inner { opacity: 1; transform: none; }

.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, .4); color: #fff; border: none;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    font-size: 18px; line-height: 1; z-index: 4; transition: background .2s;
}
.carousel-arrow:hover { background: rgba(0, 0, 0, .7); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }
.carousel-dots {
    position: absolute; bottom: 14px; left: 0; right: 0; z-index: 4;
    display: flex; justify-content: center; gap: 8px;
}
.carousel-dot {
    width: 11px; height: 11px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255, 255, 255, .5); padding: 0; transition: background .2s, transform .2s;
}
.carousel-dot.active { background: #fff; transform: scale(1.15); }

@media (max-width: 768px) {
    .carousel-slide img { max-height: 52vh; }
    .carousel-caption-inner { max-width: 90%; padding: 10px 14px; }
    .carousel-arrow { width: 36px; height: 36px; font-size: 15px; }
    .carousel-prev { left: 8px; }
    .carousel-next { right: 8px; }
}

/* Respetar preferencia de menos animaciones */
@media (prefers-reduced-motion: reduce) {
    .carousel-slide,
    .carousel-slide img,
    .carousel-slide::before,
    .carousel-caption-inner {
        transition: none !important; animation: none !important; transform: none !important;
    }
    .carousel-slide.img-loaded img,
    .carousel-slide.active .carousel-caption-inner { opacity: 1; }
}

/* ============================================================
   Servicios
   ============================================================ */
/* Encuadra el video del contenido como "pantalla cine": limita su ancho y lo
   centra con márgenes horizontales, evitando que un video cuadrado quede muy alto. */
.services-page-content .content-area video {
    display: block;
    width: 100%;
    max-width: 540px;
    height: auto;
    margin-inline: auto;
    border-radius: var(--radius);
}

.services-intro {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
}

.services-title {
    margin-bottom: 16px;
}

.services-subtitle {
    font-size: 18px;
    color: var(--gray-600);
    line-height: 1.7;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.service-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border-radius: 20px;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(41,49,109,0.10), rgba(110,58,132,0.12));
    transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.service-icon svg {
    width: 44px;
    height: 44px;
}

.service-card:hover .service-icon {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    transform: scale(1.05);
}

.service-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.service-desc {
    color: var(--gray-700);
    font-size: 15.5px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.service-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-list li {
    position: relative;
    padding-left: 26px;
    color: var(--gray-700);
    font-size: 14.5px;
    line-height: 1.5;
}

.service-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat;
}

@media (max-width: 600px) {
    .services-subtitle {
        font-size: 16px;
    }

    .service-card {
        padding: 28px 24px;
    }

    .service-icon {
        width: 72px;
        height: 72px;
    }

    .service-icon svg {
        width: 38px;
        height: 38px;
    }
}
