:root {
    --ink: #172026;
    --muted: #68727d;
    --line: #dde3ea;
    --paper: #f7f8f5;
    --surface: #ffffff;
    --accent: #1d6f6f;
    --accent-dark: #124f50;
    --gold: #b8892f;
    --rose: #8c4351;
    --shadow: 0 18px 55px rgba(23, 32, 38, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.5;
}

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

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

main {
    min-height: 70vh;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;
}

.brand,
.main-nav,
.footer-links,
.actions,
.admin-actions,
.metric-row,
.book-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    font-weight: 800;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

.main-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a:not(.button) {
    color: var(--muted);
    font-weight: 650;
}

.button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    font: inherit;
    font-weight: 750;
    text-align: center;
}

.button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    background: var(--gold);
}

.button.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
}

.button.full {
    width: 100%;
}

.hero {
    max-width: 1180px;
    min-height: 590px;
    margin: 12px auto 0;
    padding: 56px 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: center;
}

.hero-copy h1,
.page-title h1 {
    margin: 0;
    font-size: clamp(2.3rem, 6vw, 5.8rem);
    line-height: 0.98;
    max-width: 860px;
}

.hero-copy p:not(.eyebrow),
.lead {
    color: #4d5963;
    font-size: 1.12rem;
    max-width: 650px;
}

.hero-panel,
.panel,
.form-card,
.quiz-card,
.news-card,
.book-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel {
    min-height: 420px;
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        linear-gradient(rgba(23, 32, 38, 0.05), rgba(23, 32, 38, 0.2)),
        repeating-linear-gradient(90deg, #31434a 0 42px, #26343a 42px 52px, #d8c39b 52px 58px, #5c2f3a 58px 92px);
    color: #fff;
}

.hero-panel h2 {
    margin: 16px 0 24px;
    font-size: 2rem;
    line-height: 1.08;
}

.label,
.eyebrow,
.pill {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.label,
.pill {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(29, 111, 111, 0.25);
    background: rgba(29, 111, 111, 0.08);
}

.hero-panel .label {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.12);
}

.metric-row {
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 18px;
}

.metric-row strong {
    display: block;
    font-size: 2rem;
}

.metric-row span {
    color: rgba(255, 255, 255, 0.82);
}

.section,
.page-title,
.filter-bar,
.detail-layout,
.dashboard-grid,
.quiz-list,
.stats-grid,
.admin-actions {
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 22px;
}

.band {
    max-width: none;
    padding-inline: max(22px, calc((100vw - 1180px) / 2 + 22px));
    background: #eef2ee;
}

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

.section-heading h2,
.panel h2,
.form-card h1,
.quiz-card h2,
.news-card h2,
.news-card h3 {
    margin: 0;
}

.book-grid,
.news-grid,
.stats-grid,
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.cover {
    position: relative;
    /* use portrait ratio for book covers so full cover can be visible */
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: #24363d;
}

.cover img {
    width: 100%;
    height: 100%;
    /* show the full cover image instead of cropping */
    object-fit: contain;
    object-position: center;
    background: transparent;
}

/* Add subtle book-like overlays to match books.php styling */
.cover {
    box-shadow: -4px 4px 0 rgba(0,0,0,0.08), 5px 10px 22px rgba(0,0,0,0.12);
}

.cover .book-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 8px;
    background: linear-gradient(90deg, rgba(0,0,0,0.25), transparent);
    pointer-events: none;
}

.cover .book-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(130deg, rgba(255,255,255,0.12) 0%, transparent 55%);
    pointer-events: none;
}

.cover .book-cast-shadow {
    position: absolute;
    bottom: -8px;
    left: 8%;
    right: 8%;
    height: 10px;
    background: rgba(0,0,0,0.25);
    border-radius: 50%;
    filter: blur(5px);
    transform: scaleX(0.75);
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0.85;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #253840, #6f7c63 54%, #c49a43);
    color: #fff;
}

.cover-placeholder span {
    font-size: 5rem;
    font-weight: 900;
}

.cover-placeholder.large {
    aspect-ratio: 3 / 4;
    border-radius: 8px;
}

.status {
    position: absolute;
    top: 12px;
    left: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    padding: 6px 10px;
    font-weight: 800;
    font-size: 0.76rem;
}

.book-body,
.news-card,
.panel,
.form-card,
.quiz-card {
    padding: 22px;
}

.book-body h3 {
    min-height: 52px;
    margin: 0;
}

.book-body p,
.news-card p,
.panel p,
.muted {
    color: var(--muted);
}

.book-meta {
    justify-content: space-between;
    margin: 18px 0;
}

.filter-bar {
    display: grid;
    grid-template-columns: 1fr 180px 120px;
    gap: 12px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-height: 46px;
    padding: 11px 13px;
    font: inherit;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 750;
}

.auth-shell {
    max-width: 560px;
    margin: 0 auto;
    padding: 52px 22px;
}

.auth-shell.wide {
    max-width: 820px;
}

.form-card {
    display: grid;
    gap: 16px;
}

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

.detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 410px) minmax(0, 1fr);
    gap: 42px;
    align-items: center;
}

.detail-copy h1 {
    margin: 14px 0;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
}

.price {
    color: var(--rose);
    font-size: 1.4rem;
    font-weight: 900;
}

.notice,
.flash {
    display: block;
    max-width: 1180px;
    margin: 12px auto;
    padding: 14px 18px;
    border-radius: 8px;
    background: #fff4dc;
    border: 1px solid #edd293;
    color: #634911;
}

.stats-grid > div {
    background: var(--ink);
    color: #fff;
    border-radius: 8px;
    padding: 22px;
}

.stats-grid strong {
    display: block;
    font-size: 2rem;
}

.stats-grid span {
    color: rgba(255, 255, 255, 0.76);
}

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

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.badge-row {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.badge-dot {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--gold);
    margin-top: 4px;
}

.quiz-list {
    display: grid;
    gap: 18px;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 18px 0;
    padding: 18px;
}

legend {
    font-weight: 850;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-weight: 600;
}

.option input {
    width: 18px;
    min-height: 18px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.site-footer {
    margin-top: 44px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

@media (max-width: 880px) {
    .site-header,
    .site-footer,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .detail-layout,
    .dashboard-grid,
    .book-grid,
    .news-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar,
    .two-col {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }
}

.hero-banner-image{
    width:100%;
    max-width:700px;
    height:auto;
    display:block;
    border-radius:32px;
    filter:drop-shadow(0 20px 40px rgba(0,0,0,.15));
}