/* =====================================================
   Grandhashala Books Display — Frontend Styles
   v1.0.0
   Aesthetic: Editorial / Literary Magazine
   Font: Playfair Display (titles) + Source Sans 3 (body)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
    --gh-bg:         #faf9f7;
    --gh-surface:    #ffffff;
    --gh-border:     #e8e4de;
    --gh-text:       #1a1814;
    --gh-muted:      #6b6560;
    --gh-accent:     #8b4513;   /* warm brown — literary feel */
    --gh-accent-lt:  #f5ede6;
    --gh-pd-green:   #2d6a4f;
    --gh-pd-bg:      #e8f5e9;
    --gh-copy-red:   #8b1a1a;
    --gh-copy-bg:    #fde8e8;
    --gh-radius:     6px;
    --gh-shadow:     0 2px 12px rgba(0,0,0,0.08);
    --gh-shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
    --gh-font-title: 'Playfair Display', Georgia, serif;
    --gh-font-body:  'Source Sans 3', 'Segoe UI', sans-serif;
}

/* ── Shared utilities ─────────────────────────────── */
.gh-books-empty {
    padding: 30px;
    text-align: center;
    color: var(--gh-muted);
    font-family: var(--gh-font-body);
    border: 1px dashed var(--gh-border);
    border-radius: var(--gh-radius);
}

/* ── Badge ────────────────────────────────────────── */
.gh-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: var(--gh-font-body);
}
.gh-badge--pd   { background: var(--gh-pd-bg);   color: var(--gh-pd-green); }
.gh-badge--copy { background: var(--gh-copy-bg);  color: var(--gh-copy-red); }
.gh-badge--lg   { font-size: 0.8rem; padding: 4px 12px; }

/* ── Cover placeholder ────────────────────────────── */
.gh-cover-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8ddd4 0%, #d4c9bc 100%);
    font-family: var(--gh-font-title);
    font-size: 2rem;
    font-weight: 700;
    color: #a0917f;
    letter-spacing: -0.02em;
}
.gh-cover-placeholder--large { font-size: 4rem; }

/* ══════════════════════════════════════════════════
   SLIDER SECTION
══════════════════════════════════════════════════ */
.gh-books-section {
    margin: 48px 0;
    font-family: var(--gh-font-body);
}

/* Header row: title + see more */
.gh-books-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gh-text);
}

.gh-books-section-title {
    margin: 0;
    font-family: var(--gh-font-title);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gh-text);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
}

.gh-see-more {
    font-family: var(--gh-font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gh-accent);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.gh-see-more:hover { color: var(--gh-text); text-decoration: underline; }

/* Slider wrapper with arrow buttons */
.gh-books-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Arrow buttons */
.gh-slider-arrow {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--gh-border);
    background: var(--gh-surface);
    color: var(--gh-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    z-index: 2;
    padding: 0;
}
.gh-slider-arrow:hover {
    background: var(--gh-text);
    color: #fff;
    border-color: var(--gh-text);
}
.gh-slider-arrow:active { transform: scale(0.93); }
.gh-slider-arrow:disabled { opacity: 0.3; pointer-events: none; }

/* The scrollable row */
.gh-books-slider {
    flex: 1;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 8px 4px 20px;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar by default — arrows handle it */
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}
.gh-books-slider::-webkit-scrollbar { display: none; }
.gh-books-slider.is-dragging { cursor: grabbing; scroll-snap-type: none; }

/* ── Book card ────────────────────────────────────── */
.gh-book-card {
    flex: 0 0 148px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

.gh-book-cover {
    display: block;
    position: relative;
    height: 220px;
    border-radius: var(--gh-radius);
    overflow: hidden;
    box-shadow: var(--gh-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    background: var(--gh-border);
    text-decoration: none;
}
.gh-book-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.gh-book-card:hover .gh-book-cover {
    box-shadow: var(--gh-shadow-lg);
    transform: translateY(-4px);
}
.gh-book-card:hover .gh-book-cover img { transform: scale(1.04); }

/* Badge on cover */
.gh-book-cover .gh-badge {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 1;
}

.gh-book-info { padding: 10px 2px 0; }

.gh-book-title {
    margin: 0 0 4px;
    font-family: var(--gh-font-body);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--gh-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gh-book-title a { color: inherit; text-decoration: none; }
.gh-book-title a:hover { color: var(--gh-accent); }

.gh-book-author {
    margin: 0 0 3px;
    font-size: 0.8rem;
    color: var(--gh-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gh-book-meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--gh-muted);
    opacity: 0.75;
}

/* ══════════════════════════════════════════════════
   CATEGORY ARCHIVE GRID
══════════════════════════════════════════════════ */
.gh-cat-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: var(--gh-font-body);
}

.gh-cat-header {
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gh-text);
}

.gh-cat-header h1 {
    font-family: var(--gh-font-title);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--gh-text);
    margin: 0 0 8px;
}

.gh-cat-desc { color: var(--gh-muted); margin: 0 0 8px; }
.gh-cat-count { font-size: 0.88rem; color: var(--gh-muted); margin: 0; }

/* Responsive book grid */
.gh-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 28px 20px;
    margin-bottom: 48px;
}

/* Pagination */
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 8px;
    margin: 0 3px;
    border: 1.5px solid var(--gh-border);
    border-radius: var(--gh-radius);
    font-family: var(--gh-font-body);
    font-size: 0.88rem;
    color: var(--gh-text);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.page-numbers:hover, .page-numbers.current {
    background: var(--gh-text);
    color: #fff;
    border-color: var(--gh-text);
}
.page-numbers.dots { border: none; pointer-events: none; }
.gh-page-num { font-size: inherit; }

/* ══════════════════════════════════════════════════
   SINGLE BOOK PAGE
══════════════════════════════════════════════════ */
.gh-single-book {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    font-family: var(--gh-font-body);
    color: var(--gh-text);
}

/* Hero: cover + meta side by side */
.gh-single-hero {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    margin-bottom: 56px;
    align-items: start;
}

.gh-single-cover {
    position: relative;
}
.gh-single-cover img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    display: block;
}
.gh-single-cover .gh-badge--lg {
    margin-top: 12px;
    display: block;
    text-align: center;
}

.gh-single-title {
    font-family: var(--gh-font-title);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gh-text);
    margin: 0 0 12px;
}

.gh-single-author {
    font-size: 1.05rem;
    color: var(--gh-muted);
    margin: 0 0 24px;
}
.gh-single-author strong {
    color: var(--gh-text);
    font-weight: 600;
}

/* Meta grid (key: value pairs) */
.gh-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 0 0 28px;
    font-size: 0.92rem;
}
.gh-meta-grid dt {
    font-weight: 600;
    color: var(--gh-muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    padding-top: 1px;
    white-space: nowrap;
}
.gh-meta-grid dd {
    margin: 0;
    color: var(--gh-text);
}
.gh-cat-links a {
    color: var(--gh-accent);
    text-decoration: none;
}
.gh-cat-links a:hover { text-decoration: underline; }

/* Action buttons */
.gh-action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.gh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--gh-radius);
    font-family: var(--gh-font-body);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    border: none;
}
.gh-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.gh-btn--buy      { background: var(--gh-accent);   color: #fff; }
.gh-btn--download { background: var(--gh-pd-green);  color: #fff; }

/* Section headings */
.gh-section-heading {
    font-family: var(--gh-font-title);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gh-text);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--gh-border);
}

/* Content sections */
.gh-content-section {
    margin-bottom: 48px;
}

.gh-summary-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gh-text);
}

.gh-summary-credit {
    margin-top: 16px;
    font-size: 0.88rem;
    color: var(--gh-muted);
    font-style: italic;
}

.gh-detailed-content {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--gh-text);
}
.gh-detailed-content p  { margin: 0 0 1.4em; }
.gh-detailed-content h2,
.gh-detailed-content h3 { font-family: var(--gh-font-title); margin: 1.8em 0 0.6em; }

/* Teaser/blur for copyrighted detailed content */
.gh-content-teaser {
    position: relative;
    overflow: hidden;
    border-radius: var(--gh-radius);
    border: 1px solid var(--gh-border);
}
.gh-teaser-text {
    padding: 24px;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gh-text);
}
.gh-teaser-blur {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--gh-surface) 80%);
}
.gh-teaser-cta {
    text-align: center;
    padding: 20px 24px 28px;
    background: var(--gh-surface);
    position: relative;
    z-index: 1;
}
.gh-teaser-cta p {
    color: var(--gh-muted);
    margin: 0 0 12px;
    font-size: 0.92rem;
}

/* Audio player */
.gh-audio-section { margin-bottom: 48px; }
.gh-audio-player  { width: 100%; margin-top: 4px; }

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 767px) {
    .gh-book-card  { flex: 0 0 128px; }
    .gh-book-cover { height: 192px; }

    .gh-single-hero {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .gh-single-cover {
        max-width: 200px;
        margin: 0 auto;
    }
    .gh-single-title { font-size: 1.7rem; }
    .gh-single-book  { padding: 28px 16px 60px; }
}

@media (max-width: 480px) {
    .gh-slider-arrow { display: none; }
    .gh-books-slider { padding-bottom: 14px; }
}

/* ── Reduced motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .gh-book-cover, .gh-book-cover img,
    .gh-btn, .gh-slider-arrow { transition: none !important; }
}
