:root {
    --bg: #f4efe7;
    --surface: rgba(255, 252, 247, 0.82);
    --surface-strong: #fff9f0;
    --text: #1f1a17;
    --muted: #65594f;
    --accent: #a3472f;
    --accent-soft: #dfb98f;
    --line: rgba(31, 26, 23, 0.12);
    --shadow: 0 18px 40px rgba(57, 35, 16, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(223, 185, 143, 0.45), transparent 28%),
        linear-gradient(180deg, #f9f4ec 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 4rem;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand,
h1,
h2 {
    font-family: "Fraunces", serif;
}

p {
    text-align: justify;
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
}

.site-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-nav a {
    padding: 0.6rem 1rem;
    border-radius: 999px;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.site-nav a:hover {
    background: var(--accent);
    color: #fffaf4;
    transform: translateY(-1px);
}

.hero {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.risale-banner {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    column-gap: 0.4rem;
    margin: -3rem calc(-50vw + 50%) 0.1rem;
    padding-left: calc(50vw - 60%);
    position: relative;
    z-index: 1;
}

.risale-banner + .hero {
    margin-top: 0;
}

.risale-r {
    color: #b03528;
    font-family: "Great Vibes", cursive;
    font-size: clamp(5rem, 12vw, 9.2rem);
    line-height: 0.78;
    text-shadow: 0 8px 16px rgba(135, 43, 32, 0.22);
}

.risale-rest {
    color: #2c231c;
    font-family: "Fraunces", serif;
    font-size: clamp(1.15rem, 2.2vw, 1.9rem);
    letter-spacing: 0.52em;
    line-height: 1.1;
    text-transform: uppercase;
    padding-bottom: 0.55rem;
}

.hero-card,
.feature-card,
.content-panel,
.content-card,
.news-item {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero > div,
.hero-card,
.feature-card,
.content-panel,
.content-card,
.news-item {
    padding: 1.5rem;
}

.eyebrow,
.news-date {
    margin: 0 0 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-weight: 700;
}

h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    line-height: 0.95;
}

h2 {
    margin-top: 0;
    font-size: 1.5rem;
}

.lead {
    max-width: 62ch;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.feature-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
}

.achievements {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 12% 10%, rgba(163, 71, 47, 0.12), transparent 45%),
        linear-gradient(135deg, rgba(255, 249, 240, 0.92), rgba(255, 252, 247, 0.78));
    box-shadow: var(--shadow);
}

.achievements-intro {
    margin-bottom: 1rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.achievement-card {
    padding: 1.1rem;
    border: 1px solid rgba(163, 71, 47, 0.16);
    border-radius: 18px;
    background: rgba(255, 252, 247, 0.88);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.achievement-card:hover,
.achievement-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 14px 26px rgba(57, 35, 16, 0.14);
}

.achievement-value {
    margin: 0;
    font-family: "Fraunces", serif;
    color: var(--accent);
    font-size: clamp(2rem, 5vw, 2.7rem);
    line-height: 0.95;
}

.achievement-label {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
}

.feature-link {
    display: block;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.feature-link:hover,
.feature-link:focus-visible {
    transform: translateY(-6px) scale(1.03);
    background: var(--surface-strong);
    border-color: var(--accent-soft);
    box-shadow: 0 24px 50px rgba(57, 35, 16, 0.18);
}

.inline-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
}

.inline-link:hover,
.inline-link:focus-visible {
    color: #7f3423;
}

.section-intro {
    margin-bottom: 1.25rem;
}

.news-list {
    display: grid;
    gap: 1rem;
}

.articles-list {
    display: grid;
    gap: 1rem;
}

.article-card h2 {
    margin-bottom: 0.45rem;
}

.article-meta {
    margin-bottom: 0.8rem;
}

.article-meta .muted {
    margin: 0;
}

.article-body {
    color: var(--text);
    line-height: 1.75;
}

.article-body p {
    margin: 0 0 0.9rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}

.article-body ul,
.article-body ol {
    margin: 0.5rem 0 0.9rem;
    padding-left: 1.4rem;
}

.activity-gallery {
    margin-top: 1.5rem;
}

.activity-gallery.is-protected {
    -webkit-user-select: none;
    user-select: none;
}

.gallery-intro {
    margin-bottom: 1rem;
}

.collage-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.collage-card {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.collage-strip {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.6rem;
    min-height: clamp(220px, 26vw, 300px);
    overflow: hidden;
    padding: 0.35rem;
}

.mini-shot {
    width: min(100%, clamp(86px, 8.8vw, 128px));
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ece2d4;
    box-shadow: 0 12px 22px rgba(57, 35, 16, 0.16);
    flex: 1 1 0;
    min-width: 0;
    transition: transform 180ms ease, box-shadow 180ms ease;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.mini-shot:hover {
    transform: rotate(0deg) translateY(-8px);
    box-shadow: 0 18px 30px rgba(57, 35, 16, 0.22);
}

.collage-card figcaption {
    padding: 0.85rem 1rem 1rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.content-panel {
    min-height: 180px;
}

.book-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.book-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    justify-content: center;
}

.book-cover {
    display: block;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(31, 26, 23, 0.22);
    width: 150px;
    height: auto;
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.book-cover:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 40px rgba(31, 26, 23, 0.28);
}

.btn-read {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background-color 160ms ease, color 160ms ease, transform 140ms ease;
    background: var(--accent);
    color: #fffaf4;
}

.btn-read:hover {
    background: #8a3726;
    transform: translateY(-1px);
}

.reader-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 2.5rem clamp(1.5rem, 6vw, 4rem);
    max-width: 72ch;
    margin: 0 0 1.5rem;
    line-height: 1.85;
    font-size: 1.05rem;
}

.reader-panel p {
    margin: 0 0 1.1rem;
    color: var(--text);
}

.reader-heading {
    margin-top: 2rem;
    font-size: 1.25rem;
}

.reader-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}

.pdf-viewer {
    width: 100%;
    height: 80vh;
    border: none;
    border-radius: 12px;
}

.reader-panel--pdf {
    max-width: none;
}

.muted {
    color: var(--muted);
}

.inline-form {
    margin: 0;
}

.nav-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font: inherit;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-btn:hover {
    background: var(--accent);
    color: #fffaf4;
    transform: translateY(-1px);
}

.nav-btn-danger {
    border-color: rgba(127, 41, 24, 0.34);
    color: #7f2918;
}

.flash-wrap {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.flash {
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--surface);
}

.flash-success {
    border-color: rgba(55, 120, 58, 0.35);
    background: rgba(228, 249, 230, 0.78);
}

.flash-error {
    border-color: rgba(156, 52, 35, 0.35);
    background: rgba(252, 231, 224, 0.84);
}

.admin-card {
    max-width: 900px;
}

.admin-form {
    display: grid;
    gap: 0.6rem;
}

.admin-form input,
.admin-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    background: #fffdf9;
    font: inherit;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.7rem;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.65rem 0.5rem;
    vertical-align: top;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.admin-actions form {
    margin: 0;
}

@media (max-width: 800px) {
    .site-header,
    .hero,
    .feature-grid,
    .card-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .site-header {
        border-radius: 28px;
        justify-content: normal;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .page-shell {
        width: min(100% - 1rem, 1120px);
    }

    .book-layout {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .collage-list {
        grid-template-columns: 1fr;
    }

    .mini-shot {
        width: min(100%, clamp(74px, 20vw, 118px));
    }

    .mini-1,
    .mini-2,
    .mini-3,
    .mini-4 {
        transform: none;
    }

    .risale-banner {
        margin: -1.1rem 0 1rem;
    }

    .risale-rest {
        letter-spacing: 0.34em;
        padding-bottom: 0.25rem;
    }

    .admin-form-actions,
    .admin-actions {
        flex-wrap: wrap;
    }
}
