:root{
  --bg:#f6f0eb;
  --paper:#fffaf7;
  --ink:#211918;
  --muted:#766663;
  --accent:#bf7f86;
  --accent-soft:#e7bdc0;
  --line:rgba(33,25,24,.13);
  --shadow:0 28px 90px rgba(47,28,25,.13);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:Inter,Pretendard,"Noto Sans KR","Apple SD Gothic Neo","Segoe UI",Arial,sans-serif;
}
button,a{font:inherit;color:inherit}
button{cursor:pointer}
a{text-decoration:none}
.progress{position:fixed;left:0;top:0;height:3px;background:var(--accent);z-index:99;width:0}
.topbar{
  height:76px;position:sticky;top:0;z-index:50;padding:0 max(22px,calc((100vw - 1220px)/2));
  display:flex;align-items:center;gap:28px;background:rgba(246,240,235,.9);
  backdrop-filter:blur(18px);border-bottom:1px solid var(--line)
}
.brand{font-family:Georgia,serif;letter-spacing:.28em;font-size:1.25rem;white-space:nowrap}
.nav{display:flex;gap:6px;flex:1;justify-content:center}
.nav-btn,.lang-switch button,.pill{
  border:1px solid transparent;background:transparent;border-radius:999px;padding:9px 14px;font-weight:800;font-size:.76rem
}
.nav-btn.active,.nav-btn:hover{background:var(--ink);color:white}
.lang-switch{display:flex;border:1px solid var(--line);border-radius:999px;padding:3px}
.lang-switch button.active{background:var(--ink);color:white}
.hero{
  max-width:1220px;margin:auto;min-height:430px;padding:80px 22px 55px;
  display:grid;grid-template-columns:1fr 320px;gap:50px;align-items:end
}
.eyebrow{color:var(--accent);font-weight:900;font-size:.72rem;letter-spacing:.18em;margin:0 0 14px}
.hero h1,.section-head h2{font-family:Georgia,"Noto Serif KR",serif;font-weight:400;letter-spacing:-.055em}
.hero h1{font-size:clamp(3.5rem,8vw,7.4rem);line-height:.87;margin:0}
.hero-copy{max-width:620px;color:var(--muted);font-size:1.05rem;line-height:1.75;margin:28px 0 0}
.hero-card{
  background:var(--ink);color:white;border-radius:28px;padding:28px;display:flex;align-items:center;gap:14px;box-shadow:var(--shadow)
}
.hero-card small{display:block;opacity:.62;margin-top:4px;letter-spacing:.14em}
.live-dot{width:12px;height:12px;background:#5be58a;border-radius:50%;box-shadow:0 0 0 7px rgba(91,229,138,.12)}
main{max-width:1220px;margin:auto;padding:0 22px 90px}
.section-head{display:flex;align-items:end;justify-content:space-between;margin-bottom:24px}
.section-head h2{font-size:clamp(2.8rem,5vw,5rem);margin:0;line-height:.95}
.pill{border-color:var(--line);background:var(--paper)}
.feed{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:26px}
.post-card{
  overflow:hidden;background:var(--paper);border:1px solid var(--line);border-radius:28px;
  box-shadow:0 16px 48px rgba(47,28,25,.07)
}
.post-card.wide{grid-column:1/-1}
.card-head{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:18px 20px}
.identity strong{display:block}
.meta{color:var(--muted);font-size:.73rem;margin-top:4px}
.source-badge{font-size:.68rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase;border:1px solid var(--line);border-radius:999px;padding:7px 10px}
.stage{position:relative;background:#0d0c0c;overflow:hidden}
.track{display:flex;transition:transform .33s cubic-bezier(.22,1,.36,1)}
.slide{min-width:100%;height:min(68vh,720px);display:flex;align-items:center;justify-content:center;background:#0d0c0c}
.slide img,.slide video{width:100%;height:100%;object-fit:contain;display:block}
.slide video{background:#000}
.arrow{
  position:absolute;top:50%;transform:translateY(-50%);z-index:4;width:44px;height:44px;border-radius:50%;
  border:1px solid rgba(255,255,255,.28);background:rgba(0,0,0,.55);color:white;font-size:24px
}
.arrow.prev{left:12px}.arrow.next{right:12px}
.dots{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;gap:6px;z-index:4}
.dot{width:7px;height:7px;border:0;padding:0;border-radius:50%;background:rgba(255,255,255,.42)}
.dot.active{background:white;transform:scale(1.25)}
.card-body{padding:18px 20px 22px}
.card-title{font-family:Georgia,"Noto Serif KR",serif;font-size:1.7rem;margin:0 0 10px}
.caption{white-space:pre-wrap;color:var(--muted);line-height:1.6;max-height:150px;overflow:hidden}
.actions{display:flex;gap:8px;margin-top:14px}
.link{display:inline-flex;padding:9px 13px;border-radius:999px;background:var(--ink);color:white;font-size:.75rem;font-weight:800}
.youtube-card .stage{aspect-ratio:16/9}
.youtube-card .slide{height:auto;aspect-ratio:16/9}
.youtube-card .slide img{object-fit:cover}
.play{
  position:absolute;inset:0;margin:auto;width:68px;height:68px;border:0;border-radius:50%;
  background:rgba(255,255,255,.92);font-size:25px;padding-left:6px
}
.empty{padding:80px 20px;text-align:center;color:var(--muted)}
.hidden{display:none!important}
@media(max-width:820px){
  .topbar{gap:10px}.nav{overflow:auto;justify-content:flex-start}.brand{font-size:1rem}.lang-switch{margin-left:auto}
  .hero{grid-template-columns:1fr;padding-top:55px}.hero-card{display:none}
  .feed{grid-template-columns:1fr}.post-card.wide{grid-column:auto}
}
@media(max-width:560px){
  .topbar{height:auto;min-height:68px;flex-wrap:wrap;padding:10px 14px}
  .nav{order:3;width:100%}.nav-btn{white-space:nowrap}
  main{padding-left:0;padding-right:0}.section-head{padding:0 16px}
  .post-card{border-radius:0;border-left:0;border-right:0}
  .feed{gap:12px}.slide{height:66vh}
}


/* ===== v4: real homepage + gallery route ===== */
.home-nav{display:flex;gap:22px;margin-left:auto}
.home-nav a{font-size:.75rem;font-weight:850;opacity:.55}
.home-nav a.active,.home-nav a:hover{opacity:1}
.home-shell{max-width:1220px;margin:auto;padding:0 22px 90px}
.home-hero{min-height:72vh;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(330px,.75fr);gap:70px;align-items:center}
.home-hero h1{font:400 clamp(4.2rem,8.5vw,8rem)/.86 Georgia,"Noto Serif KR",serif;letter-spacing:-.065em;margin:0}
.home-copy{max-width:650px;color:var(--muted);font-size:1.08rem;line-height:1.75;margin:28px 0}
.home-primary{display:inline-flex;align-items:center;gap:16px;padding:15px 22px;border-radius:999px;background:var(--ink);color:white;font-weight:850;font-size:.8rem}
.home-panel{padding:28px;border-radius:30px;background:var(--ink);color:white;box-shadow:var(--shadow)}
.home-panel-top{display:flex;gap:12px;align-items:center;padding-bottom:22px;border-bottom:1px solid rgba(255,255,255,.13)}
.home-stat{padding:20px 0;border-bottom:1px solid rgba(255,255,255,.1)}
.home-stat:last-child{border-bottom:0;padding-bottom:0}
.home-stat strong{display:block;font:400 1.5rem Georgia,serif}
.home-stat span{display:block;margin-top:6px;font-size:.75rem;opacity:.58}
.home-links{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.home-links a{display:grid;gap:18px;padding:28px;border-right:1px solid var(--line);transition:.2s ease}
.home-links a:last-child{border-right:0}
.home-links a:hover{background:var(--paper)}
.home-links span{font-size:.65rem;color:var(--accent);font-weight:900}
.home-links strong{font:400 2rem Georgia,serif}
.home-links em{font-size:.75rem;font-style:normal;color:var(--muted)}
.gallery-shell{max-width:1220px;margin:auto;padding:58px 22px 100px}
.gallery-titlebar{margin-bottom:30px}
.gallery-titlebar h1{font:400 clamp(3.2rem,6vw,5.5rem)/.9 Georgia,"Noto Serif KR",serif;letter-spacing:-.055em;margin:0}
.subscriber-card{box-shadow:0 16px 48px rgba(191,127,134,.13)}
.subscriber-card .source-badge{border-color:#d89aa0;background:#f8e7e8}
.crown-filter{font-size:1rem}
.gallery-page .stage{min-height:240px}
.gallery-page .slide{height:min(72vh,760px)}
.gallery-page .post-card{align-self:start}
.gallery-page .story-card .card-body{display:none}
@media(max-width:820px){
  .home-hero{grid-template-columns:1fr;gap:24px;padding:55px 0}.home-panel{display:none}
  .home-links{grid-template-columns:1fr}.home-links a{border-right:0;border-bottom:1px solid var(--line)}
  .home-links a:last-child{border-bottom:0}
}


/* ===== v5 custom video controls (no progress/timeline bar) ===== */
.video-slide{position:relative}
.video-controls{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  z-index:7;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:rgba(10,10,12,.66);
  color:#fff;
  backdrop-filter:blur(14px);
  width:max-content;
  max-width:calc(100% - 28px);
}
.video-badge{
  padding:5px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.13);
  font-size:.62rem;
  font-weight:900;
  letter-spacing:.1em;
}
.video-btn{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
}
.video-btn:hover{background:rgba(255,255,255,.22)}
.video-volume{
  width:100px;
  accent-color:white;
  cursor:pointer;
}
@media(max-width:560px){
  .video-controls{left:10px;right:10px;bottom:10px}
  .video-volume{width:80px}
}


/* =========================================================
   v6 FEED
   ========================================================= */

/* Hide native browser scrollbar, replace it with the site's rail. */
html{
  scrollbar-width:none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar{
  width:0;
  height:0;
}

.scroll-rail{
  position:fixed;
  z-index:5000;
  top:82px;
  right:6px;
  bottom:8px;
  width:7px;
  border-radius:999px;
  background:rgba(33,25,24,.055);
  pointer-events:none;
}
.scroll-rail.hidden{display:none}
.scroll-thumb{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  min-height:44px;
  border-radius:999px;
  background:rgba(33,25,24,.32);
  cursor:grab;
  pointer-events:auto;
  transition:background .18s ease;
  will-change:transform;
}
.scroll-thumb:hover,
.scroll-thumb:active{
  background:rgba(191,127,134,.8);
}
.scroll-thumb:active{cursor:grabbing}

.gallery-shell{
  max-width:1480px;
}

/* Three cards per row on desktop. */
.feed{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
  align-items:start;
}
.post-card,
.post-card.wide,
.youtube-card{
  grid-column:auto;
  min-width:0;
}

/* Media should blend with the page, not sit on a black rectangle. */
.stage,
.slide,
.slide video{
  background:#eee8e3;
}
.slide img,
.slide video{
  object-fit:contain;
}
.gallery-page .slide{
  height:min(58vh,610px);
}
.gallery-page .stage{
  min-height:0;
}

/* A lighter card chrome for the denser 3-column grid. */
.post-card{
  border-radius:22px;
}
.card-head{
  padding:14px 16px;
}
.card-body{
  padding:14px 16px 17px;
}
.card-title{
  font-size:1.4rem;
}
.caption{
  font-size:.88rem;
}

/* Video indicator. */
.media-kind-badge{
  position:absolute;
  z-index:8;
  top:11px;
  left:11px;
  padding:6px 9px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(18,18,20,.68);
  color:white;
  font-size:.58rem;
  font-weight:900;
  letter-spacing:.1em;
  backdrop-filter:blur(10px);
  pointer-events:none;
}

/* Big play appears only while paused. */
.video-center-play{
  position:absolute;
  z-index:8;
  inset:50% auto auto 50%;
  width:58px;
  height:58px;
  transform:translate(-50%,-50%) scale(.9);
  display:grid;
  place-items:center;
  padding:0 0 0 4px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:50%;
  background:rgba(18,18,20,.64);
  color:#fff;
  font-size:20px;
  opacity:0;
  pointer-events:none;
  backdrop-filter:blur(12px);
  transition:opacity .18s ease,transform .18s ease;
}
.video-center-play.show{
  opacity:1;
  transform:translate(-50%,-50%) scale(1);
  pointer-events:auto;
}

/* Only the speaker stays in the corner. */
.video-audio{
  position:absolute;
  z-index:9;
  right:11px;
  bottom:11px;
  display:flex;
  align-items:center;
  flex-direction:row-reverse;
  gap:7px;
}
.video-mute{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(255,255,255,.22);
  border-radius:50%;
  background:rgba(18,18,20,.67);
  color:white;
  cursor:pointer;
  backdrop-filter:blur(10px);
}
.video-volume-popover{
  width:0;
  overflow:hidden;
  opacity:0;
  transform:translateX(8px);
  transition:width .2s ease,opacity .16s ease,transform .2s ease;
  pointer-events:none;
}
.video-audio:hover .video-volume-popover,
.video-audio:focus-within .video-volume-popover{
  width:102px;
  opacity:1;
  transform:none;
  pointer-events:auto;
}
.video-volume{
  display:block;
  width:94px;
  margin:0 4px;
  accent-color:white;
  cursor:pointer;
}

/* Remove v5 old control bar if cached CSS remains. */
.video-controls{
  display:none!important;
}

/* Carousel arrows stay compact. */
.arrow{
  width:38px;
  height:38px;
  font-size:21px;
}

/* Infinite-feed loader. */
.load-sentinel{
  min-height:92px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}
.load-sentinel span{
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--accent);
  opacity:.16;
}
.load-sentinel.loading span{
  animation:feedPulse .85s infinite alternate;
}
.load-sentinel.loading span:nth-child(2){animation-delay:.14s}
.load-sentinel.loading span:nth-child(3){animation-delay:.28s}
.load-sentinel.done{
  min-height:28px;
}
.load-sentinel.done span{
  display:none;
}
@keyframes feedPulse{
  from{opacity:.18;transform:translateY(0)}
  to{opacity:1;transform:translateY(-5px)}
}

@media(max-width:1120px){
  .feed{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:650px){
  .feed{
    grid-template-columns:1fr;
  }
  .gallery-shell{
    padding-left:0;
    padding-right:0;
  }
  .gallery-titlebar{
    padding-left:16px;
    padding-right:16px;
  }
  .post-card{
    border-radius:0;
  }
  .gallery-page .slide{
    height:min(70vh,680px);
  }
  .scroll-rail{
    right:3px;
    width:4px;
  }
}


/* =========================================================
   v7 - AMBILIGHT / MULTI VIDEO / CLEAN LANGUAGE SWITCH
   ========================================================= */

.lang-switch{
  cursor:pointer;
  user-select:none;
}
.lang-switch button{
  pointer-events:none;
}

/* Remove the little language line below username. */
.identity .meta{
  display:none!important;
}

/* Media canvas can glow instead of using a flat background. */
.stage{
  background:transparent!important;
}
.slide{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  background:#eee8e3!important;
}
.slide > img,
.slide > video{
  position:relative;
  z-index:2;
}
.ambilight{
  position:absolute;
  z-index:0;
  inset:-11%;
  overflow:hidden;
  opacity:.52;
  pointer-events:none;
}
.ambilight img,
.ambilight video{
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scale(1.08);
  filter:blur(34px) saturate(1.45) brightness(.9);
}
.slide::after{
  position:absolute;
  z-index:1;
  inset:0;
  content:"";
  background:rgba(246,240,235,.10);
  pointer-events:none;
}

/* No VIDEO text badge. */
.media-kind-badge{
  display:none!important;
}

/* Play button becomes the visual video indicator. */
.video-center-play{
  width:62px;
  height:62px;
  background:rgba(18,18,20,.63);
  box-shadow:0 8px 35px rgba(0,0,0,.28);
}

/* Audio control must always be clickable. */
.video-audio{
  pointer-events:auto;
}
.video-mute,
.video-volume-popover,
.video-volume{
  pointer-events:auto;
}
.video-mute{
  z-index:12;
}

/* Dark summary rows on Home are now real interactive links. */
.home-stat-link{
  cursor:pointer;
  transition:opacity .18s ease,transform .18s ease;
}
.home-stat-link:hover{
  opacity:.82;
  transform:translateX(4px);
}


/* =========================================================
   v7.2 - stronger ambilight + smoother media feed
   ========================================================= */

.slide{
  background:#ece5df!important;
}

/* Stronger overall glow. */
.ambilight{
  inset:-18%;
  opacity:.82;
}

.ambilight img,
.ambilight video{
  transform:scale(1.22);
  filter:
    blur(24px)
    saturate(2.15)
    contrast(1.10)
    brightness(.96);
}

/* Video needs a little more punch because moving frames blur visually. */
.video-slide .ambilight{
  opacity:.92;
}

.video-slide .ambilight video{
  transform:scale(1.28);
  filter:
    blur(20px)
    saturate(2.35)
    contrast(1.13)
    brightness(.93);
}

/* Make the center media crisp over the glow. */
.slide > img,
.slide > video{
  box-shadow:0 0 0 1px rgba(255,255,255,.02);
}

/* Do not wash out the glow too much. */
.slide::after{
  background:rgba(246,240,235,.035)!important;
}

/* Slight fade on media load so appended cards feel natural,
   without rebuilding earlier cards. */
.post-card{
  animation:cardIn .22s ease-out both;
}

@keyframes cardIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:none}
}


/* =========================================================
   v7.3 - sampled ambilight + expandable captions
   ========================================================= */

.slide{
  --amb-left: rgba(191,127,134,.52);
  --amb-right: rgba(120,145,170,.45);
  --amb-top: rgba(230,190,155,.34);
  --amb-bottom: rgba(125,105,135,.30);
}

/* Dynamic multi-zone color layer sampled from the actual image/video. */
.slide::before{
  position:absolute;
  z-index:0;
  inset:-10%;
  content:"";
  pointer-events:none;
  background:
    radial-gradient(circle at 8% 52%, var(--amb-left) 0, transparent 46%),
    radial-gradient(circle at 92% 48%, var(--amb-right) 0, transparent 46%),
    radial-gradient(circle at 50% 5%, var(--amb-top) 0, transparent 42%),
    radial-gradient(circle at 52% 95%, var(--amb-bottom) 0, transparent 43%);
  filter:blur(15px) saturate(1.55);
  transform:scale(1.08);
  opacity:.98;
}

/* Keep blurred duplicate only as texture/fallback; sampled colors do the heavy lifting. */
.ambilight{
  opacity:.34!important;
  filter:saturate(1.25);
}
.video-slide .ambilight{
  opacity:.42!important;
}
.ambient-sampled .ambilight{
  opacity:.22!important;
}
.video-slide.ambient-sampled .ambilight{
  opacity:.28!important;
}

/* Ensure the actual media sits above both ambient layers. */
.slide > img,
.slide > video{
  z-index:3!important;
}
.slide::after{
  z-index:2!important;
}

/* Instagram-like caption collapse. */
.caption-wrap{
  position:relative;
}
.caption{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  line-clamp:3;
  max-height:none!important;
  overflow:hidden;
  white-space:pre-wrap;
}
.caption-wrap.expanded .caption{
  display:block;
  -webkit-line-clamp:unset;
  line-clamp:unset;
  overflow:visible;
}
.caption-toggle{
  margin-top:7px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:.8rem;
  font-weight:750;
  cursor:pointer;
}
.caption-toggle:hover{
  color:var(--ink);
}
.caption-toggle[hidden]{
  display:none!important;
}


/* =========================================================
   v7.4 - same-origin Discord proxy + video ambient fallback
   ========================================================= */

/* Video no longer loads a second hidden MP4.
   Its sampled CSS gradients provide the live ambilight. */
.video-slide .ambilight{
  background:
    radial-gradient(circle at 20% 50%, var(--amb-left), transparent 54%),
    radial-gradient(circle at 80% 50%, var(--amb-right), transparent 54%),
    radial-gradient(circle at 50% 15%, var(--amb-top), transparent 48%),
    radial-gradient(circle at 50% 85%, var(--amb-bottom), transparent 48%);
  filter:blur(22px) saturate(1.7);
  transform:scale(1.18);
  opacity:.78!important;
}

.video-slide.ambient-sampled .ambilight{
  opacity:.9!important;
}


/* =========================================================
   v7.5 - guaranteed video canvas ambilight + uniform captions
   ========================================================= */

/* The canvas contains actual current video frames. */
.video-slide .ambilight{
  inset:-24%!important;
  opacity:.92!important;
  overflow:hidden;
  filter:none!important;
  transform:none!important;
}
.video-ambient-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scale(1.35);
  filter:
    blur(28px)
    saturate(2.45)
    contrast(1.16)
    brightness(.94);
  opacity:.96;
}
.video-slide.video-ambient-ready::before{
  opacity:.22!important;
}

/* Image ambilight stays blurred from the image itself. */
.slide:not(.video-slide) .ambilight{
  inset:-20%!important;
  opacity:.62!important;
}
.slide:not(.video-slide) .ambilight img{
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scale(1.26);
  filter:blur(25px) saturate(2.1) contrast(1.08);
}

/* Post footer/body has one collapsed height across the grid. */
.post-card:not(.youtube-card) .card-body{
  height:142px;
  min-height:142px;
  display:flex;
  flex-direction:column;
  overflow:visible;
}
.post-card:not(.youtube-card) .caption-wrap{
  min-height:49px;
  max-height:49px;
  position:relative;
  overflow:hidden;
  line-height:1.5;
  font-size:.88rem;
  color:var(--muted);
}
.post-card:not(.youtube-card) .caption-wrap.expanded{
  max-height:none;
  height:auto;
  overflow:visible;
  padding-bottom:4px;
}
.post-card:not(.youtube-card) .card-body:has(.caption-wrap.expanded){
  height:auto;
  min-height:142px;
}
.caption{
  display:inline!important;
  white-space:pre-wrap;
  max-height:none!important;
  overflow:visible!important;
  color:inherit;
  line-height:inherit;
}
.caption-toggle{
  display:inline!important;
  margin:0 0 0 5px!important;
  padding:0!important;
  border:0;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.caption-toggle[hidden]{
  display:none!important;
}
.caption-spacer{
  visibility:hidden;
}
.post-card:not(.youtube-card) .actions{
  margin-top:auto;
  padding-top:8px;
}

/* On expanded text the card may grow, but collapsed cards align perfectly. */
.caption-wrap.expanded .caption{
  display:inline!important;
}


/* =========================================================
   v7.6 - visible video glow + real 2-line captions
   ========================================================= */

/* Reset previous experimental video canvas/gradient layers. */
.video-ambient-canvas{
  display:none!important;
}

.video-slide .ambilight{
  position:absolute!important;
  z-index:0!important;
  inset:0!important;
  overflow:hidden!important;
  opacity:1!important;
  filter:none!important;
  transform:none!important;
  background:#ddd5cf;
}

.video-ambient-copy{
  position:absolute;
  width:130%!important;
  height:130%!important;
  left:-15%;
  top:-15%;
  object-fit:cover!important;
  transform:scale(1.14)!important;
  filter:
    blur(32px)
    saturate(2.6)
    contrast(1.12)
    brightness(.92)!important;
  opacity:.92!important;
}

/* Dark/light transparent veil prevents a flat grey look while preserving colors. */
.video-slide::after{
  background:rgba(246,240,235,.04)!important;
}

/* Main video remains crisp on top. */
.video-slide > video:not(.video-ambient-copy){
  position:relative!important;
  z-index:3!important;
}

/* Exactly two caption lines in collapsed state. */
.post-card:not(.youtube-card) .card-body{
  height:136px!important;
  min-height:136px!important;
  display:flex;
  flex-direction:column;
  overflow:visible;
}

.post-card:not(.youtube-card) .caption-wrap{
  position:relative;
  display:block;
  min-height:42px!important;
  height:42px!important;
  max-height:42px!important;
  overflow:hidden!important;
  line-height:21px!important;
  color:var(--muted);
  font-size:.88rem;
  padding-right:0;
}

.post-card:not(.youtube-card) .caption{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  line-clamp:2!important;
  overflow:hidden!important;
  white-space:pre-wrap;
  line-height:21px!important;
  max-height:42px!important;
}

/* Instagram-like more label overlays the end of the second line area. */
.post-card:not(.youtube-card) .caption-toggle{
  position:absolute!important;
  right:0!important;
  bottom:0!important;
  z-index:4;
  margin:0!important;
  padding:0 0 0 18px!important;
  border:0;
  background:linear-gradient(
    90deg,
    rgba(255,250,247,0),
    var(--paper) 32%
  )!important;
  color:var(--ink)!important;
  font:inherit;
  font-weight:800!important;
  line-height:21px!important;
  cursor:pointer;
}

.post-card:not(.youtube-card) .caption-wrap.expanded{
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  padding-bottom:24px;
}

.post-card:not(.youtube-card) .caption-wrap.expanded .caption{
  display:block!important;
  max-height:none!important;
  overflow:visible!important;
  -webkit-line-clamp:unset!important;
  line-clamp:unset!important;
}

.post-card:not(.youtube-card) .caption-wrap.expanded .caption-toggle{
  bottom:0!important;
  background:var(--paper)!important;
  padding-left:6px!important;
}

.post-card:not(.youtube-card) .card-body:has(.caption-wrap.expanded){
  height:auto!important;
  min-height:136px!important;
}

.post-card:not(.youtube-card) .actions{
  margin-top:auto!important;
  padding-top:7px!important;
}


/* =========================================================
   v7.7 - final media layering cleanup
   ========================================================= */

/*
   Older revisions gave every <video> a solid background while the element
   itself fills the entire slide. That solid rectangle hid the ambilight
   even though .ambilight was correctly playing underneath it.
*/
.slide{
  background:transparent!important;
}

.stage{
  background:transparent!important;
}

.slide > .primary-media{
  position:relative!important;
  z-index:5!important;
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  display:block!important;

  /* CRITICAL: letterbox area must reveal ambilight behind the media. */
  background:transparent!important;
}

/* Override every old generic video background rule. */
.slide > video.primary-video{
  background:transparent!important;
}

/* The blurred moving copy fills the whole slide behind the main video. */
.video-slide .ambilight{
  z-index:0!important;
  inset:0!important;
  background:transparent!important;
  opacity:1!important;
}

.video-slide .ambilight .video-ambient-copy{
  position:absolute!important;
  z-index:0!important;
  left:-18%!important;
  top:-18%!important;
  width:136%!important;
  height:136%!important;
  object-fit:cover!important;
  background:transparent!important;
  transform:scale(1.10)!important;
  filter:
    blur(30px)
    saturate(2.8)
    contrast(1.16)
    brightness(.91)!important;
  opacity:.98!important;
}

/*
   Keep a slight tint over the glow only, but never enough to cover it.
*/
.video-slide::after{
  z-index:2!important;
  background:rgba(246,240,235,.025)!important;
}

/* Main controls remain above main media. */
.video-center-play,
.video-audio,
.arrow,
.dots{
  z-index:10!important;
}

/* Image glow uses the same layering principle. */
.slide:not(.video-slide) .ambilight{
  z-index:0!important;
  opacity:.72!important;
}

.slide:not(.video-slide) > .primary-image{
  background:transparent!important;
  z-index:5!important;
}


/* =========================================================
   v7.8 - real media frame + download-order tools
   ========================================================= */

.gallery-tools{
  display:flex;
  align-items:center;
  gap:8px;
}
.gallery-tools .pill{
  text-decoration:none;
}

.slide,
.stage{
  background:transparent!important;
}

/* The actual media no longer paints the whole slide rectangle. */
.media-frame{
  position:absolute;
  z-index:5;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:transparent!important;
}

.media-frame > .primary-media{
  position:relative!important;
  z-index:5!important;
  width:auto!important;
  height:auto!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  display:block!important;
  background:transparent!important;
}

/* Instagram-style vertical media: use full height, natural width. */
.media-frame > video.primary-video,
.media-frame > img.primary-image{
  height:100%!important;
  width:auto!important;
  max-width:100%!important;
}

/* Strong moving glow occupies the full card behind the smaller media frame. */
.video-slide .ambilight{
  position:absolute!important;
  z-index:0!important;
  inset:0!important;
  overflow:hidden!important;
  opacity:1!important;
  background:#d9d1ca!important;
}

.video-slide .ambilight .video-ambient-copy{
  position:absolute!important;
  left:-22%!important;
  top:-22%!important;
  width:144%!important;
  height:144%!important;
  object-fit:cover!important;
  transform:scale(1.10)!important;
  filter:
    blur(28px)
    saturate(3)
    contrast(1.18)
    brightness(.92)!important;
  opacity:1!important;
}

.video-slide,
.video-slide .media-frame,
.video-slide .primary-video{
  background:transparent!important;
}

.video-slide::after{
  z-index:2!important;
  background:rgba(246,240,235,.018)!important;
}

.video-center-play,
.video-audio,
.arrow,
.dots{
  z-index:10!important;
}

/* Image ambilight stays visible around image frame as well. */
.slide:not(.video-slide) .ambilight{
  z-index:0!important;
  opacity:.76!important;
}
