/* =====================================================
   filament& BURL — style.css
   Color palette and type scale defined as CSS custom
   properties at :root for easy global tweaking.
===================================================== */

/* ── Reset & Box Model ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design Tokens ── */
:root {
  --color-sand:       #ecd2b9;
  --color-sand-dark:  #d9c4a8;
  --color-brown:      #3d1f1a;
  --color-brown-mid:  #5a2e27;
  --color-copper:     #b5622a;
  --color-copper-light: #c97d48;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Lora', Georgia, serif;

  --content-width: 550px;
  --illus-overhang: 80px;
  --section-gap: 4rem;
}

/* ── Base ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-sand);
  color: var(--color-brown);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

/* =====================================================
   HERO
   Truck is a background-image so it bleeds past the
   550px content column freely. title.png is an absolutely
   positioned element anchored to the right edge of the
   content column — sitting outside it to the right.
===================================================== */
.hero {
  position: relative;
  width: 100%;
  min-height: 450px;
  /*
    truck.png: your pre-faded truck image.
    Positioned left-of-center so it occupies the left portion
    of the hero and bleeds off the left edge on wide viewports.
    Adjust background-position-x to taste once you have the real image.
  */
  background-image: url('images/truck.png');
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: center center;
}

/*
  hero__content: the 550px centered spine.
  title.png hangs off the RIGHT edge of this box.
*/
.hero__content {
  position: relative;
  max-width: var(--content-width);
  margin: 0 auto;
  min-height: 320px;
}

/*
  title.png: positioned to the right of the content column,
  top-aligned, hugging the column's right edge.
  `left: 100%` puts it just outside the right boundary.
*/
.hero__title-img {
  position: absolute;
  top: 2rem;
  left: 100%;
  width: 260px;          /* adjust to match your actual title.png proportions */
  max-width: none;       /* override the global img max-width: 100% */
  transform: translateX(1rem); /* small breathing room from column edge */
}

/* =====================================================
   PRODUCT SECTIONS
===================================================== */

main {
  padding: 1rem 1rem var(--section-gap);
}

.product {
  max-width: var(--content-width);
  margin: 0 auto var(--section-gap);
  padding-left: var(--illus-overhang);
}

.product + .product {
  border-top: 1px solid var(--color-sand-dark);
  padding-top: var(--section-gap);
}

/* ── Product Header ── */
.product__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  color: var(--color-brown);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.product__desc {
  font-size: 1.2rem;
  color: var(--color-brown-mid);
  margin-bottom: 1.75rem;
}

/* ── Product Media: illustration + photo side by side ── */
.product__media {
  display: grid;
  grid-template-columns: 1fr auto;
  /* gap: 2rem; */
  align-items: flex-start;
}

/* Left: illustration — pulled left by overhang amount */
.product__illustration {
  display: flex;
  align-items: flex-start;
  /* Pull the illustration out past the left edge of the text column */
  margin-left: calc(-1 * var(--illus-overhang));
}

.product__illustration img {
  width: 100%;
  max-width: 360px;
  /* Drop a very light shadow to lift illustration off background */
  filter: drop-shadow(0 4px 12px rgba(61, 31, 26, 0.12));
}

/* Right: installed photo — glow/circle crop is baked into the PNG */
.product__photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  min-width: 160px;
  max-width: 200px;
}

.product__photo {
  width: 100%;
  /* PNG already has the circular glow — just render it */
}

/* ── CTAs ── */
.product__ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

/* "Watch the Install Video" — text link style */
.btn-video {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-brown);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-copper);
  transition: color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.btn-video:hover {
  color: var(--color-copper);
}

/* "Buy on our Etsy Shop" — pill button */
.btn-etsy {
  display: inline-block;
  width: 100%;
  text-align: center;
  background-color: var(--color-brown);
  color: var(--color-sand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 0.65rem 1.25rem;
  border-radius: .5rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-etsy:hover {
  background-color: var(--color-brown-mid);
  transform: translateY(-1px);
}

.btn-etsy:active {
  transform: translateY(0);
}

/* =====================================================
   VIDEO MODAL
   Uses the native <dialog> element — no JS library needed.
   JS in main.js handles open/close.
===================================================== */
.modal {
  border: none;
  border-radius: 0.5rem;
  background: #000;
  padding: 0;
  max-width: min(900px, 94vw);
  width: 100%;
  /* Center it */
  margin: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Native dialog backdrop */
.modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(3px);
}

.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  z-index: 10;
}

.modal__close:hover {
  opacity: 1;
}

.modal__video {
  position: relative;
  /* 16:9 aspect ratio container */
  padding-top: 56.25%;
  background: #000;
}

/* Both iframe and video fill the aspect-ratio box */
.modal__video iframe,
.modal__video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* =====================================================
   FOOTER
===================================================== */
.site-footer {
  border-top: 1px solid var(--color-sand-dark);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--color-brown-mid);
  opacity: 0.75;
}

/* =====================================================
   RESPONSIVE
===================================================== */

/* ── Tablet and below (< 680px) ── */
@media (max-width: 680px) {

  /*
    Hero mobile: title.png goes above the truck, centered.
    Switch from absolute positioning to normal flow.
  */
  .hero {
    background-position: center bottom;
    background-size: contain;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__content {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 0;
  }

  .hero__title-img {
    position: static;        /* back to normal flow */
    transform: none;
    width: min(280px, 80vw);
    max-width: 100%;
    margin-bottom: 1rem;
  }

  /* Remove overhang — not enough room on mobile */
  .product {
    padding-left: 0;
  }

  .product__illustration {
    margin-left: 0;
  }

  /* Stack product media: illustration above, photo+CTAs below */
  .product__media {
    grid-template-columns: 1fr;
  }

  .product__photo-wrap {
    flex-direction: row;
    align-items: center;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .product__ctas {
    align-items: flex-start;
  }

  .btn-etsy {
    width: auto;
  }
}

/* ── Small phones (< 400px) ── */
@media (max-width: 400px) {
  .product__photo {
    max-width: 140px;
  }
}
