@import "tailwindcss";

@source "../views";

/*
| Design tokens (Part 35). Restrained palette: one accent, distinct semantic
| colours for Breaking, Sponsored, Correction, Verified and Warning.
*/
@theme {
    --color-ink: #14171c;
    --color-paper: #fbfaf7;
    --color-line: #e4e1da;
    --color-muted: #6b6f76;
    --color-accent: #0b5d4b;        /* deep green: trustworthy, national */
    --color-accent-soft: #e5f1ed;
    --color-breaking: #b42318;
    --color-sponsored: #8a5a00;
    --color-correction: #6941c6;
    --color-verified: #027a48;
    --color-warning: #b54708;

    --font-latin: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
    --font-urdu: "Noto Nastaliq Urdu", serif;
}

/*
| Noto Nastaliq Urdu — free Google Font (SIL OFL 1.1), self-hosted (Part 7.2).
| Put the WOFF2 files in public/fonts/ — see docs/MULTILINGUAL_GUIDE.md.
*/
@font-face {
    font-family: "Noto Nastaliq Urdu";
    src: url("/fonts/NotoNastaliqUrdu-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+2010-2027, U+0020-0040;
}
@font-face {
    font-family: "Noto Nastaliq Urdu";
    src: url("/fonts/NotoNastaliqUrdu-Bold.woff2") format("woff2");
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+2010-2027, U+0020-0040;
}

@layer base {
    html { background: var(--color-paper); color: var(--color-ink); }
    body { font-family: var(--font-latin); line-height: 1.6; -webkit-font-smoothing: antialiased; }

    /*
    | Urdu: dedicated rules, NOT mirrored English CSS (Part 7.2, 35).
    | Nastaleeq has tall ascenders / deep descenders: generous line-height,
    | larger base size, no letter-spacing, no faux styles, nothing clipped.
    */
    :lang(ur) body,
    :lang(ur) input, :lang(ur) textarea, :lang(ur) select, :lang(ur) button {
        font-family: var(--font-urdu), var(--font-latin);
        font-synthesis: none;
        letter-spacing: 0;
        text-transform: none;
    }
    :lang(ur) body { font-size: 1.125rem; line-height: 2.1; }
    :lang(ur) h1, :lang(ur) h2, :lang(ur) h3, :lang(ur) h4 { line-height: 1.75; font-weight: 700; }
    :lang(ur) .btn, :lang(ur) .badge, :lang(ur) th, :lang(ur) td, :lang(ur) label {
        line-height: 2; padding-block: 0.35em; overflow: visible;
    }

    /* Always-Latin fields stay LTR even on Urdu pages (Part 7.3). */
    input[type="email"], input[type="url"], input[type="tel"], input[inputmode="numeric"], .ltr { direction: ltr; text-align: start; }
    :lang(ur) input[type="email"], :lang(ur) input[type="url"], :lang(ur) input[type="tel"], :lang(ur) input[inputmode="numeric"] {
        font-family: var(--font-latin); text-align: right;
    }

    a { color: var(--color-accent); }
    :focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
}

@layer components {
    .container-page { max-width: 72rem; margin-inline: auto; padding-inline: 1rem; }
    .card { background: #fff; border: 1px solid var(--color-line); border-radius: 0.75rem; padding: 1.25rem; }
    .btn { display: inline-flex; align-items: center; gap: .5rem; border-radius: .5rem; padding: .55rem 1rem; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
    .btn-primary { background: var(--color-accent); color: #fff; }
    .btn-primary:hover { filter: brightness(1.1); }
    .btn-secondary { background: #fff; border-color: var(--color-line); color: var(--color-ink); }
    .btn-danger { background: var(--color-breaking); color: #fff; }
    .btn-sm { padding: .3rem .7rem; font-size: .875rem; }
    .field { display: block; margin-bottom: 1rem; }
    .field > span { display: block; font-weight: 600; margin-bottom: .25rem; }
    .input { width: 100%; border: 1px solid var(--color-line); border-radius: .5rem; padding: .55rem .75rem; background: #fff; }
    .input:focus { border-color: var(--color-accent); outline: none; box-shadow: 0 0 0 3px var(--color-accent-soft); }
    .error { color: var(--color-breaking); font-size: .875rem; }
    .help { color: var(--color-muted); font-size: .875rem; }
    .badge { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }
    .badge-success { background: #e7f6ee; color: var(--color-verified); }
    .badge-warning { background: #fef3e7; color: var(--color-warning); }
    .badge-danger { background: #fdecea; color: var(--color-breaking); }
    .badge-muted { background: #f0efeb; color: var(--color-muted); }
    .badge-info { background: var(--color-accent-soft); color: var(--color-accent); }
    .table { width: 100%; border-collapse: collapse; }
    .table th { text-align: start; font-weight: 600; color: var(--color-muted); font-size: .85rem; border-bottom: 1px solid var(--color-line); padding: .5rem; }
    .table td { border-bottom: 1px solid var(--color-line); padding: .6rem .5rem; vertical-align: top; }
    .flash { border-radius: .5rem; padding: .75rem 1rem; margin-bottom: 1rem; }
    .flash-ok { background: #e7f6ee; color: var(--color-verified); }
    .flash-err { background: #fdecea; color: var(--color-breaking); }
    .notice { background: #fff8e6; border: 1px solid #f5d89a; border-radius: .75rem; padding: 1rem; }
    .stat { font-size: 2rem; font-weight: 700; line-height: 1.2; }
    .breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; color: var(--color-muted); font-size: .9rem; }
    .breadcrumb li + li::before { content: "›"; margin-inline-end: .5rem; }
    [x-cloak] { display: none !important; }
    /* Directional icons flip in RTL; non-directional ones never do (Part 7.3). */
    [dir="rtl"] .icon-directional { transform: scaleX(-1); }
}
