/*
Theme Name: Museum Figma Redesign
Description: Clean, pill-based minimalist design based on Figma mockup
*/

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@500&display=swap');



/* ==========================================================================
   CUSTOM LOCAL FONTS (FIXEL TEXT)
   ========================================================================== */

/* Regular / 400 */
@font-face {
    font-family: 'Fixel Text';
    src: url('./fonts/FixelText-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Bold / 700 */
@font-face {
    font-family: 'Fixel Text';
    src: url('./fonts/FixelText-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ExtraBold / 800 */
@font-face {
    font-family: 'Fixel Text';
    src: url('./fonts/FixelText-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}


:root {
/* Adding the specific brand colors to your existing root */
    --clr-blanc-soie: #F5F3EF;
    --clr-orchidee-magique: #A56BE2;
    --clr-pervenche-lumineuse: #626FF9;
    --clr-rose-aurore: #EDABCE;

  --clr-light: #F5F3EF;
    --clr-dark: #2C2A31;
    --font-primary: 'Fixel Text', sans-serif; /* Updated to match your files */
    --font-mono: 'Geist Mono', monospace;
    --radius-pill: 28px;
    --spacing-lg: 100px;
    --spacing-md: 50px;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    background-color: var(--clr-light);
    color: var(--clr-dark);
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* Typography */
h1 { font-size: clamp(3rem, 8vw, 6rem); font-weight: 900; text-transform: uppercase; margin: 0; line-height: 1; }
h2 { font-size: clamp(2rem, 5vw, 4rem); font-weight: 600; text-transform: uppercase; margin: 0; line-height: 1; }
.text-mono { font-family: var(--font-mono); font-size: 15px; text-transform: uppercase; }

/* Buttons & Pills */
.btn-dark {
    background-color: var(--clr-dark);
    color: var(--clr-light);
    padding: 16px 40px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    display: inline-block;
    border: none;
    cursor: pointer;
}
.btn-light {
    background-color: var(--clr-light);
    color: var(--clr-dark);
    padding: 16px 40px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    display: inline-block;
}

/* Layout Sections */
.section-light { background-color: var(--clr-light); color: var(--clr-dark); padding: var(--spacing-lg) 5%; }
.section-dark { background-color: var(--clr-dark); color: var(--clr-light); padding: var(--spacing-lg) 5%; }

/* Custom Layout Grids */
.hero-grid { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 30px; margin-top: 50px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 50px; }

/* 3 Info Cards */
.info-card { background: var(--clr-light); border-radius: var(--radius-pill); overflow: hidden; padding-bottom: 20px; }
.info-card img { width: 100%; height: 250px; object-fit: cover; border-radius: var(--radius-pill); }
.info-card h3 { font-size: 32px; margin: 20px 0 10px; font-weight: 700; text-transform: uppercase; }
.info-card p { font-size: 20px; font-weight: 300; margin: 0; line-height: 1.2; }

/* Carousel Pagination Styles */
.swiper-pagination-bullet {
    background: var(--clr-dark);
    opacity: 0.5;
    width: 12px;
    height: 12px;
}
.swiper-pagination-bullet-active {
    background: var(--clr-dark);
    opacity: 1;
}

/* Improved Typography & Spacing */
h1, h2, h3, h4, h5, h6 {
    text-transform: uppercase;
    color: var(--clr-dark);
}

h1 { 
    font-size: clamp(3rem, 8vw, 6rem); 
    font-weight: 900; 
    line-height: 1.1; /* Increased from 1 for better breathing room */
    margin: 0 0 0.5em 0; /* Added bottom margin */
}

h2 { 
    font-size: clamp(2rem, 5vw, 4rem); 
    font-weight: 600; 
    line-height: 1.2; 
    margin: 1em 0 0.5em 0; 
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 1em 0 0.5em 0;
}

p {
    font-size: 1.1rem;
    line-height: 1.6; /* Standard readability spacing */
    margin: 0 0 1.5em 0;
}

/* Ensure Gutenberg blocks have consistent vertical spacing */
.gutenberg-content > * + * {
    margin-top: 1.5em;
}

/* Specific spacing for the category buttons below the title */
.category-filters, .wp-block-buttons {
    margin: 2em 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Search Form States (Hover & Focus) */
.search-form-pill:focus-within {
    border-color: #ff4757 !important; /* Highlights the border when typing */
    box-shadow: 0 0 0 1px #ff4757;
}

.search-form-pill .search-submit:hover {
    opacity: 0.85;
    background-color: #ff4757 !important; /* Matches the red accent from the Figma hero */
}

/* Remove default webkit search styling */
.search-form-pill input[type="search"]::-webkit-search-decoration,
.search-form-pill input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

/* Header Desktop Layout */
.site-header { 
    position: relative; 
}
.header-nav-wrapper { 
    display: flex; 
    align-items: center; 
    gap: 40px; 
    flex: 1; 
    justify-content: flex-end; 
}

/* Mobile Hamburger Button (Hidden on Desktop) */
.mobile-menu-toggle { 
    display: none; 
    flex-direction: column; 
    justify-content: space-between; 
    width: 30px; 
    height: 20px; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    padding: 0; 
    z-index: 1000; 
}
.mobile-menu-toggle span { 
    width: 100%; 
    height: 2px; 
    background-color: var(--clr-dark); 
    transition: all 0.3s ease; 
    border-radius: 2px; 
}

/* Hamburger to 'X' Animation */
.mobile-menu-toggle.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
/* Header Desktop Layout */
.site-header { 
    position: relative; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 5%; 
    background: var(--clr-light);
}

.header-nav-wrapper { 
    display: flex; 
    align-items: center; 
    flex: 1; 
    /* This separates the centered nav and the right-aligned search bar */
    justify-content: space-between; 
    gap: 40px;
}

/* Forces the navigation to take up the middle space and center its items */
.header-nav-wrapper nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu-list { 
    display: flex; 
    gap: 30px; 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    align-items: center; 
    justify-content: center;
}

/* Mobile Hamburger Button (Hidden on Desktop) */
.mobile-menu-toggle { 
    display: none; 
    flex-direction: column; 
    justify-content: space-between; 
    width: 30px; 
    height: 20px; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    padding: 0; 
    z-index: 1000; 
}
.mobile-menu-toggle span { 
    width: 100%; 
    height: 2px; 
    background-color: var(--clr-dark); 
    transition: all 0.3s ease; 
    border-radius: 2px; 
}

/* Hamburger to 'X' Animation */
.mobile-menu-toggle.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Smartphone & Tablet Breakpoint */
@media (max-width: 900px) {
    .mobile-menu-toggle { display: flex; }
    
    .header-nav-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--clr-light);
        flex-direction: column;
        /* Centers the mobile menu content horizontally */
        align-items: center; 
        padding: 0;
        max-height: 0; 
        overflow: hidden;
        transition: max-height 0.4s ease-out, padding 0.4s ease;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        z-index: 999;
    }

    .header-nav-wrapper.is-open {
        max-height: 600px;
        padding: 30px 5%;
        border-top: 1px solid rgba(0,0,0,0.1);
    }

    .header-nav-wrapper nav {
        width: 100%;
    }

    .nav-menu-list { 
        flex-direction: column; 
        gap: 20px; 
        width: 100%; 
        margin-bottom: 30px; 
        /* Centers the text vertically inside the dropdown */
        align-items: center; 
        text-align: center;
    }
    
    .header-search { max-width: 100% !important; }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FIXES (Typography & Flex Layouts)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1a. Force standard blocks to stack vertically */
    .wp-block-media-text,
    .wp-block-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }
    
/* Force carousel titles to scale down gracefully on mobile screens */
    .swiper-slide h2 {
        font-size: clamp(1.5rem, 8vw, 2.2rem) !important;
    }

    /* 1b. Force split-grid to stack vertically with TEXT ON TOP */
    .split-grid {
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 30px !important;
    }
    
    /* 2. Stop images from being crushed into a dot */
    .split-grid > div,
    .wp-block-media-text__media,
    .wp-block-media-text__content,
    .wp-block-column {
        width: 100% !important;
        flex-basis: 100% !important;
        padding: 0 !important;
    }

    .split-grid img {
        width: 100% !important;
        height: auto !important;
        flex-shrink: 0;
    }
    
    /* 3. Scale down massive headings so they fit the screen */
    .split-grid h2,
    .wp-block-media-text__content h2,
    .wp-block-column h2,
    h2.has-huge-font-size {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        line-height: 1.1 !important;
        word-break: break-word; 
        margin-bottom: 20px !important;
    }

    /* 4. Reset asymmetrical artist grid on mobile */
    .swiss-image-grid {
        gap: 10px !important; /* Slightly tighter gap for mobile screens */
    }
    .swiss-image-grid > div {
        margin-top: 0 !important; /* Removes the staggered offsets */
    }

    /* Force newsletter heading to left-align on mobile */
    h3.newsletter-heading {
        text-align: left !important;
    }
}

/* 1. Accordion Contrast Fix (Forces pure white background) */
.brutalist-accordion-item {
    background-color: #FFFFFF !important; 
    border: 1px solid var(--clr-dark, #2C2A31) !important;
    border-radius: var(--radius-pill, 28px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 20px !important;
}

.brutalist-accordion-header:hover {
    opacity: 0.8;
}

/* Force the text inside the accordion header and content to remain dark */
.brutalist-accordion-item .brutalist-accordion-header span,
.brutalist-accordion-item .brutalist-accordion-icon,
.brutalist-accordion-item .brutalist-accordion-panel,
.brutalist-accordion-item .entry-content {
    color: var(--clr-dark) !important;
}

/* 2. Brand Charter Accents (For buttons and tags in front-page.php) */
.charter-arrow {
    color: var(--clr-pervenche-lumineuse); /* Applies the blue to the CTA arrows */
    margin-left: 5px;
}

.tag-a-la-une {
    color: var(--clr-orchidee-magique) !important; /* Applies the purple to the Top Tag */
}

/* Hide redundant Gutenberg titles inside accordions */
.brutalist-accordion-panel .entry-content h1:first-child {
    display: none !important;
}

.swiper-button-prev::after, .swiper-button-next::after { font-size: 20px !important; font-weight: bold; }

/* Reset Footer Menu Styles */
.footer-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-menu-list li {
    margin: 0;
}
.footer-menu-list a {
    color: inherit;
    text-decoration: none;
}
.footer-menu-list a::before {
    content: "→ ";
}


/* Prevent ALL titles from truncating with ellipses, including single pages */
.swiper-slide h2,
.exhibition-title,
.card-title,
.wp-block-post-title, 
.entry-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    display: block !important;
}

/* Align L'ÉQUIPE perfectly on the same line */
.footer-menu-list .sub-menu,
.widget_nav_menu .sub-menu {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.footer-menu-list .sub-menu li,
.widget_nav_menu .sub-menu li {
    padding-left: 0 !important;
    list-style-type: none !important;
}

/* Ensure the arrow appears for the sub-menu item just like the others */
.footer-menu-list .sub-menu a::before,
.widget_nav_menu .sub-menu a::before {
    content: "→ " !important;
}

/* ==========================================================================
   MOBILE MENU OVERRIDE FIX
   ========================================================================== */
@media (max-width: 900px) {
    .site-header {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative !important;
        padding: 15px 5% !important;
        z-index: 1000 !important;
    }

    .mobile-menu-toggle {
        display: flex !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
        z-index: 1002 !important;
    }

    .header-nav-wrapper {
        display: flex !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background-color: var(--clr-light, #F5F3EF) !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        padding: 0 5% !important;
        max-height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        overflow: hidden !important;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease !important;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
        z-index: 999 !important;
    }

    .header-nav-wrapper.is-open {
        max-height: 85vh !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow-y: auto !important;
        padding: 30px 5% 40px !important;
        border-top: 1px solid rgba(44, 42, 49, 0.1) !important;
    }

    .header-nav-wrapper nav {
        width: 100% !important;
        display: block !important;
    }

    .nav-menu-list {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 18px !important;
        width: 100% !important;
        margin: 0 0 25px 0 !important;
        padding: 0 !important;
    }

    /* Stack L'ÉQUIPE sub-menu cleanly inside the mobile list */
    .nav-menu-list .sub-menu {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px 0 0 0 !important;
        margin: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        list-style: none !important;
    }

    .header-search,
    .search-form-pill {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
    }
}

/* ==========================================================================
   DESKTOP DROPDOWN MENU (Clean Pill Style)
   ========================================================================== */
@media (min-width: 901px) {
    /* Set parent to relative so dropdown aligns below it */
    .nav-menu-list .menu-item-has-children {
        position: relative;
    }

    .nav-menu-list .menu-item-has-children > a {
        display: inline-flex;
        align-items: center;
        gap: 6px; /* Space between text and arrow */
    }

    /* Flip the arrow upside down when hovering */
    .nav-menu-list .menu-item-has-children:hover > a::after {
        transform: rotate(180deg);
    }

    .nav-menu-list .menu-item-has-children > a::after {
        content: "";
        display: inline-block;
        width: 0; 
        height: 0; 
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid var(--clr-dark); /* Color of the arrow */
        transition: transform 0.2s ease;
    }
    
  /* Clean, floating pill dropdown - Tighter size */
    .nav-menu-list .sub-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(15px);
        background-color: var(--clr-light, #F5F3EF);
        border: 1px solid rgba(44, 42, 49, 0.1);
        border-radius: 8px; /* Slightly tighter curves to match the smaller box */
        box-shadow: 0 10px 25px rgba(0,0,0,0.08);
        padding: 10px 16px; /* Reduced padding */
        min-width: auto; /* Removed the wide 180px minimum */
        width: max-content; /* Forces the box to exactly fit the text inside */
        list-style: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
        z-index: 100;
        text-align: center;
        margin: 0;
    }

    /* Hover trigger for desktop */
    .nav-menu-list .menu-item-has-children:hover .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(5px);
    }

    .nav-menu-list .sub-menu li {
        margin: 12px 0;
        padding: 0;
    }

    /* Ensure arrows from the footer don't leak into the header dropdown */
    .nav-menu-list .sub-menu a::before {
       content: "";
        position: absolute;
        top: -6px; /* Pushes the triangle up out of the box */
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background-color: var(--clr-light, #F5F3EF);
        border-top: 1px solid rgba(44, 42, 49, 0.1); /* Matches the box border */
        border-left: 1px solid rgba(44, 42, 49, 0.1);
        border-radius: 2px 0 0 0; /* Softens the sharp top point slightly */
        z-index: -1; /* Tucks the bottom half behind the main dropdown background */
    }

    .nav-menu-list .sub-menu a {
        color: var(--clr-dark);
        transition: color 0.2s;
        display: block;
        font-size: 13px;
    }
    
    .nav-menu-list .sub-menu a:hover {
        color: var(--clr-orchidee-magique, #A56BE2);
    }

    
}

/* ==========================================================================
   CROSS-BROWSER MOBILE FIXES (iOS Safari & Android Chrome)
   ========================================================================== */
/* Prevents iOS from rounding square buttons and adds tap-highlight fixes */
input[type="email"], 
input[type="search"], 
button, 
.btn-dark, 
.btn-light {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

/* Ensures titles only break between words, never splitting a word in half */
h1, h2, h3, .swiper-slide h2 {
    word-break: normal !important;
    overflow-wrap: normal !important;
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
}

/* ==========================================================================
   SWISS ARTISTS SECTION (Responsive Grid Fix)
   ========================================================================== */
.swiss-artists-section {
    padding: 100px 5%;
    background-color: var(--clr-dark);
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.swiss-artists-grid {
    max-width: 1440px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Columns on Desktop */
    gap: 60px;
    align-items: center;
}

/* Tablet (iPad) Breakpoint */
@media (max-width: 1024px) {
    .swiss-artists-grid {
        grid-template-columns: 1fr; /* Stacks vertically on iPads */
        gap: 50px;
    }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .swiss-artists-section {
        padding: 60px 6% !important; /* Restores safe borders on small phones */
    }
    
    .swiss-artists-grid {
        gap: 40px;
    }
    
    /* Prevents the long button text from breaking the layout */
    .swiss-artists-section .btn-light {
        width: 100% !important;
        padding: 16px 20px !important;
        text-align: center !important;
        box-sizing: border-box !important;
        white-space: normal !important; 
        font-size: 13px !important;
    }
}

/* ==========================================================================
   GLOBAL HORIZONTAL SCROLL FIX (Nest Hub / Tablets)
   ========================================================================== */
html, body {
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
}

/* Prevent the grid columns from forcing themselves wider than the screen */
.swiss-artists-grid > div,
.split-grid > div {
    min-width: 0;
    max-width: 100%;
}

/* ==========================================================================
   VISIBLE HYPERLINKS IN BODY TEXT
   ========================================================================== */
.entry-content a:not(.btn-dark):not(.btn-light):not(.wp-block-button__link),
.gutenberg-content a:not(.btn-dark):not(.btn-light):not(.wp-block-button__link),
.brutalist-accordion-panel a:not(.btn-dark):not(.btn-light):not(.wp-block-button__link) {
    color: var(--clr-pervenche-lumineuse, #626FF9);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.entry-content a:not(.btn-dark):not(.btn-light):not(.wp-block-button__link):hover,
.gutenberg-content a:not(.btn-dark):not(.btn-light):not(.wp-block-button__link):hover,
.brutalist-accordion-panel a:not(.btn-dark):not(.btn-light):not(.wp-block-button__link):hover {
    color: var(--clr-orchidee-magique, #A56BE2);
}

@media (max-width: 768px) {
    .brutalist-accordion-header {
        flex-wrap: wrap;
    }
    .brutalist-accordion-date {
        font-size: 0.72rem !important;
        white-space: normal !important;
    }
}

/* Add breathing room between the pink accordion header and the content */
.brutalist-accordion-panel {
    padding: 2rem !important;
}

/* ==========================================================================
   404 ERROR PAGE
   ========================================================================== */
.error-404-card {
    background: #ffffff;
    border: 1px solid var(--clr-dark, #2C2A31);
    border-radius: var(--radius-pill, 28px);
    padding: clamp(2rem, 5vw, 4rem);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.error-404-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 50px;
    align-items: center;
}

.error-404-nav-box {
    background: var(--clr-light, #F5F3EF);
    border: 1px solid rgba(44, 42, 49, 0.15);
    border-radius: 20px;
    padding: 30px;
}

.error-404-menu {
    font-family: var(--font-mono, 'Geist Mono', monospace);
    font-size: 14px;
    text-transform: uppercase;
    line-height: 2.3;
    font-weight: 600;
}

.error-404-menu a {
    color: var(--clr-dark, #2C2A31);
    transition: color 0.2s ease;
}

.error-404-menu a:hover {
    color: var(--clr-orchidee-magique, #A56BE2);
}

@media (max-width: 900px) {
    .error-404-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
}