/* リハビリ職のみちさき案内 — Phase 0/P2 base styles.
   Theme: 静かなキャリア案内所. Restrained visual system per Phase 0 scope
   (template/nav spec section 7): no ranking cues, no image-heavy hero,
   calm whitespace, white ground with a quiet blue-green accent. Phase P2
   adds: readable width hierarchy on Top, a zero-JS mobile nav disclosure,
   lightweight (non-card) section grouping for Top's 5 entry points, and a
   clearer visual split between body links / Related Links / Official
   Information Link so the last never reads as an affiliate-style CTA. */

:root {
  --color-bg: #ffffff;
  --color-surface: #f6f9f9;
  --color-text: #1f2a2c;
  --color-text-muted: #45565a;
  --color-border: #dbe6e6;
  --color-accent: #2c7a72;
  --color-focus: #1a5c9c;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  --max-width: 780px;
  --max-width-wide: 960px;
  --lede-width: 680px;
  --space-section: 3rem;
}

* { box-sizing: border-box; }

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

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

img { max-width: 100%; }

a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 0.5em 1em;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3.25rem;
}
.site-header__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  line-height: 1.3;
}
/* Signpost/wayfinding brand mark (FAMILY-VISUAL-1): same visual family as
   the Root portal's brand mark (vertical pole + two angled arm/sign
   shapes), rendered in this repo's own --color-accent teal-green via
   currentColor rather than any borrowed color value. */
.site-header__brand-mark {
  flex: none;
  color: var(--color-accent);
}
.site-header__brand-text {
  display: flex;
  flex-direction: column;
}
.site-header__site-name {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.site-header__line-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}

/* <details>/<summary> is a native, script-free disclosure widget --
   keyboard-operable and focus-visible out of the box. The `open`
   attribute is always present in the rendered HTML (Layout::renderHeader())
   -- a closed <details> suppresses layout of its content at the browser
   level, in a way plain CSS `display` overrides cannot undo, so this is
   the only zero-JS way to guarantee the nav actually renders at desktop
   width. Here, the <summary> marker/affordance is simply hidden via CSS,
   so it reads as a plain nav list. Only <640px does <summary> reappear
   and become a real toggle -- and since `open` starts present, it starts
   expanded there too; tapping "メニュー" collapses it (see the media
   query below and the Family Design Phase 2 note in renderHeader()). */
.site-nav__details { position: relative; }
.site-nav__toggle {
  display: none;
  cursor: pointer;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.55em 0.9em;
  font-size: 0.95rem;
  user-select: none;
}
.site-nav__toggle::-webkit-details-marker { display: none; }
.site-nav__toggle::after {
  content: "";
  display: inline-block;
  margin-left: 0.4em;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.site-nav__details[open] .site-nav__toggle::after { transform: rotate(-135deg); }

.site-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}
.site-nav__list a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
  padding: 0.25em 0;
}
.site-nav__list a:hover { color: var(--color-accent); }
/* Active Navigation (Family Design Phase 2): marks the nav group matching
   the current page's category. aria-current="true" (not "page") is used in
   the markup since these links point at Top's #anchor sections rather than
   a literal current-page URL -- see Layout::renderHeader(). */
.site-nav__list a[aria-current="true"] {
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .site-nav__toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px; /* comfortable, mis-tap-resistant tap target */
  }
  .site-nav__list {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 0.5rem;
  }
  .site-nav__list a {
    display: block;
    padding: 0.75em 0.25em;
    border-top: 1px solid var(--color-border);
    min-height: 44px;
  }
  .site-nav__details[open] .site-nav__list { display: flex; }
}

/* ---- Breadcrumb ---- */
.breadcrumb { max-width: var(--max-width); margin: 1rem auto 0; padding: 0 1rem; }
.breadcrumb__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.breadcrumb__item:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
}
.breadcrumb__item a { color: var(--color-text-muted); }

/* ---- Main content ---- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1rem 3.5rem;
}
main.main--wide { max-width: var(--max-width-wide); }

/* H1 / Intro / Key Points stay at a narrower reading width even inside
   the wider Top <main> -- this is what makes the page read as "H1, then
   intro, then a clear next thing" instead of one undifferentiated block
   of centered text (REHAB-P2 section 2A). */
.page-lede { max-width: var(--lede-width); }

h1 { font-size: 1.7rem; line-height: 1.5; margin: 0.2em 0 0.8em; max-width: 18em; }
h2 { font-size: 1.25rem; margin: var(--space-section) 0 0.7em; }
h3 { font-size: 1.05rem; margin: 1.4em 0 0.5em; }

p { max-width: 34em; }

/* ---- Hero (FAMILY-VISUAL-1): H1 + eyebrow badge + Lead, structurally
   distinct from the plain unstructured H1-then-paragraphs it replaces.
   Wording of H1/intro is unchanged; this only groups/labels it. ---- */
.page-hero { position: relative; }
.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.65em;
}
/* Route/Node accent (LOW intensity, pure CSS, no image asset): a small
   node dot ahead of the eyebrow label, echoing the Family's Map/Route/
   Node vocabulary without competing with the qualification cards below. */
.page-hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}
.page-hero h1 {
  position: relative;
  padding-bottom: 0.7rem;
}
/* A short route-line segment under the H1, fading out -- the same quiet
   geometry idea as the entry-group kicker rule elsewhere on this page,
   reused here at Hero scale instead of a new visual language. */
.page-hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
}
/* Typography fix (Family Design Phase 2): the Lead paragraph previously had
   no visual distinction at all from ordinary body copy -- only the
   margin-reset rule below existed. A modest, low-intensity bump (slightly
   larger size + a muted color already used elsewhere for secondary text)
   is enough to read as "this is the lead", without the heavier size jump
   the Nurse/Pharmacist MEDIUM-weight lines use -- consistent with Rehab's
   own LOW-MEDIUM Visual Weight target. */
.page-hero__lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
}
.page-hero__lead p:first-child { margin-top: 0; }

/* ---- Hero visual (Family Design Phase 2, Top only): text ~60-65% / visual
   ~35-40%, a smaller visual proportion than the Nurse/Pharmacist lines'
   MEDIUM visual weight -- matches Rehab's own LOW-MEDIUM target. The
   artwork is decorative (see Layout::renderHero()), sized with
   object-fit:contain so nothing is cropped, never upscaled beyond its
   600x400 delivery size. ---- */
.page-hero--with-visual { max-width: none; }
.page-hero__grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
  align-items: center;
}
.page-hero__text { min-width: 0; max-width: var(--lede-width); }
.page-hero__visual {
  min-width: 0;
}
.page-hero__visual-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 340px;
  margin-inline: auto;
  object-fit: contain;
}
@media (max-width: 760px) {
  .page-hero__grid { grid-template-columns: 1fr; }
  .page-hero__visual { order: -1; }
  .page-hero__visual-img { max-width: 260px; }
}

.key-points {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
  margin: 1.75rem 0;
  box-shadow: 0 1px 3px rgba(31, 42, 44, 0.05);
}
.key-points__heading {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0 0 0.6em;
  text-transform: none;
}
.key-points__list { margin: 0; padding-left: 1.2em; }
.key-points__list li { margin-bottom: 0.5em; }
.key-points__list li:last-child { margin-bottom: 0; }

.inline-links { display: flex; flex-direction: column; gap: 0.3em; }
.inline-links a { font-weight: 600; }

/* ---- Top page: section entry points (資格/働く場所・分野/仕事の探し方/
   サービス/ガイド) -- a light "which group am I in" cue via a colored
   kicker rule above each H2, plus a lightweight item grid. Deliberately
   NOT shadowed/elevated cards, per P2 section 2C's "カードだらけにしな
   い" constraint: a border and a soft fill on hover is as far as this
   goes. */
.entry-group { margin-top: var(--space-section); }
.entry-group__heading {
  position: relative;
  padding-top: 0.9rem;
}
.entry-group__heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.entry-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--color-bg);
}
.entry-card h3 { margin: 0 0 0.4em; font-size: 1rem; }
.entry-card p { margin: 0 0 0.7em; font-size: 0.92rem; color: var(--color-text-muted); }
.entry-card .inline-links { margin: 0; }
.entry-card .inline-links a { font-size: 0.92rem; }

/* Service chips on Top: same family as .entry-card's link styling, used
   for the two 紹介型/直接応募＋スカウト groups (converted to real links
   in Phase P2 -- same service names, same target pages already defined
   in Phase 0, no wording change). */
.entry-chip-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.entry-chip-list a {
  display: inline-block;
  padding: 0.5em 0.9em;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.entry-chip-list a:hover { border-color: var(--color-accent); }

.related-links {
  margin-top: var(--space-section);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.related-links__group { margin-bottom: 1.25rem; }
.related-links__group-heading { color: var(--color-text-muted); font-size: 0.9rem; font-weight: 600; }
.related-links__list { list-style: none; padding: 0; margin: 0.4em 0 0; display: flex; flex-wrap: wrap; gap: 0.5em 1em; }
.related-links__list a {
  display: inline-block;
  padding: 0.4em 0.8em;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
}
.related-links__list a:hover { border-color: var(--color-accent); }

/* Structured Comparison table (Family Design Phase 2 architecture only --
   no page currently emits a 'table' block; see PageRenderer::renderTableBlock()).
   The scroll wrapper keeps a wide table from ever forcing horizontal
   scroll on the page body itself, matching this site's flat/borderless
   prose styling elsewhere (no shadow, no card chrome). */
.comparison-table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.comparison-table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 0.92rem; }
.comparison-table th,
.comparison-table td {
  border: 1px solid var(--color-border);
  padding: 0.6em 0.8em;
  text-align: left;
  vertical-align: top;
}
.comparison-table thead th {
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 700;
}
.comparison-table caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5em;
}

/* Official Information Link -- deliberately styled as a plain, labeled
   text link (an eyebrow label + underlined link), never a bordered
   button/pill: P2 section 8/9 explicitly require this to read as "go
   verify the primary source", not as an affiliate-style CTA. */
.official-info { margin-top: 2rem; }
.official-info__eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.35em;
}
.official-info__note { color: var(--color-text-muted); font-size: 0.9rem; }
.official-info__link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.updated-info { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 1rem; }

/* ---- Footer (Family Common Footer, QA-2U §1) ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.site-footer__inner { max-width: var(--width-shell, 960px); margin: 0 auto; }
.site-footer__brand { margin: 0 0 0.3em; font-weight: 700; }
.site-footer__tagline { margin: 0; }
.site-footer__legal-nav ul {
  list-style: none;
  margin: 0.85em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
}
/* Family Root Return (Family Design Phase 2): a quiet text link, not a
   button -- consistent with this site's restrained footer, and doesn't
   compete with the header brand link (Profession Top Return). */
.site-footer__root-link,
.site-footer__company,
.site-footer__contact,
.site-footer__copyright { margin: 0.5em 0 0; }
.site-footer__root-link a,
.site-footer__company a { color: var(--color-text-muted); }

/* ---- Guardrails ---- */
h1, h2, h3, p, a { overflow-wrap: break-word; }
