/* site.css: Alpine Spine and Sport. Tokens in :root, consumed everywhere;
   no rule below hard-codes a raw colour, size, or duration a token names. */

:root {
  /* --- Surfaces ------------------------------------------------------- */
  --color-surface:        #F4F5F7;
  --color-surface-body:   #f4f4f4;
  --color-surface-dark:   #0066BF;
  --color-surface-dark-hover: #005299;
  --color-white:          #ffffff;

  /* --- Text ----------------------------------------------------------- */
  --color-text:           #233452;
  --color-heading:        #00102E;
  --color-text-on-dark:   #ffffff;
  --color-muted:          #67707F;

  /* --- Brand greens ----------------------------------------------------- */
  --color-link:           #0F8200;
  --color-link-hover:     #0B6300;
  --color-cta:            #368700;
  --color-cta-hover:      #2C7000;
  --color-accent-on-dark: #7FFF73;  /* only valid on --color-surface-dark */
  --color-accent-graphic: #49B000;  /* decorative divider stripe only, not a UI fill */

  /* --- Lines and state ------------------------------------------------ */
  --color-border:         #dbdbdb;
  --color-danger:         #b73d3d;
  --color-focus:          #00102E;

  /* --- Typography ------------------------------------------------------- */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;

  --step-h1:   clamp(2rem, 1.35rem + 3.2vw, 3rem);
  --step-h2:   clamp(1.6rem, 1.15rem + 2.2vw, 2.375rem);
  --step-h3:   clamp(1.25rem, 1.05rem + 1vw, 1.5rem);
  --step-body: 1rem;
  --step-small: 0.875rem;

  --leading-heading: 1.1;
  --leading-body:    1.7;

  /* --- Spacing ---------------------------------------------------------- */
  --space-1: 10px;
  --space-2: 20px;
  --space-3: 30px;
  --space-4: clamp(30px, 5vw, 60px);
  --space-5: clamp(30px, 7vw, 80px);
  --space-6: clamp(50px, 7vw, 100px);
  --space-7: clamp(50px, 10vw, 120px);
  --block-gap: 24px;

  /* --- Widths --------------------------------------------------------- */
  --width-prose: 740px;
  --width-wide: 1140px;
  --container-pad: 1rem;   /* load-bearing: the `sizes` maths depends on it */

  /* --- Radii and lines ------------------------------------------------ */
  --radius-btn: 15px;
  --radius-card: 15px;
  --radius-content: 30px;
  --stripe-height: 15px;
  --gap-hero-card: 15px;   /* own token: equal to --stripe-height by coincidence, not by relationship */

  /* --- Layering ------------------------------------------------------- */
  --z-header: 100;
  --z-nav-panel: 200;
  --z-skip: 300;

  /* --- Motion --------------------------------------------------------- */
  --motion-fast: 150ms;
  --motion-base: 250ms;
  --motion-ease: cubic-bezier(0.2, 0, 0.2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: var(--leading-body);
  color: var(--color-text);
  background-color: var(--color-surface-body);
  background-image: url("/images/reno-chiropractor-background-1224.avif");
  background-repeat: no-repeat;
  background-position: left top;
  background-size: cover;
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  color: var(--color-heading);
  line-height: var(--leading-heading);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

h1 { font-size: var(--step-h1); }
h2 { font-size: var(--step-h2); margin-top: var(--space-4); }
h3 { font-size: var(--step-h3); margin-top: var(--space-3); }

p { margin: 0 0 var(--block-gap); }

a {
  color: var(--color-link);
  text-underline-offset: 0.15em;
}

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

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--color-white);
}

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

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--width-wide);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.prose { max-width: var(--width-prose); }

.content-card {
  background-color: var(--color-white);
  border-radius: var(--radius-content);
  padding: var(--space-4);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  margin-top: var(--gap-hero-card);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-1);
  top: calc(-1 * var(--space-6));
  z-index: var(--z-skip);
  padding: var(--space-1) var(--space-2);
  background: var(--color-white);
  color: var(--color-link);
  font-weight: 600;
  transition: top var(--motion-fast) var(--motion-ease);
}

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

/* Decorative header band: HOME PAGE ONLY (scripts/assemble_shell.py only
   emits the markup when path == '/'). Desktop only, above 1024px. */
.header-band { display: none; }

@media (min-width: 1025px) {
  .header-band {
    display: block;
    height: 400px;
    background-image: url("/images/reno-chiropractor-alpine-header-1563.avif");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
  }
}

/* Buttons: base shape here, filled and ghost variants below. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--motion-fast) var(--motion-ease),
              border-color var(--motion-fast) var(--motion-ease);
}

.btn--cta {
  background-color: var(--color-cta);
  color: var(--color-white);
}

.btn--cta:hover,
.btn--cta:focus-visible {
  background-color: var(--color-cta-hover);
}

.site-header .btn--cta {
  border-color: var(--color-white);
}

.btn--ghost {
  background-color: transparent;
  border-color: currentColor;
  color: var(--color-link);
}

.btn--ghost:hover {
  color: var(--color-link-hover);
  border-color: var(--color-link-hover);
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* Site header: persistent bar (logo, contact links, nav), identical on
   every page. The decorative desktop-only band is .header-band above. */
.site-header {
  background-color: var(--color-surface-dark);
  border-bottom: var(--stripe-height) solid var(--color-accent-graphic);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding-block: var(--space-1);
}

.site-header__logo-link {
  display: block;
  flex-shrink: 0;
}

.site-header__logo {
  width: 140px;
  height: auto;
}

@media (min-width: 48rem) {
  .site-header__logo { width: 200px; }
}

@media (min-width: 1025px) {
  .site-header__logo { width: 268px; }
}

.site-header__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3em;
  font-size: var(--step-body);
  font-weight: 600;
  min-width: 0;
}

.site-header__contact a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-header__contact a {
  color: var(--color-accent-on-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  text-decoration: none;
}

.site-header__contact a:hover,
.site-header__contact a:focus-visible {
  text-decoration: underline;
}

/* Navigation: no-JS-safe by construction. The panel is a plain visible
   stacked list until main.js adds .js-enhanced to <html>; only then does it
   collapse behind the toggle. */
.site-nav {
  background-color: var(--color-surface-dark);
}

.nav-toggle-row {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
}

.js-enhanced .nav-toggle {
  display: inline-flex;
  margin-left: auto;
  background: transparent;
  border: 2px solid var(--color-white);
  color: var(--color-white);
  border-radius: 4px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle .icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .icon--menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: block; }

.nav-panel__list {
  list-style: none;
  margin: 0;
  padding: var(--space-1) 0;
  display: flex;
  flex-direction: column;
}

/* Collapsed state ONLY exists once JS has proven it can run the toggle. */
.js-enhanced .nav-panel[hidden] {
  display: none;
}

.nav-item > a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-text-on-dark);
  font-size: var(--step-small);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.nav-item > a:hover,
.nav-item > a:focus-visible {
  text-decoration: underline;
}

/* :not(.btn) so this never outranks a filled button on specificity and
   repaints its label invisible. */
.site-nav a[aria-current]:not(.btn) {
  font-weight: 700;
  text-decoration: underline;
  color: var(--color-accent-on-dark);
}

.nav-sublist {
  list-style: none;
  margin: 0;
  padding-left: var(--space-2);
}

.nav-sublist .nav-item > a {
  font-weight: 400;
  border-bottom: none;
}

@media (min-width: 1025px) {
  .nav-toggle { display: none !important; }

  .nav-panel,
  .js-enhanced .nav-panel[hidden] {
    display: block !important;
  }

  .nav-panel__list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: 0;
  }

  .nav-item { position: relative; }

  .nav-item > a {
    border-bottom: none;
    padding: var(--space-2) 0;
  }

  /* Direct children only: the top-level bar, not the hover dropdowns. */
  .nav-panel__list > .nav-item > a {
    font-size: var(--step-body);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .nav-sublist {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: var(--color-surface-dark);
    padding: var(--space-1) 0;
    z-index: var(--z-nav-panel);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  }

  .nav-item:hover > .nav-sublist,
  .nav-item:focus-within > .nav-sublist {
    display: block;
  }

  .nav-sublist .nav-item > a { padding-inline: var(--space-2); }
}

.breadcrumb {
  padding-block: var(--space-1);
  font-size: var(--step-small);
}

.breadcrumb__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  color: var(--color-muted);
}

.breadcrumb__list li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4em;
  color: var(--color-muted);
}

.breadcrumb a { color: var(--color-link); }
.breadcrumb [aria-current="page"] { color: var(--color-text); }

.figure { margin: 0 0 var(--block-gap); }

.figure > .media-link,
.figure > img {
  border-radius: var(--radius-card);
  overflow: hidden;
  display: block; /* load-bearing: .media-link is an inline <a>; without this its overflow:hidden won't clip the block-level img to the radius */
}

.figure > .media-link > img { width: 100%; }

.figcaption {
  margin-top: var(--space-1);
  font-size: var(--step-small);
  color: var(--color-muted);
}

/* Disclosure and hours blocks: shared verbatim on every page. */
.disclosure {
  margin-top: var(--space-6);
  padding: var(--space-3);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  font-size: var(--step-small);
  color: var(--color-muted);
}

.disclosure h2 { margin-top: 0; font-size: var(--step-body); }

.hours-block { font-size: var(--step-small); }

.hours-block table {
  border-collapse: collapse;
  width: 100%;
  max-width: 320px;
}

.hours-block td { padding: 0.2em 0.6em 0.2em 0; }
.hours-block td:last-child { padding-right: 0; text-align: right; }

.site-footer {
  margin-top: var(--space-7);
  background-color: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  padding-block: var(--space-5);
}

.site-footer a { color: var(--color-accent-on-dark); }

/* h1-h4's own color rule wins over the ancestor's inherited color, so this
   override is required or footer headings inherit the wrong (failing) color. */
.site-footer h2 {
  color: var(--color-text-on-dark);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .site-footer__grid { grid-template-columns: repeat(3, 1fr); }
}

.site-footer__logo { width: 160px; height: auto; }

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--color-accent-on-dark);
  text-decoration: none;
}

.site-footer__copyright {
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--step-small);
  color: var(--color-text-on-dark);
}

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

.service-list a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  min-height: 44px;
  box-sizing: border-box;
  background-color: var(--color-surface-dark);
  border: 1px solid var(--color-surface-dark);
  border-radius: var(--radius-card);
  font-weight: 600;
  color: var(--color-text-on-dark);
  text-decoration: none;
}

.service-list a:hover,
.service-list a:focus-visible {
  background-color: var(--color-surface-dark-hover);
  border-color: var(--color-surface-dark-hover);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.post-list__link {
  display: block;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--motion-fast) var(--motion-ease),
              box-shadow var(--motion-fast) var(--motion-ease);
}

.post-list__link:hover,
.post-list__link:focus-visible {
  border-color: var(--color-link);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.post-list__title {
  display: block;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-link);
  margin-bottom: 0.3em;
}

.post-list__date {
  display: block;
  font-size: var(--step-small);
  color: var(--color-muted);
  margin-bottom: 0.5em;
}

.map-embed {
  aspect-ratio: 16 / 9;
  max-width: var(--width-prose);
  margin: 0 0 var(--space-4);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-form {
  max-width: var(--width-prose);
}

.contact-form__required-note,
.recaptcha-note {
  font-size: var(--step-small);
  color: var(--color-muted);
}

.recaptcha-note {
  margin-top: var(--space-3);
}

.form-field {
  margin-bottom: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.form-field label {
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  font: inherit;
  padding: 0.6em 0.75em;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-white);
  color: var(--color-text);
  min-height: 44px;
}

.form-field textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 1px;
}

.form-field--error input,
.form-field--error textarea {
  border-color: var(--color-danger);
}

.form-field__error {
  color: var(--color-danger);
  font-size: var(--step-small);
}

/* Off-screen, not display:none/visibility:hidden: a bot that checks those
   properties before filling a form skips exactly the fields that use them. */
.form-field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
