/* Stories hub (stories.html). Colours follow Bootstrap's theme variables, so the page
   works in light and dark mode; each kind of story has its own accent. */

.stories-hub {
    --sh-film: #0E7490;
    --sh-book: #7C3AED;
    --sh-series: #B45309;
    --sh-radius: 0.9rem;
    padding-block: 1rem 3rem;
}
[data-bs-theme="dark"] .stories-hub {
    --sh-film: #38BDF8;
    --sh-book: #A78BFA;
    --sh-series: #FBBF24;
}

/* ---------- hero ---------- */
.sh-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--sh-radius);
    margin-bottom: 1.75rem;
    min-height: 15rem;
    display: flex;
    align-items: flex-end;
    background: #0b1220;
}
.sh-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}
.sh-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.1) 0%, rgba(11, 18, 32, 0.85) 100%);
}
.sh-hero-text {
    position: relative;
    z-index: 1;
    padding: 2rem clamp(1.25rem, 4vw, 2.5rem);
    color: #f8fafc;
    max-width: 46rem;
}
.sh-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.4rem;
}
.sh-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.sh-lead {
    font-size: 1.05rem;
    opacity: 0.92;
    margin-bottom: 0.75rem;
}
.sh-stats {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
}

/* ---------- toolbar ---------- */
.sh-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.sh-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.sh-filter {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.875rem;
}
.sh-filter:hover { border-color: var(--bs-emphasis-color); }
.sh-filter[aria-pressed="true"] {
    background: var(--bs-emphasis-color);
    border-color: var(--bs-emphasis-color);
    color: var(--bs-body-bg);
}
.sh-tools {
    display: flex;
    gap: 0.5rem;
    flex: 1 1 18rem;
    justify-content: flex-end;
}
.sh-search { max-width: 18rem; }
.sh-sort { width: auto; }
.sh-count { margin-bottom: 0.75rem; }

/* ---------- story cards ---------- */
.sh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
}
.sh-card {
    --accent: var(--sh-film);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.1rem 1.15rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--sh-radius);
    background: var(--bs-tertiary-bg);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.sh-card[data-kind="book"] { --accent: var(--sh-book); }
.sh-card[data-kind="series"] { --accent: var(--sh-series); }
.sh-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: var(--sh-radius) 0 0 var(--sh-radius);
    background: var(--accent);
}
.sh-card:hover, .sh-card:focus-within {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
@media (prefers-reduced-motion: reduce) {
    .sh-card { transition: none; }
    .sh-card:hover, .sh-card:focus-within { transform: none; }
}
.sh-card-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.sh-ring { flex: none; color: var(--accent); }
.sh-meta {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.sh-card-title {
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.25;
    margin: 0.1rem 0 0;
}
/* The whole card opens the story; links inside (a series' books) sit above it */
.sh-card-title a {
    color: var(--bs-emphasis-color);
    text-decoration: none;
}
.sh-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--sh-radius);
}
.sh-card-title a:focus-visible { outline: none; }
.sh-card:has(.sh-card-title a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sh-by {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin: 0;
}
.sh-hook {
    font-size: 0.92rem;
    margin: 0;
    flex: 1;
}
.sh-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
    border-top: 1px solid var(--bs-border-color);
    padding-top: 0.55rem;
}
.sh-parts {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}
.sh-parts a {
    color: var(--bs-body-color);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.4rem;
}
.sh-parts a:hover, .sh-parts a:focus-visible { background: var(--bs-secondary-bg); color: var(--accent); }
.sh-parts .sh-part-year { color: var(--bs-secondary-color); flex: none; }
.sh-empty {
    text-align: center;
    color: var(--bs-secondary-color);
    padding: 2rem 0;
}

/* ---------- more, and dreams ---------- */
.sh-section { margin-top: 2.5rem; }
.sh-section-title {
    font-size: 1.25rem;
    font-weight: 650;
    margin-bottom: 0.9rem;
}
.sh-more {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
}
.sh-more a {
    display: block;
    padding: 1rem 1.15rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--sh-radius);
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    text-decoration: none;
}
.sh-more a:hover, .sh-more a:focus-visible { border-color: var(--bs-emphasis-color); }
.sh-more strong { display: block; color: var(--bs-emphasis-color); margin-bottom: 0.2rem; }
.sh-more span { font-size: 0.9rem; color: var(--bs-secondary-color); }
.sh-dreams {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.sh-dreams a {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.875rem;
}
.sh-dreams a:hover, .sh-dreams a:focus-visible { border-color: var(--bs-emphasis-color); }

@media (max-width: 575.98px) {
    .sh-tools { justify-content: stretch; }
    .sh-search { max-width: none; flex: 1; }
    .sh-hero { min-height: 13rem; }
}
