@layer theme, base, layout, components, compatibility, utilities;

/* =========================================================
   THEME & TOKENS
   ========================================================= */
@layer theme {
    @font-face { font-family: 'Noto Kufi Arabic'; src: url('../fonts/NotoKufiArabic-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
    @font-face { font-family: 'Noto Kufi Arabic'; src: url('../fonts/NotoKufiArabic-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
    @font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/cormorantgaramond-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
    @font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/cormorantgaramond-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
    @font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/cormorantgaramond-semibolditalic.woff2') format('woff2'); font-weight: 600; font-style: italic; font-display: swap; }

    :root {
        color-scheme: dark;

        /* Typography */
        --font-heading: 'Cormorant Garamond', serif;
        --font-body: 'Cormorant Garamond', serif;
        --font-arabic: 'Noto Kufi Arabic', sans-serif;

        /* Core Colors */
        --bg: #090909;
        --bg-soft: #101010;
        --panel: #141414;
        --panel-2: #191919;
        --text: #f3efe5;
        --text-soft: #c9c2b3;
        --muted: #948d80;
        --gold: #c9a84c;
        --gold-soft: #dec77f;

        /* Phase 6C Native Colors */
        --ink-black: #07090c;
        --ivory: #f3efe5;
        --ivory-faint: #c9c2b3;
        --blue-glow: #B5B3D5;
        --faw-nav-bg: #090909;
        --faw-nav-text: #eeedf1;
        --faw-nav-soft: #c9c2b3;
        --faw-nav-border: #2B2D46;
        --faw-nav-accent: #D8B3C1;
        --gradient-button: linear-gradient(135deg, #B5B3D5 0%, #C0C9E8 35%, #AAAED0 70%, #7F8DB8 100%);

        /* Modern Derived Tokens */
        --border: color-mix(in srgb, var(--gold) 22%, transparent);
        --border-soft: color-mix(in srgb, white 8%, transparent);
        --shadow: 0 18px 60px color-mix(in srgb, black 28%, transparent);

        /* Layout & Z-Index */
        --radius: 16px;
        --shell: 1180px;
        --z-nav: 100;
        --z-dropdown: 110;
        --z-overlay: 900;

        /* Animations */
        --transition-standard: .3s ease;
        --transition-smooth: .4s ease;
    }
}

/* =========================================================
   BASE
   ========================================================= */
@layer base {
    * { box-sizing: border-box; }
    
    html { scroll-behavior: smooth; }
    
    body {
        margin: 0;
        background: var(--bg);
        color: var(--text);
        font-family: var(--font-body);
        line-height: 1.65;

        html[dir="rtl"] & { font-family: var(--font-arabic); }
        &.faw-no-scroll { overflow: hidden; }
    }

    input, select, optgroup, textarea, button { font-family: var(--font-body); }
    
    h1, h2, h3, h4, h5, h6 { 
        font-family: var(--font-heading); 
    }
    
    a { color: inherit; }
    
    img { max-width: 100%; height: auto; }
    
    :lang(ar), p[lang="ar"], .ar {
        font-family: var(--font-arabic);
        line-height: 2;
    }
}

/* =========================================================
   LAYOUT
   ========================================================= */
@layer layout {
    .shell { 
        width: min(calc(100% - 36px), var(--shell)); 
        margin-inline: auto; 
        
        @media (max-width: 560px) {
            width: min(calc(100% - 24px), var(--shell));
        }
    }
    
    .site-main { min-height: 58vh; }
    
    .section { 
        padding: 70px 0; 
        @media (max-width: 560px) { padding: 48px 0; }
    }
    
    .section-dark { 
        background: #0c0c0c; 
        border-top: 1px solid var(--border-soft); 
    }
    
    .content-page { 
        padding: 68px 0 86px; 
        @media (max-width: 560px) { padding: 48px 0; }
    }
    
    .content-shell { max-width: 840px; }
    
    .system-page { 
        min-height: 58vh; 
        display: grid; 
        align-items: center; 
        padding: 70px 0; 
    }
    
    .site-footer { 
        border-top: 1px solid var(--border-soft); 
        background: #070707; 
        padding: 34px 0; 
        color: var(--muted); 
        font-size: 12px; 
    }
    
    .footer-inner { 
        display: flex; justify-content: space-between; align-items: center; gap: 18px;
        
        > div:first-child { display: flex; flex-direction: column; }
        strong { color: var(--gold-soft); font-family: var(--font-heading); font-size: 15px; }
        
        @media (max-width: 560px) {
            align-items: flex-start; flex-direction: column;
        }
    }
    
    .footer-links { 
        display: flex; gap: 16px; 
        a { color: var(--text-soft); text-decoration: none; }
    }
}

/* =========================================================
   COMPONENTS
   ========================================================= */
@layer components {
    /* Top Bar & Search */
    .preview-banner { background: #251f11; color: var(--gold-soft); text-align: center; padding: 7px 12px; font-size: 12px; border-bottom: 1px solid var(--border); }
    .search-strip { background: #0d0d0d; border-bottom: 1px solid var(--border-soft); }
    
    .site-search { 
        display: flex; gap: 8px; max-width: 560px; padding: 12px 0; margin-inline-start: auto; 
        
        input { 
            flex: 1; min-width: 0; background: #151515; border: 1px solid var(--border-soft); border-radius: 999px; color: var(--text); padding: 10px 15px;  
            &:focus { border-color: var(--gold); }
        }
        
        @media (max-width: 560px) {
            max-width: none;
            button { padding-inline: 12px; }
        }
    }
    
    .button, .site-search button { 
        border: 1px solid var(--gold); border-radius: 999px; background: transparent; color: var(--gold-soft); padding: 9px 15px; cursor: pointer; text-decoration: none; 
        &:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
    }

    /* Headings & Heroes */
    :is(.hero, .content-header) h1, .section-head h2, .system-card h1 { 
        font-family: var(--font-heading); font-weight: 400; line-height: 1.08; 
        html[dir="rtl"] & { font-family: var(--font-arabic); }
    }
    
    .hero { 
        padding: 92px 0 72px; 
        background: radial-gradient(circle at 50% 15%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 34%), linear-gradient(180deg,#0c0c0c,#090909); 
        border-bottom: 1px solid var(--border-soft); 
        
        @media (max-width: 560px) { padding: 66px 0 54px; }
        
        h1 { margin: 0; font-size: clamp(44px, 7vw, 82px); color: var(--gold-soft); }
    }
    
    .hero-inner { max-width: 850px; text-align: center; }
    .hero-text { max-width: 690px; margin: 22px auto 0; color: var(--text-soft); font-size: clamp(17px, 2vw, 21px); }
    .eyebrow { margin: 0 0 10px; color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 700; }
    
    .section-head { 
        margin-bottom: 28px; 
        h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); }
    }
    
    /* Content Elements */
    .content-header { 
        margin-bottom: 34px; 
        h1 { margin: 0; font-size: clamp(38px, 6vw, 66px); }
        time { display: inline-block; margin-top: 15px; color: var(--muted); font-size: 12px; }
    }
    
    .lead { margin: 22px 0 0; color: var(--text-soft); font-size: 19px; line-height: 1.75; }
    
    .taxonomy-line { 
        display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; 
        a { color: var(--gold-soft); border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; font-size: 11px; text-decoration: none; }
    }
    
    .featured-image { 
        margin: 0 0 38px; 
        img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border-soft); }
        figcaption { color: var(--muted); font-size: 12px; margin-top: 9px; }
    }

    /* Grids & Cards */
    .category-grid, .article-grid { 
        display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; 
        
        @media (max-width: 860px) { grid-template-columns: repeat(2, minmax(0,1fr)); }
        @media (max-width: 560px) { grid-template-columns: 1fr; }
    }
    
    .article-grid { gap: 18px; }
    
    .category-card { 
        display: flex; min-height: 145px; flex-direction: column; justify-content: space-between; padding: 22px; 
        background: linear-gradient(145deg,#151515,#101010); border: 1px solid var(--border); border-radius: var(--radius); 
        text-decoration: none; box-shadow: var(--shadow); 
        
        strong { color: var(--gold-soft); font-family: var(--font-heading); font-size: 20px; font-weight: 400; }
        span { color: var(--muted); font-size: 13px; margin-top: 16px; }
    }
    
    .article-card { 
        overflow: hidden; background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); 
        
        &:hover .card-media img { transform: scale(1.025); }
        
        .card-media { 
            display: block; aspect-ratio: 16/10; background: #080808; overflow: hidden; 
            img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
        }
        
        .card-body { 
            padding: 20px; 
            time { color: var(--muted); font-size: 11px; }
            p { color: var(--text-soft); font-size: 14px; margin: 0; }
            
            h2, h3 { 
                margin: 7px 0 10px; font-family: var(--font-heading); font-weight: 400; line-height: 1.22; 
                a { 
                    color: var(--text); text-decoration: none; 
                    &:hover { color: var(--gold-soft); }
                }
            }
            h3 { font-size: 23px; }
            h2 { font-size: 24px; }
        }
    }

    /* Rich Text (Prose) */
    .prose { 
        color: #e9e3d8; font-family: var(--font-heading); font-size: 18px; line-height: 1.9; overflow-wrap: anywhere; 
        
        html[dir="rtl"] & { font-family: var(--font-arabic); line-height: 2; }
        
        h1, h2, h3, h4, h5, h6 { color: var(--gold-soft); line-height: 1.25; margin: 1.7em 0 .7em; }
        p, ul, ol, blockquote { margin: 0 0 1.35em; }
        a { color: var(--gold-soft); text-underline-offset: 3px; }
        blockquote { border-inline-start: 3px solid var(--gold); padding-inline-start: 22px; color: var(--text-soft); font-style: italic; }
        img { display: block; border-radius: 12px; margin: 28px auto; }
    }

    /* Lists within Editorial content */
    :is(.article, .prose) ul { 
        margin: 0 0 24px; padding-inline-start: 0; list-style: none; 
        
        li { 
            font-size: 1.04rem; color: var(--text-soft); margin-bottom: 14px; line-height: 1.65; padding-inline-start: 22px; position: relative; 
            &::before { content: ""; position: absolute; inset-inline-start: 0; top: .58em; width: 6px; height: 6px; background: var(--gradient-button); transform: rotate(45deg); }
        }
    }

    /* Search Results & Pagination */
    .search-results { max-width: 860px; display: grid; gap: 12px; }
    .search-result { 
        padding: 20px 22px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--panel); 
        h2 { margin: 0 0 8px; font-family: var(--font-heading); font-weight: 400; }
        h2 a { color: var(--gold-soft); text-decoration: none; }
        p, .result-count { color: var(--text-soft); }
    }
    
    .pagination { 
        display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 38px; 
        a { 
            min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-soft); border-radius: 999px; text-decoration: none; 
            &[aria-current="page"] { border-color: var(--gold); color: var(--gold-soft); background: color-mix(in srgb, var(--gold) 10%, transparent); }
        }
    }
    
    /* System Card */
    .system-card { 
        max-width: 720px; text-align: center; padding: 50px 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); 
        h1 { font-size: clamp(36px,5vw,58px); margin: 8px 0 16px; }
        p { color: var(--text-soft); }
        .button { display: inline-block; margin-top: 12px; }
    }
    .system-code { margin: 0; color: var(--gold); font-size: 12px; letter-spacing: .25em; }

    /* =========================================================
       PHASE 6C — NATIVE BRANDING & NAVIGATION
       ========================================================= */
    .faw-nav {
        display: flex; justify-content: space-between; align-items: center; padding: 16px 10px; background: var(--faw-nav-bg); position: sticky; top: 0; z-index: var(--z-nav); box-sizing: border-box; width: 100%;
        
        &::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; background: linear-gradient(135deg, #2B2D46 0%, #5F649B 35%, #454A78 70%, #202235 100%); }

        /* RTL Handling Encapsulated */
        html[dir="rtl"] &, &[dir="rtl"] {
            direction: rtl;
            
            .faw-lang-btn { margin-right: auto; }
            .faw-dropdown-menu a { text-align: right; }
            
            .faw-nav-links > a, .faw-dropdown > a, .faw-dropdown > button { text-align: right; }
            
            .faw-dropdown.is-open-mobile .faw-dropdown-menu { padding-left: 0; padding-right: 20px; }
        }
    }

    .faw-nav-brand {
        min-width: 150px; min-height: 44px; padding: 6px 10px; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; text-decoration: none; color: var(--faw-nav-text);
        @media(max-width: 768px) { min-width: 126px; }
    }
    .faw-nav-brand-main { font-family: var(--font-heading); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); @media(max-width: 768px) { font-size: .76rem; } }
    .faw-nav-brand-ar { font-family: var(--font-arabic); font-size: .82rem; margin-top: 3px; color: var(--faw-nav-soft); @media(max-width: 768px) { font-size: .72rem; } }

    .faw-nav-logo {
        display: inline-flex; border-radius: 8px; border: 1px solid transparent; position: relative; overflow: hidden; order: 1; transition: transform .4s ease, box-shadow .4s ease;
        &:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(216, 179, 193, .2); }
        &::before { content: ""; position: absolute; inset: 0; border: 1px solid rgba(181, 179, 213, .35); border-radius: 6px; pointer-events: none; }
        img { height: 32px; width: auto; display: block; }
    }

    .faw-nav-links {
        display: flex; align-items: center; gap: 12px; margin: 0 20px 0 auto; padding: 0; order: 2;

        @media (max-width: 768px) {
            position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--faw-nav-bg); flex-direction: column; align-items: flex-start; padding: 100px 30px 40px; gap: 22px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility .25s ease; z-index: var(--z-overlay); overflow-y: auto; box-sizing: border-box; margin: 0;
            
            &.is-open {
                opacity: 1; visibility: visible; pointer-events: auto;
                .faw-nav-close { display: block; }
            }
        }

        > a {
            background: none; border: 0; color: var(--faw-nav-text); text-decoration: none; font-size: .9rem; letter-spacing: .03em; transition: color var(--transition-standard); white-space: nowrap; cursor: pointer; padding: 0;
            
            &:hover { color: var(--faw-nav-accent); }
            &:lang(ar), body.rtl & { font-size: 1.15rem; }
            
            @media (max-width: 768px) { font-size: 1.45rem; font-weight: 600; width: 100%; text-align: left; }
        }
    }

    .faw-lang-btn {
        position: relative; overflow: hidden; display: inline-flex; justify-content: center; align-items: center; padding: 3px 7px; font-size: .85rem; font-weight: 600; text-decoration: none; font-family: var(--font-arabic); color: var(--faw-nav-text); border-radius: 8px; border: 1px solid transparent; background-image: linear-gradient(var(--faw-nav-bg), var(--faw-nav-bg)), var(--gradient-button); background-clip: padding-box, border-box; background-origin: padding-box, border-box; background-size: 100% 100%, 200% 200%; box-shadow: 0 0 12px rgba(216, 179, 193, .08); transition: transform .4s ease, color .4s ease, box-shadow .4s ease, background-position .6s ease; order: 3;
        &:hover { transform: translateY(-2px); color: #fff; background-position: center, 100% 100%; box-shadow: 0 6px 20px rgba(216, 179, 193, .2); }
    }

    .faw-dropdown {
        position: relative; z-index: var(--z-nav); order: 2;

        @media (max-width: 768px) { width: 100%; }

        > a, > button {
            background: none; border: 0; color: var(--faw-nav-text); text-decoration: none; font-size: .9rem; letter-spacing: .03em; transition: color var(--transition-standard); white-space: nowrap; cursor: pointer; padding: 0;
            &:hover { color: var(--faw-nav-accent); }
            &:lang(ar), body.rtl & { font-size: 1.15rem; }
            @media (max-width: 768px) { font-size: 1.45rem; font-weight: 600; width: 100%; text-align: left; }
        }

        @media (min-width: 769px) {
            &:hover .faw-dropdown-menu, &:focus-within .faw-dropdown-menu { display: block; }
        }
        
        &.is-open-mobile .faw-dropdown-menu { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; padding-left: 20px; width: 100%; }
    }

    .faw-dropdown-menu {
        display: none; position: absolute; top: 100%; right: 0; background: var(--faw-nav-bg); border-radius: 10px; min-width: 220px; padding: 12px 0; z-index: var(--z-dropdown); box-shadow: 0 12px 35px rgba(0,0,0,.8); border: 1px solid var(--faw-nav-border);

        @media (max-width: 768px) { background: none; border: 0; box-shadow: none; position: static; padding: 0; }

        a {
            display: block; color: var(--faw-nav-text); text-decoration: none; padding: 10px 20px; font-size: 1rem; font-family: var(--font-arabic); border: 1px solid transparent; transition: transform .25s ease, color .25s ease, background .25s ease; white-space: nowrap;
            &:hover { color: var(--faw-nav-accent); background: rgba(95, 100, 155, .12); }
            @media (max-width: 768px) { font-size: 1.15rem; color: #d8d0d6; border-inline-start: 1px solid #7F8DB8; }
        }
    }

    .faw-nav-burger {
        display: none; flex-direction: column; justify-content: center; align-items: center; gap: 6px; cursor: pointer; padding: 10px; width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--faw-nav-border); background: var(--faw-nav-bg); order: 4;
        @media (max-width: 768px) { display: flex; }
        
        span { display: block; width: 28px; height: 3px; background: var(--faw-nav-text); border-radius: 2px; transition: all .3s ease; }
    }

    .faw-nav-close { display: none; background: none; border: 0; color: #fdfcfa; font-size: 1.5rem; cursor: pointer; position: absolute; top: 20px; right: 20px; }

    /* Category Premium (Native) */
    .category-page {
        padding-top: 0;

        .faw-category-hero {
            background: var(--ink-black);
            
            .faw-category-hero-inner {
                position: relative; padding: 70px 20px 60px; text-align: center;
                background: radial-gradient(circle at 50% 20%, rgba(212,175,55,.08) 0%, rgba(7,9,12,.98) 75%);
            }
            
            h1 {
                font-family: var(--font-heading); font-weight: 700; color: var(--gold-soft); font-size: clamp(2rem, 5vw, 3rem); letter-spacing: .5px; position: relative; padding-bottom: 22px; margin: 0;
                &::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 1px; background: var(--gradient-button); opacity: .6; }
            }
        }
        
        .faw-category-description {
            max-width: 640px; margin: 24px auto 0;
            p { font-style: italic; color: var(--ivory-faint); font-size: 1.05rem; line-height: 1.75; margin: 0; }
        }

        .faw-category-listing {
            padding-top: 60px; padding-bottom: 80px;
            @media(max-width: 640px) { padding-top: 40px; padding-bottom: 60px; }
        }

        .faw-premium-grid {
            display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 42px 32px; align-items: stretch;
            @media (max-width: 1024px) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
            @media (max-width: 640px) { grid-template-columns: 1fr; gap: 44px; }
        }

        .faw-category-card {
            background: transparent; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.25,1,.5,1), transform .7s cubic-bezier(.25,1,.5,1);
            
            &.visible { opacity: 1; transform: translateY(0); }
            @media (scripting: none) { opacity: 1; transform: none; }
            
            &:hover {
                .post-thumbnail img { filter: brightness(1) saturate(1); transform: scale(1.03); }
                .entry-title a { color: var(--gold-soft); }
                .entry-title::after { width: 40px; }
            }
        }

        .post-thumbnail {
            display: block; overflow: hidden; border: 1px solid rgba(212,175,55,.15); margin-bottom: 20px; aspect-ratio: 16/10;
            img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82) saturate(.9); transition: filter .5s ease, transform .6s ease; }
        }

        .faw-card-content { display: flex; flex-direction: column; flex: 1; }
        .entry-taxonomies { margin-bottom: 10px; }
        .category-links { font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold); opacity: .85; }
        
        .entry-title {
            font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; line-height: 1.4; margin: 0 0 12px; position: relative; padding-bottom: 8px;
            a { color: var(--ivory); text-decoration: none; transition: color .3s ease; }
            &::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 0; height: 1px; background: var(--gradient-button); transition: width .4s ease; }
        }
        
        .entry-meta { font-size: .72rem; color: var(--blue-glow); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 14px; opacity: .85; }
        .entry-summary p { font-size: .95rem; line-height: 1.7; color: var(--ivory-faint); margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
        .entry-footer { margin-top: auto; }
        
        .post-more-link {
            font-size: .78rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-soft); text-decoration: none; display: inline-flex; gap: 8px; transition: gap .3s ease, color .3s ease;
            &:hover { gap: 14px; color: var(--ivory); }
        }

        .page-numbers {
            color: var(--ivory-faint); border: 1px solid rgba(212,175,55,.2); background: transparent;
            &:hover, &.current { color: var(--ink-black); background: var(--gradient-button); border-color: var(--gold-soft); }
        }
    }
}

/* =========================================================
   COMPATIBILITY (KADENCE/WP)
   ========================================================= */
@layer compatibility {
    .native-home-page { 
        width: 100%; overflow: hidden; 
        
        > * { max-width: 100%; }
        
        .alignwide { width: min(calc(100% - 36px), 1180px); margin-inline: auto; }
        .alignfull { width: 100%; max-width: none; }
        
        .faw-block-group, .faw-block-columns, .kt-row-column-wrap, .kb-row-layout-wrap { box-sizing: border-box; }
        
        .faw-block-columns { 
            display: flex; gap: 24px; flex-wrap: wrap; 
            @media (max-width: 720px) { display: block; }
        }
        
        .faw-block-column { 
            flex: 1 1 260px; min-width: 0; 
            @media (max-width: 720px) { 
                & + .faw-block-column { margin-top: 20px; }
            }
        }
        
        .faw-block-image { 
            margin: 0; 
            img { max-width: 100%; height: auto; }
        }
        
        img { max-width: 100%; height: auto; }
        
        .faw-block-cover { 
            position: relative; display: grid; place-items: center; min-height: 320px; overflow: hidden; 
        }
        
        .faw-block-cover__image-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
        .faw-block-cover__inner-container { position: relative; z-index: 1; width: min(calc(100% - 36px), 1180px); margin-inline: auto; }
        
        .faw-block-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
        .faw-block-button__link { display: inline-block; border: 1px solid var(--gold); border-radius: 999px; padding: 10px 18px; color: var(--gold-soft); text-decoration: none; }
        
        .has-text-align-center { text-align: center; }
        .has-text-align-right { text-align: right; }
        .has-text-align-left { text-align: left; }
    }
}

/* =========================================================
   UTILITIES
   ========================================================= */
@layer utilities {
    .sr-only, .skip-link:not(:focus) { 
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; 
    }
    
    .skip-link:focus { position: fixed; z-index: 1000; inset: 12px auto auto 12px; background: #fff; color: #000; padding: 10px 14px; }
    
    .empty-state { padding: 28px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); text-align: center; }
    
    .faw-progress-bar { position: fixed; top: 0; left: 0; width: 0; height: 3px; background: var(--gradient-button); z-index: calc(var(--z-overlay) + 20); transition: width .2s ease-out; }

    @media(prefers-reduced-motion: reduce) {
        *, ::before, ::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    }
}
/* Accessibilité : Focus clavier visible (WCAG) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 3px;
    border-radius: 4px;
}
cat << 'EOF' >> fawaid-public/assets/css/site.css

/* Accessibilité : Focus clavier visible (WCAG) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Palette de commandes ⌘K */
.faw-cmd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel, #141414);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  color: var(--text-soft, #c9c2b3);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color var(--transition-standard, 0.3s ease);
}
.faw-cmd-trigger:hover {
  border-color: var(--gold, #c9a84c);
}
.faw-cmd-kbd {
  background: var(--panel-2, #191919);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.15));
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
  color: var(--gold-soft, #dec77f);
}
.faw-cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay, 900);
  background: rgba(7, 9, 12, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.faw-cmd-dialog {
  width: 100%;
  max-width: 620px;
  background: var(--panel, #141414);
  border: 1px solid var(--border, rgba(201, 168, 76, 0.22));
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow, 0 18px 60px rgba(0, 0, 0, 0.28));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.faw-cmd-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  position: relative;
}
.faw-cmd-search-icon {
  color: var(--gold, #c9a84c);
  margin-right: 12px;
}
.faw-cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  
  color: var(--text, #f3efe5);
  font-size: 1rem;
}
.faw-cmd-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}
.faw-cmd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.faw-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-soft, #c9c2b3);
  transition: background 0.15s ease;
}
.faw-cmd-item.is-active {
  background: var(--panel-2, #191919);
  color: var(--text, #f3efe5);
}
.faw-cmd-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.faw-cmd-type-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold, #c9a84c);
}
.faw-cmd-status-badge {
  font-size: 0.75rem;
  color: var(--muted, #948d80);
}
.faw-cmd-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted, #948d80);
  font-size: 0.9rem;
}
.faw-cmd-footer {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-soft, #101010);
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  font-size: 0.75rem;
  color: var(--muted, #948d80);
}
.faw-cmd-footer kbd {
  background: var(--panel, #141414);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
}
.faw-cmd-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-soft, rgba(255, 255, 255, 0.1));
  border-top-color: var(--gold, #c9a84c);
  border-radius: 50%;
  animation: faw-spin 0.6s linear infinite;
}
@keyframes faw-spin {
  to { transform: rotate(360deg); }
}

/* Accessibilité : Focus clavier visible (WCAG) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Palette de commandes ⌘K */
.faw-cmd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel, #141414);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  color: var(--text-soft, #c9c2b3);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color var(--transition-standard, 0.3s ease);
}
.faw-cmd-trigger:hover {
  border-color: var(--gold, #c9a84c);
}
.faw-cmd-kbd {
  background: var(--panel-2, #191919);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.15));
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
  color: var(--gold-soft, #dec77f);
}
.faw-cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay, 900);
  background: rgba(7, 9, 12, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.faw-cmd-dialog {
  width: 100%;
  max-width: 620px;
  background: var(--panel, #141414);
  border: 1px solid var(--border, rgba(201, 168, 76, 0.22));
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow, 0 18px 60px rgba(0, 0, 0, 0.28));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.faw-cmd-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  position: relative;
}
.faw-cmd-search-icon {
  color: var(--gold, #c9a84c);
  margin-right: 12px;
}
.faw-cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text, #f3efe5);
  font-size: 1rem;
}
.faw-cmd-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}
.faw-cmd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.faw-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-soft, #c9c2b3);
  transition: background 0.15s ease;
}
.faw-cmd-item.is-active {
  background: var(--panel-2, #191919);
  color: var(--text, #f3efe5);
}
.faw-cmd-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.faw-cmd-type-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold, #c9a84c);
}
.faw-cmd-status-badge {
  font-size: 0.75rem;
  color: var(--muted, #948d80);
}
.faw-cmd-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted, #948d80);
  font-size: 0.9rem;
}
.faw-cmd-footer {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-soft, #101010);
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  font-size: 0.75rem;
  color: var(--muted, #948d80);
}
.faw-cmd-footer kbd {
  background: var(--panel, #141414);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
}
.faw-cmd-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-soft, rgba(255, 255, 255, 0.1));
  border-top-color: var(--gold, #c9a84c);
  border-radius: 50%;
  animation: faw-spin 0.6s linear infinite;
}
@keyframes faw-spin {
  to { transform: rotate(360deg); }
}
