/*
 * Root Portal CSS — owned exclusively by this repo. Never imports or
 * depends on the Nurse site's /nurse/assets/css/main.css (Phase RP-1
 * instructions, item 7). Deliberately avoids the Nurse site's
 * `.hero-inner{align-items:center}` (unreset under flex-direction:column)
 * + `html,body{overflow-x:hidden}` combination as a preventive measure
 * against a code smell identified during the Root Portal audit — NOT
 * because it was confirmed to actively clip production content. Final
 * measurement (Chrome DevTools Protocol Emulation.setDeviceMetricsOverride,
 * forcing a true 320/375px viewport, since a plain `--window-size` request
 * turned out to be silently clamped to ~500px by this environment while
 * the screenshot PNG was still cropped to the requested width — see
 * docs/root-portal-ownership.md §4) found zero active horizontal overflow
 * on either the Nurse production Root or this repo's own pages at any
 * tested width. The pattern nonetheless remains a real risk if content
 * grows, so this file avoids `overflow-x:hidden` entirely and sets
 * `align-items: flex-start` (not `stretch`) on `.hero__inner` together
 * with explicit `max-width` on its text children, so nothing needs to be
 * masked in the first place.
 */

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

:root {
  --brand-dark: #0E6F66;
  --brand-main: #2A9D94;
  --brand-mint: #B9DCD3;
  --brand-bg: #F4F8F6;
  --brand-sand: #EDE6D6;
  --text-main: #1F2D2A;
  --text-muted: #52645F;
  --surface: #FFFFFF;
  --radius-md: 14px;
  --shell-max: 1080px;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  color: var(--text-main);
  background: var(--brand-bg);
  line-height: 1.7;
  min-width: 0;
}

img, svg {
  max-width: 100%;
  height: auto;
}

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

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

/* Skip link: visually hidden until keyboard focus */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0.5rem;
  background: var(--brand-dark);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 3px solid var(--brand-main);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--brand-mint);
  width: 100%;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.25rem;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  text-decoration: none;
  color: var(--brand-dark);
  font-weight: 700;
  flex: 0 1 auto;
}

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

.site-header__brand-text {
  font-size: 1.05rem;
  white-space: nowrap;
}

/* Nav: allowed to wrap so an additional profession link never forces a
   horizontal overflow — never `flex-wrap: nowrap` + fixed header height. */
.site-nav {
  min-width: 0;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--brand-bg);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--brand-bg) 0%, var(--surface) 100%);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--brand-mint);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.hero__eyebrow {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--brand-mint);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
}

.hero__title {
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  line-height: 1.4;
  color: var(--brand-dark);
  margin: 0;
  max-width: 100%;
  text-wrap: balance;
}

.hero__lead {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 42rem;
}

/* ---------- Sections ---------- */
.section {
  padding: 2.5rem 0;
  width: 100%;
  min-width: 0;
}

.section__title {
  font-size: 1.35rem;
  color: var(--brand-dark);
  margin: 0 0 1.25rem;
}

/* ---------- Profession cards ---------- */
.profession-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  width: 100%;
}

.profession-card {
  background: var(--surface);
  border: 1px solid var(--brand-mint);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profession-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.profession-card__title a {
  text-decoration: none;
  color: var(--brand-dark);
}

.profession-card__desc {
  font-size: 0.92rem;
  color: var(--text-main);
  margin: 0;
  flex-grow: 1;
}

.profession-card__cta {
  display: inline-block;
  background: var(--brand-dark);
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  align-self: flex-start;
}

.profession-card__cta:hover,
.profession-card__cta:focus-visible {
  background: var(--brand-main);
}

/* ---------- Legal pages ---------- */
.legal-page section {
  margin-top: 1.75rem;
}

.legal-page h2 {
  font-size: 1.1rem;
  color: var(--brand-dark);
  margin: 0 0 0.5rem;
}

.legal-page h3 {
  font-size: 1rem;
  color: var(--brand-dark);
  margin: 1rem 0 0.4rem;
}

.legal-page p,
.legal-page li {
  color: var(--text-main);
  max-width: 42rem;
}

.legal-intro {
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  background: var(--brand-bg);
  border: 1px solid var(--brand-mint);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--brand-dark);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-sand);
  border-top: 1px solid var(--brand-mint);
  padding: 2rem 0;
  width: 100%;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0;
}

.site-footer__tagline {
  color: var(--text-muted);
  margin: 0;
  max-width: 42rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.site-footer a {
  color: var(--brand-dark);
  text-decoration: underline;
}

.site-footer__copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .shell {
    padding: 0 1rem;
  }

  .site-header__inner {
    padding: 0.6rem 1rem;
  }

  .hero {
    padding: 1.75rem 0;
  }

  .section {
    padding: 1.75rem 0;
  }
}
