/* YEARBOOK responsive layout rules. */
@media(max-width:1100px){.primary-nav{display:none}.menu-toggle{display:flex;flex-direction:column;gap:4px;padding:7px}.menu-toggle span{width:22px;height:2px;background:var(--ink)}.mobile-menu{display:block;position:absolute;left:0;right:0;top:74px;background:var(--color-surface);border-bottom:1px solid var(--line);padding:22px}.mobile-menu .menu{display:grid;gap:0}.mobile-menu .menu li{border-bottom:1px solid var(--line)}.mobile-menu .menu a{display:block;padding:14px 4px}.event-grid{grid-template-columns:repeat(2,1fr)}.map-section{grid-template-columns:190px 1fr}.notable-years{display:none}.latest-grid{grid-template-columns:repeat(2,1fr)}.newsletter-card{grid-column:1/-1}.quote-stats{grid-template-columns:1fr}.stats-panel{border-left:1px solid var(--line)}}
@media(max-width:760px){.container,.header-inner,.footer-main,.footer-bottom{width:min(100% - 28px, var(--max))}.header-inner{min-height:64px;gap:12px}.brand-tagline{display:none}.brand-word{font-size:31px}.login-button{display:none}.hero-section{grid-template-columns:1fr}.hero-copy{padding:45px 20px}.hero-copy h1{font-size:clamp(48px,13vw,68px)}.hero-feature{min-height:360px}.timeline-year{min-width:62px}.featured-events{padding-top:35px}.section-heading{align-items:flex-start;flex-direction:column}.event-grid{grid-template-columns:1fr 1fr}.map-section{grid-template-columns:1fr}.map-categories{border-right:0;border-bottom:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr}.map-categories .eyebrow{grid-column:1/-1}.map-panel{padding:25px 18px}.world-map{height:190px}.quote-panel{min-height:170px}.stats-panel{grid-template-columns:1fr 1fr}.stat{min-height:100px}.latest-grid{grid-template-columns:1fr 1fr}.content-with-sidebar,.single-layout{grid-template-columns:1fr}.post-grid{grid-template-columns:1fr}.footer-main{padding:25px 0;align-items:flex-start;flex-wrap:wrap}.footer-nav{margin-left:0;order:3;width:100%}.footer-nav .menu{display:grid;grid-template-columns:repeat(2,1fr)}.footer-bottom{flex-direction:column;gap:7px}.archive-shell,.page-shell,.single-shell{padding-top:38px}.error-shell{padding:80px 10px}.error-shell h1,.error-shell h2{font-size:32px}.button-row .search-form{min-width:0;width:100%}}
@media(max-width:460px){.header-inner{width:calc(100% - 22px)}.header-actions{margin-left:auto}.lang-button{display:none}.event-grid,.latest-grid,.stats-panel{grid-template-columns:1fr}.map-categories{grid-template-columns:1fr}.latest-card{border-bottom:1px solid var(--line);padding-bottom:14px}.newsletter-card{grid-column:auto}.hero-feature-overlay{padding:70px 20px 20px}.hero-counter{right:12px}.hero-feature-overlay h2{font-size:31px}.section-heading h2{font-size:25px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition:none!important;animation:none!important}}

@media(max-width:1100px){.mobile-menu:not([hidden]){display:block;position:absolute;left:0;right:0;top:100%;max-height:calc(100vh - 64px);overflow:auto;background:var(--color-surface);border-bottom:1px solid var(--color-line);box-shadow:var(--shadow-md);padding:12px max(20px,calc((100% - var(--container-max))/2));z-index:105}.mobile-menu .menu{display:grid;gap:0}.mobile-menu .menu>li{border-bottom:1px solid var(--color-line)}.mobile-menu .menu a{display:flex;width:100%;min-height:48px;padding:12px 4px}.mobile-menu .menu .sub-menu{padding:0 0 8px 16px}.mobile-menu .menu .sub-menu a{min-height:42px}.menu-toggle{display:inline-flex}.menu-toggle span{display:block;width:22px;height:2px;background:var(--color-ink);transition:transform .15s ease}.menu-toggle[aria-expanded="true"] span:first-child{transform:translateY(6px) rotate(45deg)}.menu-toggle[aria-expanded="true"] span:nth-child(2){opacity:0}.menu-toggle[aria-expanded="true"] span:last-child{transform:translateY(-6px) rotate(-45deg)}}
@media(max-width:760px){.header-inner{min-height:64px}.brand{gap:10px}.header-actions{gap:6px}.search-panel{padding:12px 14px}.search-form{min-height:48px}.search-form button{width:auto;min-width:48px}.footer-main{align-items:flex-start}.footer-nav .menu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;width:100%}.footer-nav .menu a{min-height:44px}.footer-social{flex-wrap:wrap}.brand-footer{max-width:100%}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}

@media(max-width:1100px){.yearbook-event-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.yearbook-filter-search{grid-column:1/-1}.yearbook-filter-actions{grid-column:1/-1;flex-direction:row;align-items:center}.yearbook-filter-actions .button{min-width:150px}.yearbook-filter-reset{padding:12px}}
@media(max-width:600px){.yearbook-event-filters{grid-template-columns:1fr;padding:14px}.yearbook-filter-search,.yearbook-filter-actions{grid-column:auto}.yearbook-filter-actions{flex-direction:column;align-items:stretch}.yearbook-filter-actions .button{width:100%}.yearbook-filter-reset{padding:6px}.yearbook-archive-card-body{padding:15px}.yearbook-archive-pagination{gap:9px}.yearbook-page-numbers a,.yearbook-page-numbers span{min-width:36px;min-height:36px}}


/* Etapa 38 — final responsive and accessibility hardening. */
:where(.container, .header-inner, .footer-main, .footer-bottom, .site-main, .site-footer, .hero-copy, .hero-feature, .map-panel, .event-card, .latest-card, .yearbook-search-card, .yearbook-event-detail__layout) { min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, iframe { max-width: 100%; }
pre, code { max-width: 100%; overflow-wrap: anywhere; }
:where(h1, h2, h3, h4, p, li, a, span, label, button) { overflow-wrap: break-word; }
:where(input, select, textarea, button) { max-width: 100%; }
:where(input, select, textarea) { font-size: max(16px, 1em); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--color-accent, var(--color-accent));
  outline-offset: 3px;
}
:where(button, .button, .login-button, .search-form button, .newsletter-form button, .timeline-year, .timeline-period, .yearbook-page-numbers a) { min-height: 44px; }
:where(.button, .login-button, button) { cursor: pointer; }
:where(.button, .login-button, button):disabled { cursor: not-allowed; opacity: .65; }
:target { scroll-margin-top: 1.5rem; }
.mobile-account-menu { margin-top: 10px; padding-top: 8px; border-top: 2px solid var(--color-line, var(--color-line)); }
.mobile-account-link { color: var(--color-accent, var(--color-accent)); font-weight: 800; }

@media (max-width: 1000px) {
  .hero-section { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding: clamp(28px, 5vw, 48px) clamp(18px, 4vw, 36px); }
  .hero-copy h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: 1; }
  .hero-feature { min-height: clamp(280px, 48vw, 390px); }
  .map-section { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); }
  .notable-years { display: none; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newsletter-card { grid-column: 1 / -1; }
  .content-with-sidebar, .single-layout { grid-template-columns: minmax(0, 1fr); }
  .yearbook-event-detail__layout { grid-template-columns: minmax(0, 1fr); }
  .yearbook-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .container, .header-inner, .footer-main, .footer-bottom { width: calc(100% - 28px); }
  .header-inner { gap: 8px; }
  .brand { min-width: 0; gap: 8px; }
  .brand-word { font-size: clamp(25px, 7vw, 31px); }
  .brand .custom-logo { max-width: min(42vw, 180px); max-height: 48px; }
  .header-actions { flex: 0 0 auto; gap: 4px; }
  .login-button { display: none; }
  .search-panel { padding: 12px 14px; }
  .search-form { min-width: 0; }
  .search-form input { min-width: 0; }
  .hero-copy h1 { font-size: clamp(2.35rem, 11vw, 4.2rem); }
  .hero-feature { min-height: 300px; }
  .map-section { grid-template-columns: minmax(0, 1fr); }
  .map-categories { border-right: 0; border-bottom: 1px solid var(--color-line, var(--color-line)); }
  .map-panel { padding: clamp(16px, 4vw, 26px); }
  .yearbook-home-map { min-height: 260px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .quote-stats { grid-template-columns: minmax(0, 1fr); }
  .stats-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-with-sidebar, .single-layout, .yearbook-event-detail__layout { grid-template-columns: minmax(0, 1fr); }
  .yearbook-search-grid, .yearbook-search-page .yearbook-unified-search-filters { grid-template-columns: minmax(0, 1fr); }
  .yearbook-search-page .yearbook-filter-search { grid-column: auto; }
  .yearbook-search-page .yearbook-filter-actions { flex-direction: column; align-items: stretch; }
  .yearbook-search-page .yearbook-filter-actions .button { width: 100%; }
  .footer-main { flex-wrap: wrap; align-items: flex-start; }
  .footer-nav { order: 3; width: 100%; margin-left: 0; }
  .footer-nav .menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .footer-social { flex-wrap: wrap; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .timeline-strip, .timeline-periods { max-width: 100%; }
  .timeline-strip { overflow-x: auto; overscroll-behavior-x: contain; }
  .timeline-periods { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
}
@media (max-width: 460px) {
  .container, .footer-main, .footer-bottom { width: calc(100% - 22px); }
  .header-inner { width: calc(100% - 16px); }
  .brand-tagline { display: none; }
  .event-grid, .latest-grid, .stats-panel, .post-grid { grid-template-columns: minmax(0, 1fr); }
  .newsletter-card { grid-column: auto; padding-inline: 15px; }
  .map-categories { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding: 30px 16px; }
  .hero-feature-overlay { padding: 65px 16px 18px; }
  .hero-feature-overlay h2 { font-size: clamp(1.7rem, 8vw, 2.1rem); line-height: 1.08; }
  .event-body h3, .latest-card h3 { overflow-wrap: anywhere; }
  .button-row { align-items: stretch; }
  .button-row .button { width: 100%; }
  .yearbook-event-detail__related-grid { grid-template-columns: minmax(0, 1fr); }
  .yearbook-archive-pagination, .yearbook-pagination { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid Highlight; }
  .button, .login-button, .search-form button, .newsletter-form button { border: 1px solid ButtonText; }
}

/* Preserve readable contrast for the feature hero against its dark overlay. */
.hero-feature-overlay,
.hero-feature-overlay :where(h2, p, a, .eyebrow, .meta) { color: var(--color-surface); }
.hero-feature-overlay a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero-feature-overlay a:focus-visible { outline-color: var(--color-surface); }

/* Etapa 45 — consolidated header and navigation rules. */
.site-header { position: relative; isolation: isolate; }
.header-inner { position: relative; min-width: 0; }
.primary-nav { min-width: 0; }
.primary-nav > .menu { gap: clamp(12px, 1.55vw, 22px); }
.primary-nav .menu > li > a { min-height: 44px; padding-block: 8px; }
.primary-nav .menu a[aria-current="page"],
.primary-nav .menu .current-menu-item > a,
.primary-nav .menu .current_page_item > a,
.primary-nav .menu .current-menu-ancestor > a,
.mobile-menu .menu a[aria-current="page"],
.mobile-menu .menu .current-menu-item > a,
.mobile-menu .menu .current_page_item > a,
.mobile-menu .menu .current-menu-ancestor > a { color: var(--color-accent); }
.primary-nav .menu .sub-menu { border-radius: var(--radius-md, 8px); padding: 8px; }
.primary-nav .menu .sub-menu li + li { border-top: 1px solid var(--color-line); }
.primary-nav .menu .sub-menu a { min-height: 42px; padding: 9px 10px; border-radius: 4px; }
.primary-nav .menu .sub-menu a:hover,
.primary-nav .menu .sub-menu a:focus-visible { background: var(--color-accent-soft, var(--color-pale)); }
.icon-button, .menu-toggle { flex: 0 0 44px; padding: 0; border-radius: var(--radius-sm, 4px); }
.icon-button:hover, .menu-toggle:hover { background: var(--color-accent-soft, var(--color-pale)); }
.login-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border-radius: var(--radius-sm, 4px); white-space: nowrap; }
.mobile-menu[hidden], .search-panel[hidden] { display: none !important; }

/* Keep the hamburger hidden on desktop; a broad shared button rule must not expose it. */
@media (min-width: 1101px) {
  .menu-toggle { display: none !important; }
  .mobile-menu { display: none !important; }
}
@media (max-width: 1100px) {
  .header-inner { gap: clamp(8px, 2vw, 18px); }
  .primary-nav { display: none !important; }
  .header-actions { margin-left: auto; flex: 0 0 auto; }
  .menu-toggle { display: inline-flex !important; }
  .mobile-menu:not([hidden]) { position: absolute; top: 100%; left: 0; right: 0; width: 100%; max-height: min(75vh, calc(100dvh - 70px)); overflow-y: auto; overscroll-behavior: contain; padding: 12px max(20px, calc((100% - var(--container-max)) / 2)); background: var(--color-surface); border: 1px solid var(--color-line); border-top: 0; box-shadow: var(--shadow-md); z-index: 105; }
  .mobile-menu .menu { display: grid; align-items: stretch; gap: 0; }
  .mobile-menu .menu > li { min-width: 0; border-bottom: 1px solid var(--color-line); }
  .mobile-menu .menu a { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 12px 8px; overflow-wrap: anywhere; }
  .mobile-menu .menu .sub-menu { position: static; display: grid; min-width: 0; padding: 0 0 8px 14px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .mobile-menu .menu .sub-menu li { border: 0; }
  .mobile-menu .menu .sub-menu a { min-height: 44px; padding: 10px 8px; font-size: 12px; text-transform: none; letter-spacing: .02em; }
  .mobile-account-menu { margin: 10px 0 0; padding-top: 8px; border-top: 2px solid var(--color-line); }
  .mobile-account-link { color: var(--color-accent) !important; font-weight: 800 !important; }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 760px) {
  .header-inner { width: calc(100% - 28px); min-height: 64px; }
  .brand { min-width: 0; max-width: calc(100% - 110px); }
  .brand .custom-logo { max-width: 100%; max-height: 48px; }
  .brand-word { font-size: clamp(27px, 7vw, 32px); }
  .header-actions { gap: 4px; }
  .search-panel { padding: 12px 14px; }
  .mobile-menu:not([hidden]) { padding-inline: 14px; }
}
@media (max-width: 360px) {
  .header-inner { width: calc(100% - 16px); gap: 4px; }
  .brand { max-width: calc(100% - 100px); }
  .brand-word { font-size: 25px; }
  .icon-button, .menu-toggle { flex-basis: 40px; min-width: 40px; min-height: 44px; }
}


/* Etapa 47 — responsive rules for archives and long-form content. */
@media (max-width: 900px) {
  .content-with-sidebar,.single-layout { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .site-sidebar { width: 100%; }
  .single-layout .entry-content { max-width: none; }
}
@media (max-width: 640px) {
  .archive-shell,.page-shell,.single-shell { padding-bottom: 2.75rem; }
  .archive-head { margin-bottom: 1.5rem; }
  .archive-head h1,.archive-head h2,.single-head h1,.single-head h2 { max-width: 100%; line-height: 1.04; }
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .post-card-body { padding: 1rem; }
  .yearbook-empty-state,.empty-state { padding: 1.25rem; }
  .yearbook-taxonomy-filters,.yearbook-article-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .yearbook-taxonomy-filters > *,.yearbook-article-filters > * { min-width: 0; max-width: 100%; }
  .yearbook-article-filters__actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
  .archive-shell .nav-links { gap: .35rem; }
}

/* Etapa 48 — responsive hardening for target viewport widths and device orientation. */
html { max-width: 100%; overflow-x: clip; }
body { max-width: 100%; overflow-x: clip; }
.site-main, .site-header, .site-footer, main, section, article, aside { min-width: 0; }
.container, .site-main, .archive-shell, .page-shell, .single-shell,
.content-with-sidebar, .single-layout, .yearbook-event-detail__layout,
.yearbook-search-grid, .yearbook-event-filters, .yearbook-article-filters { min-width: 0; }
:where(.event-grid, .latest-grid, .post-grid, .yearbook-archive-grid, .stats-panel) > * { min-width: 0; }
:where(.entry-content, .page-content, .event-body, .latest-card, .post-card-body) :where(img, video, iframe, table) { max-width: 100%; }
.entry-content table, .page-content table, .wp-block-table { display: block; width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.entry-content pre, .page-content pre, .wp-block-code { max-width: 100%; overflow-x: auto; }
:where(input, select, textarea) { min-width: 0; }
:where(.search-form, .newsletter-form, .yearbook-map-filters, .yearbook-event-filters) > * { min-width: 0; }
:where(.yearbook-search-grid, .yearbook-event-filters, .yearbook-article-filters) input,
:where(.yearbook-search-grid, .yearbook-event-filters, .yearbook-article-filters) select,
:where(.yearbook-search-grid, .yearbook-event-filters, .yearbook-article-filters) textarea { width: 100%; max-width: 100%; }
:where(.map-panel, .map-section, .yearbook-home-map, .timeline-strip, .timeline-periods) { min-width: 0; max-width: 100%; }
.timeline-strip, .timeline-periods { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
:where(a, button, input, select, textarea, summary, .button, .timeline-year, .timeline-period) { touch-action: manipulation; }

@media (max-width: 414px) {
  .container, .site-main, .archive-shell, .page-shell, .single-shell { max-width: 100%; }
  .header-inner { gap: 4px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-word { overflow-wrap: normal; }
  .header-actions { gap: 2px; }
  .icon-button, .menu-toggle { flex: 0 0 40px; width: 40px; min-width: 40px; }
  .search-form { display: flex; width: 100%; }
  .search-form input { flex: 1 1 auto; width: 1%; }
  .search-form button { flex: 0 0 auto; }
  .button-row { width: 100%; }
  .button-row > .button { flex: 1 1 100%; width: 100%; }
  .yearbook-page-numbers { display: flex; flex-wrap: wrap; }
  .yearbook-page-numbers a, .yearbook-page-numbers span { min-width: 40px; min-height: 40px; }
  .yearbook-event-filters, .yearbook-taxonomy-filters, .yearbook-article-filters { padding: 12px; }
  .yearbook-map-filters { grid-template-columns: minmax(0, 1fr); }
  .newsletter-card .newsletter-form { width: 100%; }
}

@media (max-width: 360px) {
  .container, .footer-main, .footer-bottom { width: calc(100% - 20px); }
  .header-inner { width: calc(100% - 12px); }
  .brand-word { font-size: 23px; letter-spacing: -.04em; }
  .icon-button, .menu-toggle { flex-basis: 38px; width: 38px; min-width: 38px; }
  .hero-copy h1 { font-size: clamp(2rem, 10vw, 2.6rem); overflow-wrap: anywhere; }
  .section-heading h2 { font-size: clamp(1.35rem, 7vw, 1.65rem); }
  .newsletter-card { padding-inline: 12px; }
  .map-panel { padding-inline: 12px; }
}

/* Landscape phones have little vertical room; keep map and hero controls usable. */
@media (max-width: 900px) and (orientation: landscape) {
  .mobile-menu:not([hidden]) { max-height: calc(100dvh - 60px); }
  .hero-feature { min-height: clamp(220px, 55vh, 340px); }
  .yearbook-home-map { height: min(58vh, 360px); min-height: 220px; }
}

@media (min-width: 761px) and (max-width: 1024px) {
  .event-grid, .latest-grid, .post-grid, .yearbook-archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-section { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); }
  .map-section > .notable-years { display: none; }
  .content-with-sidebar, .single-layout, .yearbook-event-detail__layout { grid-template-columns: minmax(0, 1fr); }
}

@media (forced-colors: active) {
  .timeline-year.is-active, .button-dark { border: 1px solid ButtonText; }
}
