/* =========================================================
   Garcés & García — Main Stylesheet (ADA/A11y-enhanced)
   Shared across Publishing, Originals, Entertainment, etc.
   ========================================================= */

:root {
  --emerald: #007A3D;
  --forest: #254D32;
  --gold: #D4AF37;
  --black: #000;
  --white: #fff;
  --maxw: 1200px;
}

/* ===== A11y Utilities ================================== */
.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; left: -9999px; top: 0;
  background: #fff; color: #000; font-weight: 700;
  padding: .6rem .9rem; border-radius: .5rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; outline: 2px solid var(--gold); }

/* Reset & Base ------------------------------------------ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

/* Links: keep design, but improve affordance on hover/focus */
a { color: inherit; text-decoration: none; }
a:not(.btn):hover,
a:not(.btn):focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 2vw, 2rem);
}

/* Header ------------------------------------------------ */
header {
  background: var(--black);
  padding-block: clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  justify-items: center;
  gap: clamp(0.75rem, 2vw, 2rem);
}

.brand__title {
  font-family: "EB Garamond", serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: clamp(1.75rem, 6vw, 3.25rem);
}

.brand__crest {
  height: clamp(80px, 12vw, 150px);
  width: auto;
  display: block;
}

/* Navigation ------------------------------------------- */
.nav { background: var(--emerald); }
.nav__bar {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}
.nav__link {
  font-weight: 700;
  padding: 0.9rem 0;
  /* A11y: Ensure minimum tap size */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
/* A11y: show current page if aria-current="page" is present */
.nav__link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 800;
}

/* Hero -------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--forest), var(--emerald));
  text-align: center;
  color: var(--white);
  padding: clamp(2rem, 5vw, 3.5rem) 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.hero h2 {
  font-family: "EB Garamond", serif;
  margin: 0 0 0.5rem;
}
.hero p {
  max-width: 700px;
  margin: 0.25rem auto 0;
  opacity: 0.95;
}

/* Cards ------------------------------------------------- */
.card {
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: "EB Garamond", serif;
  color: var(--forest);
  font-size: clamp(1.25rem, 4vw, 2rem);
  margin: 0 0 0.5rem;
}

.subhead { font-weight: 700; color: #ddd; margin-top: 0.25rem; }

/* Product Grid ----------------------------------------- */
.products-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 1rem;
}

.product {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;

  /* iOS/Safari safety: visible by default */
  opacity: 1;
}

.product__media {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product__media img {
  width: auto;
  height: 160px;
  object-fit: contain;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.product__body {
  padding: 0.75rem;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  text-align: center;
}

.product__title {
  font-weight: 700;
  color: #fff;
  transition: color 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

/* Gradient Hover Effect (title only) -------------------- */
.products-grid .product:hover .product__title,
.products-grid .product .product__title:hover {
  color: transparent;
  background-image: linear-gradient(
    90deg,
    var(--gold) 0%,
    #ffd166 18%,
    #7bdcb5 55%,
    var(--emerald) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 0.35rem rgba(212, 175, 55, 0.25));
}

/* Coming Soon / CTA ------------------------------------ */
.product__cta,
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--black);
  font-weight: 700;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.product__cta:hover,
.btn:hover {
  background: var(--emerald);
  color: var(--white);
  transform: translateY(-2px);
}
.product__cta:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

.coming-soon {
  background: rgba(255, 255, 255, 0.15);
  color: #ccc;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: inline-block;
}

.product.comingsoon img {
  opacity: 0.7;
  filter: grayscale(30%);
}

/* Product Hover Polish --------------------------------- */
.product:not(.comingsoon):hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
              0 0 10px rgba(212, 175, 55, 0.15);
}
.product:not(.comingsoon):hover .product__media img {
  transform: scale(1.05);
}

/* Accessibility ---------------------------------------- */
.product a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Reduced Motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .product, .product__media img, .product__cta, .btn {
    transition: none !important;
  }
}

/* Footer ------------------------------------------------ */
footer { background: var(--emerald); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: center;
  padding: 1rem;
}
.copyright {
  text-align: center;
  font-size: 0.875rem;
  color: #dcdcdc;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* =========================================================
   UPGRADE PACK — Animations & Hover Effects (Layout-safe)
   ========================================================= */

.product,
.product__media img,
.product__title,
.product__cta,
.btn {
  transition: transform .35s ease, box-shadow .35s ease, opacity .35s ease,
              background .35s ease, color .35s ease;
  will-change: transform;
}

.product:hover,
.product:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.06) inset;
  border-color: rgba(255,255,255,.16);
}

.product:hover .product__media img,
.product:focus-within .product__media img {
  transform: scale(1.03);
  opacity: .95;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .product:hover .product__title,
  .product:focus-within .product__title {
    background-image: linear-gradient(90deg, var(--gold), #ffffff 45%, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.product__cta {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 0 rgba(212,175,55,0);
  transform: translateZ(0);
}
.product:hover .product__cta,
.product:focus-within .product__cta {
  box-shadow: 0 6px 18px rgba(212,175,55,.35);
  transform: translateY(-1px);
}
.product__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.28) 40%, transparent 80%);
  transform: translateX(-120%);
  transition: transform .6s ease;
  pointer-events: none;
}
.product:hover .product__cta::after,
.product:focus-within .product__cta::after {
  transform: translateX(120%);
}

/* On-Load Staggered Reveal (scoped & iOS-safe) ---------- */
@keyframes floatIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.products-grid > .product {
  opacity: 0;                /* start hidden for the effect */
  animation: floatIn .5s ease forwards;
}
.products-grid > .product:nth-child(1)  { animation-delay: .05s; }
.products-grid > .product:nth-child(2)  { animation-delay: .10s; }
.products-grid > .product:nth-child(3)  { animation-delay: .15s; }
.products-grid > .product:nth-child(4)  { animation-delay: .20s; }
.products-grid > .product:nth-child(5)  { animation-delay: .25s; }
.products-grid > .product:nth-child(6)  { animation-delay: .30s; }
.products-grid > .product:nth-child(7)  { animation-delay: .35s; }
.products-grid > .product:nth-child(8)  { animation-delay: .40s; }
.products-grid > .product:nth-child(9)  { animation-delay: .45s; }
.products-grid > .product:nth-child(10) { animation-delay: .50s; }
.products-grid > .product:nth-child(11) { animation-delay: .55s; }
.products-grid > .product:nth-child(12) { animation-delay: .60s; }

/* iOS/Safari & Reduced Motion: ensure visibility -------- */
@media (prefers-reduced-motion: reduce) {
  .product,
  .product__media img,
  .product__title,
  .product__cta,
  .btn,
  .products-grid > .product {
    transition: none !important;
    animation: none !important;
  }
  .products-grid > .product {
    opacity: 1 !important;   /* stay visible if animations are suppressed */
  }
}

/* Accessibility niceties (kept & expanded) -------------- */
.product a:focus-visible,
.btn:focus-visible,
.nav__link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

/* =========================================
   High Contrast & Forced Colors Support
   ========================================= */
@media (prefers-contrast: more) {
  .card { border-color: rgba(255,255,255,0.25); }
  .product { border-color: rgba(255,255,255,0.25); }
  a:not(.btn):hover,
  a:not(.btn):focus-visible {
    text-decoration-thickness: 2px;
  }
}
@media (forced-colors: active) {
  * { forced-color-adjust: auto; }
  .card, .product { border: 1px solid ButtonText; }
  a:focus-visible, .btn:focus-visible, .product a:focus-visible {
    outline: 2px solid Highlight;
  }
  .btn, .product__cta { background: ButtonFace; color: ButtonText; }
}

/* ===========================================
   iOS Safari–only safe overrides (paint fix)
   =========================================== */
@supports (-webkit-touch-callout: none) and (-webkit-overflow-scrolling: touch) {
  .products-grid > .product {
    animation: none !important;
    opacity: 1 !important;
  }
  .product,
  .product__media img,
  .product__cta,
  .btn {
    transform: none !important;
    will-change: auto !important;
  }
  .product:hover, .product:focus-within { box-shadow: none !important; }
  .product:hover .product__media img,
  .product:focus-within .product__media img {
    transform: none !important;
    opacity: 1 !important;
  }
  .product:hover .product__title,
  .product:focus-within .product__title {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: inherit !important;
    letter-spacing: inherit !important;
  }
  .product__media { min-height: 180px; }
  img[loading="lazy"] { content-visibility: auto; max-height: 100%; }
}
