/* CIMJ Home Health Care — Sage & Stone Design System
   Shared base: nav, footer, buttons, utilities (all pages)  */

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── TOKENS ──────────────────────────────────────────── */
:root {
  --bg:         #FAF8F4;
  --green:      #2C6E49;
  --green-dark: #1E2D1F;
  --accent:      #C47B3E;
  --accent-text: #8C4E1A;
  --border:     #E8E2D8;
  --surface:    #F0EBE3;
  --text:       #2C2A25;
  --text-light: #6B6358;
  --text-muted: #7A6B5A;
  --blue:       #4A6FA5;
  --display:    'Cormorant Garamond', Georgia, serif;
  --body:       'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* ── BASE ────────────────────────────────────────────── */
html  { scroll-behavior: smooth; }
body  { font-family: var(--body); background: var(--bg); color: var(--text); line-height: 1.6; }
img   { display: block; max-width: 100%; }
a     { text-decoration: none; color: inherit; }

/* ── ACCESSIBILITY ───────────────────────────────────── */
.skip-link { position: absolute; top: -100%; left: 8px; z-index: 9999; padding: 12px 24px; background: var(--green); color: #fff; font-size: 0.9rem; font-weight: 600; border-radius: 0 0 8px 8px; transition: top 0.15s; }
.skip-link:focus { top: 0; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }

/* ── REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ── NAVIGATION ──────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 80px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 40px;
}

.nav-logo-link { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-logo-link img { height: 48px; width: auto; }
.nav-logo-text { display: flex; flex-direction: column; gap: 1px; }
.nav-logo-primary { font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text); line-height: 1.2; }
.nav-logo-tagline { font-family: var(--display); font-size: 17px; font-style: italic; color: var(--green); line-height: 1.2; }

.nav-links { display: flex; gap: 4px; list-style: none; margin: 0 auto; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-light); padding: 8px 14px; border-radius: 4px; transition: color 0.2s, background 0.2s; display: block; }
.nav-links a:hover, .nav-links a.active { color: var(--green); background: var(--surface); }

.nav-cta { background: var(--green); color: #fff; padding: 12px 28px; border-radius: 4px; font-size: 14px; font-weight: 600; transition: background 0.2s; flex-shrink: 0; white-space: nowrap; }
.nav-cta:hover { background: var(--green-dark); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: transparent; border: none; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── UTILITIES ───────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section-label { display: block; font-family: var(--body); font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 12px; }
.section-h2 { font-family: var(--display); font-size: 48px; font-weight: 400; color: var(--green-dark); line-height: 1.2; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.eyebrow-line { width: 40px; height: 2px; background: var(--accent); flex-shrink: 0; }
.eyebrow-text { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-primary      { display: inline-block; background: var(--green);  color: #fff;         padding: 15px 36px; border-radius: 4px; font-size: 15px; font-weight: 600; font-family: var(--body); border: none; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline      { display: inline-block; background: transparent;   color: var(--green); padding: 14px 36px; border-radius: 4px; font-size: 15px; font-weight: 600; font-family: var(--body); border: 1.5px solid var(--green); cursor: pointer; transition: all 0.2s; }
.btn-outline:hover { background: var(--green); color: #fff; }
.btn-accent       { display: inline-block; background: var(--accent-text);  color: #fff;         padding: 15px 36px; border-radius: 4px; font-size: 15px; font-weight: 600; font-family: var(--body); border: none; cursor: pointer; transition: opacity 0.2s; }
.btn-accent:hover { opacity: 0.9; }
.btn-white        { display: inline-block; background: var(--bg);      color: var(--green); padding: 18px 44px; border-radius: 4px; font-size: 16px; font-weight: 700; font-family: var(--body); border: none; cursor: pointer; white-space: nowrap; transition: opacity 0.2s; }
.btn-white:hover  { opacity: 0.92; }
.btn-outline-navy { display: inline-flex; align-items: center; background: transparent; color: var(--green-dark); padding: 13px 28px; border-radius: 4px; font-size: 0.88rem; font-weight: 600; font-family: var(--body); border: 1.5px solid var(--green-dark); cursor: pointer; transition: all 0.2s; }
.btn-outline-navy:hover { background: var(--green-dark); color: #fff; }

/* ── FOOTER ──────────────────────────────────────────── */
footer { background: #1A1E1B; }
.footer-inner { padding: 60px 80px 40px; display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 48px; }

.footer-logo { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--bg); margin-bottom: 4px; line-height: 1.3; }
.footer-logo em { display: block; font-style: italic; font-size: 17px; font-weight: 400; color: var(--accent); }
.footer-tagline { font-size: 13px; color: #7A8E7C; line-height: 1.7; margin-top: 10px; }

.footer-col-title { font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 13px; color: #8EA690; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }

.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; color: #8EA690; font-size: 13px; line-height: 1.6; }
.footer-contact-item:last-child { margin-bottom: 0; }
.footer-contact-item svg { flex-shrink: 0; margin-top: 2px; color: #7AB596; }

.footer-bottom { padding: 20px 80px; border-top: 1px solid #253428; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 12px; color: #7A8E7C; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 12px; color: #7A8E7C; transition: color 0.2s; }
.footer-legal a:hover { color: #fff; }

/* ── BACK TO TOP ─────────────────────────────────────── */
#back-to-top { position: fixed; bottom: 28px; right: 28px; z-index: 200; width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(44,110,73,0.4); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.22s, transform 0.22s, background 0.22s; }
#back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#back-to-top:hover { background: var(--green-dark); transform: translateY(-2px); }

/* ════════════════════════════════════════════════════════
   SHARED PAGE HERO
   ════════════════════════════════════════════════════════ */
.page-hero { background: var(--green-dark); padding: 80px 80px; }
.page-hero .section-label, .page-hero .eyebrow-text { color: #D49060; }
.page-hero .eyebrow-line { background: var(--accent); }
.page-hero h1 { font-family: var(--display); font-size: 60px; font-weight: 400; line-height: 1.1; color: var(--bg); margin-bottom: 20px; }
.page-hero h1 em { font-style: italic; color: #7AB596; }
.page-hero p { font-size: 17px; line-height: 1.75; color: rgba(250,248,244,0.7); margin-bottom: 32px; }
.page-hero p:last-child { margin-bottom: 0; }


/* ════════════════════════════════════════════════════════
   RESPONSIVE — 1024 px
   ════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  nav { padding: 18px 40px; }
  .footer-inner, .footer-bottom { padding-left: 40px; padding-right: 40px; }
  .page-hero { padding-left: 40px; padding-right: 40px; }
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE — 900 px
   ════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
.footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════════════════════
   RESPONSIVE — 640 px
   ════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  nav { padding: 16px 24px; position: sticky; top: 0; flex-wrap: wrap; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 80px; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 99; }
  .nav-links.open li { width: 100%; }
  .nav-links.open a { padding: 12px 24px; border-radius: 0; }
  nav .nav-cta { display: none; }
  .nav-toggle { display: flex; min-width: 44px; min-height: 44px; padding: 10px; justify-content: center; align-items: center; }
  .page-hero { padding: 56px 24px; }
  .footer-inner { grid-template-columns: 1fr; padding: 40px 24px 24px; }
  .footer-bottom { flex-direction: column; text-align: center; padding: 20px 24px; }
  .footer-legal { justify-content: center; }
}

/* ── PRINT ───────────────────────────────────────────── */
@media print {
  /* Reveal all animated elements regardless of JS/animation state */
  .anim-fade-up, .hero-anim { animation: none !important; opacity: 1 !important; transform: none !important; }
  /* Hide interactive-only chrome */
  .nav-toggle, #back-to-top, .skip-link { display: none !important; }
  /* Ensure light backgrounds/borders always print */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; }
  /* Page hero — dark green to white */
  .page-hero { background: #fff !important; border-bottom: 2px solid #2C6E49; }
  .page-hero h1 { color: #1E2D1F !important; }
  .page-hero h1 em { color: #2C6E49 !important; }
  .page-hero p { color: #555 !important; }
  .page-hero .section-label, .page-hero .eyebrow-text { color: #C47B3E !important; }
  .page-hero .eyebrow-line { background: #C47B3E !important; }
  /* Footer — dark to white */
  footer { background: #fff !important; border-top: 2px solid #2C6E49; }
  .footer-logo { color: #1E2D1F !important; }
  .footer-logo em { color: #C47B3E !important; }
  .footer-tagline { color: #555 !important; }
  .footer-col-title { color: #C47B3E !important; }
  .footer-links a { color: #2C6E49 !important; }
  .footer-contact-item { color: #555 !important; }
  .footer-contact-item svg { color: #2C6E49 !important; }
  .footer-bottom { border-top-color: #cdd9d2 !important; }
  .footer-copy { color: #555 !important; }
  .footer-legal a { color: #555 !important; }
}
