/* =================================================================
   TAA YouTube Media Widget  ·  youtube-media.css
   ================================================================= */

/* ── Notice ──────────────────────────────────────────────────────── */
.taa-ym-notice {
  padding: 1rem 1.25rem;
  background: #fff8e1;
  border-left: 4px solid #f9a825;
  border-radius: 4px;
  color: #555;
  font-size: .9rem;
  margin: 0;
}

/* ── Section Header ──────────────────────────────────────────────── */
.taa-ym-header {
  margin-bottom: 2rem;
}
.taa-ym-main-heading {
  margin: 0 0 .5rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
}
.taa-ym-subheading {
  margin: 0;
  opacity: .7;
  font-size: 1rem;
}

/* ── Aspect-Ratio box ────────────────────────────────────────────── */
.taa-ym-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;   /* 16:9 */
  background: #000;
  overflow: hidden;
}
.taa-ym-ratio iframe,
.taa-ym-ratio img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}

/* ── Single ──────────────────────────────────────────────────────── */
.taa-ym-single { width: 100%; }

/* ── Grid ────────────────────────────────────────────────────────── */
.taa-ym-grid {
  display: grid;
  grid-template-columns: repeat(var(--taa-cols, 3), 1fr);
  gap: 1.5rem;
}
@media (max-width: 1024px) {
  .taa-ym-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .taa-ym-grid { grid-template-columns: 1fr; }
}

/* ── Carousel ────────────────────────────────────────────────────── */
.taa-ym-carousel-wrap { position: relative; }

.taa-ym-carousel {
  display: flex;
  gap: var(--card-gap, 1.5rem);
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: .25rem;   /* prevent box-shadow clip */
}
.taa-ym-carousel::-webkit-scrollbar { display: none; }

.taa-ym-carousel .taa-ym-card {
  flex: 0 0 calc(
    (100% - (var(--taa-cols, 3) - 1) * var(--card-gap, 1.5rem))
    / var(--taa-cols, 3)
  );
  scroll-snap-align: start;
  min-width: 220px;
}

/* Nav arrows */
.taa-ym-nav {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.25rem;
}
.taa-ym-prev,
.taa-ym-next {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s;
  color: inherit;
}
.taa-ym-prev:hover,
.taa-ym-next:hover { background: currentColor; color: #fff; }
.taa-ym-prev:disabled,
.taa-ym-next:disabled { opacity: .3; cursor: not-allowed; }

/* ── Card ────────────────────────────────────────────────────────── */
.taa-ym-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.taa-ym-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0,0,0,.14);
}
.taa-ym-card-img { overflow: hidden; }
.taa-ym-card-body {
  padding: .875rem 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
}

/* clickable card cursor */
.taa-ym-lb-trigger { cursor: pointer; }

/* ── Overlay + Play Button ───────────────────────────────────────── */
.taa-ym-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.32);
  opacity: 0;
  transition: opacity .22s;
  pointer-events: none;
  z-index: 1;
}
.taa-ym-lb-trigger:hover .taa-ym-overlay,
.taa-ym-strip-item:hover .taa-ym-overlay { opacity: 1; }

.taa-ym-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}
.taa-ym-play.large { width: 68px; height: 68px; }
.taa-ym-play.small { width: 32px; height: 32px; }

/* Triangle */
.taa-ym-play::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: .5em 0 .5em .85em;
  border-color: transparent transparent transparent #fff;
  margin-left: .2em;
}

.taa-ym-play.yt    { background: #ff0000; box-shadow: 0 4px 14px rgba(255,0,0,.45); }
.taa-ym-play.white { background: rgba(255,255,255,.92); }
.taa-ym-play.white::after { border-left-color: #222; }
.taa-ym-play.brand { background: #1e6b3c; box-shadow: 0 4px 14px rgba(30,107,60,.4); }
.taa-ym-play.none  { display: none; }

.taa-ym-lb-trigger:hover .taa-ym-play,
.taa-ym-strip-item:hover .taa-ym-play { transform: scale(1.12); }

/* ── Badge ───────────────────────────────────────────────────────── */
.taa-ym-badge {
  display: inline-block;
  padding: .18em .65em;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 4px;
  background: #1e6b3c;
  color: #fff;
  align-self: flex-start;
  line-height: 1.6;
}

/* ── Title / Desc ────────────────────────────────────────────────── */
.taa-ym-title {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
}
.taa-ym-desc {
  margin: 0;
  font-size: .85rem;
  line-height: 1.55;
  opacity: .7;
}

/* ── Featured Layout ─────────────────────────────────────────────── */
.taa-ym-featured {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .taa-ym-featured { grid-template-columns: 1fr; }
}

.taa-ym-featured-main .taa-ym-ratio { border-radius: 10px; overflow: hidden; }
.taa-ym-featured-title { font-size: 1.1rem; margin-top: .75rem; }

/* Thumbnail Strip */
.taa-ym-strip {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
}
@media (max-width: 900px) {
  .taa-ym-strip {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }
}

.taa-ym-strip-item {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  cursor: pointer;
  padding: .4rem;
  border-radius: 8px;
  transition: background .18s;
}
.taa-ym-strip-item:hover { background: rgba(0,0,0,.05); }

@media (max-width: 900px) {
  .taa-ym-strip-item { flex-direction: column; min-width: 150px; }
}

.taa-ym-strip-thumb {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.taa-ym-strip-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
@media (max-width: 900px) {
  .taa-ym-strip-thumb { width: 100%; }
}

.taa-ym-strip-item .taa-ym-title {
  font-size: .8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Lightbox Modal ──────────────────────────────────────────────── */
.taa-ym-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.taa-ym-modal[hidden] { display: none !important; }

.taa-ym-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
  cursor: pointer;
}
.taa-ym-modal-inner {
  position: relative;
  width: 100%;
  max-width: 920px;
  z-index: 1;
}
.taa-ym-modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: .2rem .5rem;
  border-radius: 4px;
  transition: background .15s;
}
.taa-ym-modal-close:hover { background: rgba(255,255,255,.15); }

.taa-ym-modal-ratio {
  position: relative;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.taa-ym-modal-video {
  position: absolute;
  inset: 0;
}
.taa-ym-modal-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Entrance animation */
.taa-ym-modal:not([hidden]) .taa-ym-modal-inner {
  animation: taa-ym-in .22s ease both;
}
@keyframes taa-ym-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}