/*
 * Little Apple Tree Service: site styles. Mobile-first.
 * Breakpoints: 768px (48em), 1024px (64em), 1280px (80em).
 * Changelog:
 *   2026-10-16  Created.
 *   2026-10-18  Self-hosted fonts.
 */

/* Fonts: Google Fonts files (latin subset) hosted here, so pages don't wait on
   a third-party stylesheet. Bitter and Source Sans 3 are variable fonts. */
@font-face {
  font-family: "Alfa Slab One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/alfa-slab-one.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/bitter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/source-sans-3.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colors (from the brief) */
  --color-bg: #1F3A24;            /* dark forest green, main background */
  --color-card: #2C4E32;          /* lighter green cards */
  --color-text-on-dark: #F4EBD9;  /* cream */
  --color-article-bg: #F3F8F1;    /* very light green, article pages */
  --color-text-on-light: #2B2118; /* dark brown, ALL text on light backgrounds */
  --color-cta: #E07B39;           /* pumpkin orange, CTA buttons ONLY */
  --color-cta-hover: #C4682A;
  --color-cta-text: #2B2118;
  --color-apple: #E3262E;         /* logo apple ONLY */
  --glow-cream: 0 0 18px rgba(244, 235, 217, 0.18);

  /* Project additions */
  --color-bg-alt: #1A3220;        /* alternate section band, a shade darker */
  --color-text-muted: #D8CDB6;    /* softer cream for secondary text (AA on all greens) */
  --color-line: rgba(244, 235, 217, 0.22);
  --color-error: #FFC2B3;         /* pale coral; distinct from the apple red */

  /* Type */
  --font-logo: 'Alfa Slab One', serif;
  --font-heading: 'Bitter', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --font-size-body: 1.125rem;     /* 18px */
  --font-size-small: 1rem;        /* floor: never below 16px */
  --font-size-h1: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  --font-size-h2: clamp(1.75rem, 1.4rem + 1.4vw, 2.375rem);
  --font-size-h3: 1.375rem;
  --line-height-body: 1.6;
  --line-height-heading: 1.15;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --radius: 8px;
  --container-max: 75rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --focus: var(--color-text-on-dark);
}

/* ---- Base ------------------------------------------------------------ */

html {
  background: var(--color-bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-on-dark);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-text-on-dark);
  color: var(--color-text-on-light);
  font-weight: 600;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---- Logo ------------------------------------------------------------
   Dotless i (ı) with the apple placed where the dot would be. */

.logo {
  display: inline-flex;
  padding-top: 0.15em; /* room for the apple above the i */
  flex-direction: column;
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.05;
  color: var(--color-text-on-dark);
  text-decoration: none;
  white-space: nowrap;
}

.logo-line--bottom {
  font-size: 0.8em;
  letter-spacing: 0.07em;
}

.logo-i {
  position: relative;
  display: inline-block;
}

.logo-apple {
  position: absolute;
  left: 50%;
  top: -0.17em;
  width: 0.5em;
  height: 0.45em;
  transform: translateX(-50%);
  fill: var(--color-apple);
}

@media (min-width: 48em) {
  .site-header .logo {
    font-size: 1.625rem;
  }
}

/* ---- Buttons --------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.55em 1.25em;
  background: var(--color-cta);
  color: var(--color-cta-text);
  border: 2px solid var(--color-cta);
  border-radius: var(--radius);
  /* 19px bold: counts as large text, so the hover shade still passes AA */
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--color-cta-hover);
  border-color: var(--color-cta-hover);
}

.button:focus-visible {
  outline-color: var(--focus);
}

.button[disabled] {
  cursor: progress;
  opacity: 0.8;
}

.button--large {
  min-height: 3.25rem;
  padding: 0.7em 1.5em;
}

/* Call buttons: cream outline, so orange stays the quote CTA. */
.button--outline {
  background: transparent;
  color: var(--color-text-on-dark);
  border-color: var(--color-text-on-dark);
}

.button--outline:hover {
  background: var(--color-text-on-dark);
  color: var(--color-text-on-light);
  border-color: var(--color-text-on-dark);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---- Header and nav -------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 4.75rem;
  padding-block: var(--space-xs);
}

.header-inner .logo {
  margin-right: auto;
}

.header-call {
  display: none;
  font-weight: 600;
  white-space: nowrap;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  color: var(--color-text-on-dark);
  border-radius: var(--radius);
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

html:not(.js) .nav-toggle {
  display: none;
}

.site-nav {
  display: none;
}

.site-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.35);
}

html:not(.js) .site-nav {
  display: block;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--gutter) var(--space-md);
}

.nav-list a:not(.button) {
  display: block;
  padding: var(--space-xs) 0;
  font-weight: 600;
  text-decoration: none;
}

.nav-list a:not(.button):hover,
.nav-list a[aria-current="page"]:not(.button) {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.nav-list .button {
  margin-top: var(--space-xs);
  width: 100%;
}

@media (min-width: 48em) {
  .header-call {
    display: inline;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav,
  .site-nav.is-open {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    padding: 0;
  }

  .nav-list .button {
    margin-top: 0;
    width: auto;
  }

  .header-call + .nav-toggle + .site-nav {
    margin-left: var(--space-sm);
  }
}

/* ---- Sections -------------------------------------------------------- */

.section {
  padding-block: var(--space-xl);
}

.section--alt {
  background: var(--color-bg-alt);
}

.section-tight {
  padding-bottom: var(--space-xl);
}

.section-intro,
.lede {
  max-width: 40em;
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
}

.section-head a {
  font-weight: 600;
}

.page-header {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: var(--space-lg);
}

/* ---- Hero ------------------------------------------------------------ */

.hero {
  padding-block: var(--space-lg) var(--space-xl);
}

.hero-inner {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

.hero h1 {
  max-width: 12ch;
}

.hero-sub {
  max-width: 30em;
  margin-top: var(--space-sm);
  font-size: 1.25rem;
  color: var(--color-text-muted);
}

.hero .button-row {
  margin-top: var(--space-md);
}

.hero-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--glow-cream);
}

@media (min-width: 64em) {
  .hero {
    padding-block: var(--space-xl);
  }

  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* ---- Cards ----------------------------------------------------------- */

.card-grid {
  list-style: none;
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.card {
  background: var(--color-card);
  color: var(--color-text-on-dark);
  border-radius: var(--radius);
  box-shadow: var(--glow-cream);
}

.card-grid--services .card {
  padding: var(--space-md);
}

.card-grid--services .card p {
  margin-top: var(--space-xs);
}

@media (min-width: 48em) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64em) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Article cards: whole card clickable through the title link. */
.article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

.article-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  padding: var(--space-md);
}

.article-card-title {
  font-size: 1.3125rem;
}

.article-card-title a {
  text-decoration: none;
}

.article-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.article-card:hover .article-card-title a {
  text-decoration: underline;
}

.article-card-title a:focus-visible {
  outline: none;
}

.article-card:has(a:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.article-date {
  margin-top: auto;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

/* ---- Why us ------------------------------------------------------------ */

.why-list {
  list-style: none;
  display: grid;
  gap: var(--space-md) var(--space-lg);
  margin-top: var(--space-lg);
}

.why-list li {
  padding-left: var(--space-sm);
  border-left: 3px solid var(--color-line);
}

.why-list strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

@media (min-width: 48em) {
  .why-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Service area ------------------------------------------------------ */

.area > p:first-of-type {
  margin-top: var(--space-xs);
}

.town-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.town-list li {
  padding: 0.35rem 0.9rem;
  background: var(--color-card);
  border-radius: 999px;
  font-weight: 600;
}

.area-note {
  margin-top: var(--space-md);
  color: var(--color-text-muted);
}

/* ---- Closing band ------------------------------------------------------ */

.quote-band {
  padding-block: var(--space-xl);
  background: var(--color-card);
  border-top: 1px solid var(--color-line);
}

.quote-band-inner {
  display: grid;
  gap: var(--space-md);
  align-items: center;
}

.quote-band p {
  margin-top: var(--space-xs);
  color: var(--color-text-on-dark);
}

@media (min-width: 64em) {
  .quote-band-inner {
    grid-template-columns: 1fr auto;
  }
}

/* ---- Footer ------------------------------------------------------------ */

.site-footer {
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-line);
  background: var(--color-bg);
}

.footer-inner {
  display: grid;
  gap: var(--space-md);
}

.logo--small {
  font-size: 1.25rem;
}

.footer-area,
.footer-phone {
  margin-top: var(--space-xs);
  max-width: 30em;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
}

.footer-links a {
  display: inline-block;
  padding-block: 0.25rem;
}

.copyright {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

@media (min-width: 64em) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .copyright {
    grid-column: 1 / -1;
  }
}

/* ---- Mobile call bar (only rendered when a phone number is set) ------- */

.call-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.625rem var(--gutter);
  background: var(--color-bg);
  border-top: 1px solid var(--color-line);
}

.call-bar .button {
  width: 100%;
}

.has-call-bar {
  padding-bottom: 4.5rem;
}

@media (min-width: 48em) {
  .call-bar {
    display: none;
  }

  .has-call-bar {
    padding-bottom: 0;
  }
}

/* ---- Article pages (light theme) --------------------------------------- */

.theme-light main {
  --focus: var(--color-text-on-light);
  background: var(--color-article-bg);
  color: var(--color-text-on-light);
}

.article {
  max-width: 50rem;
  padding-block: var(--space-lg) var(--space-xl);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: var(--font-size-small);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.5rem;
}

.article-header {
  margin-top: var(--space-md);
}

.article-header h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}

.article-header .article-date {
  margin-top: var(--space-xs);
  color: var(--color-text-on-light);
}

.article-hero {
  margin-top: var(--space-md);
}

.article-hero img,
.prose figure img {
  width: 100%;
  border-radius: var(--radius);
}

.prose {
  max-width: 42rem;
  margin-top: var(--space-lg);
  line-height: 1.7;
}

.prose > * + * {
  margin-top: var(--space-sm);
}

.prose h2 {
  margin-top: var(--space-lg);
  font-size: 1.75rem;
}

.prose h3 {
  margin-top: var(--space-md);
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose figure {
  margin-block: var(--space-md);
}

.prose--dark h2:first-child {
  margin-top: 0;
}

.updated {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.article-cta {
  --focus: var(--color-text-on-dark);
  max-width: 42rem;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg);
  color: var(--color-text-on-dark);
  border-radius: var(--radius);
}

.article-cta h2 {
  font-size: 1.5rem;
}

.article-cta p {
  margin-block: var(--space-xs) var(--space-sm);
}

.more-tips {
  max-width: 42rem;
  margin-top: var(--space-lg);
}

.more-tips h2 {
  font-size: 1.5rem;
}

.more-tips ul {
  list-style: none;
  margin-top: var(--space-xs);
}

.more-tips li + li {
  margin-top: var(--space-xs);
}

.more-tips a {
  font-weight: 600;
}

/* ---- 404 ---------------------------------------------------------------- */

.not-found-links {
  list-style: none;
  margin-top: var(--space-md);
  padding-bottom: var(--space-xl);
}

.not-found-links li + li {
  margin-top: var(--space-xs);
}

.not-found-links a {
  font-weight: 600;
}

/* ---- Contact form ------------------------------------------------------ */

.contact-layout {
  display: grid;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
}

@media (min-width: 64em) {
  .contact-layout {
    grid-template-columns: minmax(0, 38rem) minmax(0, 1fr);
    gap: var(--space-xl);
    align-items: start;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--space-md);
}

.field label {
  font-weight: 600;
}

.optional,
.hint {
  color: var(--color-text-muted);
  font-weight: 400;
}

.hint {
  font-size: var(--font-size-small);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  background: var(--color-card);
  color: var(--color-text-on-dark);
  border: 1px solid rgba(244, 235, 217, 0.45);
  border-radius: var(--radius);
  font-size: var(--font-size-body);
}

.field select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23F4EBD9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

.field--zip input {
  max-width: 10rem;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--color-text-on-dark);
}

.field [aria-invalid="true"] {
  border-color: var(--color-error);
  border-width: 2px;
}

.field-error,
.form-status {
  color: var(--color-error);
  font-size: var(--font-size-small);
}

.field-error::before {
  content: "Error: ";
  font-weight: 600;
}

.field-error:empty,
.form-status:empty,
.field-note:empty {
  display: none;
}

.field-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.form-actions {
  margin-top: var(--space-md);
}

.form-status {
  margin-top: var(--space-sm);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-success,
.contact-aside {
  padding: var(--space-md);
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--glow-cream);
}

.form-success p {
  margin-top: var(--space-xs);
}

.form-success:focus {
  outline: none;
}

.form-success:focus-visible {
  outline: 3px solid var(--focus);
}

.contact-aside h2 {
  font-size: 1.5rem;
}

.contact-aside ol {
  margin-top: var(--space-sm);
  padding-left: 1.3em;
}

.contact-aside li + li {
  margin-top: var(--space-xs);
}

.aside-note {
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

/* Hidden SVG sprite holding the logo apple (kept out of inline styles for the CSP). */
.svg-sprite {
  position: absolute;
}
