:root {
    --ink: #102a43;
    --ink-soft: #334e68;
    --red: #c91f2e;
    --red-dark: #9f1724;
    --gold: #c89b3c;
    --gold-soft: #f7eedc;
    --cloud: #f4f6f8;
    --line: #d9e2ec;
    --white: #ffffff;
    --success: #1f8a70;
    --shadow: 0 18px 45px rgba(16, 42, 67, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--cloud);
    color: var(--ink);
    line-height: 1.8;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
video {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
}

.brand-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
}

.brand-subtitle {
    margin: -4px 0 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    font-weight: 700;
}

.nav-links a,
.btn {
    border-radius: 8px;
    padding: 10px 14px;
}

.nav-links a:hover {
    background: var(--cloud);
    color: var(--red);
}

.btn {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 800;
    font-family: inherit;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--red-dark);
}

.btn-dark {
    background: var(--ink);
    color: var(--white);
}

.btn-muted {
    background: var(--white);
    border: 1px solid var(--line);
    color: var(--ink);
}

.hero {
    position: relative;
    background: var(--ink);
    color: var(--white);
    padding: 84px 0 64px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 38px;
    align-items: center;
}

.eyebrow {
    color: #ffe6a3;
    font-weight: 900;
    margin: 0 0 10px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.25;
    letter-spacing: 0;
}

.hero p {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.1rem;
    max-width: 720px;
    margin: 18px 0 0;
}

.hero-panel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat {
    background: rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    padding: 16px;
}

.stat strong {
    display: block;
    font-size: 1.75rem;
}

.stat span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
}

.section {
    padding: 42px 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.section-title h2 {
    margin: 0;
    font-size: 1.8rem;
}

.section-title p {
    margin: 0;
    color: var(--ink-soft);
}

.filters {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr) auto;
    gap: 10px;
    box-shadow: var(--shadow);
    margin-top: -34px;
    position: relative;
    z-index: 5;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    padding: 10px 12px;
    font: inherit;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.category-card {
    min-height: 118px;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 4px solid var(--red);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 30px rgba(16, 42, 67, 0.08);
}

.category-card:hover {
    transform: translateY(-2px);
    border-top-color: var(--gold);
}

.category-card span {
    font-weight: 900;
    font-size: 1.05rem;
}

.category-card strong {
    color: var(--red);
    font-size: 1.8rem;
    line-height: 1;
}

.archive-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.archive-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.archive-section-head h3 {
    margin: 8px 0 0;
    font-size: 1.55rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(16, 42, 67, 0.08);
}

.media-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.media-thumb {
    aspect-ratio: 16 / 10;
    background: #d9e2ec;
    overflow: hidden;
    position: relative;
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    background: var(--gold-soft);
    color: #7a581e;
    border: 1px solid #efd9aa;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.card-body {
    padding: 18px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.86rem;
    margin-bottom: 10px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 1.22rem;
    line-height: 1.5;
}

.card p {
    margin: 0;
    color: var(--ink-soft);
}

.card-actions {
    padding: 0 18px 18px;
    margin-top: auto;
}

.empty {
    background: var(--white);
    border: 1px dashed #bcccdc;
    border-radius: 8px;
    padding: 34px;
    text-align: center;
    color: var(--ink-soft);
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.detail-hero {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 42px 0;
}

.detail-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.35;
}

.content-box {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gallery-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--cloud);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.download-row:last-child {
    border-bottom: 0;
}

.page {
    padding: 42px 0;
}

.page-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.site-footer {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.82);
    padding: 26px 0;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-row a {
    color: var(--white);
    font-weight: 800;
}

.admin-shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--ink);
    color: var(--white);
    padding: 24px;
}

.admin-main {
    padding: 26px;
}

.admin-nav {
    display: grid;
    gap: 8px;
    margin-top: 26px;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.86);
    padding: 12px;
    border-radius: 8px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 13px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: top;
}

th {
    color: var(--ink);
    background: #eef2f7;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.label {
    display: block;
    font-weight: 900;
    margin-bottom: 6px;
}

.flash {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #e7f9f3;
    border: 1px solid #b5eadb;
    color: #0b6b55;
    font-weight: 800;
}

.flash.error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.upload-feedback {
    display: none;
    margin-top: 16px;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-weight: 800;
}

.upload-feedback.is-visible {
    display: block;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(130deg, rgba(16, 42, 67, 0.95), rgba(201, 31, 46, 0.55)),
        url('../img/feature-graphic.png') center/cover no-repeat;
}

.login-card {
    width: min(440px, 100%);
    background: var(--white);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card img {
    width: 88px;
    height: 88px;
    margin-inline: auto;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .hero-grid,
    .detail-layout,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }
}

@media (max-width: 620px) {
    .archive-grid,
    .gallery,
    .form-grid,
    .stat-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .archive-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .hero {
        padding: 48px 0 42px;
    }

    .nav-links,
    .footer-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .brand {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .section-title {
        display: block;
    }
}
