/**
 * explore_hall.css
 * 🏛️ The Hall of Wisdom (Explore): dark glass and gold over the same drifting masterpiece as the World Clock and its Focus
 * Timer — or the classic purple look. It is built on the painted-canvas shell of world_clock.css (.wc-root, .wc-canvas,
 * .wc-header, .wc-icon-btn, .wc-plaque …); this file adds the hall itself: the hero, the wings of cards, a tradition's
 * quotes. Unlike the clock the hall scrolls, so its sizes are plain px/clamp() (no --u).
 */

.eh-root {
    --eh-gap: 14px;
}

/* a little more of the painting shows through than behind the clock: the cards are glass, the gaps are not */
.eh-root .wc-veil-dark {
    background: linear-gradient(to bottom, rgba(3, 6, 4, 0.82) 0%, rgba(3, 6, 4, 0.46) 24%, rgba(3, 6, 4, 0.5) 62%, rgba(3, 6, 4, 0.92) 100%);
}

/* ---------- the scrolling body ---------- */
.eh-body {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 210, 122, 0.4) transparent;
}

.eh-body::-webkit-scrollbar {
    width: 8px;
}

.eh-body::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(255, 210, 122, 0.35);
}

.eh-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 2px clamp(14px, 3.4vw, 36px) calc(44px + env(safe-area-inset-bottom));
}

.eh-inner > .wc-plaque {
    margin-top: 30px;
}

/* ---------- ornaments ---------- */
.eh-rule {
    flex: none;
    width: clamp(40px, 12vw, 120px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--wc-gold), transparent);
    opacity: 0.55;
}

.eh-glyph {
    font-size: 11px;
    color: var(--wc-gold);
    opacity: 0.85;
}

/* ---------- hero ---------- */
.eh-hero {
    padding: clamp(4px, 1.6vh, 18px) 0 clamp(16px, 3.4vh, 32px);
    text-align: center;
}

.eh-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.eh-lede {
    max-width: 30ch;
    margin: 0 auto;
    font-family: var(--wc-serif);
    font-style: italic;
    font-size: clamp(21px, 3.3vw, 34px);
    line-height: 1.28;
    color: var(--wc-cream);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
    text-wrap: balance;
}

/* ---------- wings ---------- */
.eh-wing + .eh-wing {
    margin-top: clamp(24px, 4.4vh, 44px);
}

.eh-wing-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    font-family: var(--wc-mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--wc-gold);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

.eh-wing-title .eh-rule {
    flex: 1;
    width: auto;
}

.eh-wing-title .eh-rule:first-child {
    background: linear-gradient(90deg, transparent, var(--wc-gold));
}

.eh-wing-title .eh-rule:last-child {
    background: linear-gradient(90deg, var(--wc-gold), transparent);
}

/* the cards wrap and the last row is centred, so five cards in a row of four do not leave a gap on the right */
.eh-grid {
    --cols: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--eh-gap);
}

@media (min-width: 640px) {
    .eh-grid { --cols: 2; --eh-gap: 16px; }
}

@media (min-width: 960px) {
    .eh-grid { --cols: 3; }
}

@media (min-width: 1240px) {
    .eh-grid { --cols: 4; }
}

/* ---------- a tradition's card: on a phone a row (medallion, words), from 640px a tile ---------- */
.eh-card {
    position: relative;
    flex: 0 0 calc((100% - (var(--cols) - 1) * var(--eh-gap)) / var(--cols));
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(var(--tint), 0.17), transparent 62%),
        linear-gradient(135deg, rgba(8, 10, 7, 0.8), rgba(8, 10, 7, 0.62));
    border: 1px solid var(--wc-hairline);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(10px) saturate(125%);
    backdrop-filter: blur(10px) saturate(125%);
    text-align: left;
    color: var(--wc-cream);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.eh-card:active {
    transform: scale(0.985);
}

@media (hover: hover) {
    .eh-card:hover {
        transform: translateY(-4px);
        border-color: rgba(255, 215, 0, 0.7);
        box-shadow: 0 18px 38px rgba(0, 0, 0, 0.6), 0 0 30px rgba(var(--tint), 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .eh-card:hover .eh-go {
        color: #1a0f2a;
        background: var(--wc-gold);
        border-color: var(--wc-gold);
    }
}

.eh-medal {
    flex: none;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    background: radial-gradient(circle at 35% 30%, rgba(var(--tint), 0.38), rgba(8, 10, 7, 0.86) 72%);
    border: 1px solid rgba(var(--tint), 0.7);
    box-shadow: 0 0 0 4px rgba(var(--tint), 0.09), 0 0 22px rgba(var(--tint), 0.35);
}

.eh-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.eh-card-name {
    font-family: var(--wc-serif);
    font-size: 19px;
    line-height: 1.15;
    color: var(--wc-cream);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.eh-card-desc {
    margin-top: 6px;
    font-family: var(--wc-mono);
    font-size: 10px;
    line-height: 1.55;
    letter-spacing: 0.5px;
    color: var(--wc-label);
}

.eh-card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    font-family: var(--wc-mono);
}

.eh-count {
    font-weight: 700;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: var(--wc-gold);
    text-shadow: 0 0 10px rgba(255, 196, 80, 0.4);
}

.eh-count-label {
    font-size: 9.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--wc-label);
}

.eh-go {
    margin-left: auto;
    flex: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.5);
    font-family: var(--wc-sans);
    font-size: 17px;
    line-height: 1;
    color: var(--wc-gold);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 640px) {
    .eh-card {
        flex-direction: column;
        gap: 14px;
        padding: 22px 18px 16px;
        text-align: center;
    }

    .eh-medal {
        width: 68px;
        height: 68px;
        font-size: 32px;
    }

    .eh-card-text {
        width: 100%;
        align-items: center;
    }

    .eh-card-name {
        font-size: 21px;
    }

    .eh-card-desc {
        font-size: 10.5px;
    }

    .eh-card-foot {
        width: 100%;
        margin-top: auto;
        padding-top: 12px;
        justify-content: center;
    }

    .eh-go {
        margin-left: 6px;
    }
}

/* ---------- a tradition's quotes ---------- */
.eh-group-hero {
    padding: 6px 0 24px;
    text-align: center;
}

.eh-medal-big {
    width: 84px;
    height: 84px;
    margin: 0 auto 14px;
    font-size: 40px;
}

.eh-group-name {
    font-family: var(--wc-serif);
    font-size: clamp(27px, 4.6vw, 42px);
    line-height: 1.14;
    color: var(--wc-cream);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
    text-wrap: balance;
}

.eh-group-desc {
    margin-top: 10px;
    font-family: var(--wc-mono);
    font-size: 11px;
    line-height: 1.6;
    letter-spacing: 1px;
    color: var(--wc-label);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.eh-group-count {
    display: inline-block;
    margin-top: 16px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--wc-hairline);
    background: var(--wc-glass-soft);
    font-family: var(--wc-mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--wc-gold);
}

.eh-group-count[hidden] {
    display: none;
}

.eh-quotes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--eh-gap);
}

.eh-quotes[hidden] {
    display: none;
}

@media (min-width: 720px) {
    .eh-quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 1100px) {
    .eh-quotes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.eh-quote-item {
    display: flex;
}

.eh-quote {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(8, 10, 7, 0.8), rgba(8, 10, 7, 0.64));
    border: 1px solid var(--wc-hairline);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(10px) saturate(125%);
    backdrop-filter: blur(10px) saturate(125%);
    text-align: left;
    color: var(--wc-cream);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.eh-quote:active {
    transform: scale(0.985);
}

@media (hover: hover) {
    .eh-quote:hover {
        transform: translateY(-3px);
        border-color: rgba(255, 215, 0, 0.7);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55), 0 0 24px rgba(255, 196, 80, 0.18);
    }
}

.eh-quote-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--wc-mono);
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.eh-rank {
    font-weight: 700;
    font-size: 13px;
    color: var(--wc-gold);
    text-shadow: 0 0 10px rgba(255, 196, 80, 0.35);
}

.eh-views {
    color: var(--wc-label);
}

.eh-quote-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    line-clamp: 8;
    overflow: hidden;
    font-family: var(--wc-serif);
    font-style: italic;
    font-size: 17px;
    line-height: 1.5;
    color: var(--wc-cream);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.eh-quote-author {
    margin-top: auto;
    text-align: right;
    font-family: var(--wc-mono);
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--wc-label);
}

.eh-quote-author::before {
    content: '— ';
}

/* ---------- loading, nothing yet, trouble ---------- */
.eh-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 34px 16px;
    text-align: center;
    font-family: var(--wc-serif);
    font-style: italic;
    font-size: 18px;
    line-height: 1.4;
    color: var(--wc-cream-soft);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.eh-state[hidden] {
    display: none;
}

.eh-state p {
    max-width: 34ch;
}

.eh-state-icon {
    font-size: 40px;
    line-height: 1;
}

.eh-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--wc-gold);
    animation: eh-spin 1s linear infinite;
}

.eh-retry {
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 215, 0, 0.6);
    background: var(--wc-glass);
    font-family: var(--wc-mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--wc-gold);
    transition: border-color 0.2s ease, background 0.2s ease;
}

@media (hover: hover) {
    .eh-retry:hover {
        border-color: var(--wc-gold);
        background: rgba(255, 215, 0, 0.14);
    }
}

@keyframes eh-spin {
    to { transform: rotate(360deg); }
}

/* ---------- entrance: the cards rise one after the other (--i is the card's place) ---------- */
/* backwards, not both: once it has risen, the card is free to lift on hover again */
.eh-screen.is-entering .eh-card,
.eh-screen.is-entering .eh-quote-item {
    animation: eh-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 45ms + 60ms);
}

@keyframes eh-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- a phone: the painting drifts behind every card and blurring it again and again is heavy,
   so the glass gets a little more body instead ---------- */
@media (max-width: 639px), (pointer: coarse) {
    .eh-card,
    .eh-quote {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .eh-card {
        background:
            radial-gradient(120% 100% at 0% 0%, rgba(var(--tint), 0.17), transparent 62%),
            linear-gradient(135deg, rgba(8, 10, 7, 0.88), rgba(8, 10, 7, 0.78));
    }

    .eh-quote {
        background: linear-gradient(135deg, rgba(8, 10, 7, 0.88), rgba(8, 10, 7, 0.78));
    }
}

/* ---------- classic look: purple glass, no painting ---------- */
.eh-root.is-classic .eh-card,
.eh-root.is-classic .eh-quote {
    background:
        radial-gradient(120% 100% at 0% 0%, rgba(var(--tint, 255, 215, 0), 0.14), transparent 62%),
        linear-gradient(135deg, rgba(42, 26, 58, 0.92), rgba(26, 15, 42, 0.92));
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.14);
}

.eh-root.is-classic .eh-group-count {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.35);
}

.eh-root.is-classic .eh-retry {
    background: rgba(255, 215, 0, 0.12);
}

.eh-root.is-classic .wc-plaque {
    display: none;
}

/* ---------- reduced motion: nothing rises, nothing lifts ---------- */
@media (prefers-reduced-motion: reduce) {
    .eh-screen.is-entering .eh-card,
    .eh-screen.is-entering .eh-quote-item {
        animation: none;
    }

    .eh-card,
    .eh-quote {
        transition: border-color 0.2s ease;
    }

    .eh-card:hover,
    .eh-quote:hover,
    .eh-card:active,
    .eh-quote:active {
        transform: none;
    }

    .eh-spinner {
        animation-duration: 2.4s;
    }
}
