/* ============================================================
   FREE EYE — MAIN CSS
   Tokens · Reset · Typography · Spacing · Layout · Utilities
   ============================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {

    /* Brand Colors */
    --fe-primary:         #00269A;
    --fe-primary-dark:    #001f7a;
    --fe-primary-light:   #3350b8;
    --fe-secondary:       #0082CA;
    --fe-secondary-dark:  #0069a8;
    --fe-accent:          #F18A00;
    --fe-accent-dark:     #d97800;
    --fe-accent-light:    #ffa733;

    /* Neutrals */
    --fe-dark:            #0D1B3E;
    --fe-text:            #1a1a2e;
    --fe-text-muted:      #6b7280;
    --fe-border:          #e5e7eb;
    --fe-border-light:    #f3f4f6;
    --fe-bg:              #f8fafc;
    --fe-bg-alt:          #f1f5f9;
    --fe-white:           #ffffff;

    /* Semantic */
    --fe-success:         #16a34a;
    --fe-warning:         #d97706;
    --fe-error:           #dc2626;
    --fe-info:            #0284c7;

    /* Typography */
    --fe-font-ar:         'Cairo', 'Segoe UI', sans-serif;
    --fe-font-en:         'Inter', 'Segoe UI', sans-serif;
    --fe-font-size-base:  16px;
    --fe-line-height:     1.75;

    /* Type Scale */
    --fe-text-xs:   0.75rem;
    --fe-text-sm:   0.875rem;
    --fe-text-base: 1rem;
    --fe-text-lg:   1.125rem;
    --fe-text-xl:   1.25rem;
    --fe-text-2xl:  1.5rem;
    --fe-text-3xl:  1.875rem;
    --fe-text-4xl:  2.25rem;
    --fe-text-5xl:  clamp(2.25rem, 4vw, 3rem);
    --fe-text-6xl:  clamp(2.75rem, 5vw, 3.75rem);
    --fe-text-7xl:  clamp(3.25rem, 6.5vw, 4.5rem);

    /* Font Weights */
    --fe-weight-normal:    400;
    --fe-weight-medium:    500;
    --fe-weight-semibold:  600;
    --fe-weight-bold:      700;
    --fe-weight-extrabold: 800;
    --fe-weight-black:     900;

    /* Spacing (8px grid) */
    --fe-space-1:   0.25rem;
    --fe-space-2:   0.5rem;
    --fe-space-3:   0.75rem;
    --fe-space-4:   1rem;
    --fe-space-5:   1.25rem;
    --fe-space-6:   1.5rem;
    --fe-space-7:   1.75rem;
    --fe-space-8:   2rem;
    --fe-space-10:  2.5rem;
    --fe-space-12:  3rem;
    --fe-space-14:  3.5rem;
    --fe-space-16:  4rem;
    --fe-space-20:  5rem;
    --fe-space-24:  6rem;
    --fe-space-32:  8rem;

    /* Layout */
    --fe-container-max: 1280px;
    --fe-container-pad: clamp(1rem, 4vw, 2rem);
    --fe-header-h:      72px;

    /* Borders */
    --fe-radius-sm:   4px;
    --fe-radius:      10px;
    --fe-radius-lg:   16px;
    --fe-radius-xl:   24px;
    --fe-radius-full: 9999px;

    /* Shadows */
    --fe-shadow-xs: 0 1px 3px rgba(0,0,0,.06);
    --fe-shadow-sm: 0 2px 8px rgba(0,0,0,.07);
    --fe-shadow:    0 4px 20px rgba(0,0,0,.08);
    --fe-shadow-lg: 0 8px 40px rgba(0,0,0,.12);
    --fe-shadow-xl: 0 16px 60px rgba(0,0,0,.16);

    /* Transitions */
    --fe-transition-fast: .15s ease;
    --fe-transition:      .25s ease;
    --fe-transition-slow: .4s ease;

    /* Z-index scale */
    --fe-z-base:     1;
    --fe-z-above:    10;
    --fe-z-dropdown: 100;
    --fe-z-sticky:   200;
    --fe-z-fab:      800;
    --fe-z-header:   900;
    --fe-z-overlay:  950;
    --fe-z-nav:      960;
    --fe-z-modal:    1000;
    --fe-z-toast:    1100;
}

/* ── 1b. ADMIN / PLUGIN UI SUPPRESSION ─────────────────── */
/* Hide admin-only plugin overlays that can bleed into frontend view */
#wpadminbar .wpseo-score-icon,
.wpseo-metabox-root,
.smush-notice,
#wp-smush-notice,
.duplicate-page-notice { display: none !important; }

/* ── 2. MODERN CSS RESET ─────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: var(--fe-font-size-base);
    overflow-x: hidden;
}

body {
    font-family: var(--fe-font-ar);
    font-size: var(--fe-text-base);
    line-height: var(--fe-line-height);
    color: var(--fe-text);
    background-color: var(--fe-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, video, svg {
    max-width: 100%;
    display: block;
}

img { height: auto; }

ul, ol { list-style: none; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--fe-transition-fast);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

table { border-collapse: collapse; }

/* ── 3. TYPOGRAPHY ───────────────────────────────────────── */

/* English/LTR: switch to Inter */
.lang-en, [lang="en"] { font-family: var(--fe-font-en); }

/* Kurdish: Cairo covers Sorani script; extra vertical rhythm for diacritical density */
.lang-ku, [lang="ku"] { line-height: 1.85; }

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fe-weight-bold);
    line-height: 1.2;
    color: var(--fe-text);
}

h1 { font-size: var(--fe-text-5xl); font-weight: var(--fe-weight-extrabold); }
h2 { font-size: var(--fe-text-4xl); font-weight: var(--fe-weight-extrabold); }
h3 { font-size: var(--fe-text-2xl); font-weight: var(--fe-weight-bold); }
h4 { font-size: var(--fe-text-xl);  font-weight: var(--fe-weight-bold); }
h5 { font-size: var(--fe-text-lg);  font-weight: var(--fe-weight-semibold); }
h6 { font-size: var(--fe-text-base); font-weight: var(--fe-weight-semibold); }

p { line-height: var(--fe-line-height); }

strong, b { font-weight: var(--fe-weight-bold); }
em, i     { font-style: italic; }

small { font-size: var(--fe-text-sm); }

/* ── 4. LAYOUT SYSTEM ───────────────────────────────────── */

.fe-container {
    width: 100%;
    max-width: var(--fe-container-max);
    margin-inline: auto;
    padding-inline: var(--fe-container-pad);
}

.fe-container--narrow { max-width: 760px; }
.fe-container--wide   { max-width: 1440px; }

/* Section wrappers */
.fe-section {
    padding-block: var(--fe-space-20);
}

.fe-section--sm  { padding-block: var(--fe-space-12); }
.fe-section--lg  { padding-block: var(--fe-space-24); }
.fe-section--alt { background-color: var(--fe-bg); }
.fe-section--dark {
    background-color: var(--fe-dark);
    color: var(--fe-white);
}

/* Site main wrapper — compensates for fixed header */
.fe-site-main {
    padding-block-start: var(--fe-header-h);
    min-height: 60vh;
}

/* For hero pages the template handles padding manually */
.has-hero .fe-site-main {
    padding-block-start: 0;
}

/* Grids */
.fe-grid {
    display: grid;
    gap: var(--fe-space-8);
}

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

.fe-grid--auto-sm { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.fe-grid--auto-md { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.fe-grid--auto-lg { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

/* Flex helpers */
.fe-flex         { display: flex; }
.fe-flex--center { align-items: center; justify-content: center; }
.fe-flex--between{ align-items: center; justify-content: space-between; }
.fe-flex--gap-4  { gap: var(--fe-space-4); }
.fe-flex--gap-6  { gap: var(--fe-space-6); }
.fe-flex--wrap   { flex-wrap: wrap; }

/* ── 5. ANIMATION SYSTEM ───────────────────────────────── */
.fe-animate {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .55s ease, transform .55s ease;
}

.fe-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.fe-animate--from-start {
    transform: translateX(-24px);
}

.fe-animate--from-end {
    transform: translateX(24px);
}

.fe-animate--zoom {
    transform: scale(.94) translateY(0);
}

.fe-animate--from-start.is-visible,
.fe-animate--from-end.is-visible,
.fe-animate--zoom.is-visible {
    transform: translateX(0) scale(1);
}

/* Stagger delays */
.fe-animate--d1 { transition-delay: .08s; }
.fe-animate--d2 { transition-delay: .16s; }
.fe-animate--d3 { transition-delay: .24s; }
.fe-animate--d4 { transition-delay: .32s; }
.fe-animate--d5 { transition-delay: .40s; }
.fe-animate--d6 { transition-delay: .48s; }

/* Respect user preference */
@media (prefers-reduced-motion: reduce) {
    .fe-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ── 6. UTILITY CLASSES ────────────────────────────────── */

/* Display */
.fe-hidden     { display: none !important; }
.fe-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Text */
.fe-text-center { text-align: center; }
.fe-text-start  { text-align: start; }
.fe-text-end    { text-align: end; }
.fe-text-muted  { color: var(--fe-text-muted); }
.fe-text-white  { color: var(--fe-white); }
.fe-text-accent { color: var(--fe-accent); }
.fe-text-primary{ color: var(--fe-primary); }

/* Margins */
.fe-mt-auto { margin-block-start: auto; }
.fe-mb-0    { margin-block-end: 0; }

/* Backgrounds */
.fe-bg-white   { background-color: var(--fe-white); }
.fe-bg-alt     { background-color: var(--fe-bg); }
.fe-bg-dark    { background-color: var(--fe-dark); }
.fe-bg-primary { background-color: var(--fe-primary); }

/* Borders */
.fe-rounded    { border-radius: var(--fe-radius); }
.fe-rounded-lg { border-radius: var(--fe-radius-lg); }
.fe-rounded-xl { border-radius: var(--fe-radius-xl); }

/* Shadows */
.fe-shadow    { box-shadow: var(--fe-shadow); }
.fe-shadow-lg { box-shadow: var(--fe-shadow-lg); }

/* ── 7. RESPONSIVE BREAKPOINTS ─────────────────────────── */

/* Mobile first — base styles target all screens
   Overrides applied at each breakpoint */

/* sm: 480px */
@media (max-width: 479px) {
    .fe-hide-sm { display: none !important; }
    h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
    h2 { font-size: clamp(1.5rem, 6vw, 2rem); }
}

/* md: 768px */
@media (max-width: 767px) {
    .fe-hide-md { display: none !important; }
    .fe-grid--2,
    .fe-grid--3,
    .fe-grid--4 { grid-template-columns: 1fr; }
    .fe-section { padding-block: var(--fe-space-12); }
    .fe-section--lg { padding-block: var(--fe-space-16); }
}

/* lg: 1024px */
@media (max-width: 1023px) {
    .fe-hide-lg { display: none !important; }
    .fe-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .fe-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

/* xl: 1280px+ */
@media (min-width: 1280px) {
    .fe-show-xl-only { display: block; }
}

/* ── 8. SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--fe-bg); }
::-webkit-scrollbar-thumb {
    background: var(--fe-border);
    border-radius: var(--fe-radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--fe-text-muted); }

/* ── 9. FOCUS / ACCESSIBILITY ──────────────────────────── */
:focus-visible {
    outline: 2px solid var(--fe-primary);
    outline-offset: 3px;
    border-radius: var(--fe-radius-sm);
}

a:focus-visible,
button:focus-visible { outline-offset: 4px; }

/* Skip to content */
.fe-skip-link {
    position: absolute;
    top: -100%;
    inset-inline-start: var(--fe-space-4);
    background: var(--fe-primary);
    color: var(--fe-white);
    padding: var(--fe-space-2) var(--fe-space-4);
    border-radius: 0 0 var(--fe-radius) var(--fe-radius);
    font-weight: var(--fe-weight-semibold);
    z-index: var(--fe-z-toast);
    transition: top var(--fe-transition-fast);
}

.fe-skip-link:focus { top: 0; }

/* ── 10. WP CORE OVERRIDES ─────────────────────────────── */
.wp-block-image img { border-radius: var(--fe-radius); }
.alignwide  { max-width: 100%; }
.alignfull  { margin-inline: calc(-1 * var(--fe-container-pad)); }

/* Alignment */
.alignleft  { float: inline-start; margin-inline-end: var(--fe-space-6); margin-block-end: var(--fe-space-4); }
.alignright { float: inline-end;   margin-inline-start: var(--fe-space-6); margin-block-end: var(--fe-space-4); }
.aligncenter{ margin-inline: auto; display: block; }
