/* ============================================================
   Curse of Aethara — Lore Codex
   Load AFTER theme.css + indexStyle.css + pages.css.
   ============================================================ */

/* Hub / codex landing */
.lore-grid {
    display: grid;
    /* OLD: grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); */
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.lore-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: var(--ac-glass-bg);
    border: 1px solid var(--ac-glass-border);
    border-radius: var(--ac-radius);
    color: var(--ac-text);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.lore-card:hover {
    transform: translateY(-3px);
    border-color: var(--ac-gold);
    box-shadow: var(--ac-shadow);
    color: var(--ac-text);
}

.lore-thumb {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    line-height: 1;
    background: radial-gradient(120% 120% at 20% 10%, rgba(56,178,160,0.20), rgba(212,175,55,0.10) 60%, rgba(0,0,0,0.25));
    border-bottom: 1px solid var(--ac-glass-border);
}

.lore-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lore-card .body {
    padding: 1.1rem 1.2rem 1.3rem;
}

.lore-card h3 {
    margin: 0 0 0.4rem;
    color: var(--ac-teal);
    font-family: var(--font-display);
    letter-spacing: 0.03em;
}

.lore-card p {
    margin: 0;
    color: var(--ac-text-muted);
    font-size: 0.92rem;
}

/* Media slots (image / map / 3D) for entry pages */
.media-slot {
    margin: 0 0 1.25rem;
    border: 1px solid var(--ac-glass-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.16);
}

.media-slot:empty { display: none; }

/* Drop-in image pattern: the placeholder is the fallback layer (absolute),
   the <img> sits on top (relative) and covers it once loaded. If the image
   404s, its onerror removes it and the placeholder shows through. */
.media-slot { position: relative; }
.media-slot .media-placeholder { position: absolute; inset: 0; }
.media-slot img { position: relative; }

.media-slot img,
.media-slot model-viewer {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.media-slot--image { aspect-ratio: 16 / 9; }
.media-slot--map   { aspect-ratio: 21 / 9; }
.media-slot--3d    { aspect-ratio: 4 / 3; }

.media-placeholder {
    width: 100%;
    height: 100%;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--ac-text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border: 1px dashed var(--ac-glass-border);
    background: linear-gradient(135deg, rgba(56,178,160,0.08), rgba(212,175,55,0.06));
}

.media-placeholder .glyph { font-size: 2.2rem; line-height: 1; }

/* Inline badges for blessed vs profane */
.tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: middle;
}

.tag-blessed {
    color: #0f2b26;
    background: linear-gradient(135deg, #6ee7c8, #38b2a0);
}

.tag-profane {
    color: #1a0505;
    background: linear-gradient(135deg, #ff9a5a, #c0392b);
}

/* Entry cards on content pages */
.entry {
    margin: 1.75rem 0 2.25rem;
    padding: 1.25rem 1.25rem 1rem;
    border-left: 3px solid var(--ac-glass-border);
    border-radius: 0 var(--ac-radius) var(--ac-radius) 0;
    background: rgba(0, 0, 0, 0.14);
}

.entry h3 {
    margin: 0 0 0.35rem;
    color: var(--ac-gold);
    font-family: var(--font-display);
    letter-spacing: 0.03em;
}

.entry .sub {
    color: var(--ac-teal);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin: 0 0 0.75rem;
}

.entry .quote {
    font-style: italic;
    color: var(--ac-text);
    border-left: 2px solid var(--ac-gold);
    padding-left: 0.75rem;
    margin: 0.75rem 0;
}

.entry p,
.entry li {
    color: var(--ac-text-muted);
    font-size: 0.95rem;
}

/* Divider ornament */
.lore-divider {
    text-align: center;
    color: var(--ac-gold);
    opacity: 0.5;
    letter-spacing: 0.5em;
    margin: 0.5rem 0 1.5rem;
    user-select: none;
}

/* Breadcrumb / back link on content pages */
.lore-back {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--ac-teal);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.lore-back:hover {
    color: var(--ac-gold);
    text-shadow: 0 0 10px var(--ac-gold-glow);
}


/* ── Responsive additions (2026-11-22) ─────────────────────── */
/* Ultra-wide map slots get too thin on phones; use a taller ratio there */
@media (max-width: 600px) {
    .media-slot--map { aspect-ratio: 16 / 9; }
}
@media (max-height: 500px) and (min-width: 560px) {
    .media-placeholder { min-height: 100px; }
}
