@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* Variables */
:root,
:root[data-theme="light"] {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --card: #ffffff;
    --surface-soft: #f0f5fb;
    --surface-strong: #eaf1f8;
    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #526176;
    --border: #e2e8f0;
    --primary: var(--brand-primary, #0f4c81);
    --primary-2: #0b5ed7;
    --accent: var(--brand-accent, #2563eb);
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --shadow: 0 18px 45px rgba(15, 23, 42, .09);
    --shadow-soft: 0 8px 22px rgba(15, 23, 42, .06);
}

:root[data-theme="dark"] {
    --bg: #070b16;
    --surface: #0f172a;
    --card: #111827;
    --surface-soft: #162033;
    --surface-strong: #1b2940;
    --text: #f8fafc;
    --text-secondary: #cbd5e1;
    --muted: #b6c2d3;
    --border: #243047;
    --primary: var(--brand-primary, #3b82f6);
    --primary-2: #60a5fa;
    --accent: var(--brand-accent, #60a5fa);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 18px 45px rgba(0, 0, 0, .35);
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, .24);
}

/* Base */
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
html { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    text-align: right;
    font-family: "IBM Plex Sans Arabic", Tahoma, Arial, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.8;
}
@supports (padding: max(0px)) {
    body { padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
    .site-header { padding-top: env(safe-area-inset-top); }
}
h1, h2, h3, h4, .brand { font-family: "Cairo", "IBM Plex Sans Arabic", Tahoma, sans-serif; line-height: 1.35; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[x-cloak] { display: none !important; }
.container { width: min(100% - 2rem, 1240px); margin-inline: auto; }
.icon { width: 1em; height: 1em; flex: 0 0 auto; }
.site-icon {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}
.nav-icon {
    width: 1.125rem;
    height: 1.125rem;
}
.action-icon,
.social-icon {
    width: 1.15rem;
    height: 1.15rem;
}
.card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 8px;
}
.panel-title .card-icon {
    width: 2.625rem;
    height: 2.625rem;
}
.site-icon.inline {
    display: inline-block;
    margin-inline-end: .35rem;
    vertical-align: -.2em;
}

/* Theme Helpers */
.theme-surface { background: var(--surface); color: var(--text); border-color: var(--border); }
.theme-surface-2 { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
.theme-muted { color: var(--muted); }
.theme-primary { color: var(--primary); }
.theme-border { border-color: var(--border); }
.alert-success { border: 1px solid color-mix(in srgb, var(--success) 28%, var(--border)); background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--text); border-radius: 8px; padding: .85rem 1rem; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}
.topbar {
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: .78rem;
    padding-block: .22rem;
}
.main-header {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(250px, 380px) auto;
    align-items: center;
    gap: .7rem;
    padding-block: .38rem;
}
.brand { display: inline-flex; align-items: center; gap: .75rem; min-width: 0; }
.brand > span:last-child { min-width: 0; }
.brand-mark {
    display: grid;
    width: 3.35rem;
    height: 3.35rem;
    place-items: center;
    border-radius: 8px;
    background: var(--surface);
    color: white;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 30%, transparent);
}
.site-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .14rem;
}
.brand strong { display: block; font-size: clamp(1.12rem, 1.5vw, 1.52rem); font-weight: 900; }
.brand small { display: block; color: var(--text-secondary); font-size: .8rem; margin-top: .05rem; max-width: 48ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    min-height: 2.35rem;
}
.header-search input,
.search-form input,
.newsletter-box input,
.admin-input,
.admin-select,
.admin-textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: .58rem .82rem;
    outline: none;
}
.header-search input { border: 0; background: transparent; border-radius: 0; }
.header-search button,
.icon-button {
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 8px;
    min-width: 2.25rem;
    height: 2.25rem;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.header-search button { border-block: 0; border-left: 0; border-radius: 0; color: var(--primary); min-width: 40px; height: auto; }
.icon-button:hover, .social-link:hover { transform: translateY(-1px); border-color: var(--primary); background: var(--surface-soft); }
.social-link { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border: 1px solid transparent; border-radius: 8px; color: var(--muted); }
.icon-button svg, .social-link svg, .nav-link svg, .meta-row svg, .panel-title svg { color: currentColor; flex: 0 0 auto; }
.theme-toggle {
    position: relative;
    width: 3.45rem;
    height: 1.9rem;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 999px;
    background: #dbeafe;
    cursor: pointer;
    padding: .2rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
    transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.theme-toggle:hover { border-color: var(--primary); box-shadow: 0 5px 14px rgba(15, 23, 42, .2); }
.theme-toggle-circle {
    position: absolute;
    top: .18rem;
    left: .2rem;
    display: grid;
    width: 1.42rem;
    height: 1.42rem;
    place-items: center;
    border-radius: 50%;
    background: #ffffff;
    transition: transform .3s ease, background-color .3s ease;
}
.theme-toggle-icon {
    position: absolute;
    width: .98rem;
    height: .98rem;
    transition: opacity .22s ease, transform .3s ease, color .3s ease;
}
.theme-toggle .moon-icon { color: #0f4c81; opacity: 1; transform: scale(1) rotate(0deg); }
.theme-toggle .sun-icon { color: #ffffff; opacity: 0; transform: scale(.45) rotate(-90deg); }
.theme-toggle.is-dark { border-color: #475569; background: #374151; }
.theme-toggle.is-dark .theme-toggle-circle { background: #111827; transform: translateX(1.45rem); }
.theme-toggle.is-dark .moon-icon { opacity: 0; transform: scale(.45) rotate(90deg); }
.theme-toggle.is-dark .sun-icon { color: #ffffff; opacity: 1; transform: scale(1) rotate(0deg); }
:root[data-theme="dark"] .light-icon { display: none; }
:root[data-theme="dark"] .dark-icon { display: block; }
.nav-toggle { display: none; }
.nav-shell { border-top: 1px solid var(--border); }
.nav-list { display: flex; align-items: center; gap: .2rem; overflow-x: auto; scrollbar-width: thin; }
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
    color: var(--muted);
    font-weight: 800;
    font-size: .92rem;
    padding: .55rem .76rem;
}
.nav-link::after {
    content: "";
    position: absolute;
    inset-inline: .75rem;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: transparent;
}
.nav-link:hover,
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { background: var(--danger); }

/* Breaking News */
.header-ad-slot { padding-block: .55rem .35rem; }
.breaking-bar { margin-block: .25rem .5rem; }
.breaking-inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(90deg, #7f1d1d 0%, var(--danger) 42%, #b91c1c 100%);
    color: white;
    padding: .48rem .62rem;
    box-shadow: var(--shadow-soft);
}
.breaking-label { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: .24rem .68rem; font-weight: 900; font-size: .82rem; }
.breaking-track { display: flex; align-items: center; gap: 1rem; min-width: 0; overflow-x: auto; white-space: nowrap; font-weight: 800; font-size: .9rem; scrollbar-width: none; }
.breaking-track::-webkit-scrollbar { display: none; }
.breaking-track a { position: relative; max-width: 34rem; overflow: hidden; text-overflow: ellipsis; line-height: 1.55; }
.breaking-track a + a::before { content: ""; display: inline-block; width: .38rem; height: .38rem; margin-inline: 0 .75rem; border-radius: 999px; background: rgba(255,255,255,.58); vertical-align: middle; }

/* Layout */
.home-grid {
    display: grid;
    grid-template-columns: minmax(250px, .86fr) minmax(0, 1.52fr) minmax(270px, .92fr);
    gap: 1rem;
    align-items: stretch;
    direction: ltr;
}
.home-grid.py-6 {
    padding-top: .55rem !important;
    padding-bottom: 1.25rem !important;
}
.home-grid > * { direction: rtl; }
.stack { display: grid; gap: .85rem; align-content: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: .85rem; margin-bottom: .9rem; }
.section-heading h2 { font-size: clamp(1.35rem, 2vw, 1.9rem); font-weight: 900; }
.section-link { color: var(--primary); font-weight: 800; font-size: .88rem; white-space: nowrap; }

/* Cards */
.news-card,
.side-card,
.panel,
.article-panel,
.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    box-shadow: var(--shadow-soft);
}
.news-card { overflow: hidden; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); background: color-mix(in srgb, var(--surface) 94%, var(--primary)); }
.news-card-image,
.post-placeholder { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--surface-soft); }
.post-placeholder {
    display: grid;
    place-items: center;
    color: var(--text);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
    contain: layout paint;
}
.post-placeholder::before {
    content: "";
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle, rgba(255,255,255,.22), transparent 46%);
    transform: rotate(18deg);
}
.placeholder-art {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    max-width: 80%;
    border: 1px solid color-mix(in srgb, white 32%, transparent);
    background: rgba(15, 23, 42, .28);
    color: #fff;
    border-radius: 999px;
    padding: .45rem .9rem;
    font-weight: 900;
}
.post-placeholder:has(.placeholder-tech) { background: linear-gradient(135deg, #1e3a8a, #38bdf8); }
.post-placeholder:has(.placeholder-economy) { background: linear-gradient(135deg, #064e3b, #22c55e); }
.post-placeholder:has(.placeholder-ai) { background: linear-gradient(135deg, #3b0764, #8b5cf6); }
.post-placeholder:has(.placeholder-business) { background: linear-gradient(135deg, #7c2d12, #f97316); }
.post-placeholder:has(.placeholder-breaking) { background: linear-gradient(135deg, #7f1d1d, #ef4444); }
.post-placeholder:has(.placeholder-blog) { background: linear-gradient(135deg, #312e81, #6366f1); }
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    padding: .22rem .58rem;
    font-size: .75rem;
    font-weight: 900;
    max-width: 100%;
    line-height: 1.35;
}
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--text-secondary); font-size: .78rem; font-weight: 700; }
.meta-row span, .meta-row a { display: inline-flex; align-items: center; gap: .28rem; }
.side-card { display: grid; grid-template-columns: 98px minmax(0, 1fr); gap: .82rem; padding: .76rem .82rem; min-height: 102px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.side-card > * { min-width: 0; }
.side-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); box-shadow: var(--shadow); background: color-mix(in srgb, var(--surface) 96%, var(--primary)); }
.side-card .news-card-image, .side-card .post-placeholder { height: 74px; aspect-ratio: auto; border-radius: 7px; }
.hero-card {
    position: relative;
    min-height: 450px;
    overflow: hidden;
    border-radius: 8px;
    background: #0b1220;
    box-shadow: var(--shadow);
}
.hero-card .hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.hero-card .post-placeholder { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: .75rem;
    padding: clamp(1.05rem, 2.35vw, 1.6rem);
    color: white;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, .06) 0%, rgba(2, 6, 23, .46) 42%, rgba(2, 6, 23, .94) 100%),
        linear-gradient(90deg, rgba(15, 76, 129, .34), transparent 58%);
}
.hero-content { display: grid; gap: .72rem; max-width: 760px; }
.hero-badge { width: fit-content; background: rgba(255,255,255,.14); color: white; border-color: rgba(255,255,255,.22); backdrop-filter: blur(8px); }
.hero-overlay h1 { max-width: 720px; font-size: clamp(1.9rem, 2.65vw, 2.38rem); line-height: 1.34; font-weight: 900; text-wrap: balance; }
.hero-overlay p { max-width: 620px; color: #e2e8f0; font-size: .95rem; line-height: 1.85; }
.hero-dots { display: flex; gap: .4rem; }
.hero-dots span { width: .58rem; height: .58rem; border-radius: 999px; background: rgba(255,255,255,.42); }
.hero-dots span:first-child { width: 1.4rem; background: white; }

/* Sidebar */
.panel { padding: .9rem; }
.panel-title { display: flex; align-items: center; gap: .48rem; margin-bottom: .82rem; font-size: 1.08rem; font-weight: 900; }
.panel-title svg { color: var(--primary); }
.most-read-item { display: grid; grid-template-columns: 2rem 68px minmax(0, 1fr); gap: .72rem; align-items: center; padding-block: .72rem; border-bottom: 1px solid var(--border); transition: color .18s ease, transform .18s ease; }
.most-read-item > * { min-width: 0; }
.most-read-item:last-child { border-bottom: 0; }
.most-read-item:hover { color: var(--primary); transform: translateX(-2px); }
.most-read-rank { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); font-family: "Cairo"; font-size: .95rem; font-weight: 900; line-height: 1; }
.most-read-item img, .most-read-item .post-placeholder { width: 68px; height: 52px; aspect-ratio: auto; border-radius: 7px; object-fit: cover; }
.follow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }

/* Newsletter */
.newsletter-box {
    border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
    border-radius: 8px;
    padding: 1.2rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent),
        var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}
.newsletter-box .mail-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 8px; background: var(--primary); color: white; }
.newsletter-box button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    padding: .8rem 1rem;
    font-weight: 900;
}
.danger-button { background: var(--danger); }
.load-more-wrap { display: flex; justify-content: center; }
.load-more-button { min-width: min(100%, 12rem); }
.load-more-button[aria-busy="true"] { opacity: .78; pointer-events: none; }

/* Economy */
.metal-prices-widget {
    margin-top: 1.15rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
}
.metal-prices-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.metal-prices-heading { min-width: 0; }
.metal-prices-header h2 { font-size: 1.12rem; font-weight: 900; line-height: 1.5; }
.metal-prices-header p { color: var(--muted); font-size: .82rem; line-height: 1.6; margin-top: .1rem; }
.metal-note,
.metal-footnote {
    border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--warning) 9%, var(--surface));
    color: var(--muted);
    padding: .62rem .75rem;
    font-size: .82rem;
    font-weight: 800;
}
.metal-note { display: flex; flex-wrap: wrap; gap: .35rem .75rem; margin-bottom: .85rem; }
.metal-footnote { margin-top: .75rem; }
.metal-country-form {
    display: grid;
    gap: .3rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
}
.metal-country-form label {
    display: block;
    line-height: 1.5;
}
.metal-country-form select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    border-radius: 8px;
    min-height: 2.55rem;
    padding: .48rem .65rem;
    outline: none;
}
.metal-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: .85rem;
}
.metal-summary-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: .72rem;
}
.metal-summary-card span,
.metal-summary-card small {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}
.metal-summary-card strong {
    display: block;
    margin-top: .18rem;
    color: var(--text);
    font-size: .95rem;
    font-weight: 900;
    line-height: 1.45;
}
.metal-summary-card small { margin-top: .12rem; }
.metal-summary-gold { border-color: color-mix(in srgb, #d97706 34%, var(--border)); }
.metal-summary-silver { border-color: color-mix(in srgb, #94a3b8 44%, var(--border)); }
.metal-table-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: .78rem;
    margin-top: .75rem;
}
.metal-gold-section { border-color: color-mix(in srgb, #d97706 28%, var(--border)); }
.metal-silver-section { border-color: color-mix(in srgb, #94a3b8 36%, var(--border)); }
.metal-table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .55rem;
}
.metal-table-heading h3 {
    font-size: .98rem;
    font-weight: 900;
}
.metal-table-heading span {
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: .18rem .58rem;
    font-size: .72rem;
    font-weight: 900;
    white-space: nowrap;
}
.metal-gold-section .metal-table-heading h3 { color: #b45309; }
.metal-silver-section .metal-table-heading h3 { color: color-mix(in srgb, var(--text) 70%, #94a3b8); }
.metal-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.metal-price-table {
    width: 100%;
    min-width: 920px;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: .88rem;
}
.metal-col-product { width: 13%; }
.metal-col-weight { width: 8%; }
.metal-col-region { width: 9%; }
.metal-col-local { width: 18%; }
.metal-col-usd { width: 15%; }
.metal-col-buy,
.metal-col-sell { width: 18.5%; }
.metal-price-table th {
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-soft) 78%, var(--primary));
    color: var(--text);
    text-align: right;
    padding: .76rem .78rem;
    font-weight: 900;
    line-height: 1.45;
    white-space: nowrap;
}
.metal-price-table td {
    border-top: 1px solid var(--border);
    color: var(--text);
    padding: .7rem .78rem;
    font-weight: 900;
    line-height: 1.45;
    white-space: nowrap;
}
.metal-price-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-soft) 56%, transparent); }
.metal-price-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.metal-price-table .metal-cell-product { font-weight: 900; }
.metal-price-table .metal-cell-local {
    font-weight: 900;
}
.metal-price-table .metal-cell-usd {
    font-weight: 900;
}
.metal-price-table .metal-cell-buy,
.metal-price-table .metal-cell-sell,
.metal-price-table .metal-cell-local,
.metal-price-table .metal-cell-usd {
    direction: ltr;
    text-align: left;
}
.metal-price-table .metal-cell-buy,
.metal-price-table .metal-cell-sell { font-weight: 900; }
.metal-prices-unavailable {
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface-soft);
    padding: .9rem;
    text-align: center;
    font-weight: 800;
}

/* Article */
.article-layout { display: grid; grid-template-columns: minmax(0, 840px) 330px; gap: 1.35rem; align-items: start; justify-content: center; padding-bottom: 1rem; }
.article-shell { max-width: 860px; width: 100%; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.article-title { font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.35; font-weight: 900; color: var(--text); }
.article-image { margin-top: 1.2rem; width: 100%; max-height: 520px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.article-content { margin-top: 1.25rem; font-size: 1.07rem; }
.article-content h2 { font-size: 1.65rem; font-weight: 900; margin: 2rem 0 1rem; color: var(--text); }
.article-content h3 { font-size: 1.32rem; font-weight: 900; margin: 1.5rem 0 .75rem; color: var(--text); }
.article-content p, .article-content li { line-height: 2; color: color-mix(in srgb, var(--text) 86%, var(--muted)); margin-block: .9rem; }
.article-content blockquote { border-right: 4px solid var(--danger); background: var(--surface-soft); padding: 1rem 1.25rem; border-radius: 8px; margin: 1.5rem 0; font-weight: 800; }
.share-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.comment-item { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); padding: .9rem; }
.author-box { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--surface)), var(--surface)); }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.tag-list a { border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); padding: .35rem .75rem; color: var(--muted); font-weight: 800; font-size: .88rem; }
.features-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.features-strip > div { display: grid; gap: .35rem; min-height: 132px; align-content: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 1rem; box-shadow: var(--shadow-soft); }
.features-strip svg { color: var(--primary); }
.features-strip b { font-family: "Cairo"; font-size: 1.05rem; }
.features-strip span { color: var(--muted); font-size: .9rem; }

/* Forms / Search */
.search-hero { padding-block: 2.2rem; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: .75rem; margin-top: 1rem; }
.empty-state { border: 1px dashed var(--border); background: var(--surface); border-radius: 8px; padding: 2rem; text-align: center; color: var(--muted); }

/* Footer */
.site-footer { margin-top: 2rem; background: #081526; color: white; border-top: 1px solid rgba(255,255,255,.08); }
.site-footer-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(150px, .7fr) minmax(150px, .7fr); gap: 1.35rem; padding-block: 1.65rem; align-items: start; }
.site-footer .brand-mark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); box-shadow: none; }
.site-footer .social-link { color: #cbd5e1; border-color: rgba(255,255,255,.12); }
.site-footer a, .site-footer p { color: #cbd5e1; }
.site-footer a:hover { color: white; }
.footer-title { color: white; font-weight: 900; margin-bottom: .75rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); color: #94a3b8; text-align: center; padding: 1rem; font-size: .9rem; }

/* Admin */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.admin-shell > div { min-width: 0; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #081526; color: white; padding: 1rem; }
.admin-nav { display: grid; gap: .3rem; }
.admin-nav a { display: flex; align-items: center; gap: .75rem; border-radius: 8px; padding: .72rem .85rem; color: #dbeafe; font-weight: 800; }
.admin-nav a svg { width: 1.15rem; height: 1.15rem; }
.admin-nav a:hover, .admin-nav a.is-active { background: rgba(255,255,255,.12); color: white; box-shadow: inset 3px 0 0 var(--danger); }
.admin-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); padding: 1rem 1.25rem; backdrop-filter: blur(14px); }
.admin-main { min-width: 0; padding: 1.25rem; }
.admin-stat-card { min-height: 132px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.admin-stat-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); box-shadow: var(--shadow); }
.admin-stat-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 8px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.admin-table { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: .9rem; }
.admin-table th { background: var(--surface-soft); color: var(--muted); text-align: right; padding: .8rem; }
.admin-table td { border-top: 1px solid var(--border); padding: .8rem; vertical-align: middle; }
.admin-filters { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; gap: .5rem; width: min(100%, 900px); }
.actions-menu { position: relative; display: inline-block; }
.actions-menu summary { cursor: pointer; list-style: none; border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); border-radius: 8px; padding: .42rem .7rem; font-weight: 900; white-space: nowrap; }
.actions-menu summary::-webkit-details-marker { display: none; }
.actions-menu[open] summary { border-color: var(--primary); }
.actions-menu > div { position: absolute; left: 0; z-index: 30; display: grid; min-width: 160px; gap: .2rem; margin-top: .35rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: .45rem; box-shadow: var(--shadow); }
.actions-menu a, .actions-menu button { width: 100%; border: 0; background: transparent; color: var(--text); border-radius: 6px; padding: .45rem .6rem; text-align: right; font-weight: 800; }
.actions-menu a:hover, .actions-menu button:hover { background: var(--surface-soft); color: var(--primary); }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.status-pill { border-radius: 999px; padding: .25rem .65rem; font-weight: 900; font-size: .78rem; }
.status-published { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.status-draft, .status-review { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.status-scheduled { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.status-archived { background: rgba(124, 58, 237, .14); color: #a78bfa; }

/* Utilities */
.ad-placeholder { border: 1px dashed color-mix(in srgb, var(--muted) 70%, transparent); color: var(--muted); background: var(--surface-soft); min-height: 96px; display: grid; place-items: center; border-radius: 8px; font-size: .9rem; contain: layout paint; }
.ad-slot { margin-block: .35rem; overflow: hidden; text-align: center; }
.secondary-button { border: 1px solid var(--border); border-radius: 8px; padding: .7rem 1rem; background: var(--surface-soft); color: var(--text); font-weight: 800; }
.secondary-button:hover { border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border)); color: var(--brand-primary); }
.line-clamp-2, .line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* Responsive */
@media (max-width: 1180px) {
    .home-grid { grid-template-columns: minmax(0, 1.6fr) minmax(260px, .9fr); }
    .home-left { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
}
@media (max-width: 1024px) {
    .main-header { grid-template-columns: 1fr auto; }
    .header-search { grid-column: 1 / -1; order: 3; }
    .hero-overlay h1 { font-size: clamp(1.75rem, 3.2vw, 2.15rem); }
    .nav-toggle { display: inline-grid; }
    .nav-shell { display: none; background: var(--surface); box-shadow: var(--shadow-soft); }
    .nav-shell.is-open { display: block; }
    .nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; padding-block: .7rem; overflow: visible; }
    .nav-link { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); padding: .62rem .72rem; }
    .nav-link::after { display: none; }
    .nav-link.is-active { border-color: color-mix(in srgb, var(--danger) 36%, var(--border)); }
    .home-grid, .article-layout { grid-template-columns: 1fr; }
    .article-shell { max-width: none; }
    .site-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .features-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
    .admin-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}
@media (max-width: 720px) {
    .container { width: min(100% - 1rem, 1280px); }
    .topbar { font-size: .68rem; padding-block: .12rem; }
    .topbar .container { align-items: center; gap: .35rem; }
    .topbar .container > div:first-child { gap: .55rem; }
    .topbar .social-link,
    .topbar .icon-button {
        width: 1.72rem;
        min-width: 1.72rem;
        height: 1.72rem;
    }
    .main-header { grid-template-columns: minmax(0, 1fr) 2.15rem; padding-block: .26rem; gap: .42rem; }
    .brand { gap: .55rem; }
    .brand-mark { width: 2.7rem; height: 2.7rem; }
    .brand strong { font-size: 1.04rem; }
    .brand small { font-size: .68rem; max-width: 18ch; }
    .header-search { min-height: 2.15rem; }
    .header-search input { padding-block: .45rem; font-size: .88rem; }
    .header-search button { min-width: 36px; }
    .nav-toggle { width: 2.15rem; min-width: 2.15rem; height: 2.15rem; }
    .action-icon,
    .social-icon { width: .95rem; height: .95rem; }
    .nav-icon { width: 1rem; height: 1rem; }
    .card-icon,
    .panel-title .card-icon { width: 2.12rem; height: 2.12rem; }
    .nav-list { grid-template-columns: 1fr; }
    .header-ad-slot { padding-block: .4rem .25rem; }
    .breaking-bar { margin-block: .2rem .45rem; }
    .breaking-inner { align-items: flex-start; gap: .55rem; padding: .5rem; }
    .breaking-label { padding: .2rem .58rem; }
    .breaking-track { font-size: .84rem; gap: .8rem; }
    .breaking-track a { max-width: 78vw; }
    .hero-card { min-height: 0; height: clamp(218px, 58vw, 245px); }
    .hero-overlay { justify-content: center; gap: .4rem; padding: .62rem .78rem; }
    .hero-content { gap: .38rem; }
    .hero-overlay h1 { font-size: clamp(.98rem, 4.35vw, 1.14rem); line-height: 1.35; }
    .hero-overlay p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .72rem; line-height: 1.5; }
    .hero-dots { margin-top: 0; }
    .home-grid.py-6 { padding-top: .45rem !important; }
    .home-grid {
        display: flex;
        flex-direction: column;
        gap: .75rem;
    }
    .home-main-stack,
    .home-side-stack,
    .home-left {
        display: contents;
    }
    .home-grid > *,
    .home-main-stack > *,
    .home-side-stack > *,
    .home-left > * {
        order: 20;
    }
    .hero-card { order: 1; }
    .latest-section { order: 2; }
    .today-brief-panel { order: 3; }
    .most-read-panel { order: 4; }
    .newsletter-panel { order: 5; }
    .follow-panel { order: 6; }
    .home-side-stack > .ad-placeholder { order: 7; }
    .latest-comments-panel { order: 8; }
    .tags-panel { order: 9; }
    .panel { padding: .78rem; }
    .panel-title { gap: .42rem; margin-bottom: .68rem; font-size: .98rem; line-height: 1.35; }
    .section-heading { align-items: center; margin-bottom: .68rem; }
    .section-heading h2 { font-size: 1.1rem; }
    .home-left { grid-template-columns: 1fr; }
    .side-card { grid-template-columns: 72px minmax(0, 1fr); padding: .64rem; gap: .65rem; min-height: 88px; }
    .side-card .news-card-image,
    .side-card .post-placeholder { width: 72px; height: 58px; }
    .side-card h3 { font-size: .9rem; line-height: 1.55; }
    .most-read-item {
        grid-template-columns: 1.85rem 54px minmax(0, 1fr);
        gap: .55rem;
        align-items: start;
        padding-block: .58rem;
    }
    .most-read-rank { width: 1.85rem; height: 1.85rem; font-size: .8rem; }
    .most-read-item img,
    .most-read-item .post-placeholder { display: block; width: 54px; height: 44px; }
    .most-read-item strong { font-size: .88rem; line-height: 1.55; }
    .most-read-item small { display: block; font-size: .72rem; line-height: 1.6; margin-top: .1rem; }
    .search-form { grid-template-columns: 1fr; }
    .metal-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metal-prices-header { align-items: stretch; grid-template-columns: 1fr; }
    .metal-table-section { padding: .62rem; }
    .metal-price-table { min-width: 680px; }
    .site-footer-grid { grid-template-columns: 1fr; }
    .features-strip { grid-template-columns: 1fr; }
    .admin-filters { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
    body { font-size: 15px; }
    .main-header { gap: .38rem; grid-template-columns: minmax(0, 1fr) 2.05rem; }
    .brand-mark { width: 2.48rem; height: 2.48rem; }
    .brand strong { font-size: .98rem; }
    .brand small { max-width: 16ch; }
    .header-search { grid-template-columns: minmax(0, 1fr) 36px; min-height: 2.08rem; }
    .header-search input { min-width: 0; }
    .hero-card { height: 215px; min-height: 0; }
    .hero-overlay { padding: .56rem .66rem; }
    .hero-overlay h1 { font-size: clamp(.94rem, 4.35vw, 1.06rem); }
    .hero-overlay p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .hero-content { gap: .34rem; }
    .side-card { grid-template-columns: 62px minmax(0, 1fr); gap: .58rem; padding: .58rem; }
    .side-card .news-card-image, .side-card .post-placeholder { width: 62px; height: 52px; }
    .side-card h3 { font-size: .86rem; }
    .most-read-item { grid-template-columns: 1.75rem 46px minmax(0, 1fr); gap: .5rem; align-items: start; }
    .most-read-rank { width: 1.75rem; height: 1.75rem; font-size: .76rem; }
    .most-read-item img, .most-read-item .post-placeholder { display: block; width: 46px; height: 40px; }
    .most-read-item strong { font-size: .84rem; }
    .news-card .space-y-3 { padding: .85rem; }
    .section-heading { align-items: flex-start; gap: .55rem; }
    .metal-summary-grid { grid-template-columns: 1fr; }
    .metal-table-heading { align-items: flex-start; flex-direction: column; gap: .35rem; }
    .metal-table-wrap {
        overflow-x: visible;
        border: 0;
        background: transparent;
    }
    .metal-price-table {
        min-width: 0;
        font-size: .8rem;
    }
    .metal-price-table thead { display: none; }
    .metal-price-table,
    .metal-price-table tbody,
    .metal-price-table tr,
    .metal-price-table td {
        display: block;
        width: 100%;
    }
    .metal-price-table tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        padding: .52rem;
        margin-bottom: .55rem;
    }
    .metal-price-table td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: .65rem;
        border-top: 0;
        border-bottom: 1px solid var(--border);
        padding: .36rem 0;
        white-space: normal;
        text-align: left;
    }
    .metal-price-table td:last-child { border-bottom: 0; }
    .metal-price-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 900;
        text-align: right;
    }
    .article-title { font-size: 1.55rem; }
    .article-content { font-size: 1rem; }
    .admin-topbar { align-items: flex-start; flex-direction: column; }
    .primary-button { min-height: 42px; }
}
@media (max-width: 374px) {
    .container { width: min(100% - .75rem, 1280px); }
    .brand { gap: .5rem; }
    .brand-mark { width: 2.85rem; height: 2.85rem; }
    .brand strong { font-size: 1.08rem; }
    .brand small, .topbar { font-size: .72rem; }
    .side-card { grid-template-columns: 78px minmax(0, 1fr); gap: .65rem; }
    .side-card .news-card-image, .side-card .post-placeholder { width: 78px; height: 62px; aspect-ratio: auto; }
}
