/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* --- Tablet (max 1024px) --- */

@media (max-width: 1024px) {
    :root {
        --text-display: 3rem;
        --text-5xl: 2.5rem;
        --text-4xl: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2xl);
    }

    .footer-grid > *:first-child {
        grid-column: 1 / -1;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .related-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact strip: 2x2 grid */
    .contact-strip__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact main: stack form + sidebar */
    .contact-main__grid {
        grid-template-columns: 1fr;
    }

    .contact-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-lg);
    }

    .contact-sidebar > * {
        flex: 1 1 calc(50% - var(--space-lg));
        min-width: 220px;
    }

    .contact-sidebar .ornament-border {
        flex-basis: 100%;
    }

    /* Next event: wrap action to full width */
    .next-event__inner {
        flex-wrap: wrap;
    }

    .next-event__action {
        width: 100%;
        text-align: center;
    }

    /* Programs grid: 2 columns on tablet */
    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Gallery mosaic: 3 columns, large item spans 2 */
    .gallery-grid--mosaic {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
    }

    .gallery-grid--mosaic .gallery-grid__item--large {
        grid-column: 1 / 3;
        grid-row: auto;
    }

    /* Editorial news: 2-column secondary grid at tablet */
    .news-grid--editorial {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stats: 2 columns */
    .stats-counter__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About hero: reduced padding */
    .about-hero {
        padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-2xl);
    }

    /* About intro: stack columns */
    .about-intro__grid {
        grid-template-columns: 1fr;
    }

    /* About carousel: wider slides */
    .about-carousel__slide {
        flex: 0 0 80%;
    }

    /* Program layout: single column */
    .program-layout {
        grid-template-columns: 1fr;
    }

    .program-layout__sidebar {
        position: static;
    }

    /* Detail strip: tighter gap */
    .program-detail-strip__grid {
        gap: var(--space-md);
    }
}

/* --- Mobile Nav Breakpoint (max 768px) --- */

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
        --container-padding: 1rem;
    }

    /* Reduced animation distances on mobile */
    .animate-on-scroll {
        transform: translateY(20px);
    }

    .animate-on-scroll--left {
        transform: translateX(-20px) translateY(0);
    }

    .hero__title,
    .hero__description,
    .hero__actions,
    .hero__bottom {
        transform: translateY(15px);
    }

    /* Search bar: full width on mobile */
    .header-search__input {
        font-size: var(--text-base);
    }

    .header-search__form {
        padding: 0 var(--container-padding);
    }

    /* Hide nav link underlines on mobile */
    .primary-navigation .nav-menu > li > a::before {
        display: none;
    }

    /* Mobile menu toggle */
    .menu-toggle {
        display: flex;
    }

    /* Mobile navigation overlay — dark variant */
    .primary-navigation {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        background: var(--color-primary);
        flex-direction: column;
        align-items: stretch;
        padding: calc(var(--header-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: var(--z-overlay);
        overflow-y: auto;
    }

    .primary-navigation.is-open {
        transform: translateX(0);
    }

    .primary-navigation .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .primary-navigation .nav-menu > li > a {
        padding: var(--space-md);
        font-size: var(--text-base);
        color: rgba(255, 255, 255, 0.8);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Mobile dropdown */
    .primary-navigation .nav-menu > li > .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        border: none;
        padding: 0;
        display: none;
        background: rgba(0, 0, 0, 0.15);
    }

    .primary-navigation .nav-menu > li.sub-menu-open > .sub-menu {
        display: block;
    }

    .primary-navigation .sub-menu li a {
        padding-left: var(--space-2xl);
    }

    /* Mobile menu overlay backdrop */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: calc(var(--z-overlay) - 1);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }

    .nav-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    /* Hero */
    .hero {
        min-height: 85vh;
    }

    .hero__image {
        object-position: 70% 20%;
    }

    .hero__title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .hero__title-accent {
        -webkit-text-stroke: 1.5px var(--color-accent);
    }

    .hero__description {
        font-size: var(--text-base);
    }

    .hero__geometric {
        width: 60vmin;
        height: 60vmin;
        transform: translate(-20%, -50%);
    }

    .hero__bottom {
        flex-direction: column;
        gap: var(--space-lg);
        align-items: flex-start;
    }

    .hero__social {
        gap: var(--space-md);
    }

    /* Next event: column layout, centered */
    .next-event__inner {
        flex-direction: column;
        text-align: center;
    }

    .next-event__info {
        border-left: none;
        border-top: 3px solid var(--color-accent);
        padding-left: 0;
        padding-top: var(--space-lg);
    }

    .next-event__meta {
        justify-content: center;
    }

    .next-event__badges {
        justify-content: center;
    }

    .next-event__label {
        justify-content: center;
    }

    /* Grids */
    .posts-grid,
    .archive-grid {
        grid-template-columns: 1fr;
    }

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

    /* Editorial card: stack vertically on mobile */
    .news-card--editorial {
        grid-template-columns: 1fr;
    }

    .news-card__content {
        padding: var(--space-lg);
    }

    .news-card__title {
        font-size: var(--text-xl);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Gallery mosaic: 2 columns */
    .gallery-grid--mosaic {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid--mosaic .gallery-grid__item--large {
        grid-column: 1 / -1;
    }

    /* Stats: single column */
    .stats-counter__grid {
        grid-template-columns: 1fr;
    }

    /* About mission/teaser: reduced sizing */
    .about-mission__text,
    .about-teaser__quote {
        font-size: var(--text-xl);
        padding: var(--space-lg) var(--space-xl);
    }

    /* About intro aside: top border instead of left */
    .about-intro__aside {
        border-left: none;
        border-top: 3px solid var(--color-accent);
        padding-left: 0;
        padding-top: var(--space-lg);
        margin-top: var(--space-xl);
    }

    /* About venues: single column */
    .about-venues__grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    /* About carousel: wider slides, smaller buttons */
    .about-carousel__slide {
        flex: 0 0 90%;
    }

    .about-carousel__prev,
    .about-carousel__next {
        width: 40px;
        height: 40px;
        font-size: var(--text-xl);
    }

    .decorative-quote::before,
    .decorative-quote::after {
        font-size: var(--text-5xl);
    }

    /* CTA frame: less padding */
    .cta-section__frame {
        padding: var(--space-2xl);
    }

    /* Program header: smaller title on mobile */
    .program-header__title {
        font-size: var(--text-3xl);
    }

    /* Detail strip: stack to single column */
    .program-detail-strip__grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Program layout: full width sidebar */
    .program-layout__sidebar {
        width: 100%;
    }

    /* Hide navigation thumbnails on mobile */
    .post-navigation__thumb {
        display: none;
    }

    /* Related programs: horizontal scroll on mobile */
    .related-posts__grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: var(--space-md);
        padding-bottom: var(--space-md);
    }

    .related-posts__grid .card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    /* Single */
    .post-navigation {
        grid-template-columns: 1fr;
    }

    .single-header__title {
        font-size: var(--text-3xl);
    }

    /* Comments: compact form on mobile */
    .comment-respond {
        padding: var(--space-md);
    }

    .comment-reply-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-form .form-submit {
        flex-direction: column;
        align-items: stretch;
    }

    .comment-form .submit,
    .comment-cancel-btn {
        width: 100%;
        justify-content: center;
    }

    /* Contact hero: reduce spacing */
    .contact-hero {
        padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-2xl);
    }

    .contact-hero__title,
    .about-hero__title {
        font-size: var(--text-3xl);
    }

    .about-hero {
        padding: calc(var(--header-height) + var(--space-md)) 0 var(--space-xl);
    }

    /* Contact strip: single column */
    .contact-strip__grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Contact sidebar: single column */
    .contact-sidebar {
        flex-direction: column;
    }

    .contact-sidebar > * {
        flex-basis: 100%;
    }

    /* Contact map: shorter */
    .contact-map__frame {
        height: 300px;
    }

    /* Lightbox nav */
    .lightbox__nav--prev {
        left: 10px;
    }

    .lightbox__nav--next {
        right: 10px;
    }

    /* Cookie banner: stack vertically */
    .cookie-banner__inner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }

    .cookie-banner__accept {
        width: 100%;
    }
}

/* --- Small Mobile (max 480px) --- */

@media (max-width: 480px) {
    :root {
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero__image {
        object-position: 75% center;
    }

    .hero__geometric {
        display: none;
    }

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

    .gallery-archive-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery mosaic: single column */
    .gallery-grid--mosaic {
        grid-template-columns: 1fr;
    }

    /* Stats number: smaller */
    .stats-counter__number {
        font-size: var(--text-4xl);
    }

    /* About carousel: near full-width */
    .about-carousel__slide {
        flex: 0 0 95%;
    }

    /* Contact strip: single column */
    .contact-strip__grid {
        grid-template-columns: 1fr;
    }

    .contact-card {
        flex-direction: row;
        text-align: left;
        gap: var(--space-md);
    }

    .contact-card__icon {
        width: 44px;
        height: 44px;
        margin-bottom: 0;
    }

    .contact-map__frame {
        height: 250px;
    }

    .program-type-filter {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Accessibility: Reduced Motion Override --- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll,
    .hero__title,
    .hero__description,
    .hero__actions,
    .hero__bottom,
    .hero__geometric,
    .hero__image {
        opacity: 1 !important;
        transform: none !important;
    }

    .single-featured-image {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Hero image: no slow reveal */
    .hero__image {
        opacity: 0.55 !important;
        transform: none !important;
        transition-duration: 0.01ms !important;
    }

    /* Stats: no animation, show final number immediately */
    .stats-counter__number {
        animation: none !important;
    }

    /* Ornament borders: visible immediately */
    .ornament-border::before {
        opacity: 1 !important;
    }

    /* Carousel: instant transitions */
    .about-carousel__track {
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    /* Reset backgrounds, shadows, colors for ink-saving */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Page setup */
    @page {
        margin: 2cm;
    }

    body {
        font-family: "Source Sans 3", "Source Sans Pro", Georgia, serif;
        font-size: 12pt;
        line-height: 1.6;
    }

    /* Hide non-content elements */
    .site-header,
    .site-footer,
    .menu-toggle,
    .primary-navigation,
    .nav-overlay,
    .breadcrumbs,
    .back-to-top,
    .hero__actions,
    .hero__bottom,
    .hero__geometric,
    .program-type-filter,
    .filter-bar,
    .archive-search-inline,
    .post-navigation,
    .related-posts,
    .comments-area,
    .search-form,
    .search-header__form,
    .search-no-results__actions,
    .cta-section,
    .btn,
    .lightbox,
    .scroll-progress,
    .about-carousel__prev,
    .about-carousel__next,
    .about-carousel__dots,
    .contact-map-section,
    .contact-sidebar__social,
    .single-header__back,
    .program-header__back,
    .program-layout__sidebar,
    .ornament-border,
    .share-links,
    .archive-load-more,
    .archive-results__more,
    .cookie-banner {
        display: none !important;
    }

    /* Ensure content is visible */
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Typography for print */
    h1 {
        font-size: 22pt;
        margin-bottom: 0.5em;
    }

    h2 {
        font-size: 18pt;
        margin-top: 1em;
        margin-bottom: 0.5em;
    }

    h3 {
        font-size: 14pt;
    }

    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    .single-featured-image,
    .program-featured-image {
        margin-bottom: 1em;
    }

    /* Layout: single column */
    .program-layout,
    .contact-main__grid,
    .archive-grid,
    .news-grid,
    .gallery-grid,
    .footer-grid {
        display: block !important;
    }

    /* Cards: avoid breaking mid-card */
    .card,
    article,
    .contact-card {
        page-break-inside: avoid;
    }

    /* Links: show URLs inline */
    .entry-content a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-style: italic;
        word-break: break-all;
    }

    .entry-content a[href^="#"]::after,
    .entry-content a[href^="javascript:"]::after {
        content: "";
    }

    /* Detail strip: print-friendly layout */
    .program-detail-strip {
        border-top: 2pt solid #000;
        border-bottom: 2pt solid #000;
        padding: 0.5em 0 !important;
        margin-bottom: 1em;
    }

    .program-detail-strip__grid {
        display: flex !important;
        gap: 2em;
    }

    /* Remove animations */
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Ensure all grids are visible */
    .archive-grid,
    .gallery-archive-grid,
    .programs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Contact info: keep visible */
    .contact-strip__grid {
        display: flex !important;
        gap: 2em;
    }

    .contact-card {
        text-align: left;
    }

    .contact-card__icon {
        display: none !important;
    }
}
