/*
 * Historium V52 — complete titles, compact journal cards and a coherent light
 * theme. This layer intentionally follows V49–V51 so the corrections below
 * remain authoritative without disturbing playback or saved-item behavior.
 */

/* Complete documentary titles: no ellipsis or two-line clipping. */
body[data-shell-profile="public-v1"] .video-card-body :is(h2,h3){
  display: block;
  min-height: 0;
  overflow: visible;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  text-wrap: pretty;
}

/* A denser four-column journal archive on desktop. */
body[data-page="articles"] .archive-grid--article{
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 22px;
}

body[data-page="articles"] .archive-grid--article :is(h2,h3){
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.1;
}

/* Article summaries live behind a quiet information control on the cover. */
body[data-shell-profile="public-v1"] .article-card{
  position: relative;
}

body[data-shell-profile="public-v1"] .article-card-summary{
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

body[data-shell-profile="public-v1"] .article-card-summary > summary{
  list-style: none;
}

body[data-shell-profile="public-v1"] .article-card-summary > summary::-webkit-details-marker{
  display: none;
}

body[data-shell-profile="public-v1"] .article-card-summary-trigger{
  position: absolute;
  inset: 10px 58px auto auto;
  display: grid;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .48);
  color: #fff;
  background: rgba(12, 12, 12, .72);
  border-radius: var(--v51-control-radius, 8px);
  box-shadow: 0 12px 24px -18px rgba(0, 0, 0, .95);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 150ms ease, color 150ms ease, background-color 150ms ease, border-color 150ms ease;
  -webkit-backdrop-filter: blur(9px) saturate(.86);
  backdrop-filter: blur(9px) saturate(.86);
  place-items: center;
}

body[data-shell-profile="public-v1"] .article-card-summary-icon,body[data-shell-profile="public-v1"] .article-card-summary-icon svg{
  display: block;
  width: 19px;
  height: 19px;
}

body[data-shell-profile="public-v1"] .article-card-summary-icon svg{
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

body[data-shell-profile="public-v1"] .article-card-summary-panel{
  position: absolute;
  inset: 58px 10px auto auto;
  width: min(310px, calc(100% - 20px));
  max-height: calc(100% - 70px);
  padding: 14px 15px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .2);
  color: #f7f5f0;
  background: rgba(18, 18, 18, .9);
  border-radius: 9px;
  box-shadow: 0 20px 42px -20px rgba(0, 0, 0, .96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 150ms ease, visibility 150ms ease, transform 180ms cubic-bezier(.22, 1, .36, 1);
  -webkit-backdrop-filter: blur(14px) saturate(.82);
  backdrop-filter: blur(14px) saturate(.82);
}

body[data-shell-profile="public-v1"] .article-card-summary-panel p{
  margin: 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.55;
}

body[data-shell-profile="public-v1"] .article-card:is(:hover,:focus-within) > .article-card-summary .article-card-summary-trigger,body[data-shell-profile="public-v1"] .article-card-summary:is([open],:hover,:focus-within) .article-card-summary-trigger{
  opacity: 1;
  pointer-events: auto;
}

body[data-shell-profile="public-v1"] .article-card-summary-trigger:is(:hover,:focus-visible),body[data-shell-profile="public-v1"] .article-card-summary[open] .article-card-summary-trigger{
  border-color: color-mix(in srgb, var(--v51-accent, #d7a15a) 72%, #fff);
  color: #111;
  background: var(--v51-accent, #d7a15a);
}

body[data-shell-profile="public-v1"] .article-card-summary:is([open],:hover,:focus-within) .article-card-summary-panel{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

body[data-shell-profile="public-v1"] .article-card:has(> .article-card-summary:is([open],:hover,:focus-within)){
  z-index: 24;
}

/* V50 made article excerpts visible in card bodies. They now exist only in
   the cover popover, keeping every journal card compact and even. */
body[data-page="home"] .home-shelf--journal .article-card-body > p:not(.eyebrow),body[data-page="articles"] .archive-grid--article .article-card-body > p:not(.eyebrow),body[data-page="articles"] .archive-grid--article .text-link{
  display: none;
}

/* V49 deliberately forced every non-home light route back to dark variables.
   A page attribute gives this later rule enough specificity to restore one
   consistent public light palette everywhere. */
html[data-theme="light"] body[data-shell-profile="public-v1"][data-page]{
  --bg: #f3f0e8;
  --surface: #fbfaf6;
  --surface-2: #eeece5;
  --text: #111819;
  --text-soft: #344041;
  --muted: #667071;
  --line: rgba(24, 39, 40, .14);
  --line-strong: rgba(24, 39, 40, .27);
  --brand: #98611d;
  --brand-strong: #7c4d14;
  --brand-dark: #6b410f;
  --on-brand: #fff;
  color: var(--text);
  background: var(--bg);
  color-scheme: light;
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .site-shell{
  color: var(--text);
  background: var(--bg);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .entity-archive-hero{
  border-color: var(--line-strong);
  color: var(--text);
  background:
    radial-gradient(circle at 86% 10%, rgba(152, 97, 29, .12), transparent 36%),
    linear-gradient(140deg, #fbfaf6, #e9e6dc);
  box-shadow: 0 22px 48px -38px rgba(28, 43, 44, .48);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .entity-archive-hero :is(.page-title,.archive-note strong){
  color: var(--text);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .entity-archive-hero :is(.page-lead,.archive-note span,.archive-note em){
  color: var(--text-soft);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] :is(.archive-tools,.article-filters,.music-toolbar,.music-filter-panel,.music-playlist,.music-track-browser,.search-filters,.search-results-panel){
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 16px 36px -30px rgba(28, 43, 44, .46);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] :is(.archive-tools,.article-filters,.music-toolbar,.music-filter-panel,.search-filters) :is(input,select,textarea){
  border-color: var(--line-strong);
  color: var(--text);
  background: #fff;
  color-scheme: light;
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] :is(.archive-tools,.article-filters,.music-toolbar,.music-filter-panel,.search-filters) :is(input,textarea)::placeholder{
  color: rgba(17, 24, 25, .5);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] :is(.archive-tools,.article-filters,.music-toolbar,.music-filter-panel,.search-filters) :is(.button,.action,button){
  border-color: var(--line-strong);
  color: var(--text);
  background: #f7f5ef;
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] :is(.archive-tools,.article-filters,.music-toolbar,.music-filter-panel,.search-filters) :is(.button,.action,button):is(:hover,:focus-visible){
  border-color: #182021;
  color: #fff;
  background: #182021;
}

html[data-theme="light"] body[data-page="music"] .music-main .music-hero{
  border-color: var(--line-strong);
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(152, 97, 29, .12), transparent 45%),
    var(--surface);
  box-shadow: 0 20px 46px -36px rgba(27, 43, 44, .5);
}

html[data-theme="light"] body[data-page="music"] .music-main .music-hero :is(.page-title,.lead),html[data-theme="light"] body[data-page="music"] .music-main .music-hero :is(.music-library-stat,.music-library-stat span,.music-library-stat strong){
  color: var(--text);
}

html[data-theme="light"] body[data-page="music"] .music-main .music-hero .lead{
  color: var(--muted);
}

html[data-theme="light"] body[data-page="music"] .music-main .music-hero-visual::before{
  background:
    linear-gradient(90deg, var(--surface) 0, rgba(251, 250, 246, .72) 18%, transparent 55%),
    linear-gradient(0deg, rgba(251, 250, 246, .72), transparent 62%);
}

html[data-theme="light"] body[data-page="music"] .music-main .music-hero-filmstrip{
  background: #deddd6;
}

html[data-theme="light"] body[data-page="music"] .music-main .music-hero-filmstrip img{
  filter: grayscale(.74) sepia(.08) saturate(.7) contrast(1.02) brightness(.82);
}

html[data-theme="light"] body[data-page="music"] .music-main .music-visual-label{
  color: rgba(17, 24, 25, .74);
}

html[data-theme="light"] body[data-page="music"] .music-track-list .track-play-button{
  border-color: color-mix(in srgb, var(--v51-accent) 55%, var(--v51-line));
  color: var(--v51-accent);
  background: #fff;
}

html[data-theme="light"] body[data-page="music"] .music-track-list .track-play-button:is(:hover,:focus-visible),html[data-theme="light"] body[data-page="music"] .music-track-list > .music-library-track.is-current .track-play-button{
  color: #fff;
  background: #182021;
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] :is(.music-library-tabs a,.music-filter-count,.music-filter-strip-title,.music-list-head,.music-sort-link,.track-duration,.track-library-actions){
  color: var(--text-soft);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .site-footer{
  --text: #111819;
  --text-soft: #344041;
  --muted: #667071;
  --surface: #e7e5de;
  --surface-2: #deddd5;
  --line: rgba(24, 39, 40, .14);
  --line-strong: rgba(24, 39, 40, .26);
  border-block-start: 1px solid var(--line);
  color: var(--text);
  background: #e7e5de;
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .site-footer :is(a,button,p,.footer-column-title,.footer-bottom,.footer-copyright,.footer-nav a,.footer-social-links a,.footer-legal-links a,.footer-legal-links button){
  color: var(--text-soft);
}

html[data-theme="light"] body[data-shell-profile="public-v1"][data-page] .article-card-summary-panel{
  border-color: rgba(24, 39, 40, .16);
  color: #182021;
  background: rgba(251, 250, 246, .94);
  box-shadow: 0 20px 42px -22px rgba(28, 43, 44, .58);
}

@media (min-width: 900px) and (max-width: 1199px){
  body[data-page="articles"] .archive-grid--article{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 20px;
  }
}

@media (min-width: 768px) and (max-width: 899px){
  body[data-page="articles"] .archive-grid--article{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 20px;
  }
}

@media (max-width: 767px){
  body[data-page="articles"] .archive-grid--article{
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  body[data-page="articles"][data-shell-profile="public-v1"] .article-card-summary-trigger{
    inset: 8px auto auto calc(42% - 94px);
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    opacity: 1;
    pointer-events: auto;
  }

  body[data-page="home"][data-shell-profile="public-v1"] .article-card-summary-trigger{
    inset: 8px 58px auto auto;
  }

  body[data-shell-profile="public-v1"] .article-card-summary-panel{
    inset: 54px 8px auto;
    width: auto;
    max-height: none;
  }

  body[data-shell-profile="public-v1"] .article-card:has(> .article-card-summary[open]){
    overflow: visible !important;
  }
}

@media (hover: none), (pointer: coarse){
  body[data-shell-profile="public-v1"] .article-card-summary-trigger{
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce){
  body[data-shell-profile="public-v1"] .article-card-summary-trigger,body[data-shell-profile="public-v1"] .article-card-summary-panel{
    transition: none;
  }
}
