/*
 Theme Name:   Twenty Twenty-Five Child
 Description:  Architectural Engine for Landscape Projects
 Author:       Nick Ripley
 Template:     twentytwentyfive
 Version:      2.3.0
*/

/* --- 1. THE CROWN: SHIFTNAV & ADMIN BAR --- */
.shiftnav, #shiftnav-main, .shiftnav-wrap-all {
    z-index: 99999999 !important;
}

#wpadminbar, #wpadminbar * {
    z-index: 999999 !important;
    text-decoration: none !important;
}

.admin-bar .shiftnav, 
.admin-bar #shiftnav-main {
    top: 32px !important;
}

/* --- 2. SPLIDE HERO (FRONT PAGE FIX) --- */
.splide {
    width: 100vw !important;
    position: relative !important;
    left: 50%; right: 50%;
    margin-left: -50vw; margin-right: -50vw;
    height: 80vh !important;
    background: #000;
    overflow: hidden;
}

.splide-aspect-filler {
    position: absolute !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover !important;
    background-position: center !important;
    z-index: 1;
}
/* --- 3. PROJECT CATEGORY GRID --- */

/* Desktop & Laptop Viewports (Console Closed) */
@media screen and (min-width: 960px) {
    .category-visual-grid {
        display: grid !important;
        /* Force exactly 4 columns by removing the strict 300px floor restriction */
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 30px !important;
        max-width: 1200px !important;
        margin: 40px auto !important;
        width: 100% !important;
    }
}

/* Mid-Sized Tablets & Viewports (Like when your Console is open) */
@media screen and (min-width: 600px) and (max-width: 959px) {
    .category-visual-grid {
        display: grid !important;
        /* Maintain the clean 2x2 symmetry you saw with the console open */
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
        margin: 30px auto !important;
        width: 100% !important;
    }
}

/* Small Mobile Screens */
@media screen and (max-width: 599px) {
    .category-visual-grid {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Stack vertically single-file */
        gap: 20px !important;
    }
}

/* --- 4. TEAM GRID (FIXED) --- */
#landscape_team_wrap {
    display: grid !important; 
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important; /* Defends against structural breaks */
    gap: 40px 30px !important;
    max-width: 1200px !important;
    margin: 40px auto !important;
    width: 100% !important;
}

/* Ensure child cards inside the team layout don't swell out */
.team-member-card {
    min-width: 0 !important;
}

.member-image-wrap { overflow: hidden; background: #000; width: 100%; }
.member-image-wrap img {
    width: 100% !important; 
    max-width: 100% !important;
    aspect-ratio: 1/1; 
    object-fit: cover; 
    display: block;
    filter: grayscale(100%);
    transition: 0.5s ease;
}

.team-member-card:hover .member-image-wrap img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

/* --- 5. SERVICES PAGE (ACCORDIONS) --- */
details { border-bottom: 1px solid #eee; padding: 15px 0; }
summary {
    font-weight: 700; cursor: pointer; list-style: none;
    color: #2e8b57; text-transform: uppercase; letter-spacing: 1px;
}
summary::-webkit-details-marker { display: none; }

/* --- 6. GLOBAL TYPOGRAPHY & BUTTONS --- */
p, li { line-height: 1.6 !important; }

.entry-content p a, .entry-content li a {
    display: inline !important;
    text-decoration: underline !important;
    color: #2e8b57; font-weight: 700;
}

.wp-block-button__link {
    background-color: #2e8b57 !important;
    color: #fff !important;
    border-radius: 0px !important;
    text-transform: uppercase !important;
    font-weight: 700;
    padding: 14px 32px !important;
}

/* --- 7. THE MASTER SCROLL & MODAL FIX --- */
/* Neutralizes the scroll lock from external scripts */
html, body {
    overflow: visible !important;
    height: auto !important;
    position: relative !important;
}

/* Forces the Team Modal to be scrollable independently */
.team-modal {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999999 !important;
    background: rgba(0,0,0,0.9) !important;
    overflow-y: auto !important; 
    -webkit-overflow-scrolling: touch;
}

.team-modal.is-active {
    display: block !important;
}

.modal-container {
    position: relative !important;
    background: #fff;
    width: 90%;
    max-width: 800px;
    margin: 60px auto !important; 
    padding: 40px;
    height: auto !important;
    min-height: 100px;
    overflow: visible !important;
    pointer-events: auto !important; /* Ensures profile content is clickable */
}

/* Neutralize the "Ghost" Lightbox layers if they appear */
.pswp, .mgl-lightbox, .pswp__dynamic-caption {
    pointer-events: none !important;
}

/* --- 8. DISCRETE LIGHTBOX for GALLERY --- */
#discrete-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999999;
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#discrete-lightbox.is-active { display: flex; }

#discrete-lightbox img {
    max-height: 90vh; max-width: 90vw;
    object-fit: contain; border-radius: 2px;
}

.project-gallery-trigger img { cursor: zoom-in !important; }

/* --- 9. RESPONSIVE --- */
@media (max-width: 1024px) { 
    .category-visual-grid, #landscape_team_wrap { grid-template-columns: repeat(2, 1fr) !important; } 
}
@media (max-width: 600px) {
    .category-visual-grid, #landscape_team_wrap { grid-template-columns: 1fr !important; }
}

/* Force hide the Post Terms block specifically for Project Categories */
div.taxonomy-project_category.wp-block-post-terms {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure our NEW shortcode (which uses the same classes) stays visible */
.meta-column-item.return-link {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
}

/* --- 10. LOGO INTERACTION (REFINED) --- */

/* Target the anchor directly through our custom class */
.logo-press a, 
.wp-block-site-logo.logo-press a {
    display: inline-block !important; /* Overrides the inline global rule */
    transition: transform 0.15s ease-in-out !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    vertical-align: middle;
}

/* Hover: Subtle shrink */
.logo-press a:hover {
    transform: scale(0.96) !important;
    filter: brightness(90%);
}

/* Active: The Button Press */
.logo-press a:active {
    transform: scale(0.92) translateY(3px) !important;
    filter: brightness(80%);
    transition: transform 0.05s linear !important;
}

/* Ensure the image doesn't steal the click (Ghosting fix) */
.logo-press img {
    pointer-events: none !important;
    display: block;
    max-width: 100%;
    height: auto;
}
/* --- 11. GLOBAL CONSTRAINED WRAPPER RECOVERY --- */
:root {
    /* Corrects the catastrophic 24050px variable injection */
    --wp--style--global--content-size: 1200px !important;
    --wp--style--global--wide-size: 1400px !important;
}

/* Force standard WordPress constrained layout containers back to realistic dimensions */
.is-layout-constrained > :not(.alignleft):not(.alignright):not(.alignfull) {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.is-layout-constrained > .alignwide {
    max-width: 1400px !important;
    width: 100% !important;
}