/*
Theme Name: Darwin Landing
Theme URI: https://www.charlesdarwin.cl
Author: Rodrigo Oyarzún Márquez
Author URI: https://www.charlesdarwin.cl
Description: Tema personalizado con landing page: barra superior con redes y botón de Documentos, barra principal fija con logo y menú, slider, sección de Quienes Somos (equipo directivo) y Noticias, más pie de página.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: darwin-landing
*/

/* Reset básico */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; color: #1a1a1a; font-size: 17px; line-height: 1.7; }
 a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* Layout: header fijo (top + nav) */
:root {
  --topbar-h: 64px;
  --navbar-h: 78px;
  --header-h: calc(var(--topbar-h) + var(--navbar-h));
  --adminbar-h: 0px;
  --brand: #0a4d8c;
  --brand-2: #0f6fc5;
  --accent: #e4f0fb;
  --section-gap: 0px; /* sin separación entre secciones */
  --section-inner-top: 24px; /* separación interna superior uniforme */
}

/* Cuando el usuario está logueado y WP muestra la admin bar */
body.admin-bar { --adminbar-h: 32px; }
@media (max-width: 782px) { body.admin-bar { --adminbar-h: 46px; } }

body.has-fixed-header { padding-top: calc(var(--header-h) + var(--adminbar-h)); }

/* Asegura que el primer bloque (slider) quede pegado al header */
main.site-content { margin: 0; padding-top: 0; }
.site-content > section:first-of-type { margin-top: 0 !important; padding-top: 0; }
.site-content > section { padding-top: var(--section-inner-top); }
.site-content > section + section { margin-top: var(--section-gap); }
.site-content > section.hero { padding-top: 0; }
.hero, .slider, .slides, .slide { margin-top: 0; }

header.site-header { position: fixed; top: var(--adminbar-h); left: 0; right: 0; z-index: 1000; }
.top-bar { height: var(--topbar-h); background: #0b2545; color: #fff; font-size: 14px; }
.top-bar .wrap { max-width: 1200px; margin: 0 auto; height: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 0 24px; gap: 16px; }
.top-bar .left { display: flex; align-items: center; gap: 16px; }
.top-bar .social { display: flex; gap: 12px; align-items: center; }
.top-bar .contact { display: flex; justify-content: center; gap: 22px; align-items: center; color: #cfe8ff; font-size: 16px; font-weight: 700; }
.top-bar .contact .item { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; color: #cfe8ff; }
.top-bar .social a { color: #cfe8ff; opacity: .95; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; }
.top-bar .social a i { font-size: 20px; line-height: 1; }
.top-bar .social a:hover { color: #fff; background: rgba(255,255,255,.12); }
.top-bar .contact .item:hover { color: #fff; }
.top-bar .contact .item .icon svg { display: block; }
.top-bar .docs-btn { background: #fff; color: #0b2545; padding: 10px 20px; border-radius: 10px; font-weight: 700; white-space: nowrap; margin: 0; border: 2px solid rgba(15, 111, 197, 0.2); box-shadow: 0 2px 8px rgba(15, 111, 197, 0.15), 0 1px 0 rgba(255,255,255,.8) inset; transition: all 0.2s ease; }
.top-bar .docs-btn:hover { background: #0f6fc5; color: #fff; border-color: #0f6fc5; box-shadow: 0 4px 12px rgba(15, 111, 197, 0.3), 0 1px 0 rgba(255,255,255,.2) inset; transform: translateY(-1px); }

.main-nav { height: var(--navbar-h); background: #fff; border-bottom: 1px solid #e6eef6; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.main-nav .wrap { max-width: 1200px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .custom-logo-link { display: block; height: min(var(--logo-h, 56px), var(--navbar-h)); padding: 6px 8px; border-radius: 8px; }
.brand .custom-logo { display: block; height: 100%; width: auto; max-height: var(--navbar-h); object-fit: contain; }
.brand .site-title { font-family: Montserrat, Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial; font-weight: 800; font-size: 20px; color: var(--brand); letter-spacing: .2px; }
.mobile-menu-toggle { display: none; }
.primary-menu { display: flex; gap: 20px; align-items: center; list-style: none; margin: 0; padding: 0; }
.primary-menu li { list-style: none; }
.primary-menu .sub-menu { list-style: none; margin: 0; padding: 8px 0; }
.primary-menu a { padding: 10px 6px; border-radius: 6px; color: #0b2545; font-weight: 600; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { background: var(--accent); color: var(--brand-2); }

/* Hero de páginas individuales - DESKTOP */
.page-hero { 
  position: relative; 
  background: #000; 
  overflow: hidden; 
  min-height: 420px; 
  display: flex; 
  align-items: flex-end;
  justify-content: center; 
  margin: 0;
}
.page-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.page-hero-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block !important; }
.page-hero .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.4) 45%, rgba(0,0,0,.7) 100%); z-index: 1; }
.page-hero-content { position: relative; z-index: 2; width: 100%; padding: 48px 24px 56px; }
.page-hero-content .wrap { max-width: 1200px; margin: 0 auto; }
.page-hero-title { margin: 0; color: #fff; font-family: Montserrat, Inter, system-ui; font-weight: 800; font-size: clamp(32px, 4.5vw, 52px); line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.6); }

/* Hero cuando no hay imagen destacada */
.page-hero:not(:has(.page-hero-image)) { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); min-height: 220px; }
.page-hero:not(:has(.page-hero-image)) .page-hero-title { text-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* TABLETS - Hero de páginas */
@media (max-width: 960px) and (min-width: 721px) {
  .page-hero { 
    min-height: 380px;
  }
  .page-hero-content { 
    padding: 40px 20px 48px;
  }
  .page-hero-title { 
    font-size: clamp(28px, 4vw, 42px);
  }
}

/* MÓVILES - Hero de páginas (actualizado) */
@media (max-width: 720px) {
  .page-hero { 
    min-height: 450px !important;
    height: 450px;
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-items: flex-end;
    display: flex;
  }
  .page-hero-content { 
    padding: 24px 20px 40px;
    position: relative;
    z-index: 2;
    width: 100%;
  }
  .page-hero-content .wrap { 
    width: 100%; 
  }
  .page-hero-title { 
    font-size: clamp(26px, 6.5vw, 34px); 
    line-height: 1.2;
    text-align: left;
    color: #fff;
  }
  .page-hero-image { 
    display: block !important; 
    position: absolute !important; 
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #000;
    z-index: 0;
  }
  .page-hero-image img { 
    display: block !important; 
    object-fit: cover !important; 
    object-position: center center !important;
    width: 100% !important; 
    height: 100% !important;
    max-width: 100% !important;
  }
  .page-hero .overlay { 
    display: block !important;
    opacity: 1 !important;
    background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.75) 100%) !important;
    z-index: 1;
    position: absolute;
    inset: 0;
  }
  .page-hero:not(:has(.page-hero-image)) {
    min-height: 180px;
    height: auto;
  }
}

/* Hero slider */
.hero { background: #000; }
.slider { position: relative; overflow: hidden; }
.slides { display: flex; transition: transform .5s ease; }
.slide { position: relative; min-width: 100%; height: clamp(420px, 55vw, 640px); }
.slide .slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; filter: none; }
.slide .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.55) 100%); }
.slide .slide-content { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px 16px; }
.slide .slide-content .inner { width: 100%; max-width: 1100px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.slide .slide-content h2 { margin: 0 0 10px; font-family: Montserrat, Inter, system-ui; font-weight: 800; font-size: clamp(22px, 2.8vw, 36px); line-height: 1.15; }
.slide .slide-content p { margin: 0 0 18px; font-size: clamp(16px, 1.7vw, 19px); max-width: 720px; }
.slide .slide-content .btn { display: inline-block; background: var(--brand-2); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 800; }
.slide .slide-content .btn:hover { background: #0a4d8c; }
.slider .controls { position: absolute; inset: auto 0 10px 0; display: flex; justify-content: center; gap: 10px; }
.slider .dot { width: 10px; height: 10px; background: #c3d9f5; border-radius: 999px; cursor: pointer; border: 2px solid transparent; }
.slider .dot.active { background: #0f6fc5; border-color: #fff; }

/* Slider: flechas de navegación */
.slider .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; border: none; background: rgba(0,0,0,.35); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(2px); transition: background .2s ease, transform .2s ease; }
.slider .nav:hover { background: rgba(0,0,0,.5); }
.slider .nav i { font-size: 18px; line-height: 1; }
.slider .nav.prev { left: 10px; }
.slider .nav.next { right: 10px; }

/* Sección: Quienes somos */
section.team { padding: var(--section-inner-top) 16px 16px 16px; background: #fff; text-align: center; margin: 0; }
/* (Se usa el gap global para separar secciones) */
section.team .team-grid { width: 100%; }
.section-title { max-width: 1200px; margin: 0 auto 24px; font-size: clamp(22px, 2.8vw, 36px); color: #0b2545; font-family: Montserrat, Inter, system-ui; font-weight: 800; letter-spacing: .2px; }
.content-area .page-title,
.content-area .entry-title { font-family: Montserrat, Inter, system-ui; font-weight: 800; letter-spacing: .2px; font-size: clamp(22px, 2.8vw, 36px); }
.section-title.center { text-align: center; }
.section-subtitle { max-width: 900px; margin: 0 auto 28px; color: #365a79; font-size: 17px; line-height: 1.7; }
.section-subtitle.center { text-align: center; }
.team-grid { width: 100%; max-width: 1200px; margin: 0 auto; display: grid; gap: var(--team-gap, 20px); justify-content: center; justify-items: center; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.team-grid .member { width: 100%; max-width: 480px; }
.team-grid-wrapper { display: flex !important; flex-wrap: wrap !important; gap: 20px !important; max-width: 1200px; margin: 0 auto !important; justify-content: center !important; width: 100%; }
.team-grid-wrapper.wp-block-group { display: flex !important; flex-wrap: wrap !important; }
.team-grid-wrapper > .wp-block-group { width: auto; flex: 0 0 auto; }
.team-grid-wrapper .member { width: 320px; max-width: 380px; flex-shrink: 0; }
.member { background: #f8fbff; border: 1px solid #e8f0fb; border-radius: 16px; padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.member .avatar { width: 180px; height: 180px; margin: 8px auto 14px; border-radius: 50%; overflow: hidden; box-shadow: 0 6px 20px rgba(15,111,197,.15); border: 4px solid #fff; }
.member .avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transform-origin: var(--transform-origin, center); transform: scale(var(--dl-zoom, 1)); }
.member .wp-block-image { margin: 8px auto 14px !important; width: 180px !important; height: 180px !important; }
.member .wp-block-image img { width: 180px !important; height: 180px !important; border-radius: 50% !important; object-fit: cover !important; object-position: center 30% !important; box-shadow: 0 6px 20px rgba(15,111,197,.15) !important; border: 4px solid #fff !important; display: block !important; }
.member .wp-block-image figure { margin: 0 !important; }

/* Helper classes para ajustar posición de la foto */
.member .wp-block-image.pos-top img { object-position: center 20% !important; }
.member .wp-block-image.pos-center img { object-position: center 50% !important; }
.member .wp-block-image.pos-bottom img { object-position: center 70% !important; }
.member .wp-block-image.zoom-in img { transform: scale(1.2); }
.member .wp-block-image.zoom-out img { transform: scale(0.9); }

.member .name { font-weight: 700; color: #0b2545; margin: 0; }
.member .role { color: #27567d; font-size: 14px; margin: 0; }

/* Sección: Noticias */
section.news { padding: var(--section-inner-top) 16px 56px; background: #f6f9fd; border-top: 0; }
.news .section-title { text-align: center; }
.news-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card { background: #fff; border: 1px solid #e8f0fb; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
/* Forzar que todas las miniaturas tengan el mismo alto: 16:9 y recorte centrado */
.post-card .thumb { display: block; position: relative; aspect-ratio: 16/9; background: #eaf2fc; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.post-card .body { padding: 14px; display: grid; gap: 8px; }
.post-card h3 { margin: 0; font-size: 18px; color: #0b2545; }
.post-card .meta { font-size: 12px; color: #5b6f86; }
.post-card a.read-more { color: #0f6fc5; font-weight: 600; }

/* Sección: Página Personalizada */
section.custom-page-section { padding: var(--section-inner-top) 16px 56px; background: #fff; }
.custom-page-section .container { max-width: 1200px; margin: 0 auto; }
.custom-page-section .section-title { text-align: center; margin-bottom: 32px; }
.custom-page-section .page-content { line-height: 1.7; color: #2c3e50; }
.custom-page-section .page-content h2,
.custom-page-section .page-content h3,
.custom-page-section .page-content h4 { color: #0b2545; margin-top: 1.5em; margin-bottom: 0.5em; }
.custom-page-section .page-content p { margin-bottom: 1em; }
.custom-page-section .page-content img { max-width: 100%; height: auto; border-radius: 8px; }
.custom-page-section .page-content ul,
.custom-page-section .page-content ol { margin-left: 1.5em; margin-bottom: 1em; }
.custom-page-section .page-content a { color: #0f6fc5; text-decoration: underline; text-underline-offset: 2px; }
.custom-page-section .page-content a:hover { color: #0b4d8a; }

/* Footer */
footer.site-footer { background: #0b2545; color: #cfe8ff; }
footer.site-footer .wrap { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 20px; padding: 32px 16px; }
.footer-col .widget { background: transparent; border: 0; padding: 0; color: #d9ecff; }
.footer-col .widget-title { color: #fff; font-size: 16px; margin-bottom: 8px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { list-style: none; margin: 0; padding: 4px 0; }
.footer-col a { color: #cfe8ff; }
.footer-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.brand-col .custom-logo-link { display: inline-block; padding: 8px; border-radius: 10px; }
.site-footer .brand-col .custom-logo-link { width: 200px; height: 200px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border-radius: 0; border: 0; box-shadow: none; }
.site-footer .brand-col .custom-logo { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.brand-col .site-name { font-weight: 800; color: #fff; margin-top: 10px; }
.brand-col .site-desc { color: #b9d7fa; font-size: 14px; }
.footer-social { margin-top: 10px; display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #cfe8ff; background: rgba(255,255,255,.06); }
.footer-social a:hover { background: rgba(255,255,255,.12); color: #fff; }
.footer-contact { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.footer-contact .item { display: inline-flex; align-items: center; gap: 8px; color: #cfe8ff; }
.footer-contact .item:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.footer-contact .icon svg { display: block; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
.footer-bottom .wrap { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 12px 16px; }
.footer-bottom .copy { color: #b9d7fa; font-size: 14px; }
.footer-menu .menu { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; }
.footer-menu .menu a { color: #cfe8ff; font-weight: 600; font-size: 14px; }
.footer-menu .menu a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom .admin-link a { color: #b9d7fa; font-size: 14px; }
.footer-bottom .admin-link a:hover { color: #fff; }

/* Responsive */
@media (max-width: 1024px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-bar .contact { font-size: 14px; gap: 16px; }
  .top-bar .contact .item { gap: 8px; }
  .top-bar .docs-btn { padding: 8px 16px; font-size: 13px; }
}

@media (max-width: 960px) {
  /* Altura automática para topbar en tablets cuando el botón ocupa línea completa */
  :root { --topbar-h: 110px; } /* Altura aproximada cuando el botón está en su propia línea */
  .top-bar { height: auto; min-height: 64px; }
  .top-bar .wrap { grid-template-columns: 1fr auto; gap: 12px; padding: 12px 24px; }
  .top-bar .contact { order: 2; }
  .top-bar .docs-btn { order: 3; grid-column: 1 / -1; justify-self: stretch; text-align: center; }
  
  /* Recalcular el header total para tablets */
  body.has-fixed-header { padding-top: calc(110px + var(--navbar-h) + var(--adminbar-h)); }
}

@media (max-width: 720px) {
  :root { --topbar-h: 180px; } /* Altura aproximada de topbar en móvil con todo apilado */
  :root { --navbar-h: 64px; }
  :root { --section-gap: 36px; }
  
  /* Recalcular el padding del body para móviles */
  body.has-fixed-header {
    padding-top: calc(180px + 64px + var(--adminbar-h)) !important;
  }
  
  /* Barra superior responsive */
  .top-bar { height: auto; min-height: 60px; }
  .top-bar .wrap { 
    grid-template-columns: 1fr; 
    padding: 12px 16px; 
    gap: 10px;
  }
  
  /* Redes sociales en una fila */
  .top-bar .social { 
    justify-content: center;
    width: 100%;
    order: 1;
  }
  .top-bar .social a { width: 32px; height: 32px; }
  .top-bar .social a i { font-size: 18px; }
  
  /* Contacto en dos líneas si es necesario */
  .top-bar .contact { 
    flex-direction: column;
    gap: 8px;
    order: 2;
    font-size: 13px;
    width: 100%;
  }
  .top-bar .contact .item { 
    justify-content: center;
    font-size: 14px;
  }
  
  /* Botón de documentos */
  .top-bar .docs-btn { 
    order: 3;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
  }
  
  /* Navegación principal - menú móvil */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
  }
  
  .hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
  }
  
  .hamburger-icon span {
    display: block;
    height: 3px;
    background: var(--brand);
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }
  
  .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
  
  .primary-menu {
    position: fixed;
    top: calc(var(--navbar-h) + var(--adminbar-h));
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
    max-height: calc(100vh - var(--navbar-h) - var(--adminbar-h));
    overflow-y: auto;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .primary-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .primary-menu li {
    width: 100%;
  }
  
  .primary-menu a {
    display: block;
    padding: 14px 24px;
    border-radius: 0;
    border-bottom: 1px solid #f0f5fa;
  }
  
  .primary-menu a:hover,
  .primary-menu .current-menu-item > a {
    background: var(--accent);
  }
  
  /* Logo más pequeño */
  .brand .custom-logo-link { height: min(var(--logo-h, 48px), var(--navbar-h)); padding: 4px 6px; }
  
  /* Ajustes de secciones */
  .news-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom .wrap { grid-template-columns: 1fr; justify-items: start; gap: 8px; }
  
  /* Menú del footer en móvil - lista vertical sin bullets */
  .footer-menu .menu {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .footer-menu .menu li {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
  
  .footer-menu .menu li::before {
    display: none !important;
  }
  
  .footer-menu .menu a {
    font-size: 15px;
    display: block;
    padding: 4px 0;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
  .top-bar .wrap { padding: 10px 12px; }
  .top-bar .social { gap: 8px; }
  .top-bar .social a { width: 30px; height: 30px; }
  .top-bar .contact .item { font-size: 13px; }
  .brand .site-title { font-size: 16px; }
  .main-nav .wrap { padding: 0 12px; }
}

/* Layout con sidebar para páginas y noticias */
.container.has-sidebar { max-width: 1200px; margin: 0 auto; padding: 24px 16px; display: grid; grid-template-columns: 3fr 1.2fr; gap: 24px; }
.content-area .page-title, .content-area .entry-title { margin: 0 0 12px; color: #0b2545; font-family: Montserrat, Inter, system-ui; font-weight: 800; letter-spacing: .2px; }
.content-area .entry-meta { color: #627b93; font-size: 13px; margin-bottom: 10px; }
.sidebar { position: relative; }
.widget { background: #f8fbff; border: 1px solid #e8f0fb; border-radius: 12px; padding: 14px; }
.widget + .widget { margin-top: 16px; }
.widget-title { margin: 0 0 10px; font-size: 16px; color: #0b2545; }

@media (max-width: 960px) {
  .container.has-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

/* Layout de ancho completo (sin sidebar) */
.container.full-width { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.content-area-full { width: 100%; }
.content-area-full .page-title, .content-area-full .entry-title { margin: 0 0 12px; color: #0b2545; font-family: Montserrat, Inter, system-ui; font-weight: 800; letter-spacing: .2px; }

/* Tipografía y estilos de contenido en posts/páginas */
.entry .entry-content {
  color: #1a2b3a;
  font-size: 17.5px;
  line-height: 1.78;
}
.entry .entry-content h1,
.entry .entry-content h2,
.entry .entry-content h3,
.entry .entry-content h4,
.entry .entry-content h5,
.entry .entry-content h6 {
  font-family: Montserrat, Inter, system-ui;
  color: #0b2545;
  margin: 1.2em 0 .6em;
  line-height: 1.25;
  font-weight: 800;
}
.entry .entry-content h1 { font-size: clamp(28px, 4vw, 36px); }
.entry .entry-content h2 { font-size: clamp(24px, 3.2vw, 30px); }
.entry .entry-content h3 { font-size: clamp(20px, 2.6vw, 24px); }
.entry .entry-content h4 { font-size: 18px; }

.entry .entry-content p { margin: 0 0 1em; font-size: 1em; line-height: inherit; }
.entry .entry-content strong { font-weight: 700; }
.entry .entry-content a { color: #0f6fc5; text-underline-offset: 2px; }
.entry .entry-content a:hover { color: #0a4d8c; text-decoration: underline; }

.entry .entry-content ul,
.entry .entry-content ol { padding-left: 1.2em; margin: .6em 0 1em; }
.entry .entry-content li { margin: .2em 0; }

.entry .entry-content blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  background: #f1f6fd;
  border-left: 4px solid #0f6fc5;
  border-radius: 8px;
  color: #23384b;
}

.entry .entry-content img,
.entry .entry-content figure > img { border-radius: 12px; box-shadow: 0 6px 18px rgba(15,111,197,.12); }
.entry .entry-content figure { margin: 1em 0; }
.entry .entry-content figcaption { text-align: center; color: #5b6f86; font-size: 13px; margin-top: 6px; }

.entry .entry-content table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 15px; }
.entry .entry-content th, .entry .entry-content td { border: 1px solid #e1eaf6; padding: 8px 10px; }
.entry .entry-content th { background: #f6f9fd; text-align: left; }

.entry .entry-content hr { border: 0; height: 1px; background: #e5eef9; margin: 24px 0; }

/* Caja visual para el contenido principal (como en el screenshot) */
.content-area .entry,
.content-area-full .entry { background: #fff; border: 1px solid #e5eaf2; border-radius: 14px; padding: 18px 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.03); }
.content-area .entry + .entry { margin-top: 20px; }

/* Imagen destacada en páginas */
.entry .featured-image { margin: 0 0 12px; }
.entry .featured-image img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 6px 18px rgba(15,111,197,.12); display: block; }

/* Asegurar que la imagen destacada se muestre en móvil */
@media (max-width: 720px) {
  .entry .featured-image { display: block !important; margin: 0 0 16px; }
  .entry .featured-image img { display: block !important; width: 100%; height: auto; }
}

/* Listados de blog: miniatura con relación 16:9 y recorte consistente */
.content-area .entry .featured-image { position: relative; overflow: hidden; border-radius: 12px; }
.content-area .entry .featured-image img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; object-position: center 30%; }
/* En listados, "Leer más" como enlace simple */
.content-area .entry .read-more { color: #0f6fc5; font-weight: 700; }
.content-area .entry .read-more:hover { color: #0a4d8c; text-decoration: underline; }

/* Paginación de noticias */
.pagination,
.navigation.pagination { 
  margin-top: 32px; 
  text-align: center; 
}
.pagination .nav-links,
.navigation.pagination .nav-links { 
  display: flex; 
  justify-content: center; 
  gap: 8px; 
  flex-wrap: wrap;
  align-items: center;
}
.pagination .page-numbers,
.navigation.pagination .page-numbers { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: #f8fbff;
  border: 1px solid #e8f0fb;
  border-radius: 8px;
  color: #0b2545;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover {
  background: var(--accent);
  border-color: var(--brand-2);
  color: var(--brand-2);
}
.pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
}
.pagination .page-numbers.dots,
.navigation.pagination .page-numbers.dots {
  border: none;
  background: transparent;
  cursor: default;
}

/* Botón solo para el enlace "Más Noticias" del inicio */
.more-news-btn { display: inline-block; background: var(--brand-2); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.more-news-btn:hover { background: #0a4d8c; }

/* Listado de noticias (página template) */
.news-listing { margin-top: 24px; }
.news-listing .entry { margin-bottom: 32px; }
.news-listing .entry:last-child { margin-bottom: 0; }

/* ========== Comunidad Escolar + mini banners (portada) ========== */
section.info-banners { padding: var(--section-inner-top) 16px 48px; background: #fff; }
section.info-banners .wrap { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr; gap: 26px; align-items: start; }
section.info-banners .right { padding-top: 8px; }
section.info-banners .left .section-title { font-size: clamp(22px, 2.8vw, 36px); text-align: center; }
section.info-banners .left .section-title.info-title { display: grid; gap: 4px; margin-bottom: 12px; }
section.info-banners .left .section-title.info-title .t1,
section.info-banners .left .section-title.info-title .t2 {
  display: block;
  font-weight: 800;
  font-size: inherit; /* ambos del mismo tamaño del h2 */
}
section.info-banners .info-text { color: #2a3b4f; font-size: 17px; line-height: 1.78; margin-bottom: 16px; text-align: justify; text-justify: inter-word; hyphens: auto; }
section.info-banners .info-media { background: #f3f7fc; border: 1px solid #e6eef6; border-radius: 12px; overflow: hidden; }
section.info-banners .info-media img { width: 100%; height: auto; display:block; }
section.info-banners .info-media video { width: 100%; height: auto; display:block; background:#000; }
section.info-banners .video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
section.info-banners .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
section.info-banners .right .widget { background: transparent; border: 0; padding: 0; box-shadow: none; }
section.info-banners .right .widget + .widget { margin-top: 18px; }
section.info-banners .right .mini-banner img { border-radius: 12px; display:block; width: 100%; height: auto; }
section.info-banners .right .widget .wp-block-image { margin: 0; }
section.info-banners .right .widget .wp-block-image img { display:block; width:100%; height:auto; border-radius:12px; }

@media (max-width: 960px) {
  section.info-banners .wrap { grid-template-columns: 1fr; }
  section.info-banners .right { order: 2; }
}

/* Soporte general para justificar texto desde el editor (clase core) */
.has-text-align-justify { text-align: justify; text-justify: inter-word; hyphens: auto; }

/* Banner intermedio (ancho completo de la pantalla) */
.mid-banner { margin: 0; line-height: 0; display: block; padding: 0; }
.mid-banner .mid-banner-link, .mid-banner img { display: block; width: 100%; max-width: none; margin: 0; }
.mid-banner img { height: auto; object-fit: contain; object-position: center; }

/* PDFs embebidos - Soporte para móviles */
.pdf-wrapper { 
  position: relative; 
  margin: 1em 0;
  border-radius: 12px;
  overflow: hidden;
}

.pdf-wrapper iframe { 
  width: 100%; 
  min-height: 600px; 
  border: 1px solid #e5eaf2;
  border-radius: 12px;
  display: block;
}

.pdf-mobile-download {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 111, 197, 0.3);
  transition: all 0.3s ease;
  margin: 1em 0;
}

.pdf-mobile-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 111, 197, 0.4);
  color: #fff;
}

.pdf-mobile-download i {
  font-size: 24px;
}

@media (max-width: 768px) {
  .pdf-wrapper iframe {
    display: none;
  }
  
  .pdf-mobile-download {
    display: flex;
  }
  
  .pdf-wrapper {
    background: #f8fbff;
    border: 2px dashed #d0e2f5;
    padding: 20px;
    text-align: center;
  }
}
