@font-face {
  font-family: 'Noto Sans JP';
  src: url('./assets/fonts/noto-sans-jp.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  color: #182335;
  background: #fff;
  --muted: #68717d;
  --border: #dce1e7;
  --accent: #ce3027;
}

* { box-sizing: border-box; }
body { margin: 0; }
::selection { color: #182335; background: #ffe1dc; }
[hidden] { display: none !important; }
a, button, video { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, video:focus-visible {
  outline: 3px solid #234c88;
  outline-offset: 4px;
}
.skip-link { position: absolute; top: -80px; left: 16px; z-index: 3; padding: 12px; color: #fff; background: #182335; }
.skip-link:focus { top: 8px; }
.site-header { border-bottom: 1px solid var(--border); }
.header-inner {
  width: min(960px, calc(100% - 64px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
h1 { font-size: 26px; font-weight: 750; line-height: 1.4; letter-spacing: .02em; margin: 0; }
.credit { color: var(--muted); font-size: 14px; white-space: nowrap; }
.brand { color: inherit; font-size: 26px; font-weight: 750; line-height: 1.4; letter-spacing: .02em; text-decoration: none; }
.feed { width: min(960px, calc(100% - 64px)); margin: 24px auto 64px; }
.feed:focus { outline: none; }
.service-entry + .service-entry { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--border); }
.player { position: relative; background: #101318; aspect-ratio: 16 / 9; }
video { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.play-prompt {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 4px;
  padding: 12px 20px;
  background: #182335;
  color: #fff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.play-prompt:hover { background: #293c56; }
.video-error { margin: 12px 0 0; font-size: 14px; line-height: 1.7; color: #ad211c; }
.service-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-top: 20px; }
.service-copy { min-width: 0; }
h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.45; overflow-wrap: anywhere; }
.description { margin: 4px 0 0; font-size: 17px; line-height: 1.75; }
.video-note { color: var(--muted); margin: 8px 0 0; font-size: 13px; line-height: 1.6; }
.official-link {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: none;
  transition: background-color .15s ease;
}
.official-link:hover { background: #ad211c; }
.official-link:active { background: #8e1d18; }
.official-link img { flex: 0 0 auto; }
.details-link, .back-link, .site-footer a, .watch-body a, .reading-body a {
  color: #234c88;
  text-underline-offset: .22em;
  text-decoration-thickness: 1px;
}
.details-link { display: inline-block; padding: 10px 0; font-size: 14px; line-height: 1.7; }
.details-link:hover, .back-link:hover, .site-footer a:hover, .watch-body a:hover, .reading-body a:hover { color: #182335; }
.site-footer { max-width: 960px; margin: 48px auto 0; border-top: 1px solid var(--border); padding: 24px 0 32px; font-size: 13px; line-height: 1.8; }
.site-footer p { margin: 8px 0 0; color: var(--muted); }
.watch-page, .reading-page { width: min(960px, calc(100% - 64px)); margin: 24px auto 64px; }
.back-link { display: inline-block; margin: 0 0 20px; padding: 8px 0; font-size: 14px; }
.watch-page h1 { font-size: 30px; line-height: 1.5; letter-spacing: -.02em; overflow-wrap: anywhere; }
.watch-body { max-width: 740px; margin: 40px 0 0; }
.watch-body section, .reading-body section { margin-top: 36px; }
.watch-body h2, .reading-body h2 { font-size: 21px; line-height: 1.5; letter-spacing: 0; margin: 0 0 12px; }
.watch-body p, .watch-body li, .reading-body p, .reading-body li { font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.watch-body p, .reading-body p { margin: 12px 0; }
.watch-body ul, .reading-body ul { padding-left: 1.4em; margin: 12px 0; }
.watch-body li + li, .reading-body li + li { margin-top: 8px; }
.transcript-list { list-style: none; padding: 0; margin: 20px 0; }
.transcript-list li { display: flex; align-items: flex-start; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.transcript-list li + li { margin-top: 0; }
.transcript-list a { flex: 0 0 56px; padding: 5px 0; min-height: 44px; font-size: 14px; font-variant-numeric: tabular-nums; }
.transcript-list span { flex: 1; padding: 5px 0; min-width: 0; }
.watch-body dl { margin: 20px 0; }
.watch-body dt { font-size: 13px; color: var(--muted); margin: 16px 0 4px; }
.watch-body dd { margin: 0; font-size: 15px; line-height: 1.8; }
.reading-body { max-width: 740px; }
.reading-page h1 { font-size: 30px; margin-bottom: 24px; }
.watch-page:focus, .reading-page:focus { outline: none; }
.watch-article > .back-link { margin-top: 24px; }

@media (max-width: 699px) {
  .header-inner { width: auto; min-height: 56px; margin: 0 16px; gap: 12px; }
  h1 { font-size: 21px; letter-spacing: 0; }
  .brand { font-size: 21px; letter-spacing: 0; }
  .credit { font-size: 11px; }
  .feed { width: 100%; margin: 12px 0 40px; }
  .service-entry + .service-entry { margin-top: 24px; padding-top: 16px; border-top: 0; position: relative; }
  .service-entry + .service-entry::before { content: ''; position: absolute; left: 16px; right: 16px; top: 0; border-top: 1px solid var(--border); }
  .service-info { display: block; margin: 16px 16px 0; }
  h2 { font-size: 24px; line-height: 1.4; }
  .description { font-size: 14px; line-height: 1.75; margin-top: 6px; }
  .video-note { font-size: 11px; margin-top: 6px; }
  .official-link { display: flex; width: 100%; min-height: 44px; margin-top: 16px; padding: 10px 16px; font-size: 15px; }
  .video-error { margin-left: 16px; margin-right: 16px; }
  .site-footer { margin: 32px 16px 0; padding: 20px 0 28px; }
  .watch-page { width: 100%; margin: 12px 0 40px; }
  .watch-page > .back-link { margin-left: 16px; margin-bottom: 12px; }
  .watch-article > .back-link { margin-left: 16px; }
  .watch-page h1 { font-size: 24px; }
  .watch-body { margin: 32px 16px 0; }
  .watch-body h2, .reading-body h2 { font-size: 19px; }
  .watch-body p, .watch-body li, .reading-body p, .reading-body li { font-size: 15px; }
  .transcript-list li { gap: 12px; }
  .transcript-list a { flex-basis: 48px; }
  .reading-page { width: auto; margin: 20px 16px 48px; }
  .reading-page h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .official-link { transition: none; }
}

/* Homepage feed navigation. Keep the document as the scroll surface so the
   playback observer can continue to use window scroll and video rectangles. */
html.feed-document {
  --header-height: 65px;
  --entry-padding: 24px;
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--header-height);
  scroll-behavior: auto;
}

body.feed-page .site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  background: #fff;
}

body.feed-page .header-inner {
  min-height: calc(var(--header-height) - 1px);
}

body.feed-page #feed.feed {
  width: min(960px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0;
}

body.feed-page .service-entry {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: var(--entry-padding) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.feed-page .service-entry + .service-entry {
  margin-top: 0;
  padding-top: var(--entry-padding);
  border-top: 0;
}

body.feed-page .player {
  width: min(100%, max(256px, calc((100svh - var(--header-height) - var(--entry-info-height, 160px) - 2 * var(--entry-padding) - 16px) * 16 / 9)));
  flex: 0 0 auto;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-inline: auto;
}

body.feed-page .service-info {
  width: min(960px, 100%);
  margin: 16px auto 0;
}

@media (min-width: 700px) {
  body.feed-page .service-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    align-items: baseline;
  }

  body.feed-page .service-copy h2,
  body.feed-page .service-copy .description {
    grid-column: 1 / -1;
  }

  body.feed-page .service-copy .video-note {
    grid-column: 1;
    margin-top: 8px;
  }

  body.feed-page .service-copy .details-link {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    min-height: 44px;
  }
}

body.feed-page .site-footer {
  width: min(960px, calc(100% - 64px));
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  margin: 0 auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@media (max-width: 699px) {
  html.feed-document {
    --header-height: 57px;
    --entry-padding: 16px;
  }

  body.feed-page #feed.feed {
    width: 100%;
    padding-top: 0;
  }

  body.feed-page .service-entry {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    justify-content: flex-start;
  }

  body.feed-page .service-entry + .service-entry {
    padding-top: 16px;
    border-top: 0;
    position: relative;
  }

  body.feed-page .service-entry + .service-entry::before {
    content: none;
  }

  body.feed-page .player {
    max-width: none;
    height: auto;
    margin-inline: auto;
  }

  body.feed-page .service-info {
    width: auto;
    margin: 16px 16px 0;
  }

  body.feed-page .service-copy {
    display: block;
  }

  body.feed-page .site-footer {
    width: auto;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    margin: 0 16px;
  }
}
