/* ==========================================================================
   goldpricesaudi.com theme — "clean & light" (2026-11-28)
   Loaded last (see template/head.php), so it overrides style.css,
   template/style.css and calculator.css. Remove the <link> to roll back.
   ========================================================================== */

:root {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #faf8f3;
    --ink: #1f1b16;
    --ink-2: #3d362c;
    --muted: #6f675b;
    --border: #e7e1d4;
    --border-strong: #d8cfbd;

    --gold: #c9a227;
    --gold-600: #a8841a;
    --gold-700: #8a6a0f;
    --gold-50: #fbf7ea;
    --gold-100: #f4ebcf;

    --up: #15803d;
    --up-bg: #e9f7ee;
    --down: #c62828;
    --down-bg: #fdecec;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(31, 27, 22, .05);
    --shadow: 0 1px 2px rgba(31, 27, 22, .04), 0 6px 20px -8px rgba(31, 27, 22, .12);

    --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

/* ---------- Base ---------- */
body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink-2);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ink);
    font-weight: 700;
    line-height: 1.45;
}

h1 {
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
    margin-bottom: .5rem;
}

h2, .h2 {
    font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem);
    border-bottom: 0;
    padding: 0;
    padding-inline-start: 14px;
    border-inline-start: 4px solid var(--gold);
    margin: 2rem 0 1rem;
}

h3, .h3 { font-size: 1.15rem; font-weight: 600; }
h4, .h4 { font-size: 1.05rem; font-weight: 600; }

a {
    color: var(--gold-700);
    text-decoration: none;
    transition: color .15s ease;
}

a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--gold-100); }

.date {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.25rem;
}

.muted { color: var(--muted); }

/* Numbers line up in tables and cards */
.rate, .rate-res, .table td, .table-rate, .meta-rates, .meta-rates2 {
    font-variant-numeric: tabular-nums;
}

/* ---------- Page container ---------- */
.container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
    margin-bottom: 28px;
}

@media (min-width: 576px) {
    .container { padding: 28px; }
}

@media (max-width: 575.98px) {
    .container {
        border-radius: 0;
        border-inline: 0;
        margin-top: 0;
        padding: 18px 14px;
    }
}

.section { margin-top: 0; margin-bottom: 1.75rem; }
section { margin-bottom: 1.75rem; }

/* ---------- Header ---------- */
.header,
.site-header {
    background: var(--surface);
    padding-bottom: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.site-header nav {
    padding: .5rem 1rem;
}

.nav-container {
    gap: 1.25rem;
}

.logo img {
    height: 52px;
    width: auto;
    display: block;
}

.nav-links {
    gap: .25rem;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-links a {
    display: block;
    padding: .45rem .85rem;
    border-radius: 999px;
    color: var(--ink-2);
    font-weight: 500;
    font-size: .95rem;
    white-space: nowrap;
}

.nav-links a:hover {
    background: var(--gold-50);
    color: var(--gold-700);
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* "Live" pill: ws.js adds live-up / live-down which animate the background */
.live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px 3px 12px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.live::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53935;
    box-shadow: 0 0 0 0 rgba(229, 57, 53, .5);
    animation: live-dot 1.8s ease-out infinite;
}

@keyframes live-dot {
    0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, .5); }
    70% { box-shadow: 0 0 0 7px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .live::before { animation: none; }
}

.menu-toggle {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 42px;
    height: 42px;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
}

@media (max-width: 768px) {
    .logo img { height: 42px; }
    .site-header nav { padding: .4rem .75rem; }
}

/* ---------- Mobile drawer ---------- */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 27, 22, .4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
    z-index: 1000;
}

.nav-backdrop.active { opacity: 1; visibility: visible; }

.nav-sidebar {
    width: 270px;
    margin: 0;
    padding: 1rem;
    background: var(--surface);
    box-shadow: 0 0 40px rgba(31, 27, 22, .2);
    z-index: 1001;
    overflow-y: auto;
    left: -290px;
}

.nav-sidebar.active { left: 0; }

[dir="rtl"] .nav-sidebar { left: auto; right: -290px; }
[dir="rtl"] .nav-sidebar.active { left: auto; right: 0; }

.nav-sidebar a {
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 1rem;
    font-weight: 500;
}

.nav-sidebar a:hover {
    background: var(--gold-50);
    color: var(--gold-700);
    text-decoration: none;
}

.nav-sidebar-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .5rem;
}

.nav-sidebar-close button {
    background: none;
    border: 0;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0 .4rem;
}

/* ---------- Price ticker under the header ---------- */
.ticker-band {
    background: linear-gradient(180deg, var(--gold-50) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 10px 0 16px;
}

.market {
    height: auto;
    margin: 0 0 10px;
    font-size: .85rem;
}

.market .status { font-weight: 600; }
.open { color: var(--up); }
.closed { color: var(--down); }

.countdown {
    font-family: inherit;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    margin-inline-start: 4px;
}

.header-bar {
    gap: .75rem;
    padding: 4px 12px 8px;
    /* style.css gives it width: fit-content. Outside the ticker's flex row (e.g. the two
       price cards on the silver page) that let it grow past a phone screen and shift the
       page sideways; capped, it scrolls inside like the ticker does. */
    max-width: 100%;
}

.header-bar-item {
    flex: 0 0 184px;
    height: auto;
    min-height: 128px;
    padding: 30px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    background-size: 22px auto;
    background-position: right 10px top 10px, left 10px top 10px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
    font-size: 1rem;
}

/* Price cards placed in the page itself (silver page), not in the ticker: let the two cards
   share a phone screen instead of one being cut off at the edge */
.col-md-8 > .header-bar > .header-bar-item {
    flex: 0 1 184px;
    min-width: 0;
}

/* Making-charge tables (template/manuf-*.php): on a phone they scroll sideways; a minimum
   column width stops the long notes column from being squeezed into very tall rows */
.making-charges .table th,
.making-charges .table td {
    min-width: 7.5rem;
}

.header-bar-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.header-bar .header-bar-item-main .currency-unit {
    font-size: .8rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 2px;
    line-height: 1.4;
}

.header-bar .header-bar-item-main .main-rate { margin-bottom: 2px; }

.header-bar .header-bar-item-main .large {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
}

.header-bar .meta-rates {
    font-size: .85rem;
    font-weight: 600;
    height: auto;
    line-height: 1.6;
}

.header-bar .meta-rates2 {
    font-size: .72rem;
    color: var(--muted);
    direction: ltr;
}

.scroll-btn {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    padding: 0;
    box-shadow: var(--shadow);
}

/* Up / down colours and arrows (classes set by ws.js) */
.green { color: var(--up) !important; }
.red { color: var(--down) !important; }

.up-arrow { border-bottom-color: var(--up); }
.down-arrow { border-top-color: var(--down); }

.up-arrow, .down-arrow {
    border-left-width: 6px;
    border-right-width: 6px;
}
.up-arrow { border-bottom-width: 7px; margin-bottom: 2px; }
.down-arrow { border-top-width: 7px; margin-bottom: 2px; }

/* ---------- Callouts ---------- */
.note {
    font-size: .88rem;
    line-height: 1.8;
    color: var(--ink-2);
    background-color: var(--gold-50);
    border: 1px solid var(--gold-100);
    border-inline-start: 4px solid var(--gold);
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: var(--radius-sm);
}

/* ---------- Tables ---------- */
.table {
    --bs-table-striped-bg: var(--surface-2);
    --bs-table-hover-bg: var(--gold-50);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    color: var(--ink-2);
    font-size: .95rem;
    margin-bottom: 1rem;
}

.table> :not(caption)>*>* {
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--border);
    border-inline: 0;
}

.table>tbody>tr:last-child>* { border-bottom: 0; }

.table> :not(:last-child)> :last-child>* {
    border-bottom-color: var(--border-strong);
}

.table thead th {
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 600;
    font-size: .88rem;
    text-align: start;
    white-space: nowrap;
}

.table tbody th {
    font-weight: 600;
    color: var(--ink);
    text-align: start;
}

.table-bordered> :not(caption)>*>* { border-inline: 0; }

.table-rate {
    font-weight: 700;
    color: var(--ink);
    background-color: var(--gold-50);
    border-radius: 8px;
    padding: 4px 8px;
}

.table-rate.rising { background: var(--up-bg); color: var(--up); }
.table-rate.falling { background: var(--down-bg); color: var(--down); }

.table-responsive {
    border-radius: var(--radius-sm);
}

.table-container {
    overflow: auto;
    border-radius: var(--radius-sm);
}

/* ---------- Sidebar widgets ---------- */
.sidebar { margin-top: 0; }

@media (max-width: 767.98px) {
    .sidebar { margin-top: 1rem; }
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.widget-header {
    background: var(--surface-2);
    color: var(--ink);
    padding: .8rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.widget-header::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex: none;
}

.widget-content .table {
    border: 0;
    border-radius: 0;
    margin-bottom: 0;
    font-size: .88rem;
}

.widget-content .table-responsive { border-radius: 0; }

/* ---------- Forms & buttons ---------- */
.form-control,
.calculator-form-control {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-family: inherit;
    background-color: var(--surface);
    height: calc(2.5rem + 2px);
}

.form-control:focus,
.calculator-form-control:focus {
    border-color: var(--gold);
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(201, 162, 39, .25);
}

textarea.form-control { height: auto; }

label, .form-label {
    font-size: .88rem;
    font-weight: 500;
    color: var(--ink-2);
}

.btn {
    font-family: inherit;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: .5rem 1.1rem;
}

.btn-primary,
.btn-success {
    color: #fff;
    background-color: var(--gold-700);
    border-color: var(--gold-700);
}

.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus {
    color: #fff;
    background-color: #73580b;
    border-color: #73580b;
}

.btn-outline-primary {
    color: var(--gold-700);
    border-color: var(--gold);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--gold-700);
    border-color: var(--gold-700);
}

/* ---------- Tabs (charts) ---------- */
.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    border-bottom: 0;
    margin-bottom: .75rem;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}

.tab-link {
    background: transparent;
    border-radius: 999px;
    padding: .35rem 1rem;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 500;
    color: var(--ink-2);
}

.tab-link:hover { background: var(--gold-50); }

.tab-link.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.tab-content img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ---------- Lists, news, FAQ, breadcrumbs ---------- */
.list {
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.list li {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.list li:last-child { border-bottom: 0; }
.list li:hover { background: var(--gold-50); }

.news-row {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.news-row:nth-of-type(odd) { background-color: var(--surface-2); }
.news-date { color: var(--muted); }

.faq details {
    border-color: var(--border);
    border-radius: var(--radius-sm);
}

.faq details[open] { border-color: var(--gold-100); background: var(--gold-50); }
.faq summary { color: var(--ink); }
.faq .answer { color: var(--ink-2); }

.breadcrumb { font-size: .85rem; }
.breadcrumb li { color: var(--muted); }
.breadcrumb li a { color: var(--gold-700); }
.breadcrumb li a:hover { color: var(--ink); }
.breadcrumb li.active span { color: var(--ink); }

.alert { border-radius: var(--radius-sm); }

/* ---------- Footer ---------- */
.footer,
.site-footer {
    background: #1f1b16;
    color: #cfc6b6;
    padding: 36px 16px 20px;
    margin-top: 8px;
    font-size: .9rem;
    text-align: center;
}

.footer-inner {
    max-width: 1170px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.footer-brand img {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: .9;
}

#footer-menu {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-end;
}

#footer-menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#footer-menu li {
    display: inline-block;
    padding: 0;
}

#footer-menu a {
    color: #f1ead9;
}

#footer-menu a:hover { color: var(--gold); text-decoration: none; }

#footer-menu .languages a { color: #b5ab99; font-size: .85rem; }
#footer-menu .languages img { border-radius: 2px; vertical-align: -1px; }

#copyright {
    max-width: 1170px;
    margin: 24px auto 0;
    padding: 16px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #8f8676;
    font-size: .8rem;
}

@media (max-width: 768px) {
    .footer-inner { flex-direction: column; }
    #footer-menu { align-items: center; }
    #footer-menu ul { justify-content: center; }
}

/* ---------- Back to top button (template/footer.php) ---------- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 900;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold-600);
    border-radius: 50%;
    background: var(--gold-700);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px -4px rgba(31, 27, 22, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background-color .15s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover { background: #73580b; }

.back-to-top:focus-visible {
    outline: 3px solid var(--gold-100);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .back-to-top { bottom: 14px; inset-inline-end: 14px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: none; }
}

/* ---------- FAQ (template/faq.php) ---------- */
.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: .6rem;
}
.faq summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--gold-700);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 12px;
}
.faq details > div {
    padding: 0 1rem .9rem;
    color: var(--ink-2);
    line-height: 1.9;
}
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Link chips: popular searches, other weights (template/longtail.php) ---------- */
.weight-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}
.weight-links a {
    display: inline-block;
    padding: .3rem .8rem;
    background: var(--gold-50);
    border: 1px solid var(--gold-100);
    color: var(--gold-700);
    border-radius: 999px;
    font-size: .9rem;
    text-decoration: none;
}
.weight-links a:hover,
.weight-links a:focus-visible {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}
.weight-links a:focus-visible {
    outline: 2px solid var(--gold-700);
    outline-offset: 2px;
}
