/* Hami YouTube Gallery — theme-compatible, lightweight */
.hami-yt-mount,
.hami-yt-mount--archive {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1.75rem;
  box-sizing: border-box;
}

.hami-yt {
  --hy-accent: currentColor;
  --hy-card: rgba(0, 0, 0, 0.04);
  --hy-line: rgba(0, 0, 0, 0.08);
  --hy-soft: rgba(0, 0, 0, 0.55);
  font-family: inherit;
  color: inherit;
}

.hami-yt__head {
  text-align: center;
  margin: 0 0 1.5rem;
}

.hami-yt__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 600;
}

.hami-yt__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  color: inherit;
}

.hami-yt__sub {
  margin: 0 auto;
  max-width: 36rem;
  opacity: 0.72;
  font-size: 0.95rem;
  line-height: 1.6;
}

.hami-yt__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 900px) {
  .hami-yt__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
  }
  .hami-yt[data-hami-yt="home"] .hami-yt__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.hami-yt__card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.hami-yt__media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hy-card);
  border: 1px solid var(--hy-line);
}

.hami-yt__play {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: transparent;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.hami-yt__thumb-ph {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.06), rgba(0,0,0,0.12));
}

.hami-yt__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.hami-yt__thumb.is-ready {
  opacity: 1;
}

.hami-yt__card:hover .hami-yt__thumb.is-ready {
  transform: scale(1.03);
}

.hami-yt__play-btn {
  position: relative;
  z-index: 1;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(20, 20, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.hami-yt__play:hover .hami-yt__play-btn,
.hami-yt__play:focus-visible .hami-yt__play-btn {
  transform: scale(1.05);
  background: rgba(20, 20, 20, 0.88);
}

.hami-yt__frame-wrap {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 3;
}

.hami-yt__frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hami-yt__card.is-playing .hami-yt__play,
.hami-yt__card.is-playing .hami-yt__fallback,
.hami-yt__card.is-playing .hami-yt__thumb,
.hami-yt__card.is-playing .hami-yt__thumb-ph,
.hami-yt__card.is-playing .hami-yt__play-btn {
  display: none !important;
}

.hami-yt__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.9rem;
  background: linear-gradient(160deg, rgba(18, 18, 18, 0.92), rgba(30, 30, 30, 0.95));
  color: #f5f5f5;
  z-index: 2;
}

.hami-yt__fallback-inner {
  text-align: center;
  max-width: 16rem;
}

.hami-yt__yt-icon {
  display: inline-flex;
  color: #ff3b30;
  margin-bottom: 0.5rem;
}

.hami-yt__fallback-msg {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

.hami-yt__fallback-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  opacity: 0.75;
}

.hami-yt__fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.hami-yt__retry,
.hami-yt__open {
  appearance: none;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.hami-yt__retry {
  background: #fff;
  color: #111;
}

.hami-yt__open {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.hami-yt__caption {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.hami-yt__more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.35rem;
}

.hami-yt__more {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: inherit;
  border: 1px solid var(--hy-line);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hami-yt__more:hover {
  background: var(--hy-card);
  border-color: rgba(0, 0, 0, 0.18);
}

.hami-yt__pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.hami-yt__page {
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.55rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--hy-line);
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  opacity: 0.8;
}

.hami-yt__page:hover,
.hami-yt__page.is-active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

.hami-yt-mount--archive .hami-yt {
  padding: 1.25rem 0.25rem 1.5rem;
}

@media (max-width: 640px) {
  .hami-yt__grid,
  .hami-yt[data-hami-yt="home"] .hami-yt__grid {
    grid-template-columns: 1fr;
  }
}
