/* ==========================================================================
   Canlı Altın Fiyatları — dark, sharp, terminal-style precious-metals board
   ========================================================================== */

/* Inter is split into two subsets per weight. The base file covers Latin; the latin-ext file
   carries the extended glyphs — including the Turkish ş ğ İ Ş Ğ (U+011E-015F) that the base
   subset lacks. Without the ext subset those letters fell back to a system font, so Turkish
   prose rendered in a mismatched face. unicode-range lets the browser fetch only what a page
   actually needs. */
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../lib/fonts/inter/inter-400.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../lib/fonts/inter/inter-latin-ext-400.woff2") format("woff2");
    unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("../lib/fonts/inter/inter-500.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("../lib/fonts/inter/inter-latin-ext-500.woff2") format("woff2");
    unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../lib/fonts/inter/inter-600.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../lib/fonts/inter/inter-latin-ext-600.woff2") format("woff2");
    unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("../lib/fonts/inter/inter-700.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("../lib/fonts/inter/inter-latin-ext-700.woff2") format("woff2");
    unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Theme-independent tokens. */
:root {
    /* Inter everywhere for a clean, readable trading-board look. Numbers use
       font-variant-numeric: tabular-nums so digits align. */
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --serif: "Inter", system-ui, sans-serif;
    --mono: "Inter", ui-monospace, Consolas, monospace;

    --maxw: 1080px;
    --topbar-h: 56px;
    --ticker-h: 40px;
}

/* ---- Theming ----
   Priority: explicit [data-theme] (the user's manual toggle, persisted) wins; otherwise the
   browser's prefers-color-scheme decides; otherwise dark. So:
     - dark palette lives on :root (the default) and :root[data-theme="dark"];
     - light palette applies on :root[data-theme="light"] AND, when no manual choice is set,
       under @media (prefers-color-scheme: light). */
:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a0a0c;
    --panel: #101014;
    --panel-2: #0d0d10;
    --row-alt: #0c0c0f;
    --border: #1e1e24;
    --border-strong: #2a2a32;

    --text: #f4f4f6;          /* prices: white on dark */
    --text-muted: #8b8b94;
    --text-dim: #7b7b86;      /* ≥4.5:1 on --bg (WCAG AA for small text) */

    --scroll-track: #16161b;

    --gold: #c9a44c;          /* accent only (brand/headings) */
    --gold-bright: #e4c877;

    --up: #35c67a;
    --up-bg: rgba(53, 198, 122, 0.16);
    --down: #ff5b5b;
    --down-bg: rgba(255, 91, 91, 0.16);

    --live: #35c67a;
    --stale: #d9a441;
    --sim: #b98bd0;

    --silver: #aab0bb;
    --silver-bright: #d8dde5;
}

/* Light palette (kept in sync between the explicit toggle and the browser preference). */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6f8;
    --panel: #ffffff;
    --panel-2: #eef0f3;
    --row-alt: #fafbfc;
    --border: #e3e5ea;
    --border-strong: #cdd0d7;

    --text: #16181d;          /* prices: near-black on light */
    --text-muted: #545962;
    --text-dim: #656b74;      /* ≥4.5:1 on light --bg */

    --scroll-track: #e6e8ec;

    --gold: #9a7620;          /* darker so it reads on white */
    --gold-bright: #7c5f16;   /* heading/link gold, AA on white */

    --up: #12813f;
    --up-bg: rgba(18, 129, 63, 0.12);
    --down: #c22a2a;
    --down-bg: rgba(194, 42, 42, 0.12);

    --live: #12813f;
    --stale: #8a5e0e;
    --sim: #6f4a8c;

    --silver: #5f6670;
    --silver-bright: #3f444d;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        color-scheme: light;
        --bg: #f5f6f8;
        --panel: #ffffff;
        --panel-2: #eef0f3;
        --row-alt: #fafbfc;
        --border: #e3e5ea;
        --border-strong: #cdd0d7;

        --text: #16181d;
        --text-muted: #545962;
        --text-dim: #656b74;

        --scroll-track: #e6e8ec;

        --gold: #9a7620;
        --gold-bright: #7c5f16;

        --up: #12813f;
        --up-bg: rgba(18, 129, 63, 0.12);
        --down: #c22a2a;
        --down-bg: rgba(194, 42, 42, 0.12);

        --live: #12813f;
        --stale: #8a5e0e;
        --sim: #6f4a8c;

        --silver: #5f6670;
        --silver-bright: #3f444d;
    }
}

* { box-sizing: border-box; }

html {
    /* Always reserve the vertical scrollbar gutter so the layout never shifts when moving
       between a long page (Fiyatlar) and a short one (Gizlilik). Explicit styling also
       defeats Windows' auto-hide/overlay scrollbars. */
    overflow-y: scroll;
    scrollbar-width: thin;                                    /* Firefox */
    scrollbar-color: var(--border-strong) var(--scroll-track); /* Firefox: thumb, track */
}

/* Chromium / Edge — always-visible, non-overlay scrollbar. The track is deliberately a
   different colour from the page background: on a page shorter than the viewport Chrome
   draws the track with no thumb, and a background-coloured track looks like the scrollbar
   vanished. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track {
    background: var(--scroll-track);
    border-left: 1px solid var(--border);
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid var(--scroll-track);
}
::-webkit-scrollbar-thumb:hover { background: #3d3d47; }

/* --- Accessibility helpers --- */

/* Visible only to screen readers. */
.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;
}

/* Keyboard shortcut past the header/ticker straight to the board. */
.skip-link {
    position: fixed;   /* fixed, not absolute: stays reachable when the page is scrolled */
    left: 8px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--gold);
    transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; text-decoration: none; }

/* A visible focus ring on the dark background (the UA default is nearly invisible here). */
:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}
#main-content:focus { outline: none; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Sticky top bar (header + ticker) --- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    border-bottom: 1px solid var(--border-strong);
}

.site-header { height: var(--topbar-h); }
.header-inner {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
}
/* Brand pushes the nav + actions cluster to the right (replaces space-between now that
   there are three groups: brand, nav, actions). */
.brand { margin-right: auto; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-family: var(--serif);
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; color: var(--gold-bright); }
.brand-mark { color: var(--gold); }
.brand-text { font-weight: 600; }

.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a { color: var(--text-muted); font-size: 0.9rem; }
.site-nav a:hover { color: var(--gold-bright); text-decoration: none; }

/* Right-side icon buttons (theme toggle + mobile hamburger). */
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .nav-toggle {
    background: none; border: 1px solid var(--border-strong); color: var(--text-muted);
    width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center;
    justify-content: center; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--gold-bright); border-color: var(--gold); }
.theme-toggle:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
/* Hamburger is desktop-hidden; the ≤640 query reveals it and collapses the nav. */
.nav-toggle { display: none; }

/* --- Market ticker strip --- */
.ticker {
    height: var(--ticker-h);
    border-top: 1px solid var(--border);
    background: var(--panel-2);
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}
/* The slide is a CSS animation so it survives rAF being throttled or suspended, and keeps
   working even if ticker.js never loads. The track holds two identical copies, so -50% is
   exactly one copy and the loop is seamless. JS overrides --ticker-dur for constant speed. */
@keyframes ticker-slide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.ticker-track {
    display: inline-flex;
    align-items: center;
    height: var(--ticker-h);
    will-change: transform;
    animation: ticker-slide var(--ticker-dur, 40s) linear infinite;
}
/* Pause on hover so a value can be read; the pointer is the only stop control by design. */
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 0 22px;
    border-right: 1px solid var(--border);
    font-size: 0.85rem;
}
.ticker-name { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
.ticker-price { font-family: var(--mono); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ticker-chg { font-family: var(--mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; }


/* --- Main --- */
.site-main { flex: 1 0 auto; padding: 32px 0 48px; }

.board-head { margin-bottom: 18px; }
.board-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
    margin: 0 0 6px;
    color: var(--text);
}
.board-title::after {
    content: "";
    display: block;
    width: 52px;
    height: 2px;
    margin-top: 12px;
    background: var(--gold);
}
.board-subtitle {
    color: var(--text-muted);
    /*max-width: 680px;*/
    margin: 18px 0 18px;
    font-size: 0.96rem;
}

/* --- Feed banner --- */
.feed-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    background: var(--panel);
    font-size: 0.86rem;
}
.feed-dot { width: 8px; height: 8px; background: var(--text-dim); flex: none; }
.feed-text { font-weight: 600; }
.feed-time { color: var(--text-muted); margin-left: auto; }
.feed-time time { color: var(--text); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.feed-tz { color: var(--text-dim); font-size: 0.85em; }

.status-live .feed-dot { background: var(--live); }
.status-live .feed-text { color: var(--live); }
.status-stale .feed-dot { background: var(--stale); }
.status-stale .feed-text { color: var(--stale); }
.status-stale.feed-banner { border-color: rgba(217, 164, 65, 0.5); background: rgba(217, 164, 65, 0.07); }
.status-simulated .feed-dot { background: var(--sim); }
.status-simulated .feed-text { color: var(--sim); }
.status-simulated.feed-banner { border-color: rgba(185, 139, 208, 0.5); background: rgba(185, 139, 208, 0.07); }
/* Closed: neutral/muted rather than alarming — the data is correct, just not tradeable. */
.status-closed .feed-dot { background: var(--text-muted); }
.status-closed .feed-text { color: var(--text-muted); }
.status-closed.feed-banner { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.03); }
.status-unknown .feed-text { color: var(--text-muted); }

/* --- Price table --- */
.board-card {
    margin-top: 18px;
    border: 1px solid var(--border-strong);
    background: var(--panel);
    overflow-x: auto;
}
.price-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.price-table thead th {
    text-align: right;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
    background: var(--panel-2);
}
.price-table thead th.col-product { text-align: left; }

/* Row header (product name) is a <th scope="row"> so screen readers announce the product
   with every price cell; it must still look like a normal cell. */
.price-table tbody td,
.price-table tbody th {
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
    font-weight: 400;
}
.price-table tbody tr:nth-child(even) { background: var(--row-alt); }
.price-table tbody tr:last-child td,
.price-table tbody tr:last-child th { border-bottom: none; }

/* Hover/focus highlight for every row. Specificity must beat the :nth-child(even)
   striping above, otherwise only the odd rows would light up. */
.price-table tbody tr.price-row:hover,
.price-table tbody tr.price-row:focus-within {
    background: rgba(201, 164, 76, 0.10);
}

.col-product { text-align: left !important; }
.p-name { display: block; font-size: 0.98rem; color: var(--text); }
.p-unit { display: block; font-size: 0.72rem; color: var(--text-dim); margin-top: 1px; }

.col-num {
    font-family: var(--mono);
    font-size: 0.98rem;
    color: var(--text);            /* prices are white */
}
.col-num .num { transition: color 0.9s ease; }  /* fades back to white after a tick */

/* Per-field direction arrow next to alış / satış. Only the arrow + number are coloured
   (never the whole cell). The arrow persists showing the last move direction. */
.tick-arrow {
    display: inline-block;
    width: 0.85em;
    margin-right: 2px;
    font-size: 0.78em;
    color: transparent;
    transition: color 0.2s ease;
}
.tick-arrow.up { color: var(--up); }
.tick-arrow.down { color: var(--down); }

.col-change { min-width: 92px; font-family: var(--mono); }
/* Tooltip marker on the "Değişim" header (explains the % basis, per the terminology guide). */
.th-info { text-decoration: none; border-bottom: 1px dotted var(--text-dim); cursor: help; }
.change-arrow { font-size: 0.76em; margin-right: 3px; }
.dir-up { color: var(--up); }
.dir-down { color: var(--down); }
.dir-flat { color: var(--text-muted); }

/* --- Info sections --- */
.info-section {
    margin-top: 32px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    background: var(--panel-2);
}
.info-section h1,
.info-section h2 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0 0 12px;
    color: var(--gold-bright);
}
.info-section p { margin: 0 0 10px; color: var(--text); }
.info-section .muted, .muted { color: var(--text-muted); font-size: 0.9rem; }
.formula {
    margin: 0 0 12px;
    padding: 14px 16px 14px 30px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.86rem;
}
.formula li { margin-bottom: 5px; }
.formula li:last-child { margin-bottom: 0; }
.disclaimer { border-color: rgba(201, 164, 76, 0.28); }

/* --- Footer --- */
.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-strong);
    background: var(--panel-2);
    padding: 22px 0 30px;
    margin-top: 40px;
}
.footer-disclaimer { color: var(--text-muted); font-size: 0.82rem; /*max-width: 760px;*/ margin: 0 0 8px; }
.footer-copy { color: var(--text-dim); font-size: 0.8rem; margin: 0; }

/* --- Responsive --- */

/* The board is wider than a phone, so it scrolls inside its card. Fade the right edge while
   there is more to reveal, otherwise the cut-off column reads as a broken layout. */
.board-card { position: relative; }
@media (max-width: 760px) {
    /* No scroll-snap: the table stays wherever the user releases it. Proximity snapping
       pulled the scroll back to the first column on every swipe, which read as the slide
       "resetting". Free scrolling + the edge fade is the expected touch behaviour. */
    .board-card {
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
                mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
    }
    .price-table { min-width: 460px; }
}

@media (max-width: 640px) {
    .site-main { padding: 22px 0 36px; }
    .container { padding-left: 14px; padding-right: 14px; }

    /* Header collapses to a hamburger. The top row stays a single line — brand on the
       left, theme + ☰ on the right — and the nav becomes a full-width dropdown below it,
       hidden until toggled. This replaces the old flex-wrap approach, which stacked the
       links into ragged rows and stranded the theme button on its own line. */
    .site-header, .header-inner { height: auto; min-height: var(--topbar-h); }
    .header-inner { flex-wrap: wrap; row-gap: 0; }
    .brand-text { font-size: 0.98rem; }
    .brand { order: 1; min-height: 44px; }
    .header-actions { order: 2; }
    .nav-toggle { display: inline-flex; }

    /* Dropdown: full-width column on its own row, collapsed by default. */
    .site-nav {
        order: 3; flex-basis: 100%; width: 100%;
        display: none; flex-direction: column; align-items: stretch;
        border-top: 1px solid var(--border); margin-top: 4px;
    }
    .site-nav.open { display: flex; }
    .site-nav a {
        padding: 12px 4px; min-height: 44px; display: flex; align-items: center;
        font-size: 0.95rem; border-bottom: 1px solid var(--border);
    }
    .site-nav a:last-child { border-bottom: none; }

    .price-table thead th, .price-table tbody td { padding: 10px 10px; }
    .col-num, .p-name { font-size: 0.9rem; }
    .p-unit { font-size: 0.7rem; }
    .feed-banner { flex-wrap: wrap; row-gap: 4px; }
    .feed-time { margin-left: 0; width: 100%; }
    .info-section { padding-left: 16px; padding-right: 16px; }
    .formula { padding-left: 20px; }
    .ticker-item { padding: 0 14px; }
}

@media (max-width: 380px) {
    .brand-text { font-size: 0.9rem; }
    .price-table thead th, .price-table tbody td { padding: 9px 8px; }
    .board-title { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    /* Price-flash colour transitions are suppressed under reduced motion, but the ticker
       slide is intentionally kept on: it is the site's signature element and the owner wants
       it always running. The hover-pause remains the way to stop it to read a value. */
    .col-num .num, .tick-arrow { transition: none; }
}

/* ==========================================================================
   Secondary pages: breadcrumbs, footer nav, product/content, charts, calculators
   ========================================================================== */

/* --- Breadcrumbs --- */
.breadcrumbs { margin: 2px 0 16px; font-size: 0.82rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.breadcrumbs li:not(:last-child)::after { content: "›"; color: var(--border-strong); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold-bright); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* --- Footer navigation columns --- */
.footer-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 24px;
    margin-bottom: 24px;
}
.footer-col h2 {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin: 0 0 10px;
    font-weight: 600;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: var(--text-muted); font-size: 0.86rem; }
.footer-col a:hover { color: var(--gold-bright); text-decoration: none; }

/* --- Attention callout (after the feed banner on the home page) --- */
.info-callout {
    display: flex; align-items: flex-start; gap: 12px;
    margin: 14px 0 0; padding: 14px 16px;
    border: 1px solid rgba(201, 164, 76, 0.4);
    border-left: 3px solid var(--gold);
    background: rgba(201, 164, 76, 0.07);
}
.info-callout-icon { color: var(--gold); font-size: 1rem; line-height: 1.5; flex: none; }
.info-callout p { margin: 0; font-size: 0.9rem; color: var(--text); }

/* --- Home: clickable rows + hint --- */
/* Every row navigates to its product page on click, so every row gets the affordance. */
.price-row { cursor: pointer; }
a.p-name { color: var(--text); }
a.p-name:hover { color: var(--gold-bright); text-decoration: underline; }
.board-hint { color: var(--text-dim); font-size: 0.82rem; margin: 12px 2px 0; }

.quick-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.quick-links a {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    background: var(--panel);
    color: var(--text-muted);
    font-size: 0.86rem;
}
.quick-links a:hover { color: var(--gold-bright); border-color: var(--gold); text-decoration: none; }

/* --- Quick-chart panel (home) --- */
.quick-chart { margin-top: 16px; border: 1px solid var(--border-strong); background: var(--panel); }
.quick-chart-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.quick-chart-title { margin: 0; font-size: 1rem; color: var(--gold-bright); font-weight: 600; }
.quick-chart-close {
    background: none; border: 1px solid var(--border-strong); color: var(--text-muted);
    width: 32px; height: 32px; cursor: pointer; line-height: 1;
}
.quick-chart-close:hover { color: var(--text); border-color: var(--gold); }
.quick-chart-mount { padding: 10px 10px 4px; }
.quick-chart-link { margin: 0; padding: 0 16px 14px; font-size: 0.86rem; }

/* --- Chart component (built by chart.js) --- */
.chart-host { display: flex; flex-direction: column; gap: 10px; }
.chart-toolbar { display: flex; gap: 6px; }
.chart-range-btn {
    background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--text-muted);
    padding: 5px 12px; font-size: 0.8rem; cursor: pointer; font-family: var(--mono);
}
.chart-range-btn:hover { color: var(--text); border-color: var(--gold); }
.chart-range-btn[aria-pressed="true"] {
    color: var(--bg); background: var(--gold); border-color: var(--gold); font-weight: 600;
}
.chart-canvas { width: 100%; height: 320px; }
.chart-empty { color: var(--text-dim); font-size: 0.9rem; padding: 48px 12px; text-align: center; }

/* Product-page chart (chart is the main content there → a little taller, framed). */
.chart-section { margin-top: 26px; }
.chart-section > h2 {
    font-family: var(--serif); font-weight: 600; font-size: 1.2rem; margin: 0 0 12px;
    color: var(--gold-bright);
}
.chart-host-wrap { border: 1px solid var(--border-strong); background: var(--panel); padding: 14px; }
.chart-host-wrap .chart-canvas { height: 360px; }
.chart-caption { margin: 10px 2px 0; font-size: 0.82rem; }
.calc-note { margin: 14px 2px 0; font-size: 0.85rem; }

/* --- Specs (dl) --- */
.spec-list {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px; margin: 0;
}
.spec-list > div { border: 1px solid var(--border); background: var(--bg); padding: 12px 14px; }
.spec-list dt {
    color: var(--text-dim); font-size: 0.74rem; text-transform: uppercase;
    letter-spacing: 0.05em; margin-bottom: 4px;
}
.spec-list dd { margin: 0; color: var(--text); font-size: 1rem; }

/* --- FAQ accordion (native <details>) --- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    cursor: pointer; padding: 12px 0; color: var(--text); font-weight: 500;
    list-style: none; display: flex; align-items: baseline;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; color: var(--gold); margin-right: 10px; font-weight: 700; }
.faq-item[open] summary::before { content: "\2212"; } /* minus */
.faq-item p { margin: 0 0 14px; padding-left: 22px; color: var(--text-muted); font-size: 0.92rem; }

/* --- Calculators --- */
.calc-card { margin-top: 18px; border: 1px solid var(--border-strong); background: var(--panel); padding: 22px; }
.calc-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; align-items: end; }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field label, .calc-field legend { color: var(--text-muted); font-size: 0.85rem; }
.calc-field input, .calc-field select {
    background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
    padding: 10px 12px; font-family: var(--mono); font-size: 0.95rem; width: 100%;
}
.calc-side { border: none; padding: 0; margin: 0; }
.calc-side legend { padding: 0; margin-bottom: 8px; }
.calc-side label {
    display: inline-flex; align-items: center; gap: 6px; margin-right: 18px;
    color: var(--text); font-family: var(--sans); font-size: 0.92rem;
}
.calc-output {
    grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px;
}
.calc-output-label { color: var(--text-muted); font-size: 0.9rem; }
.calc-result {
    font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--gold-bright);
    font-variant-numeric: tabular-nums;
}

/* --- Visual picker calculator (altın / gümüş hesaplama) --- */
/* Flexbox (not grid) so a partial last row is centered under the full first row. */
.gold-grid {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 12px; margin-top: 18px;
}
.gold-card {
    flex: 0 0 138px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 14px 10px; background: var(--panel); border: 1px solid var(--border-strong);
    color: var(--text); cursor: pointer; text-align: center; font: inherit;
}
.gold-card:hover { border-color: var(--gold); }
.gold-pic { color: var(--gold); display: inline-flex; }
/* Transparent product PNGs sit directly on the card (no framing box). */
.gold-pic img { width: 96px; height: 96px; object-fit: contain; display: block; }
.gold-card-name { font-size: 0.9rem; line-height: 1.25; }
.calc-hint { color: var(--text-dim); font-size: 0.85rem; margin: 4px 2px 0; }

/* --- Basket (add multiple types, sum a total) --- */
.calc-basket {
    margin-top: 22px; border: 1px solid var(--border-strong); background: var(--panel); padding: 18px 20px;
}
.calc-basket-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; margin-bottom: 12px;
}
.calc-basket-head h2 {
    margin: 0; font-size: 1.05rem; color: var(--gold-bright); font-family: var(--serif); font-weight: 600;
}
.calc-empty { color: var(--text-dim); font-size: 0.9rem; margin: 10px 0; }

.basket-list { list-style: none; margin: 0; padding: 0; }
.basket-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.basket-item:last-child { border-bottom: none; }
.bi-pic { flex: none; }
.bi-pic img { width: 40px; height: 40px; object-fit: contain; display: block; }
.bi-name { flex: 1 1 90px; min-width: 90px; }
.bi-qty { display: inline-flex; align-items: center; gap: 6px; }
.bi-step {
    width: 28px; height: 28px; background: var(--panel-2); border: 1px solid var(--border-strong);
    color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; flex: none;
}
.bi-step:hover { border-color: var(--gold); }
.bi-qtyinput {
    width: 72px; background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
    padding: 6px 8px; font-family: var(--mono); text-align: right; font-size: 0.9rem;
}
.bi-unit { color: var(--text-dim); font-size: 0.78rem; min-width: 34px; }
.bi-sub {
    font-family: var(--mono); min-width: 128px; text-align: right; color: var(--text);
    font-variant-numeric: tabular-nums;
}
.bi-remove { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.95rem; padding: 4px 2px; flex: none; }
.bi-remove:hover { color: var(--down); }

.basket-total {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    border-top: 1px solid var(--border-strong); margin-top: 8px; padding-top: 14px;
}
/* Without this, display:flex above overrides the [hidden] attribute and the total row keeps
   showing its last value after the basket is emptied. */
.basket-total[hidden] { display: none; }
.basket-total > span:first-child { color: var(--text-muted); }
.basket-total-val {
    font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--gold-bright);
    font-variant-numeric: tabular-nums; text-align: right;
}

/* Segmented Alış / Satış toggle (radios are visually hidden; the span is the button). */
.seg-toggle { display: inline-flex; border: 1px solid var(--border-strong); }
.seg-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-toggle span { display: inline-block; padding: 8px 18px; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; }
.seg-toggle label + label span { border-left: 1px solid var(--border-strong); }
.seg-toggle input:checked + span { background: var(--gold); color: var(--bg); font-weight: 600; }
.seg-toggle input:focus-visible + span { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* Single-product calculator (gümüş). */
.calc-single { margin-top: 18px; border: 1px solid var(--border-strong); background: var(--panel); padding: 22px; }
.calc-single-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; margin-bottom: 12px; }
.calc-field-inline { display: flex; flex-direction: column; gap: 6px; }
.calc-field-inline label { color: var(--text-muted); font-size: 0.85rem; }
.calc-single input[type=number] {
    background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
    padding: 10px 12px; font-family: var(--mono); font-size: 1rem; width: 160px;
}

/* Silver theme for /gumus-hesaplama (same layout, silver accent, no pictures). */
.calc-silver .gold-card:hover { border-color: var(--silver); }
.calc-silver .calc-basket-head h2 { color: var(--silver-bright); }
.calc-silver .basket-total-val { color: var(--silver-bright); }
.calc-silver .seg-toggle input:checked + span { background: var(--silver); color: var(--bg); }
.calc-silver .bi-step:hover { border-color: var(--silver); }

@media (max-width: 640px) {
    .footer-nav { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .chart-canvas, .chart-host-wrap .chart-canvas { height: 260px; }
    .gold-card { flex-basis: 104px; }
    .gold-pic img { width: 76px; height: 76px; }
    .basket-item { flex-wrap: wrap; }
    .bi-name { flex-basis: 60%; }
    .bi-sub { min-width: 0; flex: 1 1 auto; }
}
