@font-face {
    font-family: "CairoCustom";
    src: local("Cairo"), local("Noto Kufi Arabic");
}

:root {
    --bg-page: #eef2f7;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --surface-soft-2: #f1f5f9;
    --border: #dbe3ee;
    --text: #0f172a;
    --muted: #546173;
    --muted-2: #7d8997;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b91c1c;
    --warning: #b45309;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.12);
    --radius-sm: 14px;
    --radius: 20px;
    --radius-lg: 28px;
}

html[data-theme="dark"] {
    --bg-page: #0b1220;
    --bg-elevated: #111827;
    --surface: #101826;
    --surface-soft: #152033;
    --surface-soft-2: #1b2738;
    --border: #243246;
    --text: #f5f7fb;
    --muted: #b2c0d0;
    --muted-2: #8ea0b5;
    --primary: #38bdf8;
    --primary-dark: #22a9e0;
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 18px 45px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { direction: rtl; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "CairoCustom", "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(56,189,248,0.06), transparent 24%),
        radial-gradient(circle at top left, rgba(15,118,110,0.05), transparent 22%),
        var(--bg-page);
    color: var(--text);
    line-height: 1.8;
    transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
.container { width: min(1240px, calc(100% - 34px)); margin: 0 auto; }

.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; }

.top-strip {
    background: linear-gradient(90deg, #09111f, #10233d);
    color: #fff;
    padding: 9px 0;
    font-size: .92rem;
}
.top-strip-inner { padding-inline: 6px; }
.ticker {
    display: flex;
    gap: 16px;
    overflow: auto;
    scrollbar-width: none;
    align-items: center;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker strong {
    background: rgba(255,255,255,.12);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.ticker-item {
    white-space: nowrap;
    color: rgba(255,255,255,.88);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    min-height: 78px;
}
.header-brand-wrap { min-width: 0; }
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    min-width: 0;
}
.logo-text-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.logo-text-group strong {
    font-size: 1.08rem;
    line-height: 1.1;
}
.logo-text-group small {
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.3;
}
.logo-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f766e, #0ea5e9);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
}
.logo-image, .footer-logo-image {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--surface-soft);
    padding: 4px;
    border: 1px solid var(--border);
    flex: 0 0 auto;
}
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.main-nav a {
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    transition: .18s ease;
}
.main-nav a:hover, .main-nav a.active {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.theme-toggle, .button, button, .btn {
    border: none;
    outline: none;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    border-radius: 14px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 700;
    transition: .2s ease;
}
.button:hover, button:hover, .btn:hover, .theme-toggle:hover { background: var(--primary-dark); }
.theme-toggle {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.btn-secondary {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); }
.btn-compact { padding: 10px 14px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .78rem;
    font-weight: 800;
}
.badge-urgent { background: rgba(185, 28, 28, 0.12); color: #b91c1c; }
.badge-featured { background: rgba(180, 83, 9, 0.13); color: #b45309; }
.badge-category { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }

.page-section { padding: 26px 0; }
.page-section-top { padding-top: 22px; }
.home-top-wrap { padding-inline: 7px; }
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.section-heading.compact { margin-bottom: 14px; }
.section-heading h2 {
    margin: 4px 0 0;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    line-height: 1.25;
}
.section-kicker {
    display: inline-block;
    font-size: .77rem;
    color: var(--muted-2);
    font-weight: 800;
    letter-spacing: .02em;
}

.hero-grid-magazine {
    display: grid;
    grid-template-columns: 1.55fr 1fr 1fr;
    grid-template-areas:
        "main side1 side2"
        "main side3 side4";
    gap: 16px;
}
.hero-card {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}
.hero-main { grid-area: main; }
.hero-grid-magazine .hero-card:nth-child(2) { grid-area: side1; }
.hero-grid-magazine .hero-card:nth-child(3) { grid-area: side2; }
.hero-grid-magazine .hero-card:nth-child(4) { grid-area: side3; }
.hero-media { aspect-ratio: 16 / 10; background: var(--surface-soft-2); }
.hero-main .hero-media { aspect-ratio: 16 / 11; }
.hero-media img, .hero-media video,
.news-card-media img, .news-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-content, .news-card-body { padding: 16px 16px 18px; }
.hero-title {
    font-size: 1.2rem;
    line-height: 1.55;
    margin: 10px 0 10px;
    font-weight: 900;
}
.hero-main .hero-title {
    font-size: clamp(1.35rem, 2.5vw, 1.9rem);
    line-height: 1.5;
}

.feed-grid.masonry-feed {
    column-count: 3;
    column-gap: 16px;
}
.news-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 16px;
    break-inside: avoid;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.news-card.has-media .news-card-media {
    aspect-ratio: 16 / 10;
    background: var(--surface-soft-2);
}
.news-card.no-media .news-card-body {
    padding-top: 18px;
}
.news-card-body h3 {
    margin: 10px 0 10px;
    font-size: 1.04rem;
    line-height: 1.65;
}
.compact-meta { font-size: .82rem; }
.muted { color: var(--muted); }
.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: .88rem;
    color: var(--muted);
}

.page-grid, .article-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}
.content-card, .panel, .form-card, .stat-card {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.content-card { padding: 24px; }
.article-card { padding: 24px 24px 18px; }
.article-header { margin-bottom: 16px; }
.article-title {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.55;
    margin: 10px 0 12px;
    font-weight: 900;
}
.article-title-refined {
    max-width: 100%;
    font-size: clamp(1.45rem, 2.7vw, 1.95rem);
}
.article-media-wrap {
    margin-bottom: 18px;
    max-width: 920px;
}
.media-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.media-gallery.single { grid-template-columns: 1fr; }
.compact-article-media .media-box {
    background: var(--surface-soft-2);
    border-radius: 18px;
    overflow: hidden;
    max-height: min(460px, 85vh);
    display: flex;
    align-items: center;
    justify-content: center;
}
.compact-article-media .media-box video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(460px, 85vh);
    object-fit: contain;
    object-position: center;
    background: #0a0a0a;
}
.compact-article-media.single .media-box {
    max-width: 900px;
}
.article-body p { margin: 0 0 16px; }
.article-disclaimer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.9;
    color: var(--muted-2);
}
.article-disclaimer p { margin: 0 0 8px; }
.sidebar-stack { display: grid; gap: 18px; }
.related-list { display: grid; gap: 12px; }
.related-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="datetime-local"], textarea, select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--surface);
    font: inherit;
    color: var(--text);
}
textarea { min-height: 150px; resize: vertical; }

.footer {
    margin-top: 42px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 30%, #07111f), #09111f);
    color: #fff;
    padding: 32px 0 18px;
}
.footer-shell {
    display: grid;
    grid-template-columns: 1.35fr .9fr .9fr;
    gap: 24px;
    align-items: start;
}
.footer-brand {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 18px;
}
.footer-logo-row {
    display: flex;
    align-items: start;
    gap: 14px;
}
.footer-brand h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}
.footer-brand p {
    margin: 0;
    color: rgba(255,255,255,.74);
}
.footer-links-group h4 {
    margin: 0 0 12px;
    font-size: 1rem;
}
.footer-links-group a {
    display: block;
    margin-bottom: 10px;
    color: rgba(255,255,255,.82);
}
.footer-bottom {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    text-align: center;
}
.footer small { color: rgba(255,255,255,.7); }

.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    background: #0f172a;
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}
.admin-sidebar .nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255,255,255,0.82);
    margin-bottom: 6px;
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: white;
}
.admin-content { padding: 26px; }
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.grid-2, .grid-3, .grid-4, .stats-grid {
    display: grid;
    gap: 18px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4, .stats-grid { grid-template-columns: repeat(4, 1fr); }
.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: top;
}
th { background: var(--surface-soft); font-size: .92rem; }
.flash {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}
.error-box {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.stat-card { padding: 18px; }
.stat-card strong { font-size: 2rem; display: block; }
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top right, #ccfbf1, #eff6ff 40%, #f8fafc);
}
.auth-card {
    width: min(460px, 100%);
    background: var(--surface);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
/* Public + admin pagination (custom Blade view, no Bootstrap) */
.pagination-nav {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.pagination-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pagination-item {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text, #0f172a);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
}
a.pagination-link:hover {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    color: var(--text, #0f172a);
}
.pagination-link--nav {
    min-width: auto;
    padding-inline: 16px;
}
.pagination-link--ellipsis {
    min-width: auto;
    border: none;
    background: transparent;
    color: var(--muted, #64748b);
    font-weight: 500;
    pointer-events: none;
}
.pagination-item.is-active .pagination-link {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination-item.is-disabled .pagination-link {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-meta {
    margin: 0;
    font-size: 0.875rem;
    text-align: center;
}
.pagination-nav--admin {
    margin-top: 20px;
}
/* Legacy flat .pagination (if any view still uses it) */
.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 28px;
}
.pagination a, .pagination span {
    min-width: 42px;
    text-align: center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.empty-state {
    padding: 30px;
    border-radius: 20px;
    border: 1px dashed var(--border);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    text-align: center;
}

@media (max-width: 1180px) {
    .hero-grid-magazine {
        grid-template-columns: 1.2fr 1fr;
        grid-template-areas:
            "main main"
            "side1 side2"
            "side3 side4";
    }
    .feed-grid.masonry-feed { column-count: 2; }
}

@media (max-width: 1040px) {
    .page-grid, .article-shell, .footer-shell, .admin-layout, .grid-4, .stats-grid { grid-template-columns: 1fr; }
    .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
    .header-inner {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 0;
        min-height: auto;
    }
    .main-nav { justify-content: flex-start; overflow: auto; scrollbar-width: none; flex-wrap: nowrap; padding-bottom: 4px; }
    .main-nav::-webkit-scrollbar { display: none; }
    .header-actions { justify-content: space-between; }
}

@media (max-width: 720px) {
    .container { width: min(100% - 18px, 1240px); }
    .page-section { padding: 20px 0; }
    .home-top-wrap { padding-inline: 3px; }
    .hero-grid-magazine {
        grid-template-columns: 1fr;
        grid-template-areas: none;
    }
    .hero-grid-magazine .hero-card { grid-area: auto !important; }
    .feed-grid.masonry-feed { column-count: 1; }
    .article-title, .article-title-refined { font-size: 1.45rem; line-height: 1.7; }
    .media-gallery { grid-template-columns: 1fr; }
    .header-actions {
        gap: 8px;
        display: grid;
        grid-template-columns: auto 1fr 1fr;
        align-items: center;
    }
    .theme-toggle-label { display: none; }
    .logo { gap: 10px; }
    .logo-badge, .logo-image { width: 38px; height: 38px; }
    .logo-text-group strong { font-size: 1rem; }
    .logo-text-group small { font-size: .72rem; }
    .footer { padding-top: 24px; }
    .footer-shell { gap: 14px; }
    .footer-brand { padding: 16px; }
    .footer-logo-row { align-items: center; }
    .footer-links-group {
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 18px;
        padding: 14px 16px;
    }
    .footer-links-group a { margin-bottom: 8px; }
}

/* Featured magazine layout refinement */
.hero-magazine-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr);
    gap: 18px;
    align-items: stretch;
}
.hero-lead-card {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    min-height: 100%;
}
.hero-lead-media {
    display: block;
    aspect-ratio: 16 / 9.6;
    background: var(--surface-soft-2);
}
.hero-lead-media img,
.hero-lead-media video,
.hero-side-thumb img,
.hero-side-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-lead-body {
    padding: 18px 18px 20px;
}
.hero-lead-title {
    margin: 10px 0 10px;
    font-size: clamp(1.35rem, 2.3vw, 1.9rem);
    line-height: 1.55;
    font-weight: 900;
}
.hero-lead-excerpt {
    margin: 0 0 12px;
    line-height: 1.85;
}
.hero-side-stack {
    display: grid;
    gap: 12px;
}
.hero-side-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: 10px;
    min-height: 112px;
}
.hero-side-thumb {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1.05 / 1;
    background: var(--surface-soft-2);
}
.hero-side-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hero-side-category {
    font-size: .75rem;
    color: var(--muted-2);
    font-weight: 800;
}
.hero-side-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 800;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-side-time {
    font-size: .78rem;
    color: var(--muted);
}

/* Override old featured styles without touching header */
.hero-grid-magazine,
.hero-card,
.hero-main,
.hero-secondary,
.hero-media,
.hero-content,
.hero-title {
    all: unset;
}

/* Smaller single article title */
.article-title {
    font-size: clamp(1.4rem, 2.45vw, 1.85rem);
    line-height: 1.68;
}
.article-title-refined {
    font-size: clamp(1.32rem, 2.25vw, 1.72rem);
    line-height: 1.72;
}

@media (max-width: 1100px) {
    .hero-magazine-layout {
        grid-template-columns: 1fr;
    }
    .hero-side-stack {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .hero-magazine-layout {
        gap: 14px;
    }
    .hero-lead-media {
        aspect-ratio: 16 / 10.8;
    }
    .hero-lead-body {
        padding: 14px 14px 16px;
    }
    .hero-lead-title {
        font-size: 1.2rem;
        line-height: 1.7;
    }
    .hero-side-item {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        min-height: 98px;
        padding: 9px;
    }
    .hero-side-title {
        font-size: .95rem;
        line-height: 1.65;
        -webkit-line-clamp: 2;
    }
    .article-title,
    .article-title-refined {
        font-size: 1.28rem;
        line-height: 1.75;
    }
}


/* ===== Refinement patch: magazine featured + stronger header/footer ===== */
.featured-heading-tuned { margin-inline: 8px; }

.refined-site-header {
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}
.refined-site-header .header-inner {
    min-height: 74px;
    gap: 16px;
}
.refined-site-header .header-center {
    min-width: 0;
}
.refined-site-header .main-nav {
    justify-content: center;
    gap: 6px;
}
.refined-site-header .main-nav a {
    padding: 10px 14px;
    font-size: .93rem;
}
.refined-site-header .header-actions {
    gap: 8px;
}
.refined-site-header .btn,
.refined-site-header .theme-toggle {
    border-radius: 999px;
    min-height: 42px;
}
.refined-site-header .btn-compact {
    padding-inline: 15px;
}
.refined-site-header .logo {
    gap: 13px;
}
.refined-site-header .logo-text-group strong {
    font-size: 1.06rem;
}
.refined-site-header .logo-text-group small {
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.refined-footer {
    margin-top: 50px;
    padding: 34px 0 18px;
    background:
        radial-gradient(circle at top left, rgba(14,165,233,.12), transparent 24%),
        linear-gradient(180deg, color-mix(in srgb, var(--surface) 26%, #07111f), #08111c 64%, #060d18);
}
.refined-footer .footer-shell {
    grid-template-columns: 1.5fr .9fr .9fr 1fr;
    gap: 18px;
}
.footer-panel {
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 18px;
    min-height: 100%;
}
.footer-brand {
    background: rgba(255,255,255,0.06);
}
.footer-links-group h4,
.footer-contact h4 {
    margin: 0 0 12px;
    font-size: .98rem;
}
.footer-links-group a,
.footer-mail {
    display: block;
    margin-bottom: 10px;
    color: rgba(255,255,255,.86);
}
.footer-mail {
    font-weight: 800;
    direction: ltr;
    text-align: right;
    word-break: break-word;
}
.footer-note {
    margin: 10px 0 0;
    color: rgba(255,255,255,.68);
    font-size: .9rem;
    line-height: 1.9;
}
.footer-bottom {
    margin-top: 16px;
}

.hero-magazine-layout-refined {
    grid-template-columns: minmax(0, 1.26fr) minmax(300px, .96fr);
    gap: 16px;
}
.hero-lead-card-balanced {
    border-radius: 26px;
}
.hero-lead-media-balanced {
    aspect-ratio: 16 / 10.35;
}
.hero-lead-body-balanced {
    padding: 16px 16px 18px;
}
.hero-lead-title-balanced {
    font-size: clamp(1.22rem, 2vw, 1.62rem);
    line-height: 1.58;
    margin-bottom: 8px;
}
.hero-side-stack-rich {
    gap: 11px;
}
.hero-side-item-rich {
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-height: 126px;
    padding: 0;
    overflow: hidden;
}
.hero-side-thumb-rich {
    width: 132px;
    flex: 0 0 132px;
    border-radius: 0;
    overflow: hidden;
    background: var(--surface-soft-2);
}
.hero-side-thumb-rich img,
.hero-side-thumb-rich video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-side-content-rich {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px 12px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.hero-side-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.hero-side-title-rich {
    margin: 0;
    font-size: .98rem;
    line-height: 1.68;
    font-weight: 800;
}
.hero-side-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.75;
}
.hero-side-time {
    margin-top: auto;
}

.article-title-refined {
    font-size: clamp(1.24rem, 2vw, 1.58rem);
    line-height: 1.82;
}

@media (max-width: 1180px) {
    .refined-footer .footer-shell {
        grid-template-columns: 1.3fr 1fr 1fr;
    }
    .footer-contact {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1040px) {
    .refined-site-header .header-inner {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 0;
        min-height: auto;
    }
    .refined-site-header .main-nav {
        justify-content: flex-start;
        overflow: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .refined-site-header .main-nav::-webkit-scrollbar { display: none; }
    .refined-site-header .header-actions {
        justify-content: space-between;
    }
    .hero-magazine-layout-refined {
        grid-template-columns: 1fr;
    }
    .refined-footer .footer-shell {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .featured-heading-tuned { margin-inline: 4px; }
    .refined-site-header {
        backdrop-filter: blur(10px);
    }
    .refined-site-header .header-inner {
        gap: 8px;
    }
    .refined-site-header .main-nav a {
        padding: 8px 12px;
        font-size: .88rem;
    }
    .refined-site-header .header-actions {
        display: grid;
        grid-template-columns: auto 1fr 1fr;
        gap: 8px;
        align-items: center;
    }
    .refined-site-header .btn,
    .refined-site-header .theme-toggle {
        min-height: 40px;
    }
    .hero-lead-media-balanced {
        aspect-ratio: 16 / 11.2;
    }
    .hero-lead-title-balanced {
        font-size: 1.12rem;
        line-height: 1.72;
    }
    .hero-side-item-rich {
        min-height: 116px;
        gap: 10px;
    }
    .hero-side-thumb-rich {
        width: 108px;
        flex-basis: 108px;
    }
    .hero-side-content-rich {
        padding: 10px 12px 10px 10px;
    }
    .hero-side-title-rich {
        font-size: .93rem;
    }
    .hero-side-excerpt {
        font-size: .83rem;
    }
    .refined-footer {
        padding-top: 24px;
    }
    .refined-footer .footer-shell {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .footer-panel {
        padding: 14px 15px;
        border-radius: 18px;
    }
    .footer-logo-row {
        align-items: center;
    }
    .footer-note {
        font-size: .84rem;
    }
    .article-title-refined {
        font-size: 1.18rem;
        line-height: 1.9;
    }
}

/* Search + Archive refined pages */
.utility-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 20px;
}
.utility-hero-copy,
.utility-hero-side {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: 26px;
    box-shadow: var(--shadow-md);
}
.utility-hero-copy {
    padding: 26px 28px;
}
.utility-hero-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    line-height: 1.25;
}
.utility-hero-copy p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
}
.utility-hero-side {
    padding: 18px;
    display: grid;
    gap: 12px;
}
.utility-stat-card {
    min-height: 108px;
    border-radius: 22px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 12%, var(--surface-soft)), var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}
.utility-stat-card strong {
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.1;
}
.utility-stat-card span {
    color: var(--muted);
    font-size: .95rem;
}
.utility-stat-card.muted-card {
    background: var(--surface-soft);
}

.refined-page-shell {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.search-shell {
    padding: 18px;
}
.search-form-advanced {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}
.search-form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: .9rem;
    font-weight: 800;
    color: var(--muted);
}
.search-form-field input {
    width: 100%;
    height: 54px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    border-radius: 16px;
    padding: 0 18px;
    font: inherit;
}
.search-form-field input:focus {
    border-color: color-mix(in srgb, var(--primary) 65%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
    outline: none;
}
.search-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-summary-bar,
.archive-summary-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.search-summary-bar {
    border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    margin-top: 16px;
    padding-top: 14px;
    color: var(--muted);
}
.search-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-inline-start: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-weight: 800;
}
.page-results-shell {
    min-height: 260px;
}
.refined-results-grid {
    align-items: start;
}
.refined-empty-state {
    padding: 38px 24px;
    text-align: center;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}
.refined-empty-state h3 {
    margin: 0 0 10px;
    font-size: 1.3rem;
}
.refined-empty-state p {
    margin: 0 auto;
    max-width: 640px;
    color: var(--muted);
}

.archive-layout-refined {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.archive-panel {
    padding: 18px;
}
.archive-panel-head {
    margin-bottom: 14px;
}
.archive-panel-head h3 {
    margin: 0 0 6px;
    font-size: 1.12rem;
}
.archive-panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}
.sticky-panel {
    position: sticky;
    top: 94px;
}
.refined-timeline-list {
    display: grid;
    gap: 10px;
}
.timeline-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    background: var(--surface-soft);
    transition: .18s ease;
}
.timeline-link:hover,
.timeline-link.active {
    background: color-mix(in srgb, var(--primary) 11%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
    transform: translateY(-1px);
}
.timeline-date {
    font-weight: 800;
}
.timeline-count {
    color: var(--muted);
    font-size: .88rem;
    white-space: nowrap;
}
.empty-mini-state {
    color: var(--muted);
    padding: 10px 4px;
}
.archive-main-refined {
    min-width: 0;
}
.archive-summary-shell {
    padding: 18px 20px;
    margin-bottom: 18px;
}
.archive-summary-copy h2 {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}
.archive-summary-copy p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 1024px) {
    .utility-hero,
    .archive-layout-refined {
        grid-template-columns: 1fr;
    }
    .sticky-panel {
        position: static;
        top: auto;
    }
}

@media (max-width: 720px) {
    .utility-hero-copy,
    .utility-hero-side,
    .search-shell,
    .archive-panel,
    .archive-summary-shell,
    .refined-empty-state {
        border-radius: 20px;
    }
    .utility-hero-copy {
        padding: 22px 18px;
    }
    .utility-hero-copy h1 {
        font-size: 1.65rem;
    }
    .search-form-advanced {
        grid-template-columns: 1fr;
    }
    .search-form-actions {
        width: 100%;
    }
    .search-form-actions .btn {
        flex: 1 1 0;
        justify-content: center;
        text-align: center;
    }
    .search-summary-bar,
    .archive-summary-shell {
        align-items: flex-start;
    }
    .timeline-link {
        padding: 11px 12px;
    }
}

/* Category listing page (aligned with archive / utility pages) */
.category-page-section {
    padding-bottom: 32px;
}
.category-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 18px;
    font-size: .88rem;
    color: var(--muted);
}
.category-breadcrumb a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.category-breadcrumb a:hover {
    text-decoration: underline;
}
.category-breadcrumb-sep {
    opacity: .45;
    user-select: none;
}
.category-breadcrumb-current {
    color: var(--text);
    font-weight: 800;
}
.category-page-hero .category-hero-copy {
    border-inline-start: 4px solid color-mix(in srgb, var(--primary) 72%, var(--border));
}
.category-hero-side .stat-of {
    font-size: .75em;
    font-weight: 800;
    opacity: .75;
}
.category-layout-refined {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.category-panel {
    padding: 20px;
}
.category-panel-head {
    margin-bottom: 14px;
}
.category-panel-head h3 {
    margin: 0 0 6px;
    font-size: 1.12rem;
}
.category-panel-head p {
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
    line-height: 1.55;
}
.category-panel-empty {
    margin: 0 0 14px;
    font-size: .92rem;
}
.category-chips-list {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
.category-chip-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: .95rem;
    transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.category-chip-link:hover {
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.category-chip-text {
    min-width: 0;
    line-height: 1.45;
}
.category-chip-arrow {
    flex-shrink: 0;
    opacity: .55;
    font-size: 1.15rem;
    line-height: 1;
}
.category-panel-footer {
    display: grid;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
}
.btn-block-category {
    width: 100%;
    justify-content: center;
    text-align: center;
}
.category-inline-link {
    text-align: center;
    font-size: .88rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.category-inline-link:hover {
    text-decoration: underline;
}
.category-main-refined {
    min-width: 0;
}
.category-results-intro {
    margin-bottom: 16px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}
.category-results-title {
    margin: 0 0 6px;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.4;
}
.category-results-intro .muted {
    margin: 0;
    font-size: .9rem;
}
.category-feed-grid {
    margin-bottom: 8px;
}
.pagination-wrap.category-pagination {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.category-empty-state .category-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
}

@media (max-width: 1024px) {
    .category-layout-refined {
        grid-template-columns: 1fr;
    }
    .category-sidebar {
        order: 2;
    }
    .category-main-refined {
        order: 1;
    }
}

@media (max-width: 720px) {
    .category-breadcrumb {
        margin-bottom: 14px;
    }
    .category-results-intro {
        padding: 14px 14px;
        border-radius: 18px;
    }
    .category-chip-link {
        padding: 11px 12px;
    }
}
