/* ==========================================================================
   site.css — additions for the per-product pages and the new home page.

   Loaded AFTER style.css and only ever adds or overrides. style.css is left
   untouched so the existing default.aspx keeps rendering exactly as before.
   ========================================================================== */

/* --- Page transitions ---------------------------------------------------- */
/* Cross-document view transitions. Because each product is now its own URL,
   switching tabs is a real navigation, which by default gives a white flash
   and a hard cut. This animates between the two documents instead.

   Progressive enhancement: browsers without support simply navigate as before.
   Nothing here is required for the page to work. */
/* Page fading is handled site-wide by fade.js, with its CSS in style.css, so
   that the older pages (contact, privacy, msg, error) get it too.

   CSS view transitions were tried here first and removed: they only animate a
   navigation between two supporting pages — never a direct load or an arrival
   from an external link — and Firefox has no cross-document support. Running
   both would animate every navigation twice. */

/* --- Tabs ---------------------------------------------------------------- */
/* The .tab rule in style.css is already written to work for <a> as well as
   <button> (display:inline-block, text-decoration:none), so the anchors pick
   it up as-is.
   Do NOT add an `a.tab` rule: it outranks `.tab` on specificity and will
   silently override font-size/font-weight/display from the original. */

/* The active tab is marked with aria-current="page" rather than
   aria-selected="true". aria-selected is only valid on an element with
   role="tab"; on a plain navigation link it is an accessibility error.
   Same appearance as .tab[aria-selected="true"], and this file loads after
   style.css so it wins on source order at equal specificity. */
.tab[aria-current="page"] {
  background: #000;
  color: #fff;
  text-decoration: none;
}

/* The logo is a link to home now. header is display:flex, so the anchor
   became the flex item in place of the <img>. */
header a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* --- Hero ---------------------------------------------------------------- */
/* Poster paints immediately (fast LCP); site.js attaches the video source
   only to whichever hero is actually visible, so we never download both. */
.hero-v { display: none; }

@media (max-width: 900px) and (orientation: portrait) {
  .hero-h { display: none; }
  .hero-v { display: block; }
}

.media-h video,
.media-v video { background: #000; }

/* --- Gallery ------------------------------------------------------------- */
/* Fixed aspect boxes + width/height on every <img> means zero layout shift,
   which is a Core Web Vitals ranking input. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin: 30px 0 10px;
  padding: 0;
  list-style: none;
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
}

.gallery figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f2f2;
  cursor: zoom-in;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gallery figure:hover img { transform: scale(1.04); }

/* Magnifier affordance, matching .zoom-wrap::after in style.css.
   The original script.js wrapped every clickable image in a .zoom-wrap span
   at runtime to produce this; the gallery markup is already structured for
   it, so it comes straight from CSS here instead. */
.gallery figure::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .95;
  background: center/contain no-repeat url("images/zoom-in-icon.png");
}

@media (max-width: 480px) {
  .gallery figure::after { width: 34px; height: 34px; }
}

/* The floated product photo keeps its magnifier by using the original
   .zoom-wrap span. The float has to live on the wrapper, not the <img>:
   .zoom-wrap is inline-block, so a float left on the image would escape it
   and the wrapper would collapse. */
.poster-wrap { float: right; margin: 0 12px 12px 0; }
.poster-wrap .poster-img { margin: 0; float: none; }

@media (max-width: 768px) {
  .poster-wrap { margin: 0 8px 8px 0; }
}

.gallery figcaption {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Product page scaffolding ------------------------------------------- */
/* A single-product page has no carousel, so the panel is always the active
   one. style.css absolutely-positions .desc-panel until .is-active. */
.product-body { position: relative; }

.section-heading {
  margin: 40px 0 10px;
  font-size: 24px;
  font-weight: 600;
}

/* --- Home page ----------------------------------------------------------- */
.home-intro {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 10px;
  text-align: center;
}

.home-intro h1 {
  font-size: 44px;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.15;
}

.home-intro .lede {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px;
  opacity: .85;
}

.home-intro p { font-size: 19px; margin: 0 0 14px; }

@media (max-width: 768px) {
  .home-intro h1 { font-size: 32px; }
  .home-intro .lede { font-size: 18px; }
  .home-intro p { font-size: 17px; }
}

.product-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
  padding: 30px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .10);
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .16);
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-card .card-text { padding: 18px 20px 24px; }
.product-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.product-card p  { margin: 0 0 14px; font-size: 17px; opacity: .8; }

.card-cta { font-weight: 600; text-decoration: underline; }

/* --- Skip link (accessibility) ------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 10px 16px;
  z-index: 10000;
}

.skip-link:focus { left: 0; }
