/*
  薬剤師のみちさき案内 — Phase 0B-2 Visual Foundation.

  Two token layers, kept separate on purpose:
  - Common Brand Layer: neutrals, spacing, radius, widths, type. Reusable
    across any future "みちさき案内" profession line.
  - Profession Accent Layer: everything pharmacist-specific (accent color,
    hero motif tone). Swap only this block to re-skin for another
    profession — nothing else should need to change.

  Restrained on purpose: no medical-blue, no primary green, no strong cyan,
  no loud gradients, no dark hero. No external framework, no web fonts.
*/

:root {
  /* ---- Common Brand Layer ---- */
  --color-bg: #faf7f1;
  --color-surface: #ffffff;
  --color-surface-tint: #f2ede2;
  --color-text: #262521;
  --color-text-muted: #6b6960;
  --color-border: #ddd6c7;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(38, 37, 33, 0.06), 0 1px 1px rgba(38, 37, 33, 0.04);

  --width-shell: 1120px;
  --width-article: 680px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;

  /* ---- Profession Accent Layer (pharmacist) ---- */
  /* Swap this block only to re-skin the same shell for another profession. */
  --color-accent: #3f5e56;
  --color-accent-strong: #33504a;
  --color-accent-soft: #e7efec;
  --color-link: #33504a;
  --color-button-bg: #33504a;
  --color-button-text: #ffffff;

  /* Ad labeling deliberately stays neutral, not accent — an ad must never
     visually read as "recommended by the site". */
  --color-ad-label-bg: #efece3;
  --color-ad-label-text: #57544a;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.7;
}

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

a {
  color: var(--color-link);
}

a:not(.btn) {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* Accessible focus: never remove outline, only restyle it. */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Skip link: visually hidden until keyboard focus reaches it. */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  z-index: 10;
}

.skip-link:focus {
  left: var(--space-1);
  top: var(--space-1);
}

/* ---- Width utilities ----
   .shell: wide — Home and the three collection index pages (card grids).
   .article: narrow — Service/Method/Guide/Legal detail pages (reading). */

.shell {
  max-width: var(--width-shell);
  margin: 0 auto;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.article {
  max-width: var(--width-article);
  margin: 0 auto;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

/* Service Detail only (Phase 0B-3): a little more room than the narrow
   reading width, but deliberately far short of the full .shell width. */
.article--wide {
  max-width: 820px;
  margin: 0 auto;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

/* ---- Header / global nav ---- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-header__inner {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.site-header__brand {
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.brand-mark {
  color: var(--color-accent);
  flex-shrink: 0;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  padding: var(--space-1) 0;
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  font-size: 0.9rem;
}

/* Narrow screens: an intentional two-row layout — brand on its own row,
   navigation as a balanced 2x2 grid below. Not an accidental flex-wrap. */
@media (max-width: 600px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }

  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem var(--space-2);
  }

  .site-nav a {
    line-height: 1.4;
    padding: var(--space-1);
  }
}

/* ---- Breadcrumb ----
   Deliberately quiet: smaller, tighter, muted — must not compete with the
   hero or the page H1 for attention. */

nav[aria-label="breadcrumb"] {
  padding: var(--space-1) var(--space-2) 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

nav[aria-label="breadcrumb"] ol {
  max-width: var(--width-shell);
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}

nav[aria-label="breadcrumb"] a {
  color: var(--color-text-muted);
}

nav[aria-label="breadcrumb"] li:not(:last-child)::after {
  content: "/";
  margin-left: 0.3em;
  color: var(--color-border);
}

/* ---- Main content ---- */

main {
  padding-top: var(--space-3);
  padding-bottom: var(--space-5);
}

h1 {
  font-size: 1.9rem;
  line-height: 1.35;
  margin: 0 0 var(--space-2);
}

h2 {
  font-size: 1.25rem;
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 var(--space-2);
}

/* ---- Hero (Home only) ----
   Text + visual live side by side on desktop; the visual is decorative
   (aria-hidden) and never outweighs the H1. */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
}

.hero__eyebrow {
  margin: 0 0 var(--space-1);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-accent-strong);
}

.hero__description {
  color: var(--color-text-muted);
  max-width: 42em;
}

.hero__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: var(--color-accent-soft);
  /* Intentional: the decorative shapes below are positioned to bleed
     slightly past the panel edge for an organic feel. This clip is a
     deliberate component-level choice, not a page-wide overflow patch —
     see the "no overflow-x:hidden on body" note at the end of this file. */
  overflow: hidden;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Abstract "path of dots" motif used only when no real hero image is set.
   Pure CSS, no assets — swapped out automatically once Config::HERO_IMAGE_PATH
   is set (Hero::render() emits an <img> instead of these shapes). */
.hero__shapes {
  position: absolute;
  inset: 0;
}

.hero__shape {
  position: absolute;
  border-radius: 50%;
}

.hero__shape--a {
  width: 58%;
  aspect-ratio: 1;
  right: -10%;
  top: -8%;
  background: rgba(63, 94, 86, 0.14);
}

.hero__shape--b {
  width: 30%;
  aspect-ratio: 1;
  left: 12%;
  bottom: 10%;
  border: 1px solid rgba(63, 94, 86, 0.35);
}

.hero__shape--c {
  width: 10%;
  aspect-ratio: 1;
  left: 46%;
  top: 38%;
  background: var(--color-accent);
  opacity: 0.55;
}

.hero__shape--d {
  width: 6%;
  aspect-ratio: 1;
  left: 62%;
  top: 55%;
  background: var(--color-accent);
  opacity: 0.3;
}

@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    padding: var(--space-3) 0;
  }

  .hero__visual {
    aspect-ratio: 16 / 9;
  }
}

/* ---- Section panel (very weak background differentiation) ---- */

.section-panel {
  background: var(--color-surface-tint);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-top: var(--space-4);
}

.section-panel h2 {
  margin-top: 0;
}

/* ---- Method cards (Home's primary section) ---- */

.method-grid {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.method-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-2);
  min-width: 0;
}

.method-card__mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  position: relative;
  margin-bottom: var(--space-1);
}

.method-card__mark::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.method-card a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text);
}

.method-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.4em 0 0;
}

/* ---- Service cards (plain — no ranking, no elevation) ---- */

.card-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.card-list li {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-2);
  min-width: 0;
}

.card-list a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text);
  display: inline-block;
  min-height: 44px;
  line-height: 1.4;
  padding-top: 0.4em;
}

.card-list p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.2em 0 0;
}

/* ---- Guide cards (document-like) ---- */

.guide-list {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
}

.guide-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  min-width: 0;
}

.guide-card a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-text);
}

.guide-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.3em 0 0;
}

/* ---- Tag chips (Service detail: which Methods it supports) ---- */

.characteristics-label {
  margin: var(--space-2) 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.tag-list {
  list-style: none;
  margin: var(--space-1) 0 var(--space-2);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.tag {
  display: inline-block;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  font-size: 0.85rem;
  text-decoration: none;
  min-height: 32px;
  line-height: 1.6;
}

/* ---- Key points box ("このページの要点") ----
   A quiet reading aid, never a score/star/priority badge. */

.key-points {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  margin: var(--space-2) 0 var(--space-3);
}

.key-points__label {
  margin: 0 0 0.5em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.key-points ul {
  margin: 0;
  padding-left: 1.2em;
}

.key-points li {
  margin: 0.3em 0;
}

/* ---- Body tables (rare — only where the source draft used one) ---- */

.table-scroll {
  overflow-x: auto;
  margin: var(--space-2) 0;
}

.table-scroll table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
}

.table-scroll th,
.table-scroll td {
  border: 1px solid var(--color-border);
  padding: 0.5em 0.75em;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.table-scroll th {
  background: var(--color-surface-tint);
  font-weight: 600;
}

/* ---- Confirmation info (Service detail: last-checked date) ---- */

.confirmation-info {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---- Related pages (end-of-page summary list) ---- */

.related-pages {
  margin-top: var(--space-3);
}

/* ---- Article prose (Guide/Method/Service/Legal detail) ---- */

.article p {
  max-width: 100%;
}

/* Ready for future editorial content — not used on any page yet, since no
   real note/caution copy has been supplied (see Render\GuidePage). */
.note {
  background: var(--color-accent-soft);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin: var(--space-2) 0;
}

/* ---- Buttons ---- */

.btn {
  display: inline-block;
  min-height: 44px;
  line-height: 1.4;
  padding: 0.65em 1.2em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--color-button-bg);
  color: var(--color-button-text);
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
}

.btn--affiliate {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.action-slot {
  margin: var(--space-2) 0;
}

/* ---- Official actions block (Service detail) ----
   One clear button (the Placement-primary action) plus a short list of
   compact text links — never three equal-weight buttons stacked together. */

.official-actions {
  margin-top: var(--space-3);
}

.official-actions h2 {
  margin-top: 0;
}

.primary-action {
  margin: var(--space-1) 0 var(--space-2);
}

.text-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 44px;
  color: var(--color-link);
  text-decoration: none;
  font-weight: 600;
}

.text-action::before {
  content: "\203A";
  color: var(--color-accent);
}

.text-action--affiliate {
  color: var(--color-text);
}

/* ---- Affiliate ad labeling ---- */

.ad-label {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-ad-label-text);
  background: var(--color-ad-label-bg);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.5em;
  margin-right: 0.5em;
  vertical-align: middle;
}

.ad-block,
.affiliate-cta,
.primary-action {
  margin: var(--space-2) 0;
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer__inner {
  max-width: var(--width-shell);
  margin: 0 auto;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--color-text);
  font-weight: 600;
}

.footer__tagline {
  margin: 0.3em 0 0;
}

footer ul {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/*
  No `overflow-x: hidden` on body/html. Every wide element (hero grid, card
  grids, nav grid) uses `minmax(0, 1fr)` tracks and `min-width: 0` on cards
  so content can never force horizontal scroll; the only local `overflow:
  hidden` is on .hero__visual, and it exists to clip decorative shapes that
  intentionally extend past the panel edge (see .hero__shape above), not to
  paper over a layout bug.
*/
