/* 責務: SixTONES 系ページで再利用する shared plain CSS 正本を置く。
 * 責務: build-pages と Next の両方が読み、page shell の共通文法を揃える。
 * 責務: 各 page 固有 CSS を組み合わせる前段の共通文法だけを置く。 */
:root {
  color-scheme: light;
  --bg: var(--ap-color-bg, #f8fafc);
  --panel: var(--ap-color-surface, #ffffff);
  --text: var(--ap-color-text, #111827);
  --muted: var(--ap-color-muted, #4b5563);
  --accent: var(--ap-color-link, #1d4ed8);
  --border: var(--ap-color-border, #d1d5db);
  --warn-bg: #fff8e8;
  --warn-border: #d8a53a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1,
h2,
h3 {
  margin-top: 0;
}
p,
li {
  line-height: 1.7;
}
a {
  color: var(--accent);
}
.notice {
  border-left: 4px solid var(--warn-border);
  background: var(--warn-bg);
  padding: 12px;
}
.sixtones-page-title {
  color: var(--text);
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.45rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0;
}
.muted {
  color: var(--muted);
}
.error {
  color: #b74b00;
  font-weight: 700;
}
.hidden {
  display: none;
}
.status-line {
  margin: 8px 0 0;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--ap-color-surface);
  color: var(--accent);
  text-decoration: none;
  transition:
    border-color var(--ap-motion-duration-quick) var(--ap-motion-ease-standard),
    background-color var(--ap-motion-duration-quick) var(--ap-motion-ease-standard),
    color var(--ap-motion-duration-quick) var(--ap-motion-ease-standard),
    box-shadow var(--ap-motion-duration-quick) var(--ap-motion-ease-standard),
    transform var(--ap-motion-duration-quick) var(--ap-motion-ease-standard);
}
.cta-primary {
  background: var(--accent);
  color: #ffffff;
}
@media (hover: hover) and (pointer: fine) {
  .cta:hover {
    border-color: #b8c2cf;
    background: var(--ap-color-surface-muted);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
  }
  .cta-primary:hover {
    border-color: #0f6b64;
    background: #0f7b72;
  }
}
.cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .cta:hover {
    transform: none;
  }
}
.empty-note,
.error-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--ap-color-surface-muted);
}
.error-note {
  border-color: #edc274;
  background: #fffaf0;
}


/* 責務: `/sixtones/videos/` と `/sixtones/` の YouTube 一覧 UI を共通化する。
 * 責務: 保存済み YouTube 動画のカード・グリッド・状態表示だけをここに集約する。
 * 責務: YouTube の代替 UI に寄りすぎず、一次リンク導線として読みやすい見た目に留める。 */
.sixtones-videos-page {
  padding-top: 0;
}

.youtube-video-stack,
.youtube-video-state-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.youtube-video-toolbar,
.youtube-video-footer {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.youtube-video-grid {
  display: grid;
  gap: 16px;
}

.youtube-video-grid-shell-latest {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  min-width: 0;
  margin-inline-start: calc(var(--ap-space-page-x) * -1);
  margin-inline-end: 0;
  padding-inline-start: var(--ap-space-page-x);
  padding-inline-end: 0;
  overscroll-behavior-x: contain;
}

/* latest は横一列を保ちながら、要素自身の実幅が内容に引っ張られて
 * 極端に巨大化しないよう、列方向の自動配置で幅を閉じる。 */
.youtube-video-grid-latest {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(320px, calc(100vw - 56px));
  gap: 16px;
  align-items: start;
  justify-content: start;
}

.youtube-video-grid-latest .youtube-video-card {
  width: 100%;
  align-self: start;
}

.youtube-video-grid-shell-archive {
  overflow: visible;
}

.youtube-video-grid-archive {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.youtube-video-card {
  gap: 14px;
  padding: 0;
  overflow: hidden;
  align-content: start;
}

.youtube-video-thumbnail-link {
  display: block;
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 56.25%;
  overflow: hidden;
  background: #e5e7eb;
}

.youtube-video-thumbnail {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e5e7eb;
}

.youtube-video-thumbnail-overlay {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 12px;
  padding: 10px 12px 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.56) 0%, rgba(17, 24, 39, 0.24) 48%, rgba(17, 24, 39, 0) 100%);
  color: #ffffff;
  pointer-events: none;
}

.youtube-video-thumbnail-badge {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(17, 24, 39, 0.82);
  color: #ffffff;
}

.youtube-video-thumbnail-date-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: rgba(255, 255, 255, 0.94);
  font-size: var(--ap-font-size-helper-compact);
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(17, 24, 39, 0.35);
  white-space: nowrap;
}

.youtube-video-card-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 0 16px 16px;
}

.youtube-video-kind-badge {
  color: var(--ap-color-text);
  background: #eef2ff;
  border-color: #c7d2fe;
}

.youtube-video-title {
  margin: 0;
}

.youtube-video-title-link {
  color: inherit;
  text-decoration: none;
}

.youtube-video-title-link:hover,
.youtube-video-title-link:focus-visible {
  color: var(--ap-color-link);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.youtube-video-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.youtube-video-metrics div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--ap-color-border);
  border-radius: var(--ap-radius-ui);
  background: var(--ap-color-surface-muted);
}

.youtube-video-metrics dt {
  color: var(--ap-color-muted);
  font-size: var(--ap-font-size-helper-compact);
  line-height: var(--ap-line-height-helper);
}

.youtube-video-metrics dd {
  margin: 0;
  color: var(--ap-color-text);
  font-size: 1rem;
  font-weight: var(--ap-font-weight-semibold);
  line-height: 1.4;
}

.youtube-video-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}

.youtube-video-pagination-current {
  color: var(--ap-color-muted);
  font-size: var(--ap-font-size-helper);
  line-height: var(--ap-line-height-helper);
}

.youtube-video-pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.youtube-video-pagination-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--ap-color-divider);
  border-radius: var(--ap-radius-ui);
  color: #9ca3af;
  background: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .youtube-video-card-body {
    padding: 0 14px 14px;
  }

  .youtube-video-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .youtube-video-pagination {
    align-items: stretch;
  }

  .youtube-video-pagination-links {
    width: 100%;
  }

  .youtube-video-pagination-links > * {
    flex: 1 1 0;
  }
}