/* ==========================================================================
   スケベナビ — assets/style.css

   Concept: the 袖看板 (lit vertical shop sign) on a night street.
   Navy night, lamp-cream type, one crimson used ONLY for lit plates
   (the sign, the main button, the 18 mark). No external anything: system
   fonts only, no images, no JS.

   Contents
     1  tokens + base          7  item page
     2  sign + rail + nav      8  static pages
     3  stage + sidebar        9  empty / 404
     4  listing head           10 footer + ad slots
     5  grid + tiles           11 admin
     6  pager                  12 focus + motion
   ========================================================================== */

/* ---------------------------------------------------------------- 1 tokens */
:root {
  color-scheme: dark;

  --yoru:   #141a2c;   /* 夜   page                              */
  --sumi:   #1b2342;   /* 墨藍 wells behind photos, table heads   */
  --line:   #2b3662;   /* hairlines                               */
  --lamp:   #f1e9d6;   /* 灯   text and lamp light                */
  --kiri:   #a7afc6;   /* 霧   secondary text                     */
  --kiri-2: #8590ae;   /* 霧   tertiary text                      */
  --beni:   #c81d3a;   /* 紅   lit plates only                    */

  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic",
          "Yu Gothic UI", "Yu Gothic", "Noto Sans CJK JP", "Noto Sans JP",
          Meiryo, system-ui, sans-serif;
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "BIZ UDPMincho",
            "Noto Serif CJK JP", "Noto Serif JP", "MS PMincho", serif;

  --rail: 136px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--yoru);
  color: var(--lamp);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
small { font-size: 0.78em; color: var(--kiri); font-weight: 400; }
::selection { background: var(--beni); color: #fff; }

.skip {
  position: absolute; left: -9999px; top: 0;
}
.skip:focus {
  left: 12px; top: 12px; z-index: 20;
  padding: 8px 16px; border-radius: 4px;
  background: var(--lamp); color: var(--yoru);
}

/* ------------------------------------------------- 2 sign + rail + nav
   Mobile first: a horizontal lit plate, the 18 mark at the far right, the
   category nav as a scrolling row of chips underneath. From 900px the plate
   turns vertical (縦書き) and hangs in a sticky left rail.                    */

.rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 12px;
  padding: 14px 16px 0;
}

.sign { flex: none; display: block; }

.sign-plate {
  position: relative;
  isolation: isolate;
  display: flex;
  padding: 7px 15px 8px;
  border-radius: 6px;
  background: var(--beni);
  color: #fff7e6;
  text-shadow: 0 0 10px rgba(255, 236, 200, 0.35);
}
/* the inset hairline of an acrylic sign face */
.sign-plate::before {
  content: "";
  position: absolute; inset: 3px;
  border: 1px solid rgba(241, 233, 214, 0.5);
  border-radius: 3px;
  pointer-events: none;
}
/* the light it throws; this is the one thing that "switches on" at load */
.sign-plate::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(214, 36, 70, 0.55), 0 0 64px rgba(214, 36, 70, 0.28);
  animation: sign-on 1.2s ease-out both;
}

.sign-name {
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: 0.1em;
  padding-left: 0.1em;
  white-space: nowrap;   /* vertical text must never re-wrap with the viewport */
}
.sign-tag { display: none; white-space: nowrap; }

.mark-18 {
  order: 2;
  margin-left: auto;
  display: grid;
  place-content: center;
  width: 2.5rem; height: 2.5rem;
  border: 2px solid var(--beni);
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: var(--lamp);
}
.mark-18::after {
  content: "禁";
  display: block;
  margin-top: 2px;
  font-size: 0.55rem;
  font-weight: 700;
}

.nav { order: 3; flex-basis: 100%; min-width: 0; }
.nav ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px 16px 14px;
  margin-inline: -16px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }
.nav a {
  display: block;
  white-space: nowrap;
  padding: 6px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--kiri);
  font-size: 0.875rem;
  line-height: 1.6;
}
.nav a:hover { color: var(--lamp); border-color: var(--kiri-2); }
.nav a.is-current {
  background: var(--lamp);
  border-color: var(--lamp);
  color: var(--yoru);
  font-weight: 700;
}

/* ------------------------------------------------------ 3 stage + sidebar */
.body { min-width: 0; }
.stage { padding: 14px 16px 8px; }
.content { min-width: 0; }
.sidebar { display: none; }   /* only emitted at all when a sidebar ad is configured */

/* ----------------------------------------------------------- 4 listing head */
.listing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.page-heading {
  margin: 0;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.1rem);
  line-height: 1.35;
  letter-spacing: 0.05em;
  font-feature-settings: "palt" 1;
}
.listing-count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--kiri);
  font-variant-numeric: tabular-nums;
}
.page-desc {
  flex: 0 0 100%;          /* always its own row, whatever the viewport */
  margin: 6px 0 0;
  color: var(--kiri);
  font-size: 0.875rem;
  text-wrap: pretty;
}

/* ------------------------------------------------------------ 5 grid + tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card { min-width: 0; }

.card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  background: var(--sumi);
  overflow: hidden;
}
.card-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter 0.15s;
}
/* a hairline so dark photos do not dissolve into the night */
.card-thumb::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(241, 233, 214, 0.1);
  pointer-events: none;
}
.card:hover .card-thumb img { filter: brightness(1.1); }

.card-dur {
  position: absolute; right: 5px; bottom: 5px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgba(10, 13, 24, 0.82);
  color: var(--lamp);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.card-meta { padding: 9px 1px 0; }
.card-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
  font-feature-settings: "palt" 1;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.card-date {
  margin: 3px 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--kiri-2);
}

/* ------------------------------------------------------------------ 6 pager */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--kiri-2);
  border-radius: 999px;
  color: var(--lamp);
  font-size: 0.875rem;
}
.pager a:hover { background: var(--lamp); border-color: var(--lamp); color: var(--yoru); }
.pager a span { display: none; }
.pager-info {
  color: var(--kiri);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.pager-prev { margin-right: auto; }
.pager-next { margin-left: auto; }

/* ------------------------------------------------------------- 7 item page */
.item-detail { max-width: 860px; }

.item-head { margin: 0 0 18px; }
.item-title {
  margin: 0 0 10px;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem);
  line-height: 1.55;
  letter-spacing: 0.04em;
  font-feature-settings: "palt" 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.item-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--kiri);
}
.item-cat {
  padding: 0 12px;
  border: 1px solid var(--kiri-2);
  border-radius: 999px;
  color: var(--lamp);
  line-height: 1.7;
}
.item-cat:hover { background: var(--lamp); border-color: var(--lamp); color: var(--yoru); }
.item-dur { font-variant-numeric: tabular-nums; }

/* poster: small source thumbnail, glowing from behind */
.poster {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--sumi);
}
.poster-glow {
  position: absolute; z-index: -1;
  inset: -12%;
  width: 124%; height: 124%;
  max-width: none;
  object-fit: cover;
  filter: blur(26px) saturate(1.25) brightness(0.6);
}
.poster-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  box-shadow: 0 14px 44px rgba(5, 8, 18, 0.6);
}
.poster-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.poster-play {
  position: absolute; left: 50%; top: 50%;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: rgba(20, 26, 44, 0.72);
  box-shadow: inset 0 0 0 2px var(--lamp);
  transition: background 0.15s;
}
.poster-play::before {
  content: "";
  position: absolute; left: 23px; top: 18px;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--lamp);
}
.poster-link:hover .poster-play { background: var(--beni); }
.poster-dur {
  position: absolute; right: 8px; bottom: 8px;
  padding: 0 8px;
  border-radius: 3px;
  background: rgba(10, 13, 24, 0.82);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

.embed-16x9 {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--sumi);
  overflow: hidden;
}
.embed-16x9 iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

.item-action { margin: 22px 0 0; }
.item-action .btn-source { width: 100%; }
.item-action-note { margin: 8px 0 0; font-size: 0.78rem; color: var(--kiri-2); }

.item-desc, .item-tags, .item-source { margin: 34px 0 0; }
.item-desc h2, .item-tags h2, .item-source h2 {
  margin: 0 0 10px;
  font: 700 1.05rem/1.5 var(--mincho);
  letter-spacing: 0.08em;
}
.item-desc p, .item-source p {
  margin: 0 0 8px;
  max-width: 38em;
  line-height: 1.95;
  overflow-wrap: anywhere;
}
.item-desc .is-empty { color: var(--kiri-2); }
.item-source p { font-size: 0.8125rem; color: var(--kiri); }
.item-source .src-host { font-size: 0.9375rem; color: var(--lamp); font-weight: 600; margin-bottom: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li {
  padding: 1px 11px;
  border-radius: 3px;
  background: var(--sumi);
  color: var(--kiri);
  font-size: 0.8125rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* the main action: a lit plate, same make as the sign */
.btn-source {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 34px;
  border: 0;
  border-radius: 6px;
  background: var(--beni);
  color: #fff7e6;
  font: 800 1.0625rem/1 var(--sans);
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 6px 26px rgba(200, 29, 58, 0.32);
}
.btn-source::before {
  content: "";
  position: absolute; inset: 4px;
  border: 1px solid rgba(241, 233, 214, 0.5);
  border-radius: 3px;
  pointer-events: none;
}
.btn-source:hover { background: #d8274a; }
.btn-source:active { transform: translateY(1px); }

/* --------------------------------------------------------- 8 static pages */
.static-page { max-width: 38rem; }
.static-page h1 {
  margin: 0 0 8px;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.1rem);
  line-height: 1.4;
  letter-spacing: 0.05em;
  font-feature-settings: "palt" 1;
}
.static-section {
  margin: 2.2rem 0 0;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}
.static-section h2 {
  margin: 0 0 0.7rem;
  font: 700 1.1rem/1.6 var(--mincho);
  letter-spacing: 0.08em;
}
.static-section p { margin: 0 0 0.9rem; line-height: 1.95; overflow-wrap: anywhere; }
.static-section p:last-child { margin-bottom: 0; }
.static-section a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.plain-list { margin: 0; padding-left: 1.2em; line-height: 1.95; }
.plain-list li { margin-bottom: 0.4rem; }

/* ----------------------------------------------------------- 9 empty / 404 */
.empty {
  max-width: 34rem;
  padding: 36px 0 24px;
  color: var(--kiri);
}
.empty h1, .empty-lead {
  margin: 0 0 12px;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem);
  line-height: 1.55;
  letter-spacing: 0.05em;
  color: var(--lamp);
}
.empty p { margin: 0 0 12px; line-height: 1.9; }
.empty-en { font-size: 0.8125rem; color: var(--kiri-2); }
.empty .btn-source { margin-top: 8px; }

/* ------------------------------------------------- 10 footer + ad slots */
.site-footer {
  margin-top: 56px;
  padding: 24px 16px 44px;
  border-top: 1px solid var(--line);
  color: var(--kiri);
  font-size: 0.8125rem;
}
.age-notice { margin: 0 0 12px; color: var(--lamp); font-weight: 700; line-height: 1.7; }
.age-notice small { display: block; font-weight: 400; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 14px; }
.foot-nav a { padding: 4px 0; }
.foot-nav a:hover { color: var(--lamp); text-decoration: underline; text-underline-offset: 0.2em; }
.copy { margin: 0; color: var(--kiri-2); font-size: 0.78rem; line-height: 1.8; }

.ad-slot { margin: 0 0 18px; overflow: hidden; text-align: center; }
.ad-banner-header { margin: 0; padding: 8px 0; }
.ad-banner-footer { padding: 0 16px; margin: 36px 0 0; }

/* ------------------------------------------------------------------ 11 admin */
.admin-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.admin-title { margin: 0; font: 700 1.15rem/1.5 var(--mincho); letter-spacing: 0.06em; }
.admin-back { color: var(--kiri); font-size: 0.875rem; }
.admin-back:hover { color: var(--lamp); text-decoration: underline; text-underline-offset: 0.2em; }
.admin-wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 8px; }
.admin-panel {
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sumi);
}
.admin-panel h2 { margin: 0 0 10px; font: 700 1.05rem/1.5 var(--mincho); letter-spacing: 0.06em; }
.admin-panel p { margin: 0 0 10px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.8125rem; }
.admin-table th, .admin-table td { padding: 7px 10px; border: 1px solid var(--line); text-align: left; }
.admin-table th { background: var(--yoru); font-weight: 700; }
.warn-box { border-color: #d32f2f; color: #ffb3b3; }
.warn-box strong { color: #ff6b6b; }
.kill-on strong  { color: #ff6b6b; }
.kill-off strong { color: #7ee2a8; }
.kill-hint { color: var(--kiri); font-size: 0.8125rem; }
.log-ok  { color: #7ee2a8; }
.log-err { color: #ff6b6b; }
.admin-foot { padding: 18px 20px 40px; text-align: center; color: var(--kiri-2); font-size: 0.78rem; }
.admin-foot p { margin: 0; }

/* --------------------------------------------------------------- responsive */
@media (min-width: 620px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 28px 16px;
  }
  .item-action .btn-source { width: auto; }
  .poster { aspect-ratio: auto; padding: 28px 16px; }
  .poster-link { width: min(100%, 480px); }
}

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    max-width: 1440px;
    margin: 0 auto;
  }

  .rail {
    position: sticky; top: 0;
    align-self: start;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
    padding: 0 0 24px 20px;
  }

  /* the plate turns vertical and hangs from the top edge of the window */
  .sign-plate {
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 9px;
    padding: 20px 12px 18px;
    border-radius: 0 0 8px 8px;
  }
  .sign-plate::before { inset: 4px; }
  .sign-name {
    writing-mode: vertical-rl;
    font-size: 1.9rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    padding-left: 0;
  }
  .sign-tag {
    display: block;
    writing-mode: vertical-rl;
    font-size: 0.72rem;
    line-height: 1.3;
    letter-spacing: 0.22em;
    font-weight: 500;
    color: rgba(255, 247, 230, 0.9);
    padding-top: 0.3rem;
  }

  .nav { order: 2; flex-basis: auto; margin-top: 28px; width: 100%; }
  .nav ul {
    display: block;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .nav a {
    padding: 6px 0 6px 12px;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: 0;
    font-size: 0.9375rem;
  }
  .nav a:hover { border-left-color: var(--kiri-2); }
  .nav a.is-current {
    background: none;
    border-left-color: var(--lamp);
    color: var(--lamp);
  }

  .mark-18 { order: 3; margin: 26px 0 0 12px; }

  .stage { padding: 30px 28px 8px; }
  /* footer rule lines up with the content column, not the rail edge */
  .site-footer { margin-inline: 28px; padding: 24px 0 44px; }
  .ad-banner-footer { padding: 0 28px; }
}

@media (min-width: 1180px) {
  /* a second column exists only when the sidebar slot holds an ad */
  .stage.has-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 44px;
    align-items: start;
  }
  .has-side .sidebar { display: block; padding-top: 6px; }
  .has-side .ad-banner-mobile { display: none; }   /* the sidebar slot takes over */
}

@media (max-width: 380px) {
  .grid { gap: 20px 10px; }
  .card-title { font-size: 0.84rem; }
}

/* ------------------------------------------------------------ 12 focus + motion */
:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 3px;
}
.sign:focus-visible { outline-offset: 5px; }

@keyframes sign-on {
  0%   { opacity: 0; }
  10%  { opacity: 0.85; }
  16%  { opacity: 0.12; }
  28%  { opacity: 0.9; }
  34%  { opacity: 0.35; }
  48%  { opacity: 1; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sign-plate::after { animation: none; }
  * { transition: none !important; }
}
