/* Sponsorships — 鳶色 tobi-iro, kite brown (5.6:1 on the paper, so it
   doubles as --page-ink). Used like a seal: the hanko, section numerals,
   the current section, one mark per chart. */
:root { --page-color: #95483f; }



.sp-section { scroll-margin-top: calc(var(--section-nav-h, 48px) + 20px); }

/* --- Hero: the paper on the left, the photo misting in from the right ---- */
.sp-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: clamp(560px, calc(100svh - 130px), 820px);   /* the whole hero fits the first screen */
  margin-top: -40px;          /* the photo rises to meet the masthead line */
}

.sp-hero-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  padding: 110px 28px clamp(48px, 9vh, 110px) var(--gutter);
  position: relative;
  z-index: 2;
}

.sp-hero-copy {
  grid-column: 1;
  align-self: end;
  max-width: 30rem;
  margin-left: clamp(0px, 5vw, 88px);       /* off-centre: the empty paper leads */
}

.sp-title {
  font-size: clamp(1.9rem, 3.3vw, 2.9rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 28px;
}
.sp-title [lang="ja"] { letter-spacing: 0.06em; }

.sp-hero-copy .lede { margin-bottom: 32px; font-size: 15px; }

/* Vertical page title (base.css), standing against the photo's misted edge */
.sp-hero .page-v { margin-top: 8px; }

.sp-hero-photo {
  --mist-mask: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 18%, #000 38%);
  position: relative;
  margin: 0;
  margin-left: -6%;           /* the misted edge slides under the paper column */
}
/* the photo fills its cell without setting the hero's height */
.sp-hero-photo picture { position: absolute; inset: 0; }
.sp-hero-photo img { height: 100%; }
.sp-hero-photo img { object-position: 50% 62%; }

.sp-seal {
  position: absolute;
  z-index: 3;
  left: calc(45.45% - 62px);   /* on the seam between paper and photo */
  bottom: clamp(56px, 11vh, 120px);
}

/* --- Sticky in-page nav: a plain ruled line -------------------------- */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: clamp(40px, 8vh, 96px);
}
.section-nav-list {
  display: flex;
  gap: clamp(16px, 2.2vw, 30px);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section-nav-list::-webkit-scrollbar { display: none; }
.section-nav-list a {
  display: block;
  position: relative;
  white-space: nowrap;
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.section-nav-list a:hover { color: var(--ink); }
.section-nav-list a.active { color: var(--ink); }
.section-nav-list a.active::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  background: var(--page-color);
}

.sp-body { padding-top: clamp(64px, 11vh, 130px); }
.section-intro { margin: -8px 0 clamp(32px, 5vh, 48px); }

/* --- 一 Overview -------------------------------------------------------- */
.sp-numbers-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 32px;
  margin-top: 14px;
}
.data-note, .partners-line { font-size: 12px; color: var(--muted); margin: 0; }
.partners-line a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 0.3em; }
.partners-line a:hover { color: var(--page-ink); }
.data-dot { display: none; }

/* Legacy stat cards (sponsor dashboard) — the same ledger treatment */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--page-color); border-bottom: 1px solid var(--ink); }
.stat-card { padding: 18px 20px 20px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; }
.stat-card:first-child { border-left: 0; padding-left: 0; }
.stat-value { order: -1; font-family: var(--font-mincho); font-weight: 500; font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.stat-label { font-size: 13px; color: var(--ink-soft); line-height: 1.6; flex: 1; }
.stat-period { display: block; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* --- Panels: no boxes, just a rule above -------------------------------- */
.panel { border-top: 1px solid var(--ink); padding-top: 16px; }
.panel-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 2px; }
.panel-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

/* --- 二 Audience ---------------------------------------------------------- */
.audience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.audience-side { display: grid; gap: 40px; padding-top: clamp(0px, 6vh, 64px); }   /* stepped down, not aligned */

/* Share of views: a ruled table with thin bars */
.bar-list { list-style: none; }
.bar-row {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr) 3.2em;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.bar-label { color: var(--ink); }
.bar-track { height: 3px; background: none; }
.bar-fill { display: block; height: 100%; min-width: 2px; background: var(--ink); }
.bar-row:first-child .bar-fill { background: var(--page-color); }   /* one stamp of colour: the largest share */
.bar-row.is-other .bar-fill { background: var(--rule-strong); }
.bar-row.is-other .bar-label { color: var(--muted); }
.bar-value { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--font-mincho); font-weight: 500; }

.plain-list { list-style: none; display: grid; gap: 8px; }
.plain-list li { position: relative; padding-left: 1.4em; font-size: 14px; color: var(--ink-soft); line-height: 1.8; }
.plain-list li::before { content: "・"; position: absolute; left: 0; color: var(--muted); }
.who-metric strong { font-weight: 500; color: var(--ink); }

/* Interests: run in as a line of text, not chips */
.chip-list { list-style: none; display: flex; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); line-height: 2; }
.chip-list li:not(:last-child)::after { content: "・"; color: var(--muted); margin: 0 0.35em; }

/* --- 三 What performs ------------------------------------------------------ */
.category-list { border-top: 2px solid var(--page-color); }
.category {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.6fr);
  gap: clamp(20px, 3vw, 48px);
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.category-head h3 { font-size: 1.15rem; margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.category-head p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.category-tag {                  /* a small square stamp */
  font-family: var(--font-gothic);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--page-ink);
  border: 1px solid var(--page-color);
  padding: 0 6px;
  line-height: 1.8;
}

.video-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.video { display: flex; flex-direction: column; gap: 2px; }
.video-link { display: flex; flex-direction: column; gap: 10px; }
.video-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-deep); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-title { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.6; }
.video-link:hover .video-title { color: var(--page-ink); text-decoration: underline; text-underline-offset: 0.3em; }
.video-stat { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-top: 2px; }
.video-stat-value { font-family: var(--font-mincho); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.video-published { font-size: 12px; color: var(--muted); }

.fallback-links { list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.fallback-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 0.3em; }
.fallback-links a:hover { color: var(--page-ink); }

/* --- 四 Past partnerships ---------------------------------------------------- */
.case-list { border-top: 2px solid var(--page-color); max-width: 56rem; }
.case {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 48px);
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.case-partner { font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 500; line-height: 1.3; }
.case-fields { display: grid; gap: 6px; }
.case-fields div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; }
.case-fields dt { font-size: 13px; color: var(--muted); }
.case-fields dd { font-size: 14px; color: var(--ink-soft); line-height: 1.8; }
.case-fields dd a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 0.3em; }
.case-fields dd a:hover { color: var(--page-ink); }

/* --- 五 Opportunities: the 品書き ---------------------------------------------- */
.menu-board { max-width: 46rem; }
.menu-desc { font-size: 14px; color: var(--ink-soft); margin-top: 4px; max-width: var(--measure); }
.menu-includes { font-size: 13px; color: var(--muted); margin-top: 4px; }
.menu-includes-label { color: var(--ink-soft); }
.menu-availability { font-size: 12px; color: var(--page-ink); margin-top: 4px; }
.menu-stamp {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--page-ink);
  border: 1px solid var(--page-color);
  padding: 0 5px;
  line-height: 1.8;
  transform: translateY(-2px);
}
.package-note { margin-top: 18px; }

/* --- 六 Brand fit ------------------------------------------------------------ */
.fit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.fit-list { list-style: none; border-top: 1px solid var(--ink); }
.fit-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink);
}
.fit-side { padding-top: clamp(24px, 10vh, 120px); }   /* dropped lower, off the grid */
.fit-quote { position: relative; padding: 0 1.4em; }
.fit-quote p {
  font-family: var(--font-mincho);
  font-weight: 500;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.9;
  color: var(--ink);
}
/* Japanese corner brackets as quotation marks */
.fit-quote::before, .fit-quote::after {
  position: absolute;
  font-family: var(--font-mincho);
  font-size: 1.6rem;
  color: var(--page-color);
  line-height: 1;
}
.fit-quote::before { content: "「"; left: -0.3em; top: -0.4em; }
.fit-quote::after { content: "」"; right: -0.3em; bottom: -0.2em; }
.fit-exclusions { margin-top: 28px; padding-left: 1.4em; font-size: 13px; color: var(--muted); }

/* --- 七 Why: set like dictionary entries — a headword kanji, its word, reading
   and meaning, then the reason. Two columns, the second set a half-step lower. */
.why-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 6vw, 96px);
  max-width: 62rem;
  counter-reset: why;
}
.why-item {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  grid-template-areas: "kanji word" "kanji head" "kanji text";
  column-gap: 22px;
  align-content: start;
  padding: 26px 0 30px;
  border-top: 1px solid var(--rule);
}
.why-item:nth-child(even) { transform: translateY(clamp(0px, 7vh, 72px)); }   /* staggered, like a two-column dictionary page */
.why-kanji {
  grid-area: kanji;
  display: grid;
  place-items: center;
  width: 5.2rem;
  aspect-ratio: 1;
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mincho);
  font-weight: 600;
  font-size: 3rem;
  line-height: 1;
  color: var(--ink);
  background:
    linear-gradient(var(--rule), var(--rule)) center / 1px 100% no-repeat,
    linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat;
}
.why-item:first-child .why-kanji { color: var(--page-color); border-color: var(--page-color); }   /* one stamp of colour */
.why-word { grid-area: word; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.why-word [lang="ja"] { font-family: var(--font-mincho); font-size: 15px; color: var(--ink-soft); margin-right: 6px; }
.why-gloss { font-style: italic; }
.why-item h3 { grid-area: head; font-size: 1.12rem; margin-bottom: 4px; }
.why-text { grid-area: text; font-size: 14px; line-height: 1.9; }

@media (max-width: 899px) {
  .why-list { grid-template-columns: 1fr; }
  .why-item:nth-child(even) { transform: none; }
  .why-item { grid-template-columns: 4.2rem minmax(0, 1fr); column-gap: 16px; }
  .why-kanji { width: 4.2rem; font-size: 2.4rem; }
}

/* --- Charts (sponsor-charts.js) ------------------------------------------ */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-top: 48px; }
.chart-grid.has-trend { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.chart-grid > * { min-width: 0; }
.chart-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: -6px 0 12px; }
.chart-kpi { font-family: var(--font-mincho); font-size: 15px; font-weight: 600; color: var(--ink); }
.chart-kpi-sub { font-size: 13px; color: var(--muted); }
.chart-frame { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-svg:focus { outline: none; }
.chart-svg:focus-visible { outline: 2px solid var(--page-color); outline-offset: 4px; }
.chart-gridline { stroke: var(--rule); stroke-width: 1; }
.chart-axis { font-family: var(--font-gothic); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--page-color); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--page-color); fill-opacity: 0.06; stroke: none; }
.chart-cross { stroke: var(--rule-strong); stroke-width: 1; }
.chart-dot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.chart-tip {
  position: absolute; pointer-events: none; display: flex; flex-direction: column; gap: 1px;
  padding: 6px 10px; background: var(--paper-light); border: 1px solid var(--ink);
  font-size: 12px; white-space: nowrap;
}
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-family: var(--font-mincho); font-size: 14px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip span { color: var(--muted); }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--ink-soft); width: fit-content; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 0.3em; }
.chart-table-wrap { max-height: 220px; overflow-y: auto; margin-top: 8px; }
.chart-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { text-align: left; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.chart-table th:last-child, .chart-table td:last-child { text-align: right; }
.chart-table th { font-size: 12px; color: var(--muted); font-weight: 500; }

.sparkline { display: block; width: 100%; height: 30px; margin-top: 6px; overflow: visible; }
.video-trend .stat-period { margin-top: 2px; }

.mix-bar { display: flex; gap: 2px; height: 10px; margin: 4px 0 18px; background: var(--paper); }
.mix-seg { display: block; min-width: 3px; flex-basis: 0; }
.mix-legend { list-style: none; display: grid; gap: 0; }
.mix-legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.mix-key { width: 10px; height: 10px; }
.mix-label { color: var(--ink-soft); }
.mix-value { color: var(--ink); font-family: var(--font-mincho); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Age × gender (dashboard) */
.ag-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 18px; }
.ag-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ag-frame { position: relative; }
.ag-track { background: none; overflow: visible; height: 10px; }
.ag-stack { display: flex; gap: 2px; height: 100%; min-width: 4px; overflow: hidden; }
.ag-seg { display: block; flex-basis: 0; min-width: 2px; }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 1100px) {
  .category { grid-template-columns: 1fr; gap: 16px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .sp-hero { grid-template-columns: 1fr; min-height: 0; margin-top: 0; }
  .sp-hero-photo {
    --mist-mask: linear-gradient(to bottom, #000 55%, transparent 100%);
    order: -1;
    margin: 16px 0 0;
    height: min(64vh, 560px);
  }
  .sp-hero-photo img { object-position: 50% 70%; }
  .sp-hero-text {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 var(--gutter) 24px;
    margin-top: -56px;           /* text rises into the mist */
    gap: 20px;
  }
  .sp-hero-copy { margin-left: 0; align-self: start; padding-top: 8px; }
  .page-v { grid-row: 1; margin-top: 12px; }
  .page-v-ja { font-size: 24px; }
  .sp-seal { position: relative; left: auto; bottom: auto; justify-self: end; margin: 8px var(--gutter) 30px 0; width: 108px; height: 108px; }
  .sp-seal .seal-ja { font-size: 16px; }

  .audience-grid, .fit-grid { grid-template-columns: 1fr; }
  .audience-side, .fit-side { padding-top: 0; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case { grid-template-columns: 1fr; gap: 8px; }
  .chart-grid.has-trend { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { border-left: 0; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
  .stat-card:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 16px; }
}

@media (max-width: 520px) {
  .bar-row { grid-template-columns: 8.2em minmax(0, 1fr) 2.8em; gap: 10px; font-size: 13px; }
  .video-grid { grid-template-columns: 1fr; gap: 18px; }
  .video-link { flex-direction: row; align-items: flex-start; gap: 12px; }
  .video-thumb { width: 116px; flex-shrink: 0; }
  .video-stat, .video-published, .video-trend { padding-left: 128px; }
  .case-fields div { grid-template-columns: 1fr; gap: 0; }
  .menu-name, .menu-price { font-size: 1.02rem; }
}

/* Live sponsor-slot availability (from the sponsor CRM; counts only) */
.availability { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 14px; max-width: 40rem; }
.avail-title { font-family: var(--font-mincho); font-weight: 600; font-size: 1.05rem; margin-bottom: 8px; }
.avail-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.avail-item { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--rule); }
.avail-item.is-open { border-color: var(--page-color); }
.avail-month { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.avail-state { font-size: 12px; color: var(--muted); }
.avail-item.is-open .avail-state { color: var(--page-ink); font-weight: 500; }
.avail-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
