/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #111111;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray-mid: #e0e0e0;
  --gray-text: #666666;
  --accent: #e8471a;
  --accent-dark: #c73a14;
  --font-main: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

body {
  font-family: var(--font-main);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
}

/* In-page anchor jumps (nav + "browse by prefecture") clear the 64px sticky header */
html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.hidden {
  display: none !important;
}

/* Screen-reader-only labels (kept off-screen but accessible). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
.cafe-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link: off-screen until focused, then drops in at the top-left. */
.skip-link {
  position: absolute;
  top: -56px;
  left: 8px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: 3px solid var(--accent);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  color: var(--gray-mid);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--white);
}

/* ===== HAMBURGER (mobile only) ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero {
  background: var(--black);
  color: var(--white);
  padding: 52px 24px;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  /* Negative tracking hurts Japanese text; keep JA headings at normal spacing. */
  letter-spacing: normal;
}

/* Optional line break shown only on narrow screens, so a Japanese heading
   wraps at a chosen point instead of orphaning its last character(s). */
.br-sp {
  display: none;
}

.hero-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--gray-mid);
  margin-bottom: 28px;
}

/* ===== SEARCH BOX ===== */
.search-box {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row select {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  border: 2px solid var(--gray-mid);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  cursor: pointer;
  color: var(--black);
}

/* Type multi-select dropdown (checkbox filter) — lives in the results filter
   bar and filters the on-screen results live. Opens a checkbox panel. */
.filter-types {
  position: relative;
  min-width: 220px;
}

.filter-types-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid var(--gray-mid);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--black);
  cursor: pointer;
}

.filter-types-toggle:hover {
  border-color: var(--accent);
}

.filter-types-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-types-caret {
  color: var(--gray-text);
  font-size: 12px;
  transition: transform 0.15s;
}

.filter-types[data-open="true"] .filter-types-caret {
  transform: rotate(180deg);
}

.filter-types-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--white);
  border: 2px solid var(--gray-mid);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  padding: 8px;
}

.filter-types-panel[hidden] {
  display: none;
}

.filter-types-actions {
  display: flex;
  gap: 8px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--gray-light);
  margin-bottom: 6px;
}

.types-action {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--accent);
  background: var(--white);
  border: 2px solid var(--gray-mid);
  border-radius: 6px;
  cursor: pointer;
}

.types-action:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.filter-types-list {
  display: flex;
  flex-direction: column;
}

.filter-types-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
}

.filter-types-item:hover {
  background: var(--gray-light);
}

.filter-types-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}

.filter-types-name {
  flex: 1;
}

.filter-types-count {
  color: var(--gray-text);
  font-size: 12px;
}

.filter-types-loading {
  padding: 10px 6px;
  color: var(--gray-text);
  font-size: 13px;
}

.postcode-row {
  display: flex;
  gap: 12px;
}

.postcode-row input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--gray-mid);
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.postcode-row input:focus {
  border-color: var(--accent);
}

.btn-primary {
  padding: 12px 24px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.08);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.18), 0 2px 6px rgba(17, 17, 17, 0.10);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

.btn-locate {
  width: 100%;
}

/* Secondary action — outline button (used for "browse by prefecture") */
.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px 24px;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--gray-mid);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.08);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.18), 0 2px 6px rgba(17, 17, 17, 0.10);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12);
}

/* ===== RESULTS ===== */
.results-section {
  background: var(--gray-light);
  padding: 48px 24px;
}

.results-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Filter bar — spans both columns above the map + list. position/z-index keep
   the dropdown panel stacked above the Google Maps container. */
.results-filter {
  grid-column: 1 / -1;
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.results-filter-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
}

.map-container {
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--gray-mid);
  /* Same framing as the card box, for a consistent pair. */
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.32), 0 2px 8px rgba(17, 17, 17, 0.20);
}

.cafe-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 500px;
  padding-right: 8px;
  /* Slim, always-visible scrollbar (where the OS draws one) as a standing
     hint that the list scrolls. */
  scrollbar-width: thin;
  scrollbar-color: var(--gray-mid) transparent;
}

.cafe-list::-webkit-scrollbar {
  width: 8px;
}

.cafe-list::-webkit-scrollbar-thumb {
  background: var(--gray-mid);
  border-radius: 4px;
}

/* Scroll cue: the list bleeds into a soft fade when there's more above/below,
   so it reads as scrollable without arrows or extra chrome. The fades are
   toggled by JS (can-scroll-up / can-scroll-down) and only show when the list
   actually overflows — nothing appears when everything fits. */
.cafe-list-wrap {
  position: relative;
  /* Hug the list's own height (don't stretch to the map's row height) so the
     shadow frames only the cards, never empty space below a short list. */
  align-self: start;
  border-radius: 12px;
  /* Drop shadow frames the box as a distinct, contained scroll panel. */
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.32), 0 2px 8px rgba(17, 17, 17, 0.20);
}

.cafe-list-wrap::before,
.cafe-list-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 8px; /* clear the scrollbar gutter */
  height: 44px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.cafe-list-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, var(--gray-light), transparent);
}

.cafe-list-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, var(--gray-light), transparent);
}

.cafe-list-wrap.can-scroll-up::before {
  opacity: 1;
}

.cafe-list-wrap.can-scroll-down::after {
  opacity: 1;
}

.no-results {
  padding: 20px;
  color: var(--gray-text);
}

/* ===== CAFE CARD ===== */
.cafe-card {
  background: var(--white);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s;
  border: 2px solid transparent;
  /* Keep natural height; let the list scroll instead of compressing cards
     (compression + overflow:hidden was clipping the card body). */
  flex-shrink: 0;
}

.cafe-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.cafe-card.active {
  border-color: var(--accent);
}

/* Fixed aspect ratio reserves the space up-front -> no layout shift when the
   photo loads. Replaces the old conflicting width + negative-margin hack. */
.cafe-card-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cafe-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  font-size: 28px;
  color: var(--gray-text);
}

/* Required Google Maps photo author attribution. */
.photo-attr {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: 70%;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  font-size: 10px;
  line-height: 1.3;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-attr a {
  color: var(--white);
  text-decoration: underline;
}

.cafe-card-body {
  padding: 20px;
}

.cafe-card-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cafe-card-city {
  font-size: 13px;
  color: var(--gray-text);
  margin-bottom: 12px;
}

.cafe-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-paved {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-unpaved {
  background: #fff3e0;
  color: #e65100;
}

.badge-mixed {
  background: #e3f2fd;
  color: #1565c0;
}

.cafe-card-notes {
  font-size: 13px;
  color: var(--gray-text);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ===== OPENING HOURS TABLE (Mon–Sun) ===== */
.cafe-card-hours {
  margin-bottom: 16px;
}

.hours-loading,
.hours-unknown {
  font-size: 12px;
  color: var(--gray-text);
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.hours-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  color: var(--black);
  margin-bottom: 4px;
}

.hours-table th,
.hours-table td {
  padding: 3px 0;
  vertical-align: top;
  line-height: 1.4;
  border-bottom: 1px solid var(--gray-light);
}

.hours-table th {
  width: 2.5em;
  text-align: left;
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
}

.hours-table td {
  color: var(--gray-text);
  padding-left: 8px;
}

/* 定休日 (closed days) stand out in the brand accent so a rider planning a
   specific day catches them at a glance. */
.hours-table tr.is-closed th,
.hours-table tr.is-closed td {
  color: var(--accent);
  font-weight: 700;
}

.hours-note {
  font-size: 10px;
  color: var(--gray-text);
  margin-top: 4px;
}

.btn-maps {
  display: inline-block;
  padding: 8px 16px;
  background: var(--black);
  color: var(--white);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-maps:hover {
  background: var(--accent);
}

/* ===== PREFECTURE GRID ===== */
.prefecture-section {
  padding: 48px 24px;
  background: var(--white);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-inner h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 40px;
  /* JA heading — no negative tracking. */
  letter-spacing: normal;
}

.prefecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: 1fr; /* all rows equal height -> no taller bottom row */
  gap: 12px;
}

.grid-error {
  grid-column: 1 / -1;
  padding: 16px;
  color: var(--gray-text);
}

.prefecture-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  background: var(--gray-light);
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  color: var(--black);
  /* Light shadow lifts the buttons off the page. */
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.08);
}

.prefecture-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12);
}

.prefecture-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--white);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.18), 0 2px 6px rgba(17, 17, 17, 0.10);
}

.prefecture-btn.has-listings {
  background: var(--white);
  border-color: var(--gray-mid);
}

.pref-count {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  padding: 1px 6px;
  background: var(--accent);
  color: var(--white);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* ===== ABOUT ===== */
.about-section {
  background: var(--white);
  padding: 48px 24px;
}

.about-section p {
  font-size: 16px;
  color: var(--gray-text);
  max-width: 700px;
  margin-bottom: 16px;
  line-height: 1.8;
}

/* Japanese body copy: break at phrase boundaries instead of mid-phrase
   (word-break: auto-phrase — Chromium), and optimize the whole paragraph so
   no line is left with a lone stray character (text-wrap: pretty — Chrome 117+,
   Safari 26+). Unsupported browsers fall back to normal wrapping, no breakage. */
.about-section p,
.latest-intro,
.article-body p {
  word-break: auto-phrase;
  text-wrap: pretty;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--black);
  color: var(--gray-text);
  padding: 32px 24px;
  text-align: center;
  font-size: 14px;
}

/* Footer legal links (e.g. privacy policy) — muted on the dark footer. */
.footer-legal {
  margin-top: 6px;
  font-size: 13px;
}

.footer-legal a {
  color: var(--gray-text);
  text-decoration: underline;
}

.footer-legal a:hover {
  color: var(--white);
}

/* ===== SUGGEST BUTTONS ===== */
.btn-suggest {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 24px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.08);
}

.btn-suggest:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.18), 0 2px 6px rgba(17, 17, 17, 0.10);
}

.btn-suggest:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12);
}

.nav-suggest {
  background: var(--accent);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-suggest:hover {
  background: var(--accent-dark);
}

/* ===== PREFECTURE GRID — empty state ===== */
.grid-empty {
  grid-column: 1 / -1;
  padding: 16px;
  color: var(--gray-text);
}

/* ===== お役立ち情報 TEASER (homepage) ===== */
.latest-section {
  background: var(--gray-light);
  padding: 48px 24px;
}

/* /blog/ uses an <h1> here (it is the page heading); the homepage teaser
   uses an <h2> (its <h1> is the hero). Same visual treatment either way. */
.latest-section h2,
.latest-section h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: normal;
  margin-bottom: 12px;
}

.latest-intro {
  font-size: 16px;
  color: var(--gray-text);
  max-width: 700px;
  margin-bottom: 40px;
  line-height: 1.8;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 2px solid var(--gray-mid);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--black);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  /* Light resting shadow so the tile looks raised like a button. */
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.08);
}

.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.18), 0 2px 6px rgba(17, 17, 17, 0.10);
}

.article-card:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.12);
}

.article-card-thumb {
  aspect-ratio: 16 / 9;
  background: var(--gray-light);
  overflow: hidden;
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card-body {
  padding: 20px;
}

.article-card-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.article-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.article-card-excerpt {
  font-size: 14px;
  color: var(--gray-text);
  line-height: 1.6;
  margin-bottom: 12px;
}

.article-card-date {
  font-size: 12px;
  color: var(--gray-text);
}

/* Homepage teaser only: a fixed four-up grid. The homepage carries every post
   card in its markup but shows four; the inline picker in index.html reorders
   them so the chosen four lead, and the nth-child rule hides the rest. With JS
   off, the newest four show. /blog/index.html keeps the auto-fill grid above —
   it lists everything, so an uneven final row there is expected. */
#article-grid { grid-template-columns: repeat(4, 1fr); }
#article-grid .article-card:nth-child(n+5) { display: none; }

@media (max-width: 1080px) {
  #article-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Must follow the 1080 rule: same specificity, so source order decides. */
@media (max-width: 768px) {
  #article-grid { grid-template-columns: 1fr; }
}

/* Link to the full index, needed now the homepage shows only four. */
.latest-more { margin-top: 32px; }
.latest-more .btn-secondary { max-width: 320px; margin: 0 auto; }

.article-grid-empty {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--gray-text);
  font-size: 15px;
}

.article-grid-empty a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.article-grid-empty a:hover {
  text-decoration: underline;
}

/* ===== DORMANT AD SLOTS ===== */
/* Empty = invisible (no gap) until an ad unit is dropped in at the AdSense
   trigger. Once populated, the slot is centred with breathing room. */
.ad-slot {
  margin: 32px 0;
  text-align: center;
}

.ad-slot:empty {
  display: none;
}

/* ===== EMAIL BOX (styled now; markup uncommented at newsletter launch) ===== */
.email-box {
  max-width: 600px;
  margin: 40px auto 0;
  padding: 32px;
  background: var(--gray-light);
  border: 2px solid var(--gray-mid);
  border-radius: 16px;
  text-align: center;
}

.email-box h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: normal;
  margin-bottom: 8px;
}

.email-box p {
  font-size: 14px;
  color: var(--gray-text);
}

/* ===== BLOG ARTICLE (article-template.html) ===== */
.article-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.article-header {
  margin-bottom: 24px;
}

.article-eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.article-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: normal;
  margin-bottom: 16px;
}

.article-meta {
  font-size: 14px;
  color: var(--gray-text);
}

.article-disclosure {
  font-size: 12px;
  color: var(--gray-text);
  background: var(--gray-light);
  border-left: 3px solid var(--gray-mid);
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 32px;
}

.article-body {
  font-size: 17px;
  line-height: 1.9;
  color: var(--black);
}

/* Vertical rhythm: space between consecutive blocks. */
.article-body > * + * {
  margin-top: 24px;
}

.article-body h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: normal;
  margin-top: 48px;
}

/* The section-heading rule. The underline is opt-IN via .post-h2 so that box
   headings (policy box, TL;DR, related, and anything added later) do not have
   to remember to switch it off. Every section heading in a post carries this
   class — see _template.html. */
.article-body .post-h2 {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-mid);
}

.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: normal;
  margin-top: 32px;
}

.article-body a {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* Button-style links inside an article body keep the button's own colours.
   Without this, the generic `.article-body a` rule above (higher specificity
   than `.btn-primary`) repaints the label accent-dark on accent — orange on
   orange — and underlines it. */
.article-body a.btn-primary {
  color: var(--white);
  text-decoration: none;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
}

.article-body li + li {
  margin-top: 8px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  color: var(--gray-text);
}

.article-figure {
  margin: 32px 0;
}

.article-figure figcaption {
  font-size: 13px;
  color: var(--gray-text);
  text-align: center;
  margin-top: 8px;
}

/* Directory CTA — the funnel back to the search tool. */
.directory-cta {
  margin-top: 56px;
  padding: 32px;
  background: var(--black);
  color: var(--white);
  border-radius: 16px;
  text-align: center;
}

.directory-cta h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: normal;
  color: var(--white);
  margin-bottom: 12px;
}

.directory-cta p {
  font-size: 15px;
  color: var(--gray-mid);
  margin-bottom: 20px;
}

.directory-cta .directory-cta-sub {
  margin: 16px 0 0;
}

.directory-cta-sub a {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.directory-cta-sub a:hover {
  text-decoration: underline;
}

/* ===== COMING-SOON PAGE (/blog/) ===== */
.coming-soon {
  min-height: 60vh;
  display: flex;
  align-items: center;
  background: var(--black);
  color: var(--white);
  padding: 64px 24px;
}

.coming-soon-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.coming-soon-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 20px;
}

.coming-soon-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: normal;
  margin-bottom: 20px;
}

.coming-soon-lead {
  font-size: 16px;
  line-height: 1.9;
  color: var(--gray-mid);
  margin-bottom: 32px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    background: var(--black);
    border-bottom: 3px solid var(--accent);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 14px 24px;
    font-size: 16px;
  }

  .nav-suggest {
    margin: 8px 24px 4px;
    text-align: center;
  }

  .hero,
  .results-section,
  .prefecture-section,
  .latest-section,
  .about-section {
    padding: 28px 16px;
  }

  .hero h1 {
    margin-bottom: 10px;
  }

  .hero-sub {
    margin-bottom: 20px;
  }

  .search-box {
    padding: 20px 16px;
  }

  .results-inner {
    grid-template-columns: 1fr;
  }

  .map-container {
    height: 300px;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-row select {
    min-width: unset;
    width: 100%;
  }

  .prefecture-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .email-box {
    padding: 24px 16px;
  }

  .article-main {
    padding: 32px 16px 48px;
  }

  .article-body {
    font-size: 16px;
  }

  .article-body h2 {
    font-size: 22px;
  }

  .directory-cta {
    padding: 24px;
  }

  .coming-soon {
    padding: 48px 16px;
  }
}

/* Narrow phones: show the optional mid-phrase breaks (hero heading + subtext)
   so Japanese lines split at punctuation instead of orphaning or mid-word.
   Above this width the lines fit, so these breaks stay off. */
@media (max-width: 480px) {
  .br-sp {
    display: inline;
  }
}

/* ============================================================
   BLOG POST COMPONENTS — long-form guide furniture
   (numbered sections, TOC, summary box, policy box, pull-quotes,
   collapsible deep-dives, FAQ, related box, wide-table scroll,
   back-to-top). Used by /blog/helmet-guide/ and future long
   posts. All colours/type inherit the site tokens.
   ============================================================ */

/* Accent section number (wayfinding). h2 keeps its inherited
   .article-body h2 styling; sections reuse section[id]{scroll-margin-top}. */
.post-num {
  color: var(--accent);
  font-weight: 800;
  margin-right: 0.4em;
  font-variant-numeric: tabular-nums;
}

/* Restore inter-block rhythm inside <section> wrappers (the global
   .article-body > * + * only reaches direct children of .article-body). */
.post-section > * + * { margin-top: 24px; }

.article-figure.hero-figure { margin: 0 0 24px; }

/* Inline SVG diagrams. SVG text scales with the element instead of reflowing,
   so a 760-wide diagram squeezed into a ~358px phone viewport renders its 13px
   labels at about 6px — unreadable. Same treatment as wide tables: give the
   figure horizontal scroll and hold the diagram at a legible minimum width. */
.article-figure.diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.article-figure.diagram svg {
  width: 100%;
  min-width: 680px;
  height: auto;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 8px;
}

/* Wide tables: horizontal scroll on narrow screens. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 560px; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}
.article-body th,
.article-body td {
  border: 1px solid var(--gray-mid);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.article-body thead th { background: var(--gray-light); font-weight: 700; }

/* Editorial-policy box (honesty statement). */
.policy-box { background: var(--black); color: var(--white); border-radius: 12px; padding: 24px 28px; }
.policy-box > * + * { margin-top: 12px; }
.article-body .policy-box h2 { color: var(--white); margin: 0 0 12px; padding: 0; font-size: 20px; }
.article-body .policy-box a { color: #ff9a77; }
.policy-box strong { color: var(--white); }

/* "結論だけ先に" summary box. */
.tldr { background: var(--gray-light); border-left: 6px solid var(--accent); border-radius: 8px; padding: 20px 24px; }
.article-body .tldr h2 { margin: 0 0 12px; padding: 0; font-size: 20px; }
.tldr-note { font-size: 14px; color: var(--gray-text); margin-top: 12px; }

/* Table of contents. */
details.toc { border: 1px solid var(--gray-mid); border-radius: 8px; padding: 4px 20px; background: var(--white); }
details.toc > summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.article-body details.toc ol { columns: 2; column-gap: 32px; margin: 8px 0 12px; font-size: 15px;
  /* Section numbers are written into the link text so the number is part of the tap target.
     Suppress the list marker or every entry renders as "1. 1. ...". */
  list-style: none; padding-left: 0; }
details.toc li { break-inside: avoid; }

/* Collapsible deep-dives ("詳しく：…"). */
details.deep { border: 1px dashed var(--gray-mid); background: var(--gray-light); border-radius: 8px; padding: 4px 20px; }
details.deep > summary { cursor: pointer; font-weight: 700; color: var(--accent-dark); padding: 12px 0; }
.deep > * + * { margin-top: 16px; }

/* Magazine-style pull-quote (overrides muted default blockquote). */
.article-body blockquote.pullquote {
  border-left: 5px solid var(--accent);
  padding: 4px 0 4px 20px;
  color: var(--black);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.6;
}

/* FAQ. */
.faq-item { border-bottom: 1px solid var(--gray-mid); }
.faq-item > summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.faq-item p { margin: 0 0 14px; }

/* Related-posts box. */
.related { background: var(--gray-light); border-radius: 8px; padding: 20px 24px; }
.article-body .related h2 { margin: 0 0 8px; padding: 0; font-size: 18px; }

/* Floating back-to-top. */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25); opacity: 0.85;
}
.to-top:hover { opacity: 1; background: var(--accent); }

@media (max-width: 640px) {
  .article-body details.toc ol { columns: 1; }
  .article-body blockquote.pullquote { font-size: 18px; }
  .policy-box, .tldr, .related { padding: 20px 18px; }
}
