/* ===========================================
   Gallery Pages — Writing & Audio
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

.gallery-page {
    background: #eee8e3;
    min-height: 80vh;
}

.gallery-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 40px 80px;
}

/* Page label */
.page-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 8px;
}

/* Section titles */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 400;
    font-style: italic;
    color: #2c2c2c;
    margin-bottom: 36px;
    margin-top: 60px;
}

.gallery-container .section-title:first-of-type {
    margin-top: 0;
}

.divider {
    border: none;
    border-top: 1px solid #d5cec7;
    margin: 48px 0;
}

/* ---- Books ---- */
.book-item {
    display: flex;
    gap: 40px;
    margin-bottom: 56px;
    align-items: flex-start;
}

.book-img {
    width: 194px;
    min-width: 194px;
    height: 300px;
    border-radius: 4px;
    object-fit: cover;
    background: #d5cec7;
}

.book-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 12px;
    color: #1b2a4a;
}

.book-info p {
    font-family: 'Inter', sans-serif;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 14px;
    max-width: 600px;
}

.book-info a {
    color: #c0392b;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.92rem;
}

.book-info a:hover {
    text-decoration: underline;
}

/* ---- Essays Grid ---- */
.essays-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

.essay-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.2s;
}

.essay-card:hover {
    opacity: 0.8;
}

.essay-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: 14px;
    background: #d5cec7;
}

.essay-img-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 3px;
    margin-bottom: 14px;
    background: #d5cec7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 2.5rem;
}

.essay-card h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: #1b2a4a;
}

.essay-card h4 a {
    color: inherit;
    text-decoration: none;
}

.essay-card h4 a:hover {
    color: inherit;
    text-decoration: none;
}

.essay-card .listen-links {
    margin-top: 8px;
}

.essay-card .meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: #999;
}

.essay-card .desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #666;
    line-height: 1.55;
    margin-top: 6px;
}

/* ---- Audio Items ---- */
.audio-item {
    display: flex;
    gap: 36px;
    margin-bottom: 28px;
    align-items: flex-start;
    padding-bottom: 44px;
    border-bottom: 1px solid #d5cec7;
}

.audio-item:last-child {
    border-bottom: none;
}

.audio-img {
    width: 200px;
    min-width: 200px;
    height: 200px;
    border-radius: 6px;
    object-fit: cover;
    background: #d5cec7;
}

.audio-img-placeholder {
    width: 200px;
    min-width: 200px;
    height: 200px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.audio-img-placeholder.p1 {
    background: #dce8f0;
    color: #5a8dad;
}

.audio-img-placeholder.p2 {
    background: #e8dce8;
    color: #8d5a8d;
}

.audio-img-placeholder.p3 {
    background: #dce8dc;
    color: #5a8d5a;
}

.audio-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 12px;
    color: #1b2a4a;
}

.audio-info p {
    font-family: 'Inter', sans-serif;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
    max-width: 600px;
}

.listen-links {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.listen-links span {
    color: #999;
    font-weight: 500;
}

.listen-links a {
    color: #c0392b;
    text-decoration: none;
    font-weight: 500;
}

.listen-links a:hover {
    text-decoration: underline;
}

.listen-links .sep {
    color: #ccc;
    margin: 0 6px;
}

/* ---- Dark Theme ---- */
body.dark .gallery-page {
    background: rgb(40, 42, 54) !important;
}

.dark .section-title {
    color: rgb(152, 166, 173);
}

.dark .divider {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.dark .book-info h3,
.dark .audio-info h3,
.dark .essay-card h4 {
    color: #fff;
}

.dark .book-info p,
.dark .audio-info p {
    color: rgba(248, 248, 242, 0.7);
}

.dark .book-info a,
.dark .listen-links a {
    color: hsl(339, 90%, 68%);
}

.dark .essay-card .desc {
    color: rgba(248, 248, 242, 0.6);
}

.dark .essay-img-placeholder {
    background: rgb(68, 71, 90);
    color: rgba(255, 255, 255, 0.3);
}

.dark .book-img {
    background: rgb(68, 71, 90);
}

.dark .audio-img {
    background: rgb(68, 71, 90);
}

.dark .audio-img-placeholder.p1 {
    background: rgba(90, 141, 173, 0.2);
    color: #5a8dad;
}

.dark .audio-img-placeholder.p2 {
    background: rgba(141, 90, 141, 0.2);
    color: #8d5a8d;
}

.dark .audio-img-placeholder.p3 {
    background: rgba(90, 141, 90, 0.2);
    color: #5a8d5a;
}

.dark .audio-item {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.dark .essay-card img {
    background: rgb(68, 71, 90);
}

/* ---- Responsive ---- */
@media (max-width: 800px) {
    .essays-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .essays-grid {
        grid-template-columns: 1fr;
    }

    .book-item,
    .audio-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-info p,
    .audio-info p {
        max-width: 100%;
    }

    .gallery-container {
        padding: 30px 20px 60px;
    }
}