/*
Theme Name: Type Library
Theme URI: 
Author: Maxdiamond
Author URI: https://maxdiamondhead.com
Description: Typography based minimal layout.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: type-library

/* ==========================================================================
   TYPE LIBRARY: MASTER STYLESHEET
   
   TABLE OF CONTENTS:
   
   I.   BASE & SETUP
        01. Astro / Tailwind Compiled Defaults
        02. Tailwind Compiler Fallbacks
        
   II.  GLOBAL TYPOGRAPHY & CONTENT
        03. Base Typography & Headings
        04. Article & Case Study Spacing
        05. Inline Text Links & Captions
        06. Excerpt Typography
        07. Global Date Removal
        
   III. LAYOUT & ARCHITECTURE
        08. Bulletproof Layouts
        09. Architectural Blueprint Animations
        10. Native View Transitions
        11. Global Page Progress Bar
        
   IV.  HEADER, NAVIGATION & SEARCH
        12. Navigation & Active States
        13. Expanding SVG Header Search
        14. Theme Toggle Icon Logic
        15. Theme Menu Control
        
   V.   UI COMPONENTS & BLOCKS
        16. Minimal Buttons
        17. Forms & Inputs
        18. Brutalist Info / Alert Blocks
        19. Brutalist Project Metadata Grid
        20. Brutalist Blockquotes & Tables
        21. Brutalist Lists & Code Blocks
        22. Brutalist Separator Lines
        23. Mac OS Dock Tooltips
        
   VI.  MEDIA & GALLERIES
        24. Brutalist Media (Single Images, Videos, Embeds)
        25. Brutalist Gallery Hover Effects
        26. Brutalist Gallery Instructional Text
        27. Brutalist Vanilla Lightbox
        28. Audio Players (Cue & Native)
        29. Dynamic Hero Images
        
   VII. ARCHIVES, CARDS & SIDEBAR
        30. Custom Sidebar Portfolio Grid
        31. Media Cards & Hover States
        32. Templates, Archives & Pagination
        33. Custom UI / View All Utilities
        
   VIII. GLOBAL DARK MODE OVERRIDES
        34. Tailwind Card Protectors & WordPress Fixes
========================================================================== */


/* ==========================================================================
   GLOBAL VIEWPORT LOCK (IOS SAFARI SAFE)
   ========================================================================== */

html {
    max-width: 100vw !important;
    -webkit-font-smoothing: antialiased;
    /* CRITICAL: No overflow rules here, or Safari's address bar breaks */
}

body {
    max-width: 100vw !important;
    overflow-x: clip !important; /* 'clip' safely cuts off horizontal blowout without killing native scroll UI */
}

/* Forces all media and code blocks to safely stay inside the grid */
img, video, iframe, canvas, svg {
    max-width: 100% !important;
    height: auto;
}

pre, code {
    white-space: pre-wrap !important; 
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

/* Forces long URLs or unbreakable words in headings/paragraphs to wrap */
h1, h2, h3, h4, h5, h6, p, a, li {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}


/* ==========================================================================
   I. BASE & SETUP
   ========================================================================== */

/* --- 01. Astro / Tailwind Compiled Defaults --- */
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--color-border-primary)}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Instrument Sans,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}@font-face{font-family:"Instrument Serif";src:url('./fonts/InstrumentSerif-Regular.woff2') format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:"Instrument Serif";src:url('./fonts/InstrumentSerif-Italic.woff2') format("woff2");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:Instrument Sans;src:url('./fonts/InstrumentSans-VariableFont_wdth,wght.woff2') format("woff2");font-weight:400 700;font-style:normal;font-display:swap}@font-face{font-family:Instrument Sans;src:url('./fonts/InstrumentSans-Italic-VariableFont_wdth,wght.woff2') format("woff2");font-weight:400 700;font-style:italic;font-display:swap}@font-face{font-family:JetBrains Mono;src:url('./fonts/JetBrainsMono-VariableFont_wght.woff2') format("woff2");font-weight:100 800;font-style:normal;font-display:swap}@font-face{font-family:Adjusted Georgia Fallback;src:local(Georgia);size-adjust:75%;ascent-override:normal;descent-override:normal;line-gap-override:60%}:root{color:var(--color-text-primary);background-color:var(--color-bg-primary);scroll-behavior:smooth;--grid-display-size: calc((100vw - 3rem - 1px) / 24);--fade-size: 24px;--color-bg-primary: #f7f5f2;--color-bg-highlight: #fff;--color-bg-secondary: #e2dfdb;--color-bg-highlight-invert: #1f1d1d;--color-text-primary: #4a4846;--color-text-secondary: #726f6d;--color-text-highlight: #1f1d1d;--color-text-highlight-invert: #f7f5f2;--color-text-decoration: #5f5d5b;--color-border-primary: #ccc9c5;--color-border-highlight: #1f1d1d;--color-gradient-highlight-1: #8b8885;--color-gradient-highlight-2: #343232;--color-gradient-background: #eceae6}@media (prefers-color-scheme: dark){:root:not(.light):not(.dark){--color-bg-primary: #343232;--color-bg-highlight: #1f1d1d;--color-bg-secondary: #4a4846;--color-bg-highlight-invert: #fff;--color-text-primary: #ccc9c5;--color-text-highlight: #e2dfdb;--color-text-highlight-invert: #1f1d1d;--color-text-secondary: #a09d9a;--color-text-decoration: #b6b3af;--color-border-primary: #8b8885;--color-border-highlight: #f7f5f2;--color-gradient-highlight-1: #a09d9a;--color-gradient-highlight-2: #ccc9c5;--color-gradient-background: #292827}}:root[class~=dark]{--color-bg-primary: #343232;--color-bg-highlight: #1f1d1d;--color-bg-secondary: #4a4846;--color-bg-highlight-invert: #fff;--color-text-primary: #ccc9c5;--color-text-highlight: #e2dfdb;--color-text-highlight-invert: #1f1d1d;--color-text-secondary: #a09d9a;--color-text-decoration: #8b8885;--color-border-primary: #8b8885;--color-border-highlight: #f7f5f2;--color-gradient-highlight-1: #a09d9a;--color-gradient-highlight-2: #ccc9c5;--color-gradient-background: #292827}@media (min-width: 768px){:root{--fade-size: 48px;--grid-display-size: calc((100vw - 6rem - 1px) / 24)}}@media (min-width: 1024px){:root{--fade-size: 72px;--grid-display-size: calc((100vw - 9rem - 1px) / 36)}}@media (min-width: 1680px){:root{--grid-display-size: calc(1534px / 36)}}@view-transition{navigation: auto;}button:hover{cursor:auto}kbd{display:flex;justify-content:center;border-radius:.125rem;border-width:1px;border-color:var(--color-border-primary);background-color:var(--color-bg-primary);font-size:clamp(.7901rem,.7758rem + .0714vw,.833rem);line-height:.875rem;color:var(--color-text-secondary);box-shadow:0 1px 0 0 var(--color-border-primary)}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.body-text *+*{margin-top:var(--space, 1.5rem)}.body-text--tight{--space: .25rem}@media (min-width: 1024px){.body-text--constrain-width>:not(.astro-code){max-width:calc(77.77778% - .777778 * 1rem)}}@media (min-width: 1280px){.body-text--constrain-width>:not(.astro-code){max-width:calc(66.66667% - .6666667 * 1rem)}}.body-text a{text-decoration-line:underline;text-decoration-color:var(--color-text-decoration);text-underline-offset:2px;text-decoration-thickness:.07em}.body-text h2{--space: 3.5rem;scroll-margin-top:1rem;font-size:clamp(1.125rem,.9896rem + .6771vw,1.5313rem);line-height:1.33;text-transform:uppercase;letter-spacing:.025em;font-variation-settings:"wdth" 83}.body-text h3{--space: 2.5rem;scroll-margin-top:1rem;font-family:Instrument Serif,Adjusted Georgia Fallback,ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;font-size:clamp(1.125rem,.9896rem + .6771vw,1.5313rem);line-height:1.33;color:var(--color-text-secondary)}.body-text h2+h3{--space: 1.25rem}.body-text h4{scroll-margin-top:1rem;font-family:Instrument Sans,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:clamp(1rem,.9167rem + .4167vw,1.25rem);font-weight:500}.body-text figcaption{--space: .5rem;font-size:clamp(.8889rem,.845rem + .2192vw,1.0204rem);color:var(--color-text-secondary)}.body-text ul{list-style-type:disc;padding-left:1.5rem}.body-text ol{list-style-type:decimal;padding-left:1.5rem}.body-text li{--space: .75rem}.body-text strong{font-weight:590;letter-spacing:.01em}.body-text code{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.92em;font-weight:300;font-variant-ligatures:none}.body-text kbd{display:inline;font-size:.92em;font-weight:300;padding:.1em .4em}.body-text [data-footnote-ref]{border-radius:.25rem;background-color:transparent;padding-left:.25rem;padding-right:.25rem;text-decoration-line:none;transition-duration:.2s}.body-text [data-footnote-ref]:hover{background-color:var(--color-bg-secondary)}.footnotes{margin-bottom:1rem;display:block;border-top-width:1px;border-color:var(--color-border-primary);font-size:clamp(.8889rem,.845rem + .2192vw,1.0204rem);color:var(--color-text-secondary)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-right-2{right:-.5rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-\[calc\(var\(--grid-display-size\)\*2\)\]{left:calc(var(--grid-display-size) * 2)}.left-\[calc\(var\(--grid-display-size\)\*4\)\]{left:calc(var(--grid-display-size) * 4)}.right-2{right:.5rem}.right-\[calc\(var\(--grid-display-size\)\*3\)\]{right:calc(var(--grid-display-size) * 3)}.right-\[var\(--grid-display-size\)\]{right:var(--grid-display-size)}.top-0{top:0}.top-0\.5{top:.125rem}.top-1{top:.25rem}.top-1\/2{top:50%}.top-\[calc\(var\(--grid-display-size\)\*3\)\]{top:calc(var(--grid-display-size) * 3)}.top-\[calc\(var\(--grid-display-size\)\*4\.5\)\]{top:calc(var(--grid-display-size) * 4.5)}.top-\[calc\(var\(--grid-display-size\)\*8\)\]{top:calc(var(--grid-display-size) * 8)}.top-\[var\(--grid-display-size\)\]{top:var(--grid-display-size)}.z-10{z-index:10}.z-20{z-index:20}.col-span-12{grid-column:span 12 / span 12}.col-span-4{grid-column:span 4 / span 4}.col-span-8{grid-column:span 8 / span 8}.col-span-full{grid-column:1 / -1}.row-span-full{grid-row:1 / -1}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.-ml-1{margin-left:-.25rem}.-mr-2{margin-right:-.5rem}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-4\/3{aspect-ratio:4 / 3}.aspect-\[4\/3\]{aspect-ratio:4/3}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.h-4{height:1rem}.h-72{height:18rem}.h-\[0\.9em\]{height:.9em}.h-\[1em\]{height:1em}.h-\[calc\(var\(--grid-display-size\)\*4\)\]{height:calc(var(--grid-display-size) * 4)}.h-\[calc\(var\(--grid-display-size\)\*8\)\]{height:calc(var(--grid-display-size) * 8)}.h-auto{height:auto}.h-full{height:100%}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-\[60vh\]{min-height:60vh}.min-h-\[calc\(var\(--grid-display-size\)\*12\)\]{min-height:calc(var(--grid-display-size) * 12)}.w-1\/2{width:50%}.w-4{width:1rem}.w-\[0\.9em\]{width:.9em}.w-\[1em\]{width:1em}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-4{min-width:1rem}.max-w-full{max-width:100%}.max-w-screen-2xl{max-width:1536px}.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.resize{resize:both}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-subgrid{grid-template-columns:subgrid}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.gap-px{gap:1px}.gap-x-px{-moz-column-gap:1px;column-gap:1px}.gap-y-px{row-gap:1px}.overflow-y-auto{overflow-y:auto}.text-pretty{text-wrap:pretty}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.border{border-width:1px}.border-dotted{border-style:dotted}.border-border-highlight{border-color:var(--color-border-highlight)}.border-border-primary{border-color:var(--color-border-primary)}.border-grey-9\.5{--tw-border-opacity: 1;border-color:rgb(41 40 39 / var(--tw-border-opacity, 1))}.bg-background-highlight{background-color:var(--color-bg-highlight)}.bg-background-primary{background-color:var(--color-bg-primary)}.bg-border-primary{background-color:var(--color-border-primary)}.bg-grey-0{--tw-bg-opacity: 1;background-color:rgb(247 245 242 / var(--tw-bg-opacity, 1))}.bg-grey-0\.5{--tw-bg-opacity: 1;background-color:rgb(236 234 230 / var(--tw-bg-opacity, 1))}.bg-grey-10{--tw-bg-opacity: 1;background-color:rgb(31 29 29 / var(--tw-bg-opacity, 1))}.bg-grey-9{--tw-bg-opacity: 1;background-color:rgb(52 50 50 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-contain{-o-object-fit:contain;object-fit:contain}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\[var\(--grid-display-size\)\]{padding:var(--grid-display-size)}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-\[1px\]{padding-left:1px;padding-right:1px}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[calc\(var\(--grid-display-size\)\*1\.5\)\]{padding-top:calc(var(--grid-display-size) * 1.5);padding-bottom:calc(var(--grid-display-size) * 1.5)}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pb-\[calc\(var\(--grid-display-size\)\*2\)\]{padding-bottom:calc(var(--grid-display-size) * 2)}.pb-\[var\(--grid-display-size\)\]{padding-bottom:var(--grid-display-size)}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-4{padding-left:1rem}.pl-\[var\(--grid-display-size\)\]{padding-left:var(--grid-display-size)}.pr-0{padding-right:0}.pr-1{padding-right:.25rem}.pr-6{padding-right:1.5rem}.pt-0{padding-top:0}.pt-\[calc\(var\(--grid-display-size\)\*0\.5\)\]{padding-top:calc(var(--grid-display-size) * .5)}.pt-\[calc\(var\(--grid-display-size\)\*1\.3333\)\]{padding-top:calc(var(--grid-display-size) * 1.3333)}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:Instrument Sans,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.font-serif{font-family:Instrument Serif,Adjusted Georgia Fallback,ui-serif,Georgia,Cambria,"Times New Roman",Times,serif}.text-2xl{font-size:clamp(1.4238rem,1.1325rem + 1.4567vw,2.2978rem);line-height:1.125}.text-\[calc\(var\(--grid-display-size\)\*2\)\]{font-size:calc(var(--grid-display-size) * 2)}.text-\[calc\(var\(--grid-display-size\)\*3\)\]{font-size:calc(var(--grid-display-size) * 3)}.text-base{font-size:clamp(1rem,.9167rem + .4167vw,1.25rem)}.text-lg{font-size:clamp(1.125rem,.9896rem + .6771vw,1.5313rem);line-height:1.33}.text-sm{font-size:clamp(.8889rem,.845rem + .2192vw,1.0204rem)}.text-xs{font-size:clamp(.7901rem,.7758rem + .0714vw,.833rem)}.font-\[550\]{font-weight:550}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-\[calc\(var\(--grid-display-size\)\*2\)\]{line-height:calc(var(--grid-display-size) * 2)}.leading-\[calc\(var\(--grid-display-size\)\*3\)\]{line-height:calc(var(--grid-display-size) * 3)}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-\[-0\.004em\]{letter-spacing:-.004em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-grey-2{--tw-text-opacity: 1;color:rgb(204 201 197 / var(--tw-text-opacity, 1))}.text-grey-7{--tw-text-opacity: 1;color:rgb(95 93 91 / var(--tw-text-opacity, 1))}.text-red{--tw-text-opacity: 1;color:rgb(217 81 81 / var(--tw-text-opacity, 1))}.text-text-highlight{color:var(--color-text-highlight)}.text-text-secondary{color:var(--color-text-secondary)}.underline{text-decoration-line:underline}.decoration-inherit{text-decoration-color:inherit}.decoration-text-decoration{text-decoration-color:var(--color-text-decoration)}.decoration-\[0\.07em\]{text-decoration-thickness:.07em}.underline-offset-2{text-underline-offset:2px}.underline-offset-\[0\.15em\]{text-underline-offset:.15em}.shadow-border{--tw-shadow: 0 0 0 1px var(--color-border-primary);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.variable-font-wdth-83{font-variation-settings:"wdth" 83}.variable-font-wdth-90{font-variation-settings:"wdth" 90}[class*=border-fade]{position:relative}.border-fade-l:before{content:"";position:absolute;top:-1px;right:100%;display:block;width:var(--fade-size);height:calc(100% + 2px);-o-border-image:linear-gradient(to left,var(--color-border-primary) 30%,rgba(0,0,0,0) 100%) 1 100%;border-image:linear-gradient(to left,var(--color-border-primary) 30%,rgba(0,0,0,0) 100%) 1 100%;border-image-slice:1;border-top-width:1px;border-bottom-width:1px;pointer-events:none}.border-fade-r:after{content:"";position:absolute;top:-1px;left:100%;display:block;width:var(--fade-size);height:calc(100% + 2px);-o-border-image:linear-gradient(to right,var(--color-border-primary) 30%,rgba(0,0,0,0) 100%) 1 100%;border-image:linear-gradient(to right,var(--color-border-primary) 30%,rgba(0,0,0,0) 100%) 1 100%;border-image-slice:1;border-top-width:1px;border-bottom-width:1px;pointer-events:none}.squared-bg{background-color:var(--color-bg-primary);background-image:linear-gradient(to bottom,var(--color-bg-primary) 0,rgba(255,255,255,0) calc(var(--grid-display-size) * 3),rgba(255,255,255,0) calc(100% - var(--grid-display-size)),var(--color-bg-primary) 100%),linear-gradient(to right,var(--color-bg-primary) 0,rgba(255,255,255,0) calc(var(--grid-display-size) * 2),rgba(255,255,255,0) calc(100% - var(--grid-display-size)),var(--color-bg-primary) 100%),linear-gradient(105deg,var(--color-bg-primary),rgba(255,255,255,0)),linear-gradient(var(--color-border-primary) 1px,transparent 1px),linear-gradient(to right,var(--color-border-primary) 1px,var(--color-bg-primary) 1px);background-size:100% 100%,100% 100%,100% 100%,var(--grid-display-size) var(--grid-display-size),var(--grid-display-size) var(--grid-display-size);background-position:top left}.astro-code{padding:1rem;margin-inline:-1rem}:root[class~=dark] .astro-code,:root[class~=dark] .astro-code span{color:var(--shiki-dark)!important;background-color:var(--shiki-dark-bg)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;text-decoration:var(--shiki-dark-text-decoration)!important}.data-footnote-backref{margin-top:0;display:inline-flex;width:1lh;align-items:center;justify-content:center;border-radius:.25rem;background-color:transparent;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;transition-duration:.2s}.data-footnote-backref:hover{background-color:var(--color-bg-secondary)}.data-footnote-backref{text-decoration:none!important}.hover\:rounded-xl:hover{border-radius:.75rem}.hover\:bg-background-highlight-invert:hover{background-color:var(--color-bg-highlight-invert)}.hover\:bg-background-secondary:hover{background-color:var(--color-bg-secondary)}.hover\:bg-grey-0\.5:hover{--tw-bg-opacity: 1;background-color:rgb(236 234 230 / var(--tw-bg-opacity, 1))}.hover\:bg-grey-8:hover{--tw-bg-opacity: 1;background-color:rgb(74 72 70 / var(--tw-bg-opacity, 1))}.hover\:text-grey-1:hover{--tw-text-opacity: 1;color:rgb(226 223 219 / var(--tw-text-opacity, 1))}.hover\:text-grey-8:hover{--tw-text-opacity: 1;color:rgb(74 72 70 / var(--tw-text-opacity, 1))}.hover\:text-text-highlight:hover{color:var(--color-text-highlight)}.hover\:text-text-highlight-invert:hover{color:var(--color-text-highlight-invert)}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.aria-expanded\:bg-background-secondary[aria-expanded=true]{background-color:var(--color-bg-secondary)}@media (min-width: 640px){.sm\:not-sr-only{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}.sm\:absolute{position:absolute}.sm\:left-auto{left:auto}.sm\:right-4{right:1rem}.sm\:top-4{top:1rem}.sm\:col-span-6{grid-column:span 6 / span 6}.sm\:max-w-\[calc\(var\(--grid-display-size\)\*18\)\]{max-width:calc(var(--grid-display-size) * 18)}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:gap-2{gap:.5rem}.sm\:gap-6{gap:1.5rem}.sm\:p-2{padding:.5rem}.sm\:pb-0{padding-bottom:0}.sm\:pr-4{padding-right:1rem}}@media (min-width: 768px){.md\:col-span-12{grid-column:span 12 / span 12}.md\:col-span-3{grid-column:span 3 / span 3}.md\:col-span-6{grid-column:span 6 / span 6}.md\:col-span-9{grid-column:span 9 / span 9}.md\:mx-12{margin-left:3rem;margin-right:3rem}.md\:flex{display:flex}.md\:grid{display:grid}.md\:items-end{align-items:flex-end}.md\:justify-end{justify-content:flex-end}.md\:gap-px{gap:1px}.md\:before\:hidden:before{content:var(--tw-content);display:none}}@media (min-width: 1024px){.lg\:static{position:static}.lg\:col-span-4{grid-column:span 4 / span 4}.lg\:col-span-6{grid-column:span 6 / span 6}.lg\:col-span-8{grid-column:span 8 / span 8}.lg\:mx-18{margin-left:72px;margin-right:72px}.lg\:ml-4{margin-left:1rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:h-96{height:24rem}.lg\:w-auto{width:auto}.lg\:flex-row{flex-direction:row}.lg\:flex-row-reverse{flex-direction:row-reverse}.lg\:items-center{align-items:center}.lg\:justify-end{justify-content:flex-end}.lg\:justify-between{justify-content:space-between}.lg\:gap-4{gap:1rem}.lg\:py-\[var\(--grid-display-size\)\]{padding-top:var(--grid-display-size);padding-bottom:var(--grid-display-size)}.lg\:pt-2{padding-top:.5rem}.lg\:text-xl{font-size:clamp(1.2656rem,1.0622rem + 1.0169vw,1.8758rem);line-height:1.25}}@media (min-width: 1280px){.xl\:col-span-3{grid-column:span 3 / span 3}.xl\:col-span-4{grid-column:span 4 / span 4}.xl\:pt-6{padding-top:1.5rem}.xl\:before\:hidden:before{content:var(--tw-content);display:none}.xl\:after\:hidden:after{content:var(--tw-content);display:none}}.\[\&\>\*\]\:h-auto>*{height:auto}.\[\&\>\*\]\:h-full>*{height:100%}.\[\&\>\*\]\:w-full>*{width:100%}.\[\&\>\*\]\:border>*{border-width:1px}.\[\&\>\*\]\:border-border-primary>*{border-color:var(--color-border-primary)}.sun[data-astro-cid-tcsrer47]{stroke:currentColor}.moon[data-astro-cid-tcsrer47],.dark .sun[data-astro-cid-tcsrer47]{stroke:transparent}.dark .moon[data-astro-cid-tcsrer47]{stroke:currentColor}@media (prefers-color-scheme: dark){:root:not(.light):not(.dark) .sun[data-astro-cid-tcsrer47]{stroke:transparent}:root:not(.light):not(.dark) .moon[data-astro-cid-tcsrer47]{stroke:currentColor}}#theme-menu[data-astro-cid-tcsrer47]{position:absolute;right:-1px;top:100%;background-color:var(--color-bg-primary);color:var(--color-text-primary);border:1px solid var(--color-border-primary);box-shadow:0 2px 10px #0000001a}#theme-menu[data-astro-cid-tcsrer47] button[data-astro-cid-tcsrer47]:hover,#theme-menu[data-astro-cid-tcsrer47] button[data-astro-cid-tcsrer47]:focus-visible{background:var(--color-bg-secondary)}#theme-menu[data-astro-cid-tcsrer47] button[data-astro-cid-tcsrer47][aria-checked=true]:after{content:"";position:absolute;top:50%;right:5px;transform:translateY(-50%);width:6px;height:6px;background-color:#d95151;border-radius:50%}html[data-modifier-key=command] .control,html[data-modifier-key=control] .command{display:none}.search-dialog{background:transparent}.search-dialog::backdrop{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#0000004d}.search-container{display:flex;flex-direction:column;height:calc(100vh - 6rem);width:calc(100vw - 3rem);max-width:600px;color:var(--color-text-primary);border-radius:8px;pointer-events:none}@media (min-width: 768px){.search-container{height:60vh;width:80vw}}.search-combobox{position:relative;background-color:var(--color-bg-highlight);border-radius:8px;pointer-events:auto}.search-combobox[aria-expanded=true]{border-bottom-left-radius:0;border-bottom-right-radius:0}.search-icon{position:absolute;left:.4rem;top:0;height:100%}.search-input{width:100%;padding:.5rem 3rem .5rem 2.5rem;border-radius:8px;color:var(--color-text-primary);background:transparent}.search-input:focus-visible{outline:none}.search-close{position:absolute;top:0;right:0;display:flex;align-items:center;height:100%;padding-inline:.66rem}.search-close kbd{cursor:default}.search-results{overflow-y:scroll;display:grid;background-color:var(--color-bg-highlight);border-bottom-left-radius:8px;border-bottom-right-radius:8px;cursor:pointer;pointer-events:auto}.search-result{display:flex;flex-direction:column-reverse;color:var(--color-text-primary);border-top:1px solid var(--color-border-primary);padding:1rem}.search-result[aria-selected=true]{border-color:var(--color-border-highlight);color:var(--color-text-primary);background:var(--color-bg-primary)}.search-result[aria-selected=true]+.search-result{border-color:var(--color-border-highlight)}.here[data-astro-cid-3ef6ksr2]{position:relative}.here[data-astro-cid-3ef6ksr2]:after{content:"";position:absolute;bottom:-10px;left:50%;transform:translate(-50%);width:6px;height:6px;background-color:#d95151;border-radius:50%}

/* --- 02. Tailwind Compiler Fallbacks --- */
@media (min-width: 768px){
  .md\:hidden { display: none !important; }
  .md\:flex { display: flex !important; }
  .md\:col-span-3 { grid-column: span 3 / span 3 !important; }
  .md\:col-span-9 { grid-column: span 9 / span 9 !important; }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
}


/* ==========================================================================
   II. GLOBAL TYPOGRAPHY & CONTENT
   ========================================================================== */

/* --- 03. Base Typography & Headings --- */
@font-face {
    font-family: 'Instrument Sans'; /* MUST match Tailwind's compiled name */
    font-style: italic;
    font-weight: 100 900; 
    font-stretch: 75% 100%; 
    src: url('./fonts/InstrumentSans-VariableFont_wdth,wght.woff2') format('woff2'); /* Forces the base file to handle italics */
    font-display: swap; 
}

html { font-size: 100%; }

body {
    transition: background-color 0.3s ease, color 0.3s ease !important;
}

body, p, li, blockquote {
    font-size: 1.2rem; 
    line-height: 1.8; 
    letter-spacing: 0.012em; 
}

/* Primary Architecture (H1, H2): Structural & Punchy */
h1 {
    font-weight: 300 !important;
    color: var(--color-text-primary, #020617) !important;
}

/* Secondary Architecture (H3 - H6): Elegant & Editorial */
h2, h3, h4, h5, h6 {
    font-weight: 500 !important;
    color: var(--color-text-primary, #020617) !important;
}

h1 { font-size: 2.488rem !important; line-height: 1.1 !important; letter-spacing: -0.02em !important; } 
h2 { font-size: 2.074rem !important; line-height: 1.2 !important; letter-spacing: -0.01em !important; } 
h3 { font-size: 1.728rem !important; line-height: 1.25 !important; } 
h4 { font-size: 1.44rem !important; line-height: 1.3 !important; }  
h5 { font-size: 1.2rem !important; line-height: 1.4 !important; }   
h6 { font-size: 1rem !important; line-height: 1.5 !important; text-transform: uppercase !important; letter-spacing: 0.05em !important; }

/* Meta Data */
small, .wp-block-latest-posts__post-date, .post-metadata, .entry-meta {
    font-size: 0.875rem !important;
    color: var(--color-text-secondary, #475569) !important;
    font-family: "Instrument Sans", sans-serif !important;
}

/* --- 04. Article & Case Study Spacing --- */
.entry-content p:first-of-type { 
    font-size: 1.25rem; 
    font-weight: 500; 
}

.wp-content > *:first-child { margin-top: 0; }

.wp-content h1, 
.wp-content h2, 
.wp-content h3, 
.wp-content h4 {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    line-height: 1.2;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary, #000);
}

.wp-content h2 { font-size: 2.5rem; }
.wp-content h3 { font-size: 2rem; }
.wp-content h4 { font-size: 1.5rem; }

.wp-content p { margin-bottom: 1.75rem; line-height: 1.7; }
.wp-content ul, .wp-content ol { margin-bottom: 1.75rem; padding-left: 1.5rem; }
.wp-content ul { list-style-type: square; }
.wp-content ol { list-style-type: decimal; }
.wp-content li { margin-bottom: 0.5rem; }

/* --- 05. Inline Text Links & Captions --- */
.entry-content p a:not(.wp-block-button__link):not(.brutalist-sidebar-btn):not(.btn),
.entry-content li a:not(.wp-block-button__link):not(.brutalist-sidebar-btn):not(.btn),
.wp-block-post-content p a:not(.wp-block-button__link),
.wp-block-post-content li a:not(.wp-block-button__link),
footer p a,
footer li a,
figcaption a,
.brutalist-info a,
.spec-value a,
:not(h1, h2, h3, h4, h5, h6) > a:not([class]):not(:has(*)) {
    color: var(--color-text-primary, #4a4846) !important;
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
    text-decoration-color: var(--color-text-highlight, #1f1d1d) !important;
    background-color: transparent !important;
    padding: 0 0.15rem !important; 
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.entry-content p a:not(.wp-block-button__link):not(.brutalist-sidebar-btn):not(.btn):hover,
.entry-content li a:not(.wp-block-button__link):not(.brutalist-sidebar-btn):not(.btn):hover,
.wp-block-post-content p a:not(.wp-block-button__link):hover,
.wp-block-post-content li a:not(.wp-block-button__link):hover,
footer p a:hover,
footer li a:hover,
figcaption a:hover,
.brutalist-info a:hover,
.spec-value a:hover,
:not(h1, h2, h3, h4, h5, h6) > a:not([class]):not(:has(*)):hover {
    background-color: var(--color-text-highlight, #1f1d1d) !important;
    color: var(--color-text-highlight-invert, #f7f5f2) !important;
    text-decoration-color: transparent !important; 
}

/* Link Protector (Safeguard for images/icons) */
a:has(img),
a:has(svg),
.wp-block-social-link-anchor {
    text-decoration: none !important;
    background-color: transparent !important;
}

figcaption,
.wp-element-caption {
    display: block !important;
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--color-text-secondary, #726f6d) !important;
    text-align: left !important;
    margin-top: 0.75rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid var(--color-border-primary, #ccc9c5) !important;
}

.brutalist-lightbox .bl-caption {
    text-align: center !important;
    border-bottom: none !important;
    font-family: "Instrument Serif", serif !important; 
    font-size: 1.5rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* --- 06. Excerpt Typography --- */
.entry-summary p {
    font-size: clamp(0.8889rem, 0.845rem + 0.2192vw, 1.0204rem) !important; 
    line-height: 1.6 !important;
    margin-bottom: 0 !important;
    opacity: 0.7;
}

/* --- 07. Global Date Removal --- */
.ils-results-wrapper .ils-date,
.ils-results-wrapper .ils-meta,
.ils-item-date,
.ils-info,
.posted-on,
.post-date,
.entry-date,
.published,
.updated,
time.entry-date {
    display: none !important;
}


/* ==========================================================================
   III. LAYOUT & ARCHITECTURE
   ========================================================================== */

/* --- 08. Bulletproof Layouts --- */
.custom-sidebar-layout {
    display: flex;
    flex-direction: column;
}
.custom-sidebar-aside {
    border-top: 1px solid var(--border-primary, #e5e7eb);
}
@media (min-width: 1024px) {
    .custom-sidebar-layout {
        flex-direction: row;
        align-items: stretch; 
    }
    .custom-sidebar-content {
        width: 75%;
        border-right: 1px solid var(--border-primary, #e5e7eb);
    }
    .custom-sidebar-aside {
        width: 25%;
        border-top: none; 
    }
}

/* --- 09. Architectural Blueprint Animations --- */
@keyframes blueprintContent {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

.site-header nav,
.site-header .justify-between > *,
.squared-bg,
.wp-content > *,
.custom-sidebar-grid > *,
.site-footer .grid > *,
.site-footer .flex {
    opacity: 0; 
    animation: blueprintContent 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.site-header nav, .site-header .justify-between > * { animation-delay: 0.1s; }
.squared-bg { animation-delay: 0.2s; }
.wp-content > *:nth-child(-n+3), .custom-sidebar-grid h3 { animation-delay: 0.4s; }
.wp-content > *:nth-child(n+4), .custom-sidebar-grid .sidebar-portfolio-list { animation-delay: 0.5s; }
.site-footer .grid > * { animation-delay: 0.6s; }
.site-footer .flex { animation-delay: 0.7s; }

/* Interactive Blueprint Illustrations */
.illustration {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1.6s linear(0, .0024, .0145, .0355, .0644, .1, .142, .189, .241, .296, .354, .414, .474, .535, .596, .656, .715, .772, .826, .878, .927, .973, 1.02, 1.05, 1.09, 1.12, 1.15, 1.17, 1.19, 1.21, 1.22, 1.23, 1.24, 1.24, 1.25, 1.24, 1.24, 1.23, 1.23, 1.22, 1.21, 1.19, 1.18, 1.17, 1.15, 1.14, 1.12, 1.11, 1.09, 1.08, 1.07, 1.05, 1.04, 1.03, 1.01, 1, .993, .984, .976, .968, .962, .956, .951, .947, .944, .942, .941, .94, .94, .94, .941, .943, .945, .947, .95, .953, .956, .96, .963, .967, .971, .974, .978, .981, .985, .988, .991, .995, .997, 1, 1, 1, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1, 1, 1, 1, 1, 1, 1) forwards;
}

.illustration:nth-of-type(1) { animation-delay: .8s; }
.illustration:nth-of-type(2) { animation-delay: 1.6s; }
.illustration:nth-of-type(3) { animation-delay: 2.4s; }
.illustration:nth-of-type(4) { animation-delay: 3.2s; }

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .illustration { animation: none; opacity: 1; transform: translateY(0); }
}

/* --- 10. Native View Transitions --- */
.site-header { view-transition-name: main-header; }
.site-footer { view-transition-name: main-footer; }
#main { view-transition-name: core-content; }

::view-transition-old(core-content) { animation: fade-out 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
::view-transition-new(core-content) { animation: fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes fade-in { 
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 11. Global Page Progress Bar --- */
.global-progress-bar {
    width: 100%; /* Give it full physical width immediately */
    transform-origin: left; /* Anchor the animation to the left side */
    transform: scaleX(0); /* Visually shrink it down to 0% */
    transition: transform 0.4s ease; /* Only animate the transform */
    will-change: transform; /* Tells the browser to prep the GPU */
}

.global-progress-bar.is-loading {
    opacity: 1;
    width: 85%;
    transition: width 5s cubic-bezier(0.1, 0.8, 0.2, 1); 
}

.global-progress-bar.is-complete {
    transform: scaleX(1); /* Visually scale it back up to 100% */
}


/* ==========================================================================
   IV. HEADER, NAVIGATION & SEARCH
   ========================================================================== */

/* --- 12. Navigation & Active States --- */
header, .site-header, nav {
    overflow: visible !important;
}

.custom-header-nav-menu .menu-item a { text-decoration: none !important; }
.custom-header-nav-menu li > a { position: relative; }

/* The Active Indicator */
.custom-header-nav-menu .current-menu-item > a::after, 
.custom-header-nav-menu .current_page_item > a::after,
.custom-header-nav-menu .current-menu-ancestor > a::after,
.custom-header-nav-menu .current-menu-parent > a::after,
.custom-header-nav-menu .current_page_parent > a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 6px; 
    height: 6px;
    background-color: var(--color-text-primary, #020617) !important;
    border-radius: 0 !important;
}

/* The Hover Indicator */
.custom-header-nav-menu li:not(.current-menu-item):not(.current_page_item):not(.current-menu-parent):not(.current_page_parent) > a:hover::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--color-text-primary, #020617);
    opacity: 0.75;
    border-radius: 0 !important;
}

a:focus {
    outline: 2px solid var(--color-text-primary, #020617) !important;
    outline-offset: 4px;
}

.custom-header-nav-menu {
    display: flex !important;
    flex-direction: column;
    gap: 1rem !important;
}

@media (min-width: 768px) {
    /* 1. Forces the wrapper to fill the <nav> height and center its children */
    #mobile-menu {
        height: 100% !important;
        align-items: center !important;
    }

    /* 2. Forces the list to fill the wrapper and align the links */
    .custom-header-nav-menu {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
        height: 100% !important;
    }
}

@media (max-width: 1023px) {
    #site-header .justify-between { min-width: 100%; }
    #menu-default {
        max-height: calc(100vh - 5rem) !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        padding-bottom: 0 !important;
    }
    #mobile-menu { margin-top: 0.75rem; }
}

@media (max-width: 640px) { #site-header .justify-between { padding: 0.5rem; } }
@media (max-width: 340px) {
    #site-header nav { transform: translate(0px, 0px) !important; padding-top: 16px; }
}

/* --- 13. Expanding SVG Header Search --- */
.header-search-container .search-form {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 40px;
}

.header-search-container .search-field {
    margin-top: -8px;
    width: 0;
    opacity: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: "Instrument Sans", sans-serif;
    color: var(--color-text-primary, #4a4846) !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, border-color 0.4s ease;
}

.header-search-container .search-submit {
    background: transparent !important;
    border: none !important;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; 
    height: 40px;
    box-shadow: none !important;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.header-search-container .search-icon {
    margin-top: 8px; 
    width: 20px;
    height: 20px;
    color: var(--color-text-primary, #4a4846) !important; 
    stroke: currentColor !important;
    fill: none !important;
}

.header-search-container .search-field:focus,
.header-search-container .search-form:hover .search-field {
    width: 200px;
    opacity: 1;
    padding: 0.5rem 0;
    cursor: text;
    border-bottom: 2px solid var(--color-text-primary, #4a4846) !important;
    outline: none;
}

.header-search-container .search-form:hover .search-submit,
.header-search-container .search-field:focus + .search-submit {
    opacity: 0;
    width: 0; 
    pointer-events: none; 
}

@media (max-width: 768px) {
    .header-search-container .search-field:focus,
    .header-search-container .search-form:hover .search-field { width: 140px; }
}

/* --- 14. Theme Toggle Icon Logic --- */

/* Default (Light Mode): Show Moon (to switch to dark), Hide Sun */
body #theme-toggle .sun { display: block !important; }
body #theme-toggle .moon { display: none !important; }

/* Dark Mode Active: Show Sun (to switch to light), Hide Moon */
html.dark body #theme-toggle .moon { display: block !important; }
html.dark body #theme-toggle .sun { display: none !important; }

/* --- Mobile Menu Smooth Animation --- */
@media (max-width: 767px) {
    #mobile-menu {
        display: grid !important;
        grid-template-rows: 0fr;
        opacity: 0;
        margin-top: 0;
        pointer-events: none; 
        transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                    opacity 0.3s ease, 
                    margin-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        
        /* Failsafe: Ensures it sits above hero images if they have relative positioning */
        position: relative;
        z-index: 50;
    }
    
    #mobile-menu > ul {
        overflow: hidden; 
        
        /* THE FIX: Forces iOS Safari to calculate the 1fr height correctly */
        min-height: 0; 
        
        padding: 0 8px 12px 8px !important; 
        margin: 0 -8px !important; 
    }
    
    #mobile-menu.is-open {
        grid-template-rows: 1fr;
        opacity: 1;
        margin-top: 1rem; 
        pointer-events: auto;
    }
}



/* ==========================================================================
   15.1 GTRANSLATE HEADER WIDGET
   ========================================================================== */

/* 1. Main Header Button: Align the flag and arrow cleanly */
.gtranslate_wrapper .gt_switcher-popup {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0.5rem !important; /* Matches the padding of your theme toggle */
    border-radius: 0 !important;
    text-decoration: none !important;
}

/* 2. Hide the language name in the main button, keep the arrow */
.gtranslate_wrapper .gt_switcher-popup > span:first-of-type {
    display: none !important;
}

/* Ensure the tiny down arrow inherits the right theme color */
.gtranslate_wrapper .gt_switcher-popup > span:last-of-type {
    color: var(--color-text-primary, #020617) !important;
    font-size: 10px !important;
    margin-left: 2px !important;
}

/* 3. The Dropdown Menu: Ensure both flag and text show up */
.gtranslate_wrapper .gt_languages a {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.5rem 1rem !important;
    text-decoration: none !important;
    color: var(--color-text-primary, #020617) !important;
}

.gtranslate_wrapper .gt_languages a span {
    display: inline-block !important; /* Forces the text to stay visible */
    font-family: "Instrument Sans", sans-serif !important;
    font-size: 0.85rem !important;
}

/* 4. Dropdown Hover State (Matches your minimal theme menu) */
.gtranslate_wrapper .gt_languages a:hover {
    background-color: var(--color-bg-secondary, #e2dfdb) !important;
}

/* 5. Hide the invasive Google Translate bottom banner/toolbar */
body {
    top: 0 !important; /* Prevents body from jumping down */
}
.skiptranslate iframe,
.goog-te-banner-frame {
    display: none !important;
}
#goog-gt-tt {
    display: none !important;
}


/* ==========================================================================
   V. UI COMPONENTS & BLOCKS
   ========================================================================== */

/* --- 16. Minimal Buttons --- */
body .wp-block-button__link,
body .wp-element-button,
body a.btn.block.w-full {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    background-color: var(--color-text-highlight, #020617) !important;
    color: var(--color-text-highlight-invert, #ffffff) !important;
    border: 1px solid var(--color-text-highlight, #020617) !important;
    padding: 0.75rem 1.5rem !important;
    font-family: "Instrument Sans", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    font-size: 0.875rem !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    box-shadow: none !important; 
    transform: none !important;  
}

body a.btn.block.w-full { width: 100% !important; }

body .wp-block-button__link:hover,
body .wp-element-button:hover,
body a.btn.block.w-full:hover {
    background-color: transparent !important;
    color: var(--color-text-highlight, #020617) !important;
    transform: none !important;
    box-shadow: none !important;
}

body .wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent !important;
    color: var(--color-text-highlight, #020617) !important;
}

body .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--color-text-highlight, #020617) !important;
    color: var(--color-text-highlight-invert, #ffffff) !important;
}

/* --- 17. Forms & Inputs --- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="tel"], textarea, select, .wp-block-search__input {
    border-radius: 0 !important;
    background-color: transparent;
    border: 1px solid var(--border-primary, #cbd5e1);
    color: var(--text-primary, #020617);
    padding: 0.75rem 1rem;
    font-family: "Instrument Sans", sans-serif;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
    box-shadow: none !important;
    transition: border-color 0.2s ease, outline 0.2s ease;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus, .wp-block-search__input:focus {
    border-color: var(--text-primary, #020617);
    outline: 1px solid var(--text-primary, #020617);
    outline-offset: 0;
}
::placeholder { color: var(--text-primary, #020617); opacity: 0.4; }

/* --- 18. Brutalist Info / Alert Blocks --- */
p.brutalist-info,
div.brutalist-info {
    position: relative !important;
    padding: 1.5rem 2rem !important;
    margin: 3.5rem 0 2.5rem 0 !important; 
    border: 1px solid var(--color-border-primary, #ccc9c5) !important;
    background-color: transparent !important;
    border-left: 4px solid var(--color-text-highlight, #1f1d1d) !important;
    font-size: 1rem !important; 
    font-weight: 400 !important;
    line-height: 1.6 !important;
    color: var(--color-text-primary, #4a4846) !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

p.brutalist-info::before,
div.brutalist-info::before {
    content: "NOTE"; 
    position: absolute;
    top: -1px; 
    left: -4px; 
    transform: translateY(-100%);
    background-color: var(--color-text-highlight, #1f1d1d);
    color: var(--color-text-highlight-invert, #f7f5f2);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.35rem 0.75rem;
    text-transform: uppercase;
}

p.brutalist-info.is-wip::before, div.brutalist-info.is-wip::before { content: "WORK IN PROGRESS"; }
p.brutalist-info.is-update::before, div.brutalist-info.is-update::before { content: "PROJECT UPDATE"; }
p.brutalist-info.is-info::before, div.brutalist-info.is-info::before { content: "INFO"; }

p.brutalist-info.is-disclaimer, div.brutalist-info.is-disclaimer {
    background-color: #d95151 !important; 
    border-color: #d95151 !important;
    color: #ffffff !important; 
}
p.brutalist-info.is-disclaimer::before, div.brutalist-info.is-disclaimer::before { 
    content: "DISCLAIMER"; background-color: var(--color-text-highlight, #1f1d1d); color: #ffffff;
}

/* --- 19. Brutalist Project Metadata Grid --- */
.brutalist-spec-grid {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch !important; 
    align-content: stretch !important;
    border-top: 1px solid var(--color-border-primary, #ccc9c5) !important;
    margin: 4rem 0 3rem 0 !important;
    padding: 0 !important;
}

.spec-cell {
    display: block !important; 
    align-self: stretch !important; 
    box-sizing: border-box !important;
    padding: 1.25rem 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--color-border-primary, #ccc9c5) !important;
    border-top: none !important;
}

.spec-label {
    display: block !important;
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: var(--color-text-secondary, #726f6d) !important;
    margin: 0 0 0.5rem 0 !important;
    line-height: 1.2 !important;
}

.spec-value {
    display: block !important;
    font-family: "Instrument Sans", sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    color: var(--color-text-primary, #4a4846) !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

@media (min-width: 768px) {
    .brutalist-spec-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        border-bottom: 1px solid var(--color-border-primary, #ccc9c5) !important;
    }
    .spec-cell {
        padding: 1.5rem 2rem !important;
        border-bottom: none !important;
        border-right: 1px solid var(--color-border-primary, #ccc9c5) !important;
    }
    .spec-cell:first-child { padding-left: 0 !important; }
    .spec-cell:last-child { border-right: none !important; padding-right: 0 !important; }
}

/* --- 20. Brutalist Blockquotes & Tables --- */
.wp-block-quote, blockquote {
    position: relative !important;
    
    /* THE FIX: Fluid Margins & Padding */
    margin: clamp(2rem, 5vw, 4rem) 0 !important;
    padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 2.5rem) !important;
    
    border: 1px solid var(--color-border-primary, #ccc9c5) !important;
    border-left: 4px solid var(--color-text-highlight, #1f1d1d) !important;
    background-color: transparent !important;
}

.wp-block-quote::before, blockquote::before {
    content: "QUOTE";
    position: absolute;
    top: -1px; left: -4px; transform: translateY(-100%);
    background-color: var(--color-text-highlight, #1f1d1d);
    color: var(--color-text-highlight-invert, #f7f5f2);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
    padding: 0.35rem 0.75rem; text-transform: uppercase;
}

.wp-block-quote p, blockquote p {
    font-family: "Instrument Serif", serif !important;
    
    /* THE FIX: Fluid Typography (Scales between 1.25rem on mobile and 1.75rem on desktop) */
    font-size: clamp(1.25rem, 3vw + 0.5rem, 1.75rem) !important; 
    
    line-height: 1.3 !important;
    color: var(--color-text-highlight, #1f1d1d) !important;
    background-color: transparent !important; 
    margin-bottom: 1rem !important; 
    font-style: normal !important; 
}

.wp-block-quote cite, blockquote cite {
    display: block !important;
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
    
    /* THE FIX: Fluid Cite Text */
    font-size: clamp(0.75rem, 2vw, 0.85rem) !important; 
    
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important; 
    color: var(--color-text-secondary, #726f6d) !important;
    font-style: normal !important;
}
.wp-block-quote cite::before, blockquote cite::before { content: "\2014  "; }

/* ==========================================================================
   2. BRUTALIST TABLES (The Ultimate Grid Blowout Preventer)
   ========================================================================== */

/* 1. Global Iframe Fix: Vertical scroll remains smooth */
html, body {
    max-width: 100% !important;
    overscroll-behavior-y: none !important; 
    -webkit-overflow-scrolling: touch !important; 
}

/* 2. The Wrapper: Unbreakable Mathematical Trap */
body figure.wp-block-table,
body .entry-content .wp-block-table,
body .wp-block-post-content .wp-block-table {
    /* THE FIX: Grid + Minmax creates a rigid boundary that Flexbox cannot stretch */
    display: grid !important; 
    grid-template-columns: minmax(0, 1fr) !important; 
    min-width: 0 !important; /* Forces the flex-parent to strictly obey 100% width */
    
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important; 
    box-sizing: border-box !important;
    margin: 3rem 0 !important;
    padding: 0 !important;
    border: none !important;
    background-color: transparent !important;
}

/* 3. The Core Table Grid: Natural expansion inside the trap */
body .wp-block-table table,
table {
    display: table !important;
    table-layout: auto !important; 
    width: max-content !important; 
    min-width: 100% !important; 
    border-collapse: collapse !important; 
    margin: 0 !important;
    border: 2px solid var(--color-border-primary, #ccc9c5) !important;
    max-width: none !important; 
}

/* 4. Table Cells: The Anti-Squish Fallback */
body .wp-block-table th, 
body .wp-block-table td, 
table th, 
table td {
    border: 1px solid var(--color-border-primary, #ccc9c5) !important;
    padding: 1rem 1.25rem !important; 
    text-align: left !important;
    white-space: normal !important;
    min-width: 180px !important; 
    vertical-align: top !important;
}

/* 5. Table Headers */
body .wp-block-table thead th,
body .wp-block-table thead td,
body .wp-block-table th, 
table th {
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.05em !important;
    font-weight: 700 !important;
    background-color: var(--color-text-highlight, #1f1d1d) !important; 
    color: var(--color-text-highlight-invert, #f7f5f2) !important;
    border-bottom: 2px solid var(--color-text-highlight, #1f1d1d) !important;
}

/* 6. Table Data */
body .wp-block-table td, 
table td {
    font-family: "Instrument Sans", sans-serif !important;
    font-size: 1rem !important; 
    color: var(--color-text-primary, #4a4846) !important;
    line-height: 1.5 !important;
}


/* --- 21. Brutalist Lists & Code Blocks --- */
.entry-content ul, .wp-block-list {
    list-style: none !important; padding-left: 0 !important; margin: 2.5rem 0 !important;
}
.entry-content ul li, .wp-block-list li {
    position: relative !important; padding-left: 1.5rem !important; margin-bottom: 0.75rem !important; line-height: 1.6 !important;
}
.entry-content ul li::before, .wp-block-list li::before {
    content: "+" !important; position: absolute !important; left: 0 !important;
    font-family: "JetBrains Mono", ui-monospace, monospace !important; font-size: 1rem !important;
    font-weight: 700 !important; color: var(--color-text-highlight, #1f1d1d) !important; transform: translateY(-0.1rem) !important;
}

.entry-content ol {
    list-style: none !important; counter-reset: brutalist-counter !important;
    padding-left: 0 !important; margin: 2.5rem 0 !important;
}
.entry-content ol li {
    position: relative !important; padding-left: 2.25rem !important;
    margin-bottom: 1rem !important; counter-increment: brutalist-counter !important; line-height: 1.6 !important;
}
.entry-content ol li::before {
    content: counter(brutalist-counter, decimal-leading-zero) "." !important;
    position: absolute !important; left: 0 !important; font-family: "JetBrains Mono", ui-monospace, monospace !important;
    font-size: 0.85rem !important; font-weight: 700 !important; color: var(--color-text-secondary, #726f6d) !important; transform: translateY(0.2rem) !important;
}

.wp-block-code, pre {
    position: relative !important; margin: 4rem 0 3rem 0 !important;
    padding: 3rem 2rem 2rem 2rem !important; 
    background-color: var(--color-text-highlight, #1f1d1d) !important; 
    border: 1px solid var(--color-text-highlight, #1f1d1d) !important;
    border-radius: 0 !important; overflow-x: auto !important;
}
.wp-block-code::before, pre::before {
    content: "TERMINAL"; position: absolute; top: 0; left: 0;
    background-color: var(--color-text-highlight-invert, #f7f5f2); 
    color: var(--color-text-highlight, #1f1d1d); 
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.75rem;
    font-weight: 700; letter-spacing: 0.1em; padding: 0.35rem 0.75rem; text-transform: uppercase;
}
.wp-block-code, .wp-block-code code, pre, pre code, .wp-block-code *, pre * {
    color: #f7f5f2 !important; 
}
.wp-block-code code, pre code {
    display: block !important; font-family: "JetBrains Mono", ui-monospace, monospace !important;
    font-size: 0.85rem !important; background: transparent !important; line-height: 1.7 !important;
}
p code, li code {
    font-family: "JetBrains Mono", ui-monospace, monospace !important; font-size: 0.85em !important;
    background-color: transparent !important; color: var(--color-text-highlight, #1f1d1d) !important;
    padding: 0.1rem 0.3rem !important; border: 1px solid var(--color-border-primary, #ccc9c5) !important; border-radius: 2px !important; 
}

/* --- 22. Brutalist Separator Lines --- */
hr.wp-block-separator, .wp-block-separator {
    border: none !important; border-top: 1px solid var(--color-border-primary, #ccc9c5) !important; 
    background: transparent !important; opacity: 1 !important; 
    margin: 4rem auto !important; height: 0 !important;
}
hr.wp-block-separator.is-style-wide, .wp-block-separator.is-style-wide { width: 100% !important; max-width: 100% !important; }
hr.wp-block-separator.is-style-dots::before, .wp-block-separator.is-style-dots::before { color: var(--color-border-primary, #ccc9c5) !important; }

/* --- 23. Mac OS Dock Tooltips --- */
.custom-tooltip-trigger { position: relative; display: block; }
.custom-tooltip-label {
    position: absolute; bottom: 80%; left: 50%;
    transform: translateX(-50%) translateY(0px); 
    padding: 0.25rem 0.5rem; background-color: var(--text-primary, #020617); color: var(--background-primary, #ffffff);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    white-space: nowrap; opacity: 0; pointer-events: none; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.custom-tooltip-trigger:hover .custom-tooltip-label { opacity: 1; transform: translateX(-50%) translateY(-8px); }


/* ==========================================================================
   VI. MEDIA & GALLERIES
   ========================================================================== */

/* --- 24. Brutalist Media (Single Images, Videos, Embeds) --- */
body .wp-block-image img, body .wp-block-video video, body .wp-block-embed iframe {
    border-radius: 0 !important; 
    /*border: 1px solid var(--color-border-primary, #ccc9c5) !important;  /* Image Border */
    box-shadow: none !important; 
    max-width: 100% !important; height: auto !important; display: block !important;
}
body .wp-block-image, body .wp-block-video, body .wp-block-embed {
    margin: 4rem auto !important; position: relative !important;
}
body .wp-block-image.alignwide img, body .wp-block-image.alignfull img {
    border-left: none !important; border-right: none !important;
}

#page img, .wp-block-embed iframe, .wp-block-video video, .smush-lazyload-video {
    border-radius: 3px; overflow: hidden;
}

.wp-content figure, .wp-content .wp-block-image { margin-top: 3rem; margin-bottom: 3rem; }
.wp-content img { width: 100%; max-width: 100%; height: auto; display: block; border: 1px solid var(--border-primary, #e5e7eb); }
.wp-content figcaption {
    margin-top: 0.75rem; font-size: 0.875rem; opacity: 0.7; text-align: center; font-family: "Instrument Sans", sans-serif;
}

/* --- 25. Brutalist Gallery Hover Effects --- */
.brutalist-gallery .wp-block-image, .brutalist-gallery .wp-block-image figure {
    position: relative !important; overflow: hidden !important; margin: 0 !important; border: 1px solid var(--border-primary, #e5e7eb) !important;
}
.brutalist-gallery .wp-block-image a { display: block !important; width: 100% !important; height: 100% !important; }
.brutalist-gallery .wp-block-image img {
    width: 100% !important; height: 100% !important; object-fit: cover !important; border: none !important;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important; will-change: transform; 
}

/* Notice: The ::after pseudo-element has been removed here to prevent conflicts with the Image Preloader curtain */

.brutalist-gallery .wp-block-image figcaption, .brutalist-gallery .wp-block-image .wp-element-caption {
    position: absolute !important; inset: 0 !important; z-index: 10 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    text-align: center !important; padding: 1.5rem !important; margin: 0 !important;
    
    /* THE FIX: Apply the dark overlay directly to the caption's background */
    background: rgba(0, 0, 0, 0.7) !important; 
    
    color: #ffffff !important;
    font-family: "Instrument Serif", serif !important; font-size: 1.5rem !important; line-height: 1.1 !important;
    opacity: 0 !important; transform: translateY(10px) !important;
    transition: all 0.3s ease !important; pointer-events: none !important;
}

.brutalist-gallery .wp-block-image:hover img { transform: scale(1.05) !important; }
.brutalist-gallery .wp-block-image, .brutalist-gallery .wp-block-image * {
    cursor: pointer !important; touch-action: manipulation !important; -webkit-tap-highlight-color: transparent !important; 
}

.brutalist-gallery .wp-block-image:hover figcaption, .brutalist-gallery .wp-block-image:hover .wp-element-caption {
    opacity: 1 !important; transform: translateY(0) !important;
}

/* --- 26. Brutalist Gallery Instructional Text --- */
.brutalist-gallery::before {
    content: "[ \2197 CLICK ANY IMAGE TO EXPAND ]"; 
    flex: 1 1 100%; grid-column: 1 / -1; display: block;
    font-family: "JetBrains Mono", ui-monospace, monospace !important; font-size: 0.75rem !important;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--color-text-secondary, #726f6d) !important;
    margin-bottom: 1.5rem !important; text-align: right; border-bottom: 1px solid var(--color-border-primary, #ccc9c5); padding-bottom: 0.5rem;
}

/* ==========================================================================
   27. BRUTALIST VANILLA LIGHTBOX (The Override Engine)
   ========================================================================== */

/* --- 1. The Core Overlay --- */
.brutalist-lightbox {
    position: fixed !important; inset: 0 !important; z-index: 999999 !important; 
    display: flex !important; align-items: center !important; justify-content: center !important;
    visibility: hidden; opacity: 0; pointer-events: none; 
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.brutalist-lightbox.is-open {
    visibility: visible !important; opacity: 1 !important; pointer-events: auto !important; 
    transition: opacity 0.3s ease, visibility 0s;
}
.bl-backdrop { 
    position: absolute !important; inset: 0 !important; 
    background-color: rgba(2, 6, 23, 0.95) !important; /* Dark solid backdrop */
    cursor: zoom-out !important; z-index: 1 !important; 
}

/* --- 2. The Content Wrapper (Shrink-wraps perfectly) --- */
.bl-content {
    position: relative !important; z-index: 10 !important; 
    display: inline-flex !important; flex-direction: column !important; 
    align-items: center !important; justify-content: center !important;
    width: fit-content !important; height: fit-content !important;
    max-width: 90vw !important; max-height: 90vh !important;
    margin: auto !important; /* Dead center */
    transform: translateY(20px) scale(0.98); transition: transform 0.4s ease;
}
.brutalist-lightbox.is-open .bl-content { transform: translateY(0) scale(1) !important; }

/* --- 3. The Image (Immune to all external styling) --- */
.brutalist-lightbox .bl-image {
    display: block !important;
    width: auto !important; 
    height: auto !important; 
    max-width: 90vw !important; 
    
    /* THE FIX: Carves out 6rem of empty space at the top and bottom */
    max-height: calc(100vh - 12rem) !important; 
    
    min-width: 0 !important; 
    min-height: 0 !important; 
    aspect-ratio: auto !important; 
    object-fit: contain !important; 
    margin: 0 auto !important; 
    border: none !important; 
    box-shadow: none !important; border-radius: 0 !important; 
    opacity: 1 !important;
}

/* --- 4. The UI Controls (Fixed to the Viewport Screen) --- */
.brutalist-lightbox .bl-close, 
.brutalist-lightbox .bl-nav {
    position: fixed !important; /* Anchors to the screen, NOT the container */
    z-index: 9999999 !important; /* Highest possible layer */
    display: block !important; visibility: visible !important; opacity: 1 !important;
    background: #020617 !important; /* Solid dark background */
    border: 1px solid #333 !important;
    color: #ffffff !important; 
    font-family: "Instrument Sans", sans-serif !important; 
    font-size: 0.875rem !important;
    letter-spacing: 0.1em !important; 
    cursor: pointer !important; 
    padding: 0.75rem 1.5rem !important; 
    border-radius: 4px !important;
}

/* Strict Mapping to Screen Edges */
.brutalist-lightbox .bl-close { top: 1.5rem !important; right: 1.5rem !important; }
.brutalist-lightbox .bl-prev { left: 1.5rem !important; top: 50% !important; transform: translateY(-50%) !important; }
.brutalist-lightbox .bl-next { right: 1.5rem !important; top: 50% !important; transform: translateY(-50%) !important; }

.brutalist-lightbox .bl-close:hover, 
.brutalist-lightbox .bl-nav:hover { color: #0ea5e9 !important; border-color: #0ea5e9 !important; }

/* --- 5. Captions & Loaders (Top Anchored HUD) --- */
.brutalist-lightbox .bl-counter {
    position: fixed !important;
    top: 1.5rem !important; /* EXACTLY matches the Close button's top coordinate */
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important; 
    color: #a09d9a !important; 
    font-family: "Instrument Sans", sans-serif !important;
    font-size: 0.75rem !important; 
    letter-spacing: 0.1em !important; 
    text-align: center !important;
    z-index: 999999 !important;
    pointer-events: none !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8) !important;
}

.brutalist-lightbox .bl-caption {
    position: fixed !important; 
    top: 2.75rem !important; /* Sits cleanly right below the counter */
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important; 
    color: #ffffff !important; 
    font-family: "Instrument Serif", serif !important;
    font-size: 1.5rem !important; 
    text-align: center !important; 
    width: 100% !important;
    max-width: 60vw !important; 
    z-index: 999999 !important;
    pointer-events: none !important; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8) !important; 
}

/* Lightbox Progress Bar */
.brutalist-lightbox .bl-progress {
    position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important;
    height: 3px !important; background-color: var(--border-primary, #ccc9c5) !important;
    width: 0% !important; max-width: 240px !important; z-index: 99 !important; opacity: 0 !important; transition: width 0s, opacity 0.2s ease !important;
}
.brutalist-lightbox .bl-progress.is-loading { opacity: 1 !important; width: 200px !important; transition: width 4s cubic-bezier(0.1, 0.8, 0.2, 1) !important; }
.brutalist-lightbox .bl-progress.is-complete { opacity: 0 !important; width: 240px !important; transition: width 0.2s ease, opacity 0.3s ease 0.2s !important; }

/* --- 6. Zoom Controls UI --- */
.brutalist-lightbox .bl-zoom-controls {
    position: fixed !important;
    bottom: 1.5rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important; /* Locks it dead-center */
    top: auto !important;
    right: auto !important;
    z-index: 9999999 !important;
    display: flex !important;
    gap: 0.5rem !important;
}

.brutalist-lightbox .bl-zoom-btn {
    background: rgba(2, 6, 23, 0.6) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(4px);
    color: #ffffff !important; 
    font-family: "Instrument Sans", sans-serif !important; 
    font-size: 0.875rem !important;
    letter-spacing: 0.1em !important; 
    cursor: pointer !important; 
    padding: 0.75rem 1rem !important; 
    border-radius: 4px !important;
    display: block !important; 
    transition: all 0.2s ease;
}

.brutalist-lightbox .bl-zoom-btn:hover {
    background: rgba(2, 6, 23, 0.9) !important;
    color: #0ea5e9 !important; 
    border-color: #0ea5e9 !important;
}

/* --- 5. Mobile & Small Screen Adjustments (Icon-Only UI) --- */
/* Hide text, enforce identical, massive touch targets */
    .brutalist-lightbox .bl-close, 
    .brutalist-lightbox .bl-prev, 
    .brutalist-lightbox .bl-next {
        font-size: 0 !important; 
        letter-spacing: 0 !important;
        
        /* THE FIX: Explicit square dimensions instead of padding */
        width: 3.5rem !important;  /* 56px width */
        height: 3.5rem !important; /* 56px height */
        padding: 0 !important;     /* Strip the old padding */
        
        /* Perfect internal centering */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Inject pure symbols and normalize their baselines */
    .brutalist-lightbox .bl-close::after { 
        content: "X"; 
        font-size: 1.25rem !important; 
        line-height: 1 !important; 
    }
    .brutalist-lightbox .bl-prev::after { 
        content: "←"; 
        font-size: 1.75rem !important; 
        line-height: 1 !important; 
        margin-bottom: 2px !important; /* Tiny optical tweak for arrows */
    }
    .brutalist-lightbox .bl-next::after { 
        content: "→"; 
        font-size: 1.75rem !important; 
        line-height: 1 !important; 
		margin-bottom: 2px !important; /* Tiny optical tweak for arrows */
}

/* Mobile adjustments for the new Top HUD */
    .brutalist-lightbox .bl-caption {
      top: 2rem !important;
      font-size: 1.25rem !important;
      max-width: 75vw !important; /* Gives the caption a bit more room to breathe on phones */
}
    .brutalist-lightbox .bl-counter {
      top: 0.75rem !important;
}

/* Mobile HUD Alignment */
    .brutalist-lightbox .bl-counter {
      top: 1rem !important; /* Matches mobile Close button top */
}
    .brutalist-lightbox .bl-caption {
      top: 2.25rem !important;
      font-size: 1.25rem !important;
      max-width: 75vw !important; 
}
    .brutalist-lightbox .bl-image {
      max-height: calc(100vh - 10rem) !important; /* Mobile safe zones */
}


/* --- 29. Dynamic Hero Images --- */
.squared-bg { min-height: var(--hero-height, 50vh) !important; width: 100%; }
@media (max-width: 768px) and (orientation: portrait) { .squared-bg { min-height: calc(var(--hero-height, 50vh) / 2) !important; } }


/* ==========================================================================
   VII. ARCHIVES, CARDS & SIDEBAR
   ========================================================================== */

/* --- 30. Custom Sidebar Portfolio Grid --- */
.sidebar-portfolio-list { display: flex; flex-direction: column; gap: 0.42rem; }
.custom-sidebar-item { display: block; position: relative; text-decoration: none !important; }
.sidebar-image-container {
    position: relative; width: 100%; aspect-ratio: var(--sidebar-aspect, 2/1); 
    background-color: var(--background-secondary, #f1f5f9); overflow: hidden; border: 1px solid var(--border-primary, #e5e7eb); 
}
.sidebar-cover-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover !important; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.sidebar-hover-overlay {
    position: absolute; inset: 0; background-color: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; opacity: 0; transition: opacity 0.3s ease; z-index: 10;
}
.sidebar-hover-title { color: #ffffff !important; margin: 0; font-family: "Instrument Serif", serif; font-size: 1.75rem; text-align: center; line-height: 1.1; transform: translateY(10px); transition: transform 0.3s ease; }
.custom-sidebar-item:hover .sidebar-cover-image { transform: scale(1.05); }
.custom-sidebar-item:hover .sidebar-hover-overlay { opacity: 1; }
.custom-sidebar-item:hover .sidebar-hover-title { transform: translateY(0); }
.sidebar-text-only { padding: 1rem; border-bottom: 1px solid var(--border-primary, #cbd5e1); transition: all 0.2s ease; }
.sidebar-text-only h4 { margin: 0; font-family: "Instrument Serif", serif; font-size: 1.25rem; }
.custom-sidebar-item:hover .sidebar-text-only { background-color: var(--text-primary, #020617); }
.custom-sidebar-item:hover .sidebar-text-only h4 { color: var(--background-primary, #ffffff) !important; }

/* --- 31. Media Cards & Hover States --- */
#menu-default li a, #menu-default li a:hover,
.grid li, .grid li:hover, .grid li a, .grid li a:hover,
.grid li img, .grid li:hover img,
[class*="card"], [class*="entry"] { border-radius: 0px !important; }

.aspect-4\/3 { aspect-ratio: 1/1; }
.\[\&\>\*\]\:h-auto > * { height: 100%; }
.object-contain { -o-object-fit: contain; object-fit: cover; }

.link-card {
    cursor: pointer;
    transition: background-color .3s cubic-bezier(.22, 1, .36, 1), border-radius .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s cubic-bezier(.22, 1, .36, 1), transform .3s cubic-bezier(.22, 1, .36, 1);
    box-shadow: 0 0 0 1px var(--color-border-primary);
}
.link-card:hover {
    background-color: var(--color-bg-highlight); box-shadow: 0 0 0 1px var(--color-border-highlight);
    transform: translate(4px, -4px); z-index: 1; filter: brightness(1.1); transition: all .3s ease-out;
}
.primary-link:after { content: ""; position: absolute; inset: 0; }

/* --- 32. Templates, Archives & Pagination --- */
.page-id-233 .text-pretty .h2,
.post-type-archive-jetpack-portfolio .text-pretty .h2 { font-size: clamp(1.125rem, 4vw, 1.875rem) !important; }
.page-id-233 .relative.mb-px .justify-center,
.post-type-archive-jetpack-portfolio .relative.mb-px .justify-center { min-height: clamp(172px, 45vw, 480px) !important; }

.navigation .nav-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; padding: 2rem 0; }
.navigation .nav-links a.page-numbers, .navigation .nav-links span.page-numbers { padding: 0.5rem 1rem; transition: opacity 0.2s ease; }
.navigation .nav-links .current { opacity: 0.4; text-decoration: underline; text-underline-offset: 4px; }
.navigation .nav-links .prev, .navigation .nav-links .next { padding: 0.5rem 2rem !important; }
@media (min-width: 1024px) { .archive #infinite-post-wrap .hentry .entry-container { padding-top: 0; } }

/* --- 33. Custom UI / View All Utilities --- */
.gap-x-px .pl-\[var\(--grid-display-size\)\] .site-info { font-size: 16px; color: #666; }
.gap-x-px .pl-\[var\(--grid-display-size\)\] h1 { font-size: 64px !important; line-height: 1.8em; color: #F0555E; }
.mb-px .justify-center .h2 { transform: translate(0px, 0px); color: #ccc; font-family: 'Instrument Serif', serif; font-size: 1em; }

.group:hover .group-hover\:opacity-100 { opacity: 1 !important; }
.group:hover .group-hover\:scale-100 { transform: scale(1) !important; }
.group:hover .group-hover\:translate-x-2 { transform: translateX(8px) !important; }
.group:hover { background-color: var(--wp--preset--color--background-primary, #ffffff) !important; }

.btn-right-side { bottom: 4px; right: 4px !important; }
@media (max-width: 569px) { .btn-right-side { bottom: 8px; right: 8px !important; } }


/* ==========================================================================
   VIII. GLOBAL DARK MODE OVERRIDES
   ========================================================================== */

/* --- 34. Tailwind Card Protectors & WordPress Fixes --- */

/* Prevents the 'group' card wrappers from getting a background color on hover */
a.group,
a.group:hover {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* --- A. OS Dark Mode (Yields to explicit .light class) --- */
@media (prefers-color-scheme: dark) {
    html:not(.light) {
        --color-text-primary: #f7f5f2 !important;       
        --color-text-secondary: #a3a19e !important;     
        --color-border-primary: #4a4846 !important;     
        --color-text-highlight: #f7f5f2 !important;     
        --color-text-highlight-invert: #1f1d1d !important; 
        --background-primary: #020617 !important;       
        --text-primary: #f8fafc !important;             
    }

    html:not(.light) .wp-block-post:hover,
    html:not(.light) .custom-sidebar-item:hover .sidebar-text-only { background-color: #0f172a !important; }
    
    html:not(.light) .wp-block-post a:hover,
    html:not(.light) .wp-block-query a:hover,
    html:not(.light) .custom-sidebar-item a:hover { background-color: transparent !important; color: var(--color-text-primary) !important; }

    html:not(.light) .wp-block-post:hover h1,
    html:not(.light) .wp-block-post:hover h2,
    html:not(.light) .wp-block-post:hover h3,
    html:not(.light) .wp-block-post:hover p,
    html:not(.light) .wp-block-post:hover a,
    html:not(.light) .custom-sidebar-item:hover h4 { color: var(--color-text-primary) !important; }

    html:not(.light) a.group .bg-white { background-color: transparent !important; border-color: var(--color-border-primary, #4a4846) !important; }
    
    html:not(.light) a.group:hover h2,
    html:not(.light) a.group:hover p,
    html:not(.light) a.group:hover div { color: var(--color-text-primary, #f7f5f2) !important; background-color: transparent !important; }
}

/* --- B. Explicit Dark Mode (Forced via UI Toggle) --- */
html.dark {
    --color-text-primary: #f7f5f2 !important;       
    --color-text-secondary: #a3a19e !important;     
    --color-border-primary: #4a4846 !important;     
    --color-text-highlight: #f7f5f2 !important;     
    --color-text-highlight-invert: #1f1d1d !important; 
    --background-primary: #020617 !important;       
    --text-primary: #f8fafc !important;             
}

html.dark .wp-block-post:hover,
html.dark .custom-sidebar-item:hover .sidebar-text-only { background-color: #0f172a !important; }

html.dark .wp-block-post a:hover,
html.dark .wp-block-query a:hover,
html.dark .custom-sidebar-item a:hover { background-color: transparent !important; color: var(--color-text-primary) !important; }

html.dark .wp-block-post:hover h1,
html.dark .wp-block-post:hover h2,
html.dark .wp-block-post:hover h3,
html.dark .wp-block-post:hover p,
html.dark .wp-block-post:hover a,
html.dark .custom-sidebar-item:hover h4 { color: var(--color-text-primary) !important; }

html.dark a.group .bg-white { background-color: transparent !important; border-color: var(--color-border-primary, #4a4846) !important; }

html.dark a.group:hover h2,
html.dark a.group:hover p,
html.dark a.group:hover div { color: var(--color-text-primary, #f7f5f2) !important; background-color: transparent !important; }

/* ==========================================================================
   XII. IFRAME MODAL VIEW (Clean UI for Internal Pages)
   ========================================================================== */

/* 1. Hide the UI elements, specifically targeting the original theme classes */
body.is-modal-view .site-header,
body.is-modal-view #masthead,
body.is-modal-view .site-sidebar, /* <-- The exact class you provided */
body.is-modal-view #secondary,
body.is-modal-view .site-footer,
body.is-modal-view #colophon,
body.is-modal-view #wpadminbar {
    display: none !important;
}

/* 2. Kill the Grid/Flex layout on the main wrapper so it doesn't reserve empty space */
body.is-modal-view .site-content,
body.is-modal-view .content-area {
    display: block !important; 
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 3. Force the main article container to expand to the edges */
body.is-modal-view .site-main,
body.is-modal-view #main,
body.is-modal-view #primary {
    width: 100% !important;
    max-width: 800px !important; /* Keeps the reading line-length comfortable */
    margin: 0 auto !important; /* Centers the text block perfectly */
    flex: 0 0 100% !important;
    grid-column: 1 / -1 !important;
    border: none !important; 
    box-shadow: none !important;
}

/* 4. Give the body a clean, isolated document feel */
body.is-modal-view {
    padding: 3rem 2rem !important;
    background-color: var(--color-bg-primary, #ffffff) !important;
    margin-top: 0 !important;
}

/* ==========================================================================
   XIII. AUDIO PLAYERS (Cue Playlist & Native WP Audio)
   ========================================================================== */

/* --- 1. CUE: MAIN PLAYER CONTAINER (Inverted Look) --- */
.cue-playlist .mejs-player-background { 
    display: none !important; 
}

.cue-playlist .mejs-container,
.cue-playlist .cue-skin-default {
    background-color: var(--color-text-highlight) !important; /* Dark in Light, Light in Dark */
    background-image: none !important; 
    border-radius: 2px !important;
    border: none !important;
    box-shadow: none !important;
}

/* Invert text inside the player */
.cue-playlist .mejs-container .mejs-track-details,
.cue-playlist .mejs-container .mejs-track-title,
.cue-playlist .mejs-container .mejs-track-artist,
.cue-playlist .mejs-container .mejs-time,
.cue-playlist .mejs-container .mejs-currenttime,
.cue-playlist .mejs-container .mejs-duration {
    color: var(--color-text-highlight-invert) !important; 
    text-shadow: none !important; 
}
.cue-playlist .mejs-container .mejs-track-title { font-weight: 600 !important; }

/* Invert SVG icons in Dark Mode */
html.dark .cue-playlist .mejs-container .mejs-button button { filter: invert(1); }

/* --- 2. CUE: PROGRESS BAR & TIMELINE (Imported & Refined) --- */
.cue-playlist .mejs-time-total, 
.cue-playlist .mejs-time-loaded, 
.cue-playlist .mejs-time-current, 
.cue-playlist .mejs-time-hovered { 
    border-radius: 2px !important; 
    background-image: none !important; 
    box-shadow: none !important; 
    height: 6px !important; 
}
/* Use neutral opacities so they work on both dark/light inverted backgrounds */
.cue-playlist .mejs-time-total { background-color: rgba(128, 128, 128, 0.2) !important; }
.cue-playlist .mejs-time-loaded { background-color: rgba(128, 128, 128, 0.4) !important; }
/* Current playback bar inherits the inverted text color */
.cue-playlist .mejs-time-current { background-color: var(--color-text-highlight-invert) !important; } 

.cue-playlist .mejs-time-rail { padding-top: 2px !important; }
.cue-playlist .mejs-time-handle-content { 
    border-radius: 4px !important; 
    background-color: var(--color-text-highlight-invert) !important; 
    border: none !important; 
    width: 6px !important; 
    height: 14px !important; 
    top: -4px !important; 
    transform: none !important; 
}

/* --- 3. CUE: PLAYLIST TRACKS (Scrollable & Spacious) --- */
.cue-playlist-container, .cue-playlist { 
    display: flex !important; 
    flex-direction: column !important; 
}
.cue-playlist .cue-tracks { 
    background-color: transparent !important;
    border: none !important;
    margin-top: 1rem;
    max-height: 500px !important; /* Cap height to enable scrolling */
    overflow-y: auto !important; 
    padding-right: 8px; 
    scrollbar-width: thin; 
    scrollbar-color: var(--color-bg-secondary) transparent; 
}

/* Custom Scrollbar */
.cue-playlist .cue-tracks::-webkit-scrollbar { width: 6px; }
.cue-playlist .cue-tracks::-webkit-scrollbar-track { background: transparent; }
.cue-playlist .cue-tracks::-webkit-scrollbar-thumb { background-color: var(--color-bg-secondary); border-radius: 4px !important; }
.cue-playlist .cue-tracks::-webkit-scrollbar-thumb:hover { background-color: var(--color-text-secondary); }

/* Track Items */
.cue-playlist .cue-track { 
    background-color: transparent !important;
    color: var(--color-text-secondary) !important;
    padding: 1.5rem 1rem !important; /* Re-integrated your spacious padding */
    box-sizing: border-box !important; 
    border-bottom: 1px solid var(--color-bg-secondary) !important; 
    transition: background-color 0.2s ease, color 0.2s ease !important; 
    cursor: pointer !important; 
}
.cue-playlist .cue-track-cell, 
.cue-playlist .cue-track-details, 
.cue-playlist .cue-track-title, 
.cue-playlist .cue-track-artist { 
    vertical-align: middle !important; 
    margin: 0 !important; 
}

/* Hover & Active Track States */
.cue-playlist .cue-track:hover { 
    background-color: var(--color-bg-secondary) !important; 
    color: var(--color-text-primary) !important;
}
.cue-playlist .cue-track.is-current,
.cue-playlist .cue-track.is-playable.is-current { 
    background-color: var(--color-bg-secondary) !important; 
    color: var(--color-text-highlight) !important;
    border-radius: 2px; 
    border-bottom: none !important; /* Removes divider line for a cleaner active state */
}

/* --- 4. NATIVE WP AUDIO BLOCK (.wp-block-audio) --- */
.wp-block-audio { 
    background-color: var(--color-bg-secondary); 
    border: none !important; /* Stripped the old 1.32px hard border */
    border-radius: 2px !important; 
    padding: 1rem;
    margin: 3rem 0; 
    width: 100%; 
}
.wp-block-audio audio { 
    width: 100%; 
    border-radius: 2px !important; 
    background-color: transparent; 
    outline: none; 
}
.wp-block-audio figcaption { 
    margin-top: 1rem; 
    font-family: "JetBrains Mono", monospace; /* Updated to match new editorial typography */
    font-size: 0.75rem; 
    text-transform: uppercase;
    color: var(--color-text-secondary); 
    text-align: center; 
}

/* Clean up native webkit controls */
.wp-block-audio audio::-webkit-media-controls-enclosure, 
.wp-block-audio audio::-webkit-media-controls-panel { 
    background-color: var(--color-bg-secondary) !important; 
    border-radius: 2px !important;
    box-shadow: none !important; 
}

/* --- 5. HIDE ARTIST NAMES --- */
.cue-playlist .cue-track-artist,
.cue-playlist .mejs-container .mejs-track-artist {
    display: none !important;
}

/* ==========================================================================
   XV. SCROLL-TRIGGERED IMAGE REVEAL (Dynamic Customizer Version)
   ========================================================================== */

/* 1. Prepare wrappers */
body.has-image-preloader .wp-block-image, 
body.has-image-preloader .post-thumbnail,
body.has-image-preloader .sidebar-image-container {
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg-secondary); 
    transition: background-color 0.1s ease; 
}

/* 2. Image initial state */
body.has-image-preloader .wp-block-image img, 
body.has-image-preloader .post-thumbnail img,
body.has-image-preloader .sidebar-image-container img {
    opacity: 0;
    transform: scale(1.02); 
    transition: opacity 0.1s ease 0.1s, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.1s; 
    will-change: transform, opacity;
}

/* 3. The Dynamic Curtain */
body.has-image-preloader .wp-block-image::after, 
body.has-image-preloader .post-thumbnail::after,
body.has-image-preloader .sidebar-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--color-text-primary); 
    /* Variables injected by Customizer PHP */
    transform-origin: var(--preloader-origin);
    transition: transform var(--preloader-curtain-speed) cubic-bezier(0.77, 0, 0.175, 1); 
    z-index: 2;
    pointer-events: none;
}

/* 4. The Dynamic Text */
body.has-image-preloader .wp-block-image::before, 
body.has-image-preloader .post-thumbnail::before,
body.has-image-preloader .sidebar-image-container::before {
    content: var(--preloader-text); /* Pulls Customizer text */
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--color-bg-primary); 
    z-index: 3;
    opacity: 1;
    /* Variable injected by Customizer PHP */
    transition: opacity var(--preloader-text-speed) ease; 
    pointer-events: none;
}

/* 5. The Active "Revealed" State */
body.has-image-preloader .is-revealed img {
    opacity: 1 !important;
    transform: scale(1) !important;
}

body.has-image-preloader .is-revealed::before {
    opacity: 0; 
}

body.has-image-preloader .is-revealed::after {
    /* Uses scaleX(0) or scaleY(0) depending on Customizer direction */
    transform: var(--preloader-axis); 
    transition-delay: var(--preloader-curtain-delay); 
}

/* 6. Strip the skeleton background precisely on time */
body.has-image-preloader .is-revealed {
    background-color: transparent !important;
    transition-delay: var(--preloader-strip-delay); 
}

/* ==========================================================================
   XVI. RESPONSIVE TABLES (Grid-Blowout Final Fix)
   ========================================================================== */

/* 1. THE CURE: Stop the parent Grid/Flex items from expanding to fit the table */
.custom-sidebar-layout,
.custom-sidebar-content,
article.body-text,
main.grid > div {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* 2. The Wrapper: Perfectly contained inside the fixed parents */
.wp-block-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important; /* Reverted from 100vw so it respects your p-4 padding */
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch; 
    margin-bottom: 2rem;
    scrollbar-width: thin; 
    scrollbar-color: var(--color-bg-secondary) transparent;
}

/* 3. The Table: Forces the horizontal scroll internal to the wrapper */
.wp-block-table table {
    width: 100% !important;
    min-width: 640px !important; 
    border-collapse: collapse;
}

/* Keep headers neat */
.wp-block-table th,
.wp-block-table thead td {
    white-space: nowrap;
}

/* 4. Webkit Custom Scrollbar */
.wp-block-table::-webkit-scrollbar { height: 6px; }
.wp-block-table::-webkit-scrollbar-track { background: transparent; }
.wp-block-table::-webkit-scrollbar-thumb { background-color: var(--color-bg-secondary); border-radius: 4px; }
.wp-block-table::-webkit-scrollbar-thumb:hover { background-color: var(--color-text-secondary); }

/* ==========================================================================
   XVII. RESPONSIVE EMBEDS (YouTube, Vimeo, Iframes)
   ========================================================================== */

/* 1. Ensure the wrapper block spans the full safe width */
.wp-block-embed,
.wp-block-embed__wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 2rem;
    display: block;
}

/* 2. Force the iframe to scale proportionally (Modern 16:9 approach) */
.wp-block-embed iframe,
.wp-block-embed video,
article.body-text iframe {
    width: 100% !important;
    height: auto !important; /* Overrides the static HTML height attribute */
    aspect-ratio: 16 / 9 !important; /* Locks in the perfect video shape */
    max-width: 100%;
    display: block;
    border: none;
    background-color: var(--color-bg-secondary); /* Provides a skeleton color while the video loads */
}

/* ==========================================================================
   XVIII. SMART SCALING CONTENT IMAGES (True Gallery Firewall)
   ========================================================================== */

/* 1. The Wrapper: Shrink-wrap around standalone images only */
article.body-text .wp-block-image:not(.wp-block-gallery .wp-block-image) {
    width: fit-content !important; 
    max-width: 100% !important; 
    margin-left: auto !important; 
    margin-right: auto !important; 
    display: block !important;
}

/* 2. Standard Standalone Images: Smart intrinsic scaling */
article.body-text .wp-block-image:not(.wp-block-gallery .wp-block-image):not(.is-resized) img {
    width: auto !important; 
    max-width: 100% !important; 
    height: auto !important; 
    display: block !important;
}

/* 3. The Exception (SVGs & Custom Sizes) */
article.body-text .wp-block-image.is-resized:not(.wp-block-gallery .wp-block-image) img {
    max-width: 100% !important; 
    height: auto !important; 
    display: block !important;
}

/* ==========================================================================
   BRUTALIST SWOT ANALYSIS GRID (Dark Mode Safe)
   ========================================================================== */

/* 1. The Grid Container */
.wp-block-group.brutalist-swot {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
    margin: 4rem 0 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 2. The Quadrant Cards */
.wp-block-group.brutalist-swot > p {
    position: relative !important;
    padding: 2rem !important;
    margin: 0 !important;
    border: 1px solid var(--color-border-primary, #ccc9c5) !important;
    background-color: transparent !important; /* Relies on the global body background */
    color: var(--color-text-primary, #4a4846) !important;
    font-family: "Instrument Sans", sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* 3. Semantic Top Borders (The Color Replacements) */
.wp-block-group.brutalist-swot > p:nth-child(1) { border-top: 4px solid #10b981 !important; } /* Strengths: Emerald */
.wp-block-group.brutalist-swot > p:nth-child(2) { border-top: 4px solid #ef4444 !important; } /* Weaknesses: Red */
.wp-block-group.brutalist-swot > p:nth-child(3) { border-top: 4px solid #3b82f6 !important; } /* Opportunities: Blue */
.wp-block-group.brutalist-swot > p:nth-child(4) { border-top: 4px solid #f59e0b !important; } /* Threats: Amber */

/* 4. SWOT Quadrant Titles (The first strong tag) */
.wp-block-group.brutalist-swot > p > strong:first-child {
    display: block !important;
    font-family: "Instrument Serif", serif !important;
    font-size: 1.75rem !important;
    color: var(--color-text-highlight, #1f1d1d) !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 1px solid var(--color-border-primary, #ccc9c5) !important;
    font-weight: 400 !important;
}

/* 5. Sub-headings (Subsequent strong tags) */
.wp-block-group.brutalist-swot > p > strong:not(:first-child) {
    display: block !important;
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
    color: var(--color-text-highlight, #1f1d1d) !important;
    margin-top: 1rem !important;
    margin-bottom: 0.25rem !important;
}

/* 6. Mobile Responsiveness */
@media (max-width: 768px) {
    .wp-block-group.brutalist-swot {
        grid-template-columns: 1fr !important; /* Stacks to a single column on phones */
        gap: 1rem !important;
    }
}

/* ==========================================================================
   FLOATING TABLE OF CONTENTS (Snappy Coda-Style Line Tabs)
   ========================================================================== */

/* 1. The Anchors */
/* THE FIX: Anchor the TOC to the outer layout block instead of the article */
.custom-sidebar-layout {
    position: relative !important; 
}

.toc-wrapper {
    position: absolute !important;
    top: 0;
    bottom: 0; 
    
    /* THE FIX: Since it's anchored to the layout border now, we don't need padding math. 
       -1px perfectly centers the 2px line directly over the grid border! */
    left: -2px; 
    
    z-index: 40;
    pointer-events: none; 
}

/* 2. The Sticky Nav */
.floating-toc {
    position: sticky !important;
    top: 2rem !important; 
    display: flex;
    flex-direction: column;
    pointer-events: auto; 

    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    
    width: max-content; 
    max-width: 32px; 
    overflow-x: hidden;
    scrollbar-width: none; 

    padding: 0.5rem;
    margin-left: -0.5rem; 
    border-radius: 2px;
    background-color: transparent;
    border: 1px solid transparent;
    
    transition: none !important; 
}
.floating-toc::-webkit-scrollbar { display: none; } 

.floating-toc:hover {
    max-width: 400px; 
    background-color: var(--color-bg-primary, #ffffff);
    border-color: var(--color-border-primary, #ccc9c5);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* 3. The List: High Density */
.floating-toc ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important; 
}

.floating-toc .toc-link {
    display: flex;
    align-items: flex-start; 
    gap: 0.75rem;
    text-decoration: none !important;
    opacity: 0.5;
    padding: 2px 0 !important; 
    outline: none !important; 
    transition: none !important; 
}

.floating-toc .toc-link:focus,
.floating-toc .toc-link:active {
    outline: none !important;
    background: transparent !important;
}

.floating-toc .toc-link:hover,
.floating-toc .toc-link.is-active {
    opacity: 1;
}

/* 4. The Line Tabs */
.floating-toc .toc-line {
    display: block;
    width: 2px;
    height: 16px;
    border-radius: 2px;
    background-color: var(--color-text-secondary, #726f6d);
    flex-shrink: 0;
    margin: 0 !important; 
    transform: translateY(1px); 
    transition: none !important; 
}

/* H3 Smaller Line */
.floating-toc .toc-h3 .toc-line {
    height: 12px;
    opacity: 0.5; 
    transform: translateY(0); 
}

/* Active State Line */
.floating-toc .toc-link.is-active .toc-line {
    background-color: var(--color-text-highlight, #1f1d1d);
    width: 3px;
    height: 18px; 
    transform: translateY(1px); 
}

/* 5. The Text */
.floating-toc .toc-text {
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.85rem; 
    line-height: 1.3; 
    white-space: nowrap; 
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: none !important; 
    margin-top: 1px; 
}

/* THE FIX: Active vs Inactive Text Colors */
.floating-toc .toc-link.is-active .toc-text {
    color: var(--color-text-highlight, #1f1d1d) !important;
    font-weight: 700 !important; 
}

.floating-toc .toc-link:not(.is-active) .toc-text {
    color: var(--color-text-primary, #4a4846) !important;
    font-weight: 400 !important; 
}

/* Instant Reveal & Wrap on Hover */
.floating-toc:hover .toc-text {
    visibility: visible;
    opacity: 1;
    padding-right: 1rem; 
    white-space: normal; 
    word-break: break-word; 
}

/* 6. Mobile & Touch Safety */
/* THE FIX: Detects touch devices (pointer: coarse) OR devices with no hover capability OR screens under 1024px, and safely hides the TOC */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
    .toc-wrapper, .floating-toc { display: none !important; }
}

