/* ==========================================================================
   ポップなトップページ（3.6.0）
   方眼紙・ドット絵・太い墨線・黄色の帯。トップ（is_home）でだけ読み込む。
   ========================================================================== */

:root {
  --pop-sky: #2f9be6;
  --pop-sky-soft: #dff0fc;
  --pop-leaf: #33a463;
  --pop-leaf-soft: #e0f3e6;
  --pop-yellow: #ffd43b;
  --pop-line: 2px solid var(--ot-ink);
  --pop-paper: #f6fbff;
  --pop-grid: rgba(47, 155, 230, .16);
  --pop-red: #e5483a;
  --pop-blue: #3b82c4;
  --pop-green: #3d9a5b;
}

.ot-px { display: block; flex: none; image-rendering: pixelated; }

/* ---------- 見出し ---------- */
.ot-pop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 auto 22px; }
.ot-pop-head h2, .ot-pop-head h1 { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ot-pop-head__en {
  font-family: "Poppins OnTrails", Futura, "Century Gothic", sans-serif;
  font-weight: 700; font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: .9; letter-spacing: -.01em;
  color: var(--ot-ink);
}
.ot-pop-head__ja { font-size: .9rem; font-weight: 800; letter-spacing: .08em; }
.ot-pop-head__note {
  margin: 0; font-size: .72rem; font-weight: 700; padding: .35em .9em;
  border: var(--pop-line); border-radius: 999px; background: #fff; white-space: nowrap;
}

/* ---------- ヒーロー ---------- */
.ot-pop-hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-bottom: var(--pop-line); background: #fff;
}
.ot-pop-hero__paper {
  position: relative; overflow: hidden; min-height: 540px;
  /* 方眼紙をやめ、空色の地に等高線（3.6.7） */
  background: var(--pop-sky-soft) url("../img/contours-sky.svg") center / 960px 480px repeat;
  border-right: var(--pop-line);
}
.ot-pop-hero__paper { display: flex; align-items: center; justify-content: center; }
.ot-pop-hero__stage { position: relative; z-index: 1; width: min(94%, 560px); display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 28px 0 28px; }
.ot-pop-hero__name { margin: 0; justify-content: center; white-space: nowrap; font-size: clamp(20px, 2.1vw, 28px) !important; color: var(--ot-ink); }

/* 山の形に切り抜いた動画。マスクと輪郭線は同じ viewBox を伸縮させて重ねる */
.ot-ridge-video { position: relative; width: 100%; aspect-ratio: 5 / 8; }
.ot-ridge-video__media {
  position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  clip-path: var(--rock);
  background: var(--pop-sky-soft);
}
.ot-ridge-video__line { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ot-ridge-video__line path { fill: none; stroke: var(--ot-ink); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ot-ridge-video::before {
  /* 少しずらした墨の影で、貼ったシールのように見せる */
  content: ""; position: absolute; inset: 0; translate: 7px 7px; background: var(--ot-ink);
  clip-path: var(--rock);
}

.ot-sticker {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 70px; height: 70px;
  background: #fff; border: var(--pop-line); border-radius: 18px; box-shadow: 4px 4px 0 var(--ot-ink);
  animation: ot-bob 5s ease-in-out infinite;
}
.ot-sticker--1 { top: 28px; right: 30px; transform: rotate(9deg); border-radius: 50%; background: #fff6cc; }
.ot-sticker--2 { bottom: 34px; right: 28px; transform: rotate(-8deg); animation-delay: -1.6s; background: var(--pop-sky-soft); }
.ot-sticker--3 { top: 36px; left: 34px; transform: rotate(6deg); animation-delay: -3s; background: var(--pop-leaf-soft); }
/* 3.6.17 左下にもアイコン（PC・SP共通。右下とは高さをずらす） */
.ot-sticker--4 { bottom: 118px; left: 30px; transform: rotate(-7deg); animation-delay: -2.2s; background: #fff; }
@keyframes ot-bob { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .ot-sticker { animation: none; } }

.ot-pop-hero__slides { position: relative; overflow: hidden; min-width: 0; }
.ot-pop-hero__track {
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none;
}
.ot-pop-hero__track::-webkit-scrollbar { display: none; }
.ot-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: 520px; }
.ot-slide__image, .ot-slide__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ot-slide__image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.25)); }
.ot-slide__panel {
  position: absolute; left: 28px; right: 28px; bottom: 56px; max-width: 620px;
  background: #fff; border: var(--pop-line); box-shadow: 6px 6px 0 var(--ot-ink); padding: 18px 22px 16px;
}
.ot-slide__label { margin: 0 0 8px; font: 700 .7rem/1 "Poppins OnTrails", sans-serif; letter-spacing: .2em; display: flex; align-items: center; gap: 10px; }
.ot-slide__title { margin: 10px 0 8px; font-size: clamp(1.05rem, 2vw, 1.45rem); line-height: 1.5; font-weight: 800; }
.ot-slide__title a { text-decoration: none; color: var(--ot-ink); }
.ot-slide__title a::after { content: ""; position: absolute; inset: 0; }
.ot-slide__panel time { font: 700 .74rem/1 "Poppins OnTrails", sans-serif; color: var(--ot-muted); }
.ot-pop-hero__dots { position: absolute; right: 28px; bottom: 20px; display: flex; gap: 8px; }
.ot-pop-hero__dots button {
  width: 12px; height: 12px; padding: 0; border: var(--pop-line); border-radius: 50%; background: #fff; cursor: pointer;
}
.ot-pop-hero__dots button[aria-selected="true"] { background: var(--pop-sky); width: 30px; border-radius: 999px; }

/* ---------- ピル・NEW ---------- */
.ot-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ot-pill {
  display: inline-block; font-size: .68rem; font-weight: 800; line-height: 1; padding: .45em .9em;
  border: 1.5px solid var(--ot-ink); border-radius: 999px; background: #fff; color: var(--ot-ink); white-space: nowrap;
}
.ot-pill--cat { background: var(--pop-leaf); color: #fff; border-color: var(--pop-leaf); }
.ot-pill--tag::before { content: "#"; }
.ot-new {
  display: inline-flex; align-items: center; gap: 5px; font: 700 .68rem/1 "Poppins OnTrails", sans-serif;
  color: var(--pop-red); letter-spacing: .06em;
}
.ot-new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pop-red); }
.ot-new--dot {
  position: absolute; top: 10px; left: 10px; background: #fff; padding: .45em .8em; border: 1.5px solid var(--ot-ink); border-radius: 999px;
}

/* ---------- チップ ---------- */
.ot-chips { border-bottom: var(--pop-line); background: #fff; overflow: hidden; }
/* 左へ流れ続ける帯。同じ列を2本並べ、半分動いたら最初に戻る */
.ot-chips__track { display: flex; width: max-content; animation: ot-marquee 38s linear infinite; }
.ot-chips:hover .ot-chips__track, .ot-chips:focus-within .ot-chips__track { animation-play-state: paused; }
.ot-chips__list { display: flex; gap: 10px; margin: 0; padding: 16px 10px 16px 0; list-style: none; flex: none; }
@keyframes ot-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ot-chips { overflow-x: auto; }
  .ot-chips__track { animation: none; }
  .ot-chips__list[aria-hidden] { display: none; }
}
.ot-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px;
  border: var(--pop-line); border-radius: 999px; background: #fff; color: var(--ot-ink);
  font-size: .82rem; font-weight: 800; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ot-ease), box-shadow .15s var(--ot-ease), background .15s;
}
.ot-chip--cat { background: var(--pop-leaf-soft); }
.ot-chip:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ot-ink); background: var(--pop-sky-soft); }

/* ---------- ランキング ---------- */
.ot-ranking {
  background-color: var(--pop-sky);
  background-image: radial-gradient(rgba(255,255,255,.28) 1.4px, transparent 1.5px);
  background-size: 14px 14px;
  border-bottom: var(--pop-line); padding: 56px 0 64px;
}
.ot-ranking__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: auto auto; gap: 22px;
}
.ot-rank-card a {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: #fff; border: var(--pop-line); box-shadow: 6px 6px 0 var(--ot-ink);
  color: var(--ot-ink); text-decoration: none; transition: transform .15s var(--ot-ease), box-shadow .15s var(--ot-ease);
}
.ot-rank-card a:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ot-ink); }
.ot-rank-card--top { grid-row: span 2; }
.ot-rank-card__img { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-bottom: var(--pop-line); background: var(--ot-soft); }
.ot-rank-card__img { aspect-ratio: 16 / 9; }
.ot-rank-card--top .ot-rank-card__img { flex: 1; aspect-ratio: auto; min-height: 300px; }
.ot-rank-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ot-ease); }
.ot-rank-card a:hover img { transform: scale(1.04); }
.ot-rank-card__body { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; }
.ot-rank-card__title { font-size: .92rem; font-weight: 800; line-height: 1.6; }
.ot-rank-card--top .ot-rank-card__title { font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.55; }
.ot-rank-card__no {
  position: absolute; z-index: 2; top: -16px; left: -12px; display: grid; place-items: center;
  width: 52px; height: 52px; background: var(--ot-ink); color: #fff;
  font: 700 1.6rem/1 "Poppins OnTrails", sans-serif; border-radius: 50%; border: 3px solid #fff;
}
.ot-rank-card--top .ot-rank-card__no { width: 76px; height: 76px; font-size: 2.6rem; top: -22px; left: -18px; }
/* 1〜3位は金・銀・銅 */
.ot-rank-card:nth-child(-n+3) .ot-rank-card__no { color: var(--ot-ink); border-color: var(--ot-ink); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.ot-rank-card:nth-child(1) .ot-rank-card__no { background: linear-gradient(145deg, #fff1a8 0%, #f2c230 45%, #c9940f 100%); }
.ot-rank-card:nth-child(2) .ot-rank-card__no { background: linear-gradient(145deg, #ffffff 0%, #d3d8de 45%, #9aa2ab 100%); }
.ot-rank-card:nth-child(3) .ot-rank-card__no { background: linear-gradient(145deg, #ffd9b0 0%, #d48a4c 45%, #9c5a26 100%); }
.ot-ranking .ot-pop-head__en, .ot-ranking .ot-pop-head__ja { color: #fff; text-shadow: 3px 3px 0 var(--ot-ink); }
.ot-ranking .ot-pop-head__ja { text-shadow: none; }

/* ---------- 新着グリッド ---------- */
.ot-new-arrivals { padding: 56px 0 24px; }
.ot-pgrid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: var(--pop-line); border-left: var(--pop-line); margin: 0 auto 36px; max-width: 1600px;
}
.ot-pcard { border-right: var(--pop-line); border-bottom: var(--pop-line); background: #fff; }
.ot-pcard__link { display: flex; flex-direction: column; height: 100%; color: var(--ot-ink); text-decoration: none; }
.ot-pcard__img { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-bottom: var(--pop-line); background: var(--ot-soft); }
.ot-pcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ot-ease); }
.ot-pcard__link:hover .ot-pcard__img img { transform: scale(1.05); }
.ot-pcard__link:hover { background: var(--pop-paper); }
.ot-pcard__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 20px; flex: 1; }
.ot-pcard__title { font-size: .95rem; font-weight: 800; line-height: 1.6; }
.ot-pcard__date { margin-top: auto; font: 700 .72rem/1 "Poppins OnTrails", sans-serif; color: var(--ot-muted); }

/* ---------- 画面幅 ---------- */
@media (max-width: 1100px) {
  .ot-pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ot-ranking__list { grid-template-columns: 1fr 1fr; }
  .ot-rank-card--top { grid-column: span 2; grid-row: auto; }
  .ot-rank-card--top a { flex-direction: row; }
  .ot-rank-card--top .ot-rank-card__img { flex: 0 0 55%; aspect-ratio: 3 / 2; min-height: 0; border-bottom: 0; border-right: var(--pop-line); }
}
@media (max-width: 860px) {
  .ot-pop-hero { grid-template-columns: 1fr; }
  .ot-pop-hero__paper { min-height: 0; border-right: 0; border-bottom: var(--pop-line); }
  /* SP：岩を大きく真ん中に、メディア名はその下に1行（3.6.14） */
  .ot-pop-hero__stage { width: 100%; max-width: 520px; flex-direction: column; align-items: center; gap: 14px; padding: 26px 20px 22px; }
  .ot-pop-hero__stage .ot-ridge-video { width: min(78vw, 370px); flex: none; }
  .ot-pop-hero__name { font-size: clamp(18px, 5.4vw, 26px) !important; }
  .ot-sticker { width: 38px; height: 38px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ot-ink); }
  .ot-sticker svg { width: 22px; height: 22px; }
  .ot-sticker--1 { top: 10px; right: 10px; }
  .ot-sticker--2 { bottom: 10px; right: 12px; }
  /* 3.6.15 左にもアイコン。右（上10px・下10px）とずらして左は少し内側の高さに */
  .ot-sticker--3 { display: grid; top: 64px; left: 12px; }
  .ot-sticker--4 { display: grid; bottom: 70px; left: 10px; }
  .ot-slide { min-height: 380px; }
  .ot-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  /* 3.6.19 SP：写真を上に全部見せ、記事カードは写真の下に少し重ねて置く（カードで写真が隠れないように） */
  .ot-slide { min-height: 0; display: flex; flex-direction: column; background: var(--pop-sky-soft); }
  .ot-slide__image { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 10; flex: none; }
  .ot-slide__image::after { display: none; }
  .ot-slide__panel { position: relative; left: auto; right: auto; bottom: auto; max-width: none; margin: -22px 14px 18px; padding: 14px 16px; }
  .ot-slide__title { font-size: 1.02rem; }
  .ot-pop-hero__dots { top: 12px; bottom: auto; right: 14px; background: rgba(255,255,255,.85); padding: 6px 8px; border-radius: 999px; border: var(--pop-line); }
  .ot-ranking { padding: 40px 0 44px; }
  .ot-ranking__list { grid-template-columns: 1fr; gap: 18px; }
  .ot-rank-card--top { grid-column: auto; }
  .ot-rank-card--top a { flex-direction: column; }
  .ot-rank-card--top .ot-rank-card__img { flex: none; border-right: 0; border-bottom: var(--pop-line); }
  .ot-rank-card:not(.ot-rank-card--top) a { flex-direction: row; }
  .ot-rank-card:not(.ot-rank-card--top) .ot-rank-card__img { flex: 0 0 38%; aspect-ratio: 1 / 1; border-bottom: 0; border-right: var(--pop-line); }
  .ot-rank-card:not(.ot-rank-card--top) .ot-rank-card__body { padding: 10px 12px; gap: 6px; }
  .ot-rank-card:not(.ot-rank-card--top) .ot-rank-card__title { font-size: .84rem; }
  .ot-rank-card__no { width: 40px; height: 40px; font-size: 1.2rem; top: -12px; left: -8px; }
  .ot-rank-card--top .ot-rank-card__no { width: 60px; height: 60px; font-size: 2rem; top: -16px; left: -10px; }
  .ot-pop-head { flex-direction: column; align-items: flex-start; }
  .ot-pgrid { grid-template-columns: 1fr; }
  .ot-pcard__link { flex-direction: row; }
  .ot-pcard__img { flex: 0 0 40%; aspect-ratio: 1 / 1; border-bottom: 0; border-right: var(--pop-line); }
  .ot-pcard__body { padding: 12px 14px; gap: 8px; }
  .ot-pcard__title { font-size: .86rem; }
  .ot-new--dot { top: 6px; left: 6px; font-size: .6rem; }
}

/* 3.6.9 KV左の等高線はフッターと同じ地形（contour-surfaces.js が描く）を空色の線で */
.ot-pop-hero__paper .ot-contour-art g { stroke: var(--pop-sky); stroke-opacity: .4; }
html.ot-contours-pending .ot-pop-hero__paper { background-image: none; }
