/* Detail rozprávky – čitateľský layout */
.story { --st-accent: var(--l-accent, #24499b); --st-ink: #26262b; --st-muted: #6b6f7a; --st-line: #e6e8ee; --st-soft: #f4f6fb;
  max-width: 44rem; margin: 0 auto; padding: 2.25rem 0 3rem; }

/* Hlavička */
.story-kicker { margin: 0 0 .6rem; font: 600 .8rem/1.2 'Qanelas-Soft Semibold', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--st-accent); }
.story-title { margin: 0 0 1rem; font-size: clamp(2.1rem, 5.5vw, 3.1rem); line-height: 1.1; letter-spacing: -.01em; color: var(--st-ink); }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.4rem; }
.story-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border: 1px solid var(--st-line); border-radius: 999px;
  background: #fff; color: var(--st-muted); font: 600 .85rem/1.3 'Qanelas-Soft Semibold', sans-serif; }
button.story-chip { cursor: pointer; }
button.story-chip:hover, button.story-chip[aria-expanded="true"] { border-color: var(--st-accent); color: var(--st-accent); }
.story-chip__hint { font-weight: 400; opacity: .7; text-decoration: underline dotted; }
.story-fav { display: inline-flex; align-items: center; }

.story-lead { margin: 0 0 1.1rem; font-size: 1.3rem; line-height: 1.55; color: var(--st-ink); font-weight: 600; }
.story-moral { margin: 0 0 1.2rem; padding: 1rem 1.25rem; border-left: 4px solid var(--st-accent); background: var(--st-soft); border-radius: 0 10px 10px 0; }
.story-moral__label { display: block; margin-bottom: .2rem; font: 600 .75rem/1.2 'Qanelas-Soft Semibold', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--st-accent); }
.story-moral p { margin: 0; font-size: 1.1rem; line-height: 1.55; font-style: italic; color: var(--st-ink); }

.story-tags { display: grid; gap: .5rem; margin-bottom: 1.8rem; }
.story-tags__row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.story-tags__label { min-width: 4.2rem; font: 600 .75rem/1 'Qanelas-Soft Semibold', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--st-muted); }
.story-tag { padding: .2rem .7rem; border-radius: 999px; background: var(--st-soft); color: var(--st-accent); font-size: .9rem; line-height: 1.4; text-decoration: none; }
.story-tag:hover { background: var(--st-accent); color: #fff; text-decoration: none; }

/* Popover s vekom */
.age-badge-wrapper { position: relative; display: inline-block; }
.trigger-popover { position: absolute; z-index: 50; top: calc(100% + 8px); left: 0; width: min(22rem, calc(100vw - 2rem)); padding: 1rem 1.1rem;
  background: #fff; border: 1px solid var(--st-line); border-radius: 12px; box-shadow: 0 10px 30px rgba(20,25,50,.18); font-family: 'Source Serif Pro', serif; }
.trigger-popover[hidden] { display: none; }
.trigger-popover__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.trigger-popover__close { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--st-muted); cursor: pointer; }
.trigger-popover__why { margin: 0 0 .8rem; font-size: .95rem; line-height: 1.5; color: var(--st-ink); }
.trigger-popover__list { padding-top: .8rem; border-top: 1px solid var(--st-line); font-size: .9rem; }
.trigger-row { margin-top: .6rem; }
.trigger-row__label { display: flex; justify-content: space-between; margin-bottom: 3px; font-size: .85rem; }
.trigger-row__label span:first-child::first-letter { text-transform: uppercase; }
.trigger-row__label span:last-child { font-weight: 700; }
.trigger-row__bar { height: 7px; border-radius: 4px; background: #e9ecef; overflow: hidden; }
.trigger-row__bar i { display: block; height: 100%; }
.lvl-0 { background: #a8e6cf; } .lvl-1 { background: #ffc107; } .lvl-2 { background: #ff9800; } .lvl-3 { background: #f44336; }

/* Záložky ako segmentový prepínač */
.story-tabs { display: inline-flex; gap: 2px; margin: 0 0 1.6rem; padding: 4px; border: 0 !important; background: var(--st-soft); border-radius: 12px; }
.story-tabs .nav-item { margin: 0; float: none; }
.story-tabs .nav-link { display: flex; align-items: center; gap: .35rem; padding: .5rem 1rem; border: 0 !important; border-radius: 9px; background: transparent;
  font: 600 .95rem/1.2 'Qanelas-Soft Semibold', sans-serif; color: var(--st-muted); }
.story-tabs .nav-link small { font-weight: 400; opacity: .8; }
.story-tabs .nav-link:hover { color: var(--st-ink); }
.story-tabs .nav-link.active { background: #fff !important; color: var(--st-accent) !important; box-shadow: 0 1px 4px rgba(20,25,50,.14); }

/* Čítanie */
.story-body { padding-top: 0 !important; }
.story-text { font-size: 1.25rem; line-height: 1.8; color: var(--st-ink); hyphens: auto; }
.story-text p { margin: 0 0 1.25em; }
.story-text sup a { text-decoration: none; color: var(--st-accent); font-size: .75em; }
.story-text .story-source-note { margin-bottom: 1.8rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--st-line); font-size: 1rem; line-height: 1.6; color: var(--st-muted); }
.story-text .story-source-note + p::first-letter { float: left; margin: .08em .1em 0 0; font: 700 3.6em/.8 'Qanelas-Soft Heavy', sans-serif; color: var(--st-accent); }
.story-text--modern > p:first-child::first-letter { float: left; margin: .08em .1em 0 0; font: 700 3.6em/.8 'Qanelas-Soft Heavy', sans-serif; color: var(--st-accent); }

.story-ai-note { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 1.6rem; padding: .7rem 1rem; border-radius: 10px; background: var(--st-soft); color: var(--st-muted); font-size: .9rem; line-height: 1.5; }
.story-ai-note .ai-icon { flex: none; margin-top: .25rem; }

/* Vysvetlivky */
.story-footnotes { margin-top: 2.5rem; padding: 1.2rem 1.4rem; border-radius: 12px; background: var(--st-soft); }
.story-footnotes h2 { margin: 0 0 .6rem; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; color: var(--st-muted); }
.story-footnotes p { margin: 0 0 .3rem; font-size: .95rem; line-height: 1.5; color: var(--st-ink); }
.story-footnotes sup a { text-decoration: none; color: var(--st-accent); font-weight: 700; }

/* Bibliografia */
.story-biblio { display: grid; gap: 1.2rem; }
.story-biblio__group { padding: 1.1rem 1.3rem; border: 1px solid var(--st-line); border-radius: 12px; }
.story-biblio__group h2 { margin: 0 0 .7rem; font-size: 1.05rem; color: var(--st-accent); }
.story-biblio dl { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: .35rem 1rem; margin: 0; font-size: .95rem; }
.story-biblio dt { color: var(--st-muted); font-weight: 400; }
.story-biblio dd { margin: 0; overflow-wrap: anywhere; }

/* Podobné rozprávky */
.story-similar { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--st-line); }
.story-similar h2 { margin: 0 0 1.1rem; font-size: 1.5rem; }
.story-similar__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .9rem; }
.story-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border: 1px solid var(--st-line); border-radius: 12px; background: #fff; color: var(--st-ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.story-card:hover { border-color: var(--st-accent); box-shadow: 0 6px 18px rgba(20,25,50,.1); transform: translateY(-2px); text-decoration: none; color: var(--st-ink); }
.story-card__title { font: 600 1.1rem/1.3 'Qanelas-Soft Semibold', sans-serif; color: var(--st-accent); }
.story-card__text { font-size: .9rem; line-height: 1.45; color: var(--st-muted); }
.story-card__meta { margin-top: auto; font-size: .8rem; color: var(--st-muted); }
.story-similar__more { margin: 1.2rem 0 0; font-size: .95rem; }

@media (max-width: 600px) {
  .story { padding-top: 1.4rem; }
  .story-text { font-size: 1.15rem; line-height: 1.75; }
  .story-lead { font-size: 1.15rem; }
  .story-biblio dl { grid-template-columns: 1fr; gap: 0; }
  .story-biblio dt { margin-top: .5rem; font-size: .8rem; }
  .story-tabs { display: flex; }
  .story-tabs .nav-item { flex: 1; }
  .story-tabs .nav-link { justify-content: center; padding: .5rem .4rem; }
  .story-tabs .nav-link small { display: none; }
}
