/* Trailside Handyman — global stylesheet
   Tokens, reset, typography, layout primitives, components.
   Mobile-first. Tablet at 600px, desktop at 1024px. */

/* ---------- Tokens (per trailside-design-spec.md) ---------- */
:root {
  /* Surfaces */
  --c-navy: #1A2332;            /* deep navy/charcoal — hero, footer, nav */
  --c-navy-2: #233044;          /* slightly lighter, for utility bar */
  --c-bg-light: #F5F5F5;        /* light gray content sections */
  --c-white: #ffffff;
  --c-border-dark: #2a3550;

  /* Brand accents */
  --c-accent: #2DD4C4;          /* teal — eyebrows, links, outlines, accents */
  --c-accent-dark: #20B5A8;
  --c-highlight: #F5A623;       /* warm gold/amber — primary CTAs */
  --c-highlight-dark: #D88A0E;

  /* Legacy aliases (kept so component rules below still resolve) */
  --c-teal: var(--c-accent);
  --c-teal-dark: var(--c-accent-dark);

  /* Text */
  --c-text: #1A1A1A;
  --c-text-muted: #6A6A6A;
  --c-text-on-dark: #d8e1ec;

  --f-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --fs-h1: clamp(32px, 5vw, 48px);
  --fs-h2: clamp(28px, 4vw, 36px);
  --fs-h3: 24px;
  --fs-body: 16px;
  --fs-small: 14px;
  --lh-body: 1.6;
  --lh-heading: 1.2;

  --container-max: 1200px;
  --space-section: clamp(48px, 8vw, 80px);

  --radius: 6px;
  --radius-lg: 8px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);

  --nav-height: 72px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-teal); text-decoration: none; }
a:hover { color: var(--c-teal-dark); text-decoration: underline; }
ul, ol { padding-left: 1.4em; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-sans);
  margin: 0 0 0.5em 0;
  line-height: var(--lh-heading);
  font-weight: 700;
  color: inherit;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { margin: 0 0 1em 0; }
strong { font-weight: 700; }
.eyebrow {
  display: inline-block;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-teal);
  margin-bottom: 0.6em;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}
.section {
  padding: var(--space-section) 0;
}
.section--dark {
  background: var(--c-navy);
  color: var(--c-text-on-dark);
}
.section--dark h1, .section--dark h2, .section--dark h3,
.section--dark h4, .section--dark h5, .section--dark h6 {
  color: var(--c-white);
}
.section--light {
  background: var(--c-bg-light);
  color: var(--c-text);
}
.section--light h1, .section--light h2, .section--light h3 {
  color: var(--c-navy);
}
.section--accent {
  /* CTA band: dark navy with teal top accent (per spec 3.1 §3) */
  background: var(--c-navy);
  color: var(--c-white);
  border-top: 4px solid var(--c-accent);
}
.section--accent h1, .section--accent h2, .section--accent h3 {
  color: var(--c-white);
}
.section__header { text-align: center; margin-bottom: 2.5em; }

/* ---------- Page banner (about/services/portfolio header) ---------- */
.page-banner {
  background: var(--c-navy);
  color: var(--c-white);
  padding: 72px 0 56px 0;
  text-align: center;
  border-bottom: 4px solid var(--c-accent);
}
.page-banner__eyebrow {
  display: inline-block;
  color: var(--c-accent);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.page-banner h1 {
  margin: 0 0 14px 0;
  color: var(--c-white);
  font-size: clamp(34px, 5.5vw, 56px);
}
.breadcrumb {
  font-size: var(--fs-small);
  color: var(--c-text-on-dark);
}
.breadcrumb a { color: var(--c-accent); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-white); text-decoration: none; }
.breadcrumb__sep { margin: 0 8px; opacity: 0.5; }

/* ---------- Tile grid (services/portfolio categories) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--c-navy-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--c-white);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
  color: var(--c-white);
}
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.tile:hover img { transform: scale(1.04); }
.tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.78) 100%);
}
.tile__label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-navy);
  flex-shrink: 0;
}
.tile__icon svg { width: 22px; height: 22px; }
.tile__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
@media (min-width: 600px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (min-width: 1024px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* ---------- Bio grid (about + service detail two-column) ---------- */
.bio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}
.bio-grid__photo img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
  display: block;
}
.bio-grid__content h2 { margin-top: 0; }
.bio-grid--reverse .bio-grid__photo { order: 2; }
@media (min-width: 768px) {
  .bio-grid { grid-template-columns: 1fr 1.3fr; gap: 56px; }
  .bio-grid--reverse { grid-template-columns: 1.3fr 1fr; }
}

/* ---------- Checklist (what we offer) ---------- */
.checklist {
  list-style: none;
  padding: 0;
  margin: 1.4em 0 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.checklist li {
  position: relative;
  padding-left: 32px;
  line-height: 1.5;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231A2332' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
@media (min-width: 600px) {
  .checklist { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
}

/* ---------- Feature card (value props) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
}
.feature-card {
  background: var(--c-white);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
}
.feature-card h3 {
  color: var(--c-navy);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 22px;
}
.feature-card p { margin: 0; color: var(--c-text); }
@media (min-width: 768px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:focus-visible {
  outline: 3px solid var(--c-highlight);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--c-highlight);
  color: var(--c-navy);
  border-color: var(--c-highlight);
}
.btn--primary:hover {
  background: var(--c-highlight-dark);
  border-color: var(--c-highlight-dark);
  color: var(--c-navy);
}
.btn--accent {
  background: var(--c-accent);
  color: var(--c-white);
  border-color: var(--c-accent);
}
.btn--accent:hover {
  background: var(--c-accent-dark);
  border-color: var(--c-accent-dark);
  color: var(--c-white);
}
.btn--ghost {
  background: transparent;
  color: var(--c-white);
  border-color: var(--c-white);
}
.btn--ghost:hover {
  background: var(--c-white);
  color: var(--c-navy);
}
.btn--ghost-dark {
  background: transparent;
  color: var(--c-navy);
  border-color: var(--c-navy);
}
.btn--ghost-dark:hover {
  background: var(--c-navy);
  color: var(--c-white);
}
.btn--outline {
  /* Teal outline secondary CTA per spec §4 */
  background: transparent;
  color: var(--c-accent);
  border-color: var(--c-accent);
}
.btn--outline:hover {
  background: var(--c-accent);
  color: var(--c-navy);
}

/* ---------- Site nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; }
.site-nav__utility {
  background: var(--c-navy-2);
  color: var(--c-white);
  font-size: var(--fs-small);
  padding: 8px 0;
}
.site-nav__utility-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.site-nav__utility a { color: inherit; }
.site-nav__utility a:hover { color: var(--c-accent); text-decoration: none; }
.site-nav__welcome { font-weight: 500; }
.site-nav__contact { display: flex; gap: 18px; flex-wrap: wrap; }

.site-nav__main {
  background: var(--c-navy);
  color: var(--c-white);
  border-bottom: 1px solid var(--c-border-dark);
}
.site-nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  gap: 16px;
}
.site-nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-nav__logo img {
  height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
}
.site-nav__hamburger {
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--c-white);
  margin-left: auto;
}
.site-nav__hamburger svg { display: block; }
.site-nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  background: var(--c-navy);
  border-top: 1px solid var(--c-border-dark);
  padding: 12px 0 16px 0;
}
.site-nav.is-open .site-nav__links { display: flex; }
.site-nav__links a {
  display: block;
  padding: 10px 4px;
  color: var(--c-white);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.site-nav__links a:hover { color: var(--c-accent); text-decoration: none; }
.site-nav__links a[aria-current="page"] {
  color: var(--c-accent);
  border-bottom: 2px solid var(--c-accent);
}
.site-nav__cta {
  display: none;
  margin-left: 8px;
  padding: 10px 20px;
  font-size: 14px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 350px;
  background: var(--c-navy);
  color: var(--c-white);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(20, 34, 58, 0.82) 0%, rgba(20, 34, 58, 0.55) 100%);
  z-index: 1;
}
.hero__inner {
  position: relative;
  z-index: 2;
  padding: 80px 0;
  max-width: 760px;
}
.hero__title {
  font-size: clamp(32px, 5.5vw, 52px);
  margin-bottom: 0.4em;
  color: var(--c-white);
}
.hero__sub {
  font-size: clamp(16px, 2vw, 18px);
  margin-bottom: 1.6em;
  color: var(--c-text-on-dark);
  max-width: 600px;
}
.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-navy);
  color: var(--c-text-on-dark);
  padding: 64px 0 0 0;
  font-size: var(--fs-small);
  border-top: 2px solid var(--c-accent);
}
.site-footer__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.site-footer__col h3 {
  color: var(--c-accent);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1em;
}
.site-footer__col p, .site-footer__col li {
  color: var(--c-text-on-dark);
  margin: 0 0 0.6em 0;
}
.site-footer__col ul { list-style: none; padding: 0; margin: 0; }
.site-footer__col a { color: var(--c-text-on-dark); }
.site-footer__col a:hover { color: var(--c-teal); text-decoration: none; }
.site-footer__brand img {
  height: 52px;
  width: auto;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}
.site-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-navy-2);
  color: var(--c-white);
  transition: background 0.2s, transform 0.15s;
}
.site-footer__social a:hover {
  background: var(--c-teal);
  color: var(--c-white);
  transform: translateY(-2px);
}
.site-footer__social svg { width: 18px; height: 18px; fill: currentColor; }
.site-footer__bottom {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--c-border-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer__legal a { color: var(--c-text-on-dark); }
.site-footer__legal a:hover { color: var(--c-teal); text-decoration: none; }

/* ---------- Policy pages (lifted from add_pages.py) ---------- */
.policy-content {
  max-width: 920px;
  margin: 60px auto 100px;
  padding: 0 24px;
  color: #d8d8d8;
  font-size: 17px;
  line-height: 1.75;
}
.policy-content .policy-meta {
  color: #b0b0b0;
  margin: 0 0 2.2em 0;
  padding-bottom: 1.4em;
  border-bottom: 1px solid var(--c-border-dark);
  font-size: 0.95em;
}
.policy-content .policy-meta strong { color: var(--c-white); }
.policy-content h2 {
  color: var(--c-white) !important;
  font-size: 1.65em;
  margin: 2.4em 0 0.6em 0;
  font-weight: 700;
  line-height: 1.3;
}
.policy-content h3 {
  color: #e8e8e8 !important;
  font-size: 1.2em;
  margin: 1.8em 0 0.5em 0;
  font-weight: 600;
}
.policy-content p { margin: 0.9em 0; color: #d8d8d8; }
.policy-content ul { padding-left: 1.5em; margin: 0.9em 0; list-style: disc; }
.policy-content li { margin-bottom: 0.55em; color: #d8d8d8; }
.policy-content strong { color: var(--c-white); }
.policy-content a { color: var(--c-highlight); text-decoration: underline; }
.policy-content a:hover { color: var(--c-white); }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
  }
  .hero { min-height: 420px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .site-nav__hamburger { display: none; }
  .site-nav__bar { gap: 32px; }
  .site-nav__links {
    display: flex;
    flex-direction: row;
    width: auto;
    background: transparent;
    border-top: 0;
    padding: 0;
    gap: 28px;
    margin-left: auto;
  }
  .site-nav__links a { padding: 6px 0; }
  .site-nav__links a[aria-current="page"] { border-bottom: 2px solid var(--c-accent); }
  .site-nav__cta {
    display: inline-block;
  }
  .hero { min-height: 500px; }
  .site-footer__cols {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
  }
  .policy-content { margin: 80px auto 120px; }
}
