/* ==========================================================================
   Outdoor Packing List - shared stylesheet (all pages)
   Mobile-first. No framework, no external fonts.
   ========================================================================== */

:root {
  --mint: #3ECFAC;
  --mint-dark: #2BA98B;
  --mint-pale: #E4F8F2;
  --text: #1A1F2E;
  --muted: #6B7380;
  --border: #E5E7EB;
  --bg: #F7F9FB;
  --card: #FFFFFF;
  --warn-bg: #FFF7E6;
  --warn-border: #E8C775;
  --radius: 12px;
  --space-sm: 14px;
  --space-lg: 28px;
  /* Vertical spacing scale (shared across the 4 DeepMint checklist sites).
     One source of truth per gap: the PRECEDING element carries margin-bottom;
     blocks never carry margin-top (documented exceptions only). */
  --gap-s: 12px;  /* intra-block spacing */
  --gap-m: 20px;  /* between adjacent blocks (cards, ad slots, FAQ) */
  --gap-l: 32px;  /* between major sections */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "BIZ UDPGothic", Meiryo, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 { word-break: keep-all; line-height: 1.4; }

a { color: var(--mint-dark); }

img { max-width: 100%; display: block; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
}

.site-header .brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header .brand img { width: 28px; height: 28px; flex: none; }

.lang-link {
  margin-left: auto;
  flex: none;
  font-size: 13px;
  text-decoration: none;
  color: var(--mint-dark);
  border: 1px solid var(--mint);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--card);
}

/* --------------------------------------------------------------------------
   Hero (tool pages)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,31,46,0.15) 0%, rgba(26,31,46,0.65) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.hero h1 {
  color: #fff;
  font-size: 22px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero p {
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Guide/comparison pages that open directly with a content card (no intro
   paragraph under the hero) need explicit clearance below the hero image.
   Deliberate margin-top exception: .hero cannot carry margin-bottom without
   also pushing down checklist pages, which have their own intro spacing. */
.hero + .container > .seo-block:first-child { margin-top: var(--gap-m); }

/* --------------------------------------------------------------------------
   Hub (index)
   -------------------------------------------------------------------------- */
.hub-head {
  text-align: center;
  padding: 28px 16px 8px;
}

.hub-head h1 { font-size: 24px; margin-bottom: 8px; }

.hub-head p { color: var(--muted); font-size: 14px; }

.jp-scope-note {
  display: inline-block;
  margin: var(--gap-s) 0 0;
  padding: 6px 16px;
  background: var(--mint-pale);
  border-radius: 999px;
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 12px);
  text-align: center;
}

.hub-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px 0 var(--gap-m);
}

.hub-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(26,31,46,0.06);
}

.hub-card img { height: 140px; width: 100%; object-fit: cover; flex: none; }

.hub-card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hub-card h2 { font-size: 18px; margin-bottom: 4px; }

.hub-card p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

.hub-card .cta {
  display: inline-block;
  align-self: center;
  margin-top: auto;
  background: var(--mint);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 20px;
}

/* Standalone CTA (error pages): same pill as .hub-card .cta, usable outside
   the card grid. */
.error-cta {
  display: inline-block;
  margin-top: 16px;
  background: var(--mint);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 24px;
}

.hub-steps {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 var(--gap-m);
}

.hub-steps h2 { font-size: 16px; margin-bottom: 8px; }

.hub-steps ol { padding-left: 22px; font-size: 14px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Benefit line (tool pages, under the page title)
   -------------------------------------------------------------------------- */
.benefit-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0;
}

/* --------------------------------------------------------------------------
   Question card
   -------------------------------------------------------------------------- */
.qcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0 0;
}

/* The flow wrapper itself is the first item after the qcard sits inside it;
   qcard is the flow's first child, so its own top margin (16px) is fine and
   its bottom margin is 0 (spacing to the next item comes from .gap-lg). */

/* --------------------------------------------------------------------------
   Flow: single flat flex container. Every direct child is one item of the
   sequence. Spacing is set per-child via .gap-lg / .gap-sm (margin-top on the
   element that FOLLOWS the gap). Only two values exist: 14px and 28px.
   No element inside carries its own vertical margin.
   -------------------------------------------------------------------------- */
.flow { display: flex; flex-direction: column; }
.flow > .gap-lg { margin-top: var(--space-lg); }
.flow > .gap-sm { margin-top: var(--space-sm); }
/* An empty notices container must not occupy space or emit a phantom gap. */
#notices:empty { display: none; }
/* When notices is empty and hidden, the checklist becomes the element right
   after the ad-note; its .gap-sm still applies correctly (small gap). When
   notices IS shown, checklist follows it with the same small gap. */

.qcard h2 { font-size: 16px; margin-bottom: 12px; }

.qgroup { margin-bottom: 14px; }

.qgroup:last-child { margin-bottom: 0; }

.qgroup .qlabel {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.qbtns { display: flex; flex-wrap: wrap; gap: 8px; }

.qbtn {
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  flex: 1 1 auto;
}

.qbtn[aria-pressed="true"] {
  background: var(--mint);
  border-color: var(--mint);
  color: #fff;
  font-weight: 700;
}

.qhint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* --------------------------------------------------------------------------
   Progress counter (most prominent element of the actions zone)
   -------------------------------------------------------------------------- */
.progress {
  width: 72%;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  background: var(--mint-pale);
  border: 1px solid var(--mint);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.progress strong { color: var(--mint-dark); font-size: 22px; }

/* --------------------------------------------------------------------------
   Actions (print / share / reset)
   -------------------------------------------------------------------------- */
.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.actions button svg { width: 18px; height: 18px; flex: none; }

.actions button:hover:not(:disabled) { background: var(--bg); border-color: var(--mint); }

.actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-status {
  font-size: 13px;
  color: var(--mint-dark);
  text-align: center;
}

/* When the status message is empty it must take no vertical room at all,
   otherwise it injects a phantom gap between the buttons and the counter. */
.action-status:empty { display: none; }
.action-status:not(:empty) { margin-top: 6px; }

/* --------------------------------------------------------------------------
   Ad disclosure
   -------------------------------------------------------------------------- */
.ad-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 0 0 var(--gap-m);
}

/* --------------------------------------------------------------------------
   Checklist
   -------------------------------------------------------------------------- */
#checklist { display: flex; flex-direction: column; gap: var(--space-sm); }

.checklist-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.checklist-section h3 {
  font-size: 14px;
  background: var(--mint-pale);
  color: var(--text);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.checklist-section ul { list-style: none; }

.check-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.check-item:last-child { border-bottom: none; }

.check-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

.remove-btn {
  flex: none;
  font: inherit;
  font-size: 12px;
  border: 1px solid #E0897E;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  background: var(--card);
  color: #C0392B;
  cursor: pointer;
}

.remove-btn:hover, .remove-btn:focus {
  background: #FDECEA;
}

.check-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--mint);
  cursor: pointer;
}

.check-item .iname { font-size: 15px; }

.check-item .inote {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.check-item input:checked ~ .itext .iname {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(107,115,128,0.5);
}

.buy-link {
  flex: none;
  font-size: 12px;
  text-decoration: none;
  color: var(--mint-dark);
  border: 1px solid var(--mint);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  align-self: center;
}

/* --------------------------------------------------------------------------
   Custom items (user-added checklist entries)
   -------------------------------------------------------------------------- */
.custom-desc {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 14px;
}

.custom-add-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.custom-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

.custom-input:focus {
  outline: 2px solid var(--mint);
  outline-offset: 1px;
}

.custom-add-btn {
  flex: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  background: var(--mint);
  color: #fff;
  cursor: pointer;
}

.custom-add-btn:hover:not(:disabled) { background: var(--mint-dark); }

.custom-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-limit-msg {
  font-size: 12px;
  color: var(--muted);
  padding: 0 14px 10px;
}

.custom-limit-msg:empty { display: none; }

/* --------------------------------------------------------------------------
   Notice (safety warnings)
   -------------------------------------------------------------------------- */
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   SEO text block
   -------------------------------------------------------------------------- */
.seo-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0 0 var(--gap-m);
}

.seo-block h2 { font-size: 17px; margin-bottom: 10px; }

.seo-block p { font-size: 14px; color: #3A4150; margin-bottom: 10px; }

.seo-block p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   FAQ block
   -------------------------------------------------------------------------- */
.faq-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0 0 var(--gap-m);
}

.faq-block h2 { font-size: 17px; margin-bottom: 8px; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.faq-item:last-child { border-bottom: none; padding-bottom: 0; }

.faq-item summary {
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--mint-dark);
  font-weight: 700;
  font-size: 18px;
}

.faq-item[open] summary::after { content: '\2212'; }

.faq-item p {
  font-size: 14px;
  color: #3A4150;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Back to top button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26,31,46,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 40;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Rakuten affiliate banner (responsive: desktop 728x90 / mobile 320x48,
   never both at once). Width absorbs the larger 728px format. Spacing
   follows the site-wide rule: the banner carries only margin-bottom
   (--gap-m); clearance above comes from the preceding block.
   -------------------------------------------------------------------------- */
.rakuten-banner {
  max-width: 760px;
  margin: 0 auto var(--gap-m);
  padding: 0 16px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.rakuten-banner > div,
.rakuten-banner iframe,
.rakuten-banner table {
  max-width: 100% !important;
}

.rakuten-banner-desktop { display: none; }

@media (min-width: 720px) {
  .rakuten-banner-mobile { display: none; }
  .rakuten-banner-desktop { display: flex; }
}

/* --------------------------------------------------------------------------
   Admax banner
   -------------------------------------------------------------------------- */
.admax-banner {
  max-width: 760px;
  margin: 0 auto var(--gap-m);
  padding: 0 16px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.admax-banner > div {
  max-width: 100% !important;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  /* No margin-top: the ad banner that always precedes the footer carries
     the gap (margin-bottom: var(--gap-m)) - single source of truth. */
  margin-top: 0;
  padding: 20px 16px 28px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.site-footer a { color: var(--muted); text-decoration: none; }

/* --------------------------------------------------------------------------
   Print title (hidden on screen)
   -------------------------------------------------------------------------- */
.print-header { display: none; }

/* --------------------------------------------------------------------------
   Narrow mobile adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Action buttons stay horizontal and equal-width; hide the decorative
     icon and keep the text label, since a mis-tapped icon-only Reset
     button would silently wipe the user's saved progress. */
  .actions button svg { display: none; }

  .check-item { flex-direction: column; align-items: stretch; }
  .row-actions { margin-left: 0; margin-top: 4px; justify-content: flex-end; }

  /* Season question group: force a fixed 2x2 grid instead of flex-wrap, so
     JP/EN label length never produces an unbalanced 3+1 wrap. */
  .qbtns-season { display: grid; grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   Desktop adjustments (secondary target)
   -------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .hero img { height: 260px; }
  .hero h1 { font-size: 28px; }
  .hub-cards { grid-template-columns: repeat(3, 1fr); }
  .hub-card img { height: 120px; }
}

/* --------------------------------------------------------------------------
   Print: checklist only, black and white
   -------------------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .site-header, .hero, .qcard, .actions, .progress, .action-status,
  .ad-note, .buy-link, .remove-btn, .benefit-line, .seo-block, .faq-block, .site-footer, .notice, .back-to-top,
  .rakuten-banner, .admax-banner,
  .custom-desc, .custom-add-row, .custom-limit-msg { display: none !important; }
  .custom-section.is-empty { display: none !important; }
  .print-header { display: block; margin-bottom: 12pt; }
  .print-header h1 { font-size: 16pt; }
  .print-header p { font-size: 10pt; color: #333; }
  .container { max-width: none; padding: 0; }
  #checklist { gap: 0; }
  .checklist-section {
    border: none;
    border-radius: 0;
    margin-bottom: 8pt;
    break-inside: avoid;
  }
  .checklist-section h3 {
    background: none;
    border-bottom: 1pt solid #000;
    padding: 2pt 0;
    font-size: 12pt;
  }
  .check-item { padding: 3pt 0; border-bottom: none; }
  .check-item .iname { font-size: 11pt; color: #000 !important; text-decoration: none !important; }
  .check-item .inote { color: #444; }
}
