/* =========================================================
   訪問看護またはり - Shared Styles
   ========================================================= */

:root {
  /* Palette — Orange (default) */
  --bg: #FBF5EC;
  --bg-2: #F5E6D3;
  --bg-3: #EED9BE;
  --surface: #FFFCF7;
  --ink: #3D342E;
  --ink-soft: #6B5E54;
  --ink-muted: #9A8B7E;
  --accent: #D97757;
  --accent-soft: #E8A87C;
  --accent-ink: #8B4A2B;
  --line: #E6D4BD;
  --line-soft: #EFE3D0;
  --success: #7A9B6E;
  --shadow-soft: 0 1px 2px rgba(125, 85, 55, 0.06), 0 8px 24px rgba(125, 85, 55, 0.08);
  --shadow-hover: 0 4px 12px rgba(125, 85, 55, 0.12), 0 18px 40px rgba(125, 85, 55, 0.14);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

/* Green theme */
[data-theme="green"] {
  --bg: #F5F7F0;
  --bg-2: #E6EDDA;
  --bg-3: #D4DFC2;
  --surface: #FBFCF6;
  --ink: #2E3A2A;
  --ink-soft: #5E6A56;
  --ink-muted: #8A9381;
  --accent: #6F8F56;
  --accent-soft: #A8BD8D;
  --accent-ink: #3F5A2C;
  --line: #D7E0C5;
  --line-soft: #E4EBD5;
}

/* Blue theme */
[data-theme="blue"] {
  --bg: #F2F5F8;
  --bg-2: #DFE8F0;
  --bg-3: #C7D6E3;
  --surface: #FAFCFD;
  --ink: #2A3541;
  --ink-soft: #556273;
  --ink-muted: #8796A5;
  --accent: #4A7A9C;
  --accent-soft: #8BADC6;
  --accent-ink: #2C4E6B;
  --line: #CADAE6;
  --line-soft: #DDE7EF;
}

/* =========================================================
   Reset + Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

.serif { font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif; font-weight: 500; }
.hand  { font-family: "Klee One", "Yomogi", "Noto Serif JP", serif; font-weight: 600; }

/* =========================================================
   Layout helpers
   ========================================================= */
.container { width: min(1160px, 92vw); margin: 0 auto; }
.container-narrow { width: min(780px, 92vw); margin: 0 auto; }

section { padding: clamp(64px, 10vw, 120px) 0; position: relative; }
.section-title {
  font-family: "Noto Serif JP", serif;
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.4;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.section-kicker {
  font-family: "Klee One", serif;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0.14em;
  display: inline-block;
  margin-bottom: 18px;
}
.section-kicker::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 10px;
  transform: translateY(-3px);
}

.lede { color: var(--ink-soft); max-width: 640px; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.brand-logo {
  height: 44px; width: auto; display: block;
  mix-blend-mode: multiply;
}
.site-footer .brand-logo { mix-blend-mode: multiply; }
/* Legacy fallback for any remaining brand-mark */
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #FFFCF7; font-family: "Klee One", serif; font-weight: 700;
  font-size: 18px;
}
.brand-name { display: none; }
.brand-sub  { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.nav {
  display: flex; gap: 28px; align-items: center;
}
.nav a {
  font-size: 14.5px; color: var(--ink-soft);
  padding: 6px 2px; position: relative;
  transition: color 0.2s;
}
.nav a:hover { color: var(--accent); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

.header-cta { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px; border-radius: var(--radius-pill);
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #FFFCF7;
  box-shadow: 0 2px 0 var(--accent-ink), 0 6px 18px rgba(217, 119, 87, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--accent-ink), 0 10px 24px rgba(217, 119, 87, 0.35); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--accent-soft); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.hamburger { display: none; background: none; border: 0; padding: 8px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--bg-2);
  padding: 72px 0 32px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 48px;
}
.footer-brand { max-width: 300px; }
.footer-brand p {
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.9;
}
.footer-col h4 {
  font-family: "Noto Serif JP", serif;
  font-size: 15px; font-weight: 500;
  margin: 0 0 16px; letter-spacing: 0.1em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13.5px; color: var(--ink-soft); transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-muted);
}

/* =========================================================
   Floating CTA (mobile/all pages)
   ========================================================= */
.floating-cta {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: flex; flex-direction: column; gap: 10px;
}
.floating-cta .fab {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.floating-cta .fab:hover { transform: translateY(-2px); background: var(--accent); color: #FFFCF7; }
.floating-cta .fab.primary { background: var(--accent); color: #FFFCF7; }

/* =========================================================
   Fade-in on scroll
   ========================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* =========================================================
   Utility cards
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--bg-2); color: var(--accent-ink);
  font-size: 12px; letter-spacing: 0.08em; font-weight: 600;
}

/* =========================================================
   Placeholder imagery (soft striped)
   ========================================================= */
.img-placeholder {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in oklab, var(--accent-soft) 32%, transparent) 0 10px,
      color-mix(in oklab, var(--accent-soft) 18%, transparent) 10px 20px
    ),
    var(--bg-2);
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.1em;
  min-height: 200px;
}
.img-placeholder span {
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 14px; opacity: 0.9;
}

/* =========================================================
   Page hero (shared)
   ========================================================= */
.page-hero {
  padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 6vw, 72px);
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 100%);
  border-bottom: 1px solid var(--line-soft);
}
.page-hero h1 {
  font-family: "Noto Serif JP", serif; font-weight: 500;
  font-size: clamp(32px, 4.5vw, 52px);
  margin: 10px 0 12px;
  letter-spacing: 0.04em;
}
.page-hero .lede { font-size: 16px; max-width: 620px; }

/* =========================================================
   Breadcrumbs
   ========================================================= */
.crumbs {
  display: flex; gap: 10px; align-items: center;
  font-size: 13px; color: var(--ink-muted);
}
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.5; }

/* =========================================================
   Tweaks panel
   ========================================================= */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 96px; z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: 18px; width: 260px;
  display: none; flex-direction: column; gap: 14px;
  font-size: 13px;
}
.tweaks-panel.open { display: flex; }
.tweaks-panel h5 {
  margin: 0; font-family: "Noto Serif JP", serif; font-weight: 500;
  font-size: 14px; letter-spacing: 0.1em;
}
.tweaks-row { display: flex; flex-direction: column; gap: 6px; }
.tweaks-row label { color: var(--ink-soft); font-size: 11.5px; letter-spacing: 0.1em; }
.swatch-row { display: flex; gap: 8px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--line); cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.06); }
.swatch.on { border-color: var(--ink); }
.seg {
  display: flex; border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 3px; background: var(--bg-2);
}
.seg button {
  flex: 1; padding: 6px 8px; border: 0; background: transparent;
  border-radius: var(--radius-pill); font-size: 12px; color: var(--ink-soft);
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 820px) {
  .nav { display: none; }
  .hamburger { display: inline-grid; place-items: center; }
  .header-cta .btn.btn-ghost { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  body { font-size: 16px; }
}
