/* ============================================================
   Care Container Lines — Media Center
   ============================================================ */

/* ---------------- Hero ---------------- */
.media-hero { overflow: hidden; min-height: 340px; }
.media-hero::after {           /* slow ken-burns on the banner image */
  content: "";
  position: absolute;
  inset: -6%;
  background: inherit;
  z-index: 0;
  animation: kenburns 22s ease-in-out infinite alternate;
}
.media-hero::before { z-index: 1; background: linear-gradient(100deg, rgba(10,10,10,.82) 0%, rgba(10,10,10,.5) 60%, rgba(230,74,21,.35) 100%); }
.media-hero .wrap { z-index: 3; width: 100%; }
@keyframes kenburns { from { transform: scale(1) translate(0,0); } to { transform: scale(1.12) translate(-1.5%, -1%); } }

.hero-streak {                 /* diagonal light sweep */
  position: absolute;
  top: -20%; bottom: -20%;
  width: 140px;
  left: -200px;
  background: linear-gradient(90deg, transparent, rgba(255,240,0,.28), transparent);
  transform: skewX(-20deg);
  z-index: 2;
  animation: streak 5.5s ease-in-out 1s infinite;
}
@keyframes streak { 0% { left: -200px; } 55%, 100% { left: 110%; } }

.media-hero h1 .split {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotate(2deg);
  animation: riseIn .8s cubic-bezier(.2,.8,.2,1) forwards;
}
.media-hero h1 .split:nth-child(2) { animation-delay: .15s; color: var(--ccl-yellow-bright); }
.hero-sub {
  margin: 10px 0 0;
  font-size: 18px;
  color: #f0f0f0;
  opacity: 0;
  animation: riseIn .8s .35s cubic-bezier(.2,.8,.2,1) forwards;
}
.media-hero .crumb { opacity: 0; animation: riseIn .8s .5s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes riseIn { to { opacity: 1; transform: none; } }

/* ---------------- Scroll reveal ---------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--i, 0) * 120ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------- Section ---------------- */
.media-section { background: linear-gradient(180deg, #fff 0%, var(--ccl-grey-bg) 100%); padding-bottom: 80px; }
.section-intro { margin: 16px 0 0; color: #666; }
.js .section-head .rule { transform-origin: center; transform: scaleX(0); transition: transform .9s .3s cubic-bezier(.2,.8,.2,1); }
.js .section-head.in .rule { transform: scaleX(1); }

/* ---------------- Filters ---------------- */
.media-filters {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 46px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--ccl-grey-line);
  border-radius: 40px;
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.filter-pill {                 /* sliding highlight */
  position: absolute;
  top: 0; left: 0;
  height: 0;
  width: 0;
  background: var(--ccl-orange);
  border-radius: 30px;
  transition: transform .45s cubic-bezier(.3,.9,.3,1), width .45s cubic-bezier(.3,.9,.3,1), height .45s;
  box-shadow: 0 6px 16px rgba(230,74,21,.35);
}
.filter-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--ccl-ink);
  padding: 10px 22px;
  border-radius: 30px;
  cursor: pointer;
  transition: color .3s;
}
.filter-btn em {
  font-style: normal;
  display: inline-block;
  min-width: 22px;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 20px;
  border-radius: 10px;
  background: rgba(0,0,0,.08);
  transition: background .3s;
}
.filter-btn.active { color: #fff; }
.filter-btn.active em { background: rgba(255,255,255,.25); }
.filter-btn:not(.active):hover { color: var(--ccl-orange); }
.filter-btn:focus-visible { outline: 2px solid var(--ccl-orange); outline-offset: 2px; }

/* ---------------- Grid & cards ---------------- */
.media-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
  perspective: 1200px;
}
.media-card {
  width: min(100%, 350px);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ccl-grey-line);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .35s ease, box-shadow .35s ease;
  transition-delay: calc(var(--i, 0) * 120ms), 0s, 0s;
  transform-style: preserve-3d;
  will-change: transform;
}
.media-card.in:hover { box-shadow: 0 24px 50px rgba(0,0,0,.18); }
.media-card.hide-anim { opacity: 0 !important; transform: scale(.88) translateY(20px) !important; transition: opacity .3s ease, transform .3s ease !important; transition-delay: 0s !important; }
.media-card.gone { display: none; }
.media-card.pop { animation: cardPop .6s cubic-bezier(.2,.9,.3,1.2) backwards; animation-delay: calc(var(--j, 0) * 110ms); }
@keyframes cardPop { from { opacity: 0; transform: scale(.85) translateY(30px); } to { opacity: 1; transform: none; } }

.media-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #e9edf3;
  cursor: zoom-in;
}
.media-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .5s;
}
.media-thumb:hover img { transform: scale(1.07); filter: brightness(.72); }

.ribbon {
  position: absolute;
  top: 16px; left: 0;
  z-index: 3;
  background: var(--ccl-orange);
  color: #fff;
  font-family: var(--font-head);
  font-size: 12.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 6px 16px 6px 14px;
  border-radius: 0 20px 20px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transform: translateX(-100%);
  animation: ribbonIn .7s .5s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes ribbonIn { to { transform: none; } }

.thumb-overlay {
  position: absolute; inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  opacity: 0;
  transition: opacity .35s;
}
.media-thumb:hover .thumb-overlay,
.media-thumb:focus-visible .thumb-overlay { opacity: 1; }
.zoom-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--ccl-orange);
  display: grid;
  place-items: center;
  transform: scale(.4) rotate(-90deg);
  transition: transform .5s cubic-bezier(.2,.9,.3,1.3);
  box-shadow: 0 0 0 0 rgba(255,240,0,.6);
}
.media-thumb:hover .zoom-icon { transform: none; animation: pulse 1.8s .5s infinite; }
.zoom-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.zoom-text {
  font-family: var(--font-head);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
  transform: translateY(14px);
  transition: transform .45s .05s;
}
.media-thumb:hover .zoom-text { transform: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,240,0,.55); } 100% { box-shadow: 0 0 0 22px rgba(255,240,0,0); } }

.shine {                       /* glossy sweep on hover */
  position: absolute;
  top: 0; bottom: 0; left: -80%;
  width: 50%;
  z-index: 2;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.media-thumb:hover .shine { animation: shine .9s ease; }
@keyframes shine { to { left: 140%; } }

.media-body { padding: 20px 22px 24px; position: relative; }
.media-body::before {          /* accent line grows on hover */
  content: "";
  position: absolute;
  top: 0; left: 22px;
  height: 3px; width: 44px;
  background: var(--ccl-orange);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.media-card:hover .media-body::before { width: calc(100% - 44px); }
.media-date {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--ccl-orange);
}
.media-body h3 { font-size: 20px; line-height: 1.25; margin: 6px 0 8px; }
.media-issuer { margin: 0; font-size: 14px; color: #666; line-height: 1.5; }
.media-empty { text-align: center; color: #888; margin-top: 30px; }

/* ---------------- Quote ---------------- */
.media-quote {
  position: relative;
  background: var(--ccl-ink);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.media-quote::before {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -140px; top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,74,21,.45), transparent 65%);
  animation: floaty 9s ease-in-out infinite alternate;
}
@keyframes floaty { to { transform: translate(-60px, 40px) scale(1.15); } }
.media-quote .wrap { position: relative; max-width: 860px; }
.quote-mark { width: 46px; height: 46px; fill: var(--ccl-yellow-bright); margin: 0 auto 14px; }
.media-quote blockquote {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.45;
}
.media-quote cite {
  display: block;
  margin-top: 20px;
  font-style: normal;
  color: #ffb79f;
  letter-spacing: .5px;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  color: #fff;
}
.lightbox.open { display: flex; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,10,14,.94);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .4s;
}
.lightbox.show .lb-backdrop { opacity: 1; }

.lb-top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity .4s .15s, transform .4s .15s;
}
.lightbox.show .lb-top { opacity: 1; transform: none; }
.lb-count { font-family: var(--font-head); letter-spacing: 1.5px; color: #ccc; }
.lb-actions { display: flex; gap: 10px; }
.lb-btn, .lb-nav {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .25s, transform .25s, border-color .25s;
}
.lb-btn:hover, .lb-nav:hover { background: var(--ccl-orange); border-color: var(--ccl-orange); }
.lb-btn:hover { transform: rotate(8deg) scale(1.08); }
#lbClose:hover { transform: rotate(90deg) scale(1.08); }
.lb-btn svg, .lb-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn.on { background: var(--ccl-orange); border-color: var(--ccl-orange); }

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  margin-top: -22px;
  opacity: 0;
  transition: opacity .4s .2s, background .25s, transform .25s;
}
.lb-nav.prev { left: 20px; }
.lb-nav.next { right: 20px; }
.lightbox.show .lb-nav { opacity: 1; }
.lb-nav.prev:hover { transform: translateX(-4px); }
.lb-nav.next:hover { transform: translateX(4px); }
.lightbox.single .lb-nav { display: none; }

.lb-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 70px;
  touch-action: pan-y;
}
.lb-figure {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  will-change: transform, opacity;
}
.lb-figure img {
  display: block;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  background: #fff;
  cursor: zoom-in;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
  user-select: none;
  -webkit-user-drag: none;
}
.lb-figure.zoomed img { transform: scale(2.2); cursor: zoom-out; transition: transform .35s cubic-bezier(.2,.8,.2,1), transform-origin 0s; }
.lb-figure.zoomed { z-index: 5; }
.lb-stage.zoomed { cursor: zoom-out; }
.lb-figure.swap-next { animation: swapNext .45s cubic-bezier(.2,.8,.2,1); }
.lb-figure.swap-prev { animation: swapPrev .45s cubic-bezier(.2,.8,.2,1); }
@keyframes swapNext { from { opacity: 0; transform: translateX(60px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes swapPrev { from { opacity: 0; transform: translateX(-60px) scale(.96); } to { opacity: 1; transform: none; } }

.lb-loader {
  position: absolute;
  top: 50%; left: 50%;
  width: 42px; height: 42px;
  margin: -21px 0 0 -21px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: var(--ccl-yellow-bright);
  border-radius: 50%;
  opacity: 0;
  animation: spin .8s linear infinite;
  pointer-events: none;
}
.lb-figure.loading .lb-loader { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.lb-caption {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 12px 24px 22px;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s .25s, transform .5s .25s;
}
.lightbox.show .lb-caption { opacity: 1; transform: none; }
.lb-caption h4 { color: #fff; font-size: 20px; }
.lb-caption p { margin: 4px 0 0; font-size: 14px; color: #c9ced6; line-height: 1.5; }
#lbMeta { color: var(--ccl-yellow); }
#lbDesc { display: none; max-width: 760px; margin-left: auto; margin-right: auto; font-size: 13.5px; }
@media (min-height: 940px) and (min-width: 761px) { #lbDesc { display: block; } }
.lightbox.zoomed-ui .lb-caption { opacity: 0; transform: translateY(20px); }

body.lb-lock { overflow: hidden; }

/* ---------------- Responsive ---------------- */
@media (max-width: 760px) {
  .lb-stage { padding: 0 8px; }
  .lb-nav { top: auto; bottom: 26px; margin: 0; width: 40px; height: 40px; }
  .lb-nav.prev { left: 12px; }
  .lb-nav.next { right: 12px; }
  .lb-caption { padding: 10px 62px 22px; }
  .filter-btn { padding: 9px 14px; font-size: 14px; }
  .media-filters { border-radius: 26px; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal, .media-hero h1 .split, .hero-sub, .media-hero .crumb { opacity: 1; transform: none; }
}

/* ---------------- Safety / diagnostics ---------------- */
.missing-note { display: none; position: absolute; inset: 0; z-index: 4; padding: 20px; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: #b00020; background: #fff3f3; word-break: break-all; }
.media-thumb.img-missing .missing-note { display: flex; }
.media-thumb img { position: relative; z-index: 1; }
