/* =========================================================
   Home page only. Loaded by the home route alone (via
   $pageStyles), so nothing in here can reach any other page.
   Colours, spacing and the type scale come from main.css.
   ========================================================= */

/* Every section pads top and bottom, so the gap between two sections is
   double this value. */
:root {
  --home-section-space: var(--space-6);
}

@media (min-width: 900px) {
  :root {
    --home-section-space: var(--space-7);
  }
}

.home-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Hero ---------- */
.home-hero {
  padding-block: var(--space-5) var(--home-section-space);
}

.home-hero__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 900px) {
  .home-hero {
    padding-top: var(--space-7);
  }

  .home-hero__inner {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
    gap: var(--space-7);
  }
}

.home-hero__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

@media (min-width: 600px) {
  .home-hero__title {
    font-size: var(--text-3xl);
  }
}

@media (min-width: 1100px) {
  .home-hero__title {
    font-size: var(--text-4xl);
  }
}

.home-hero__lead {
  margin-top: var(--space-3);
  max-width: 36ch;
  color: var(--color-text-muted);
}

@media (min-width: 600px) {
  .home-hero__lead {
    font-size: var(--text-lg);
  }
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

@media (max-width: 599px) {
  .home-hero__actions .btn {
    flex: 1 1 100%;
  }
}

.home-hero__alt {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.home-hero__alt a {
  color: var(--color-text);
  font-weight: 700;
  text-underline-offset: 3px;
}

.home-hero__photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- Shared section rhythm ---------- */
.home-section {
  padding-block: var(--home-section-space);
}

.home-section--tinted {
  background: var(--color-bg-alt);
  border-block: 1px solid var(--color-border);
}

.home-heading {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

@media (min-width: 900px) {
  .home-heading {
    font-size: var(--text-3xl);
  }
}

.home-subheading {
  margin-top: var(--space-2);
  max-width: 52ch;
  color: var(--color-text-muted);
}

.home-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* ---------- What we fix: the repair board ---------- */
.home-fix {
  display: grid;
  gap: var(--space-5);
}

.home-fix__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 18% 50%;
  border-radius: var(--radius-lg);
}

@media (min-width: 900px) {
  .home-fix {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
  }

  /* The board sets the row height; the photo fills whatever that is. */
  .home-fix__photo {
    position: relative;
  }

  .home-fix__photo img {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
  }
}

.repair-board {
  margin-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.repair-board__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.repair-board__name {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
}

.repair-board__faults {
  margin-top: var(--space-1);
  max-width: 52ch;
  color: var(--color-text-muted);
}

/* Same look as the main "Book a Repair" button (.btn-primary), sized to
   sit in a row, with a softer glow since five of them stack up. */
.repair-board__book {
  min-height: 44px;
  padding: 0 var(--space-4);
  box-shadow: 0 4px 14px var(--color-accent-blue-glow);
}

.repair-board__extra {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
}

.repair-board__extra a {
  color: var(--color-text);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* The card's photo box is sized for a large placeholder icon; keep the
   alt text readable-size if a photo ever fails to load. */
.home-section .product-card__photo img {
  font-size: var(--text-sm);
}

/* ---------- Visit the shop ---------- */
.home-visit {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 900px) {
  .home-visit {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
  }
}

.home-visit__address {
  margin-top: var(--space-3);
  font-style: normal;
  font-size: var(--text-lg);
  line-height: 1.4;
}

.home-hours {
  width: 100%;
  max-width: 420px;
  margin-top: var(--space-4);
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.home-hours th,
.home-hours td {
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  font-weight: 400;
  text-align: left;
}

.home-hours td {
  text-align: right;
}

.home-hours .is-today th,
.home-hours .is-today td {
  font-weight: 700;
}

.home-hours .is-today th::after {
  content: "Today";
  margin-left: var(--space-2);
  padding: 2px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  vertical-align: 2px;
}

.home-contact {
  margin: var(--space-3) 0 0;
}

.home-contact div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
}

.home-contact dt {
  color: var(--color-text-muted);
}

.home-contact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.home-contact a {
  display: inline-block;
  padding-block: 10px;
  color: var(--color-text);
  font-weight: 700;
  text-underline-offset: 3px;
}

.home-visit__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.home-visit__links > a:not(.btn) {
  color: var(--color-text);
  font-weight: 700;
  text-underline-offset: 3px;
}

.home-visit__map {
  min-height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.home-visit__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
}

/* ---------- Mobile call bar ----------
   Pinned within thumb reach on phones. Tucked away while the hero's own
   buttons are on screen (see main.js), so the two never show together. */
.home-callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
  transition: transform var(--duration-base) var(--ease-out);
}

.home-callbar .btn {
  padding: 12px 16px;
}

.home-callbar.is-tucked {
  transform: translateY(110%);
}

@media (max-width: 699px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 700px) {
  .home-callbar {
    display: none;
  }
}
