/*
 * webroot/css/home.css — Home page only.
 *
 * Ported from `docs/mockups/Miss Cake Web/Miss Cake Home.html`. Most of
 * that mockup's sections are NOT duplicated here on purpose:
 *
 *   - Hero, trust seals (`.seals`), newsletter (`.nl`) and footer (`.foot`)
 *     already live in `app.css` — they are shared by every page, not
 *     home-only.
 *   - Product cards (`.card`, `.grid`), category cards (`.cats`, `.cat`)
 *     and the section shell (`.block`, `ui/section-head`) come from the
 *     `Shop` plugin's `shop.css` (loaded in `templates/layout/default.php`
 *     before `app.css`, whose "Shop variable overrides" §7.3 re-skin them
 *     with the brand palette) plus `.block`/`.grid-4` in `app.css`, since
 *     `Shop\Controller\CatalogController::index()` needs those same
 *     classes on `/tienda` — a home-only file would leave that page
 *     unstyled.
 *   - The "events" band (`.events`) is also shared: fixed directly in
 *     `app.css` since it was already declared there (with the wrong,
 *     paper background) and had no other consumer yet.
 *
 * What's left, and genuinely home-only, is the Instagram feed teaser
 * (`element/instagram/grid.php`, M7 — supersedes the old placeholder-tile
 * `element/home/instagram.php`) and the `#byo` block below.
 *
 * `.byo` (M5, `element/home/byo.php`) is NOT the mockup's full interactive
 * "build your own box" grid (`.byo-layout`/`.byo-grid`/`.byo-cart`): that
 * configurator is `Shop.gift/box-builder`, rendered on its own page
 * (`/regalo/box/{slug}`). Here on the Home it is a two-column CTA card —
 * copy plus a link into that page — fed by the `is_featured` box template.
 */

/* === Build your box (#byo) === */
.byo { background: var(--paper); padding: var(--sp-8) 0; }
.byo-inner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7); align-items: center; }
.byo-copy .eyebrow { color: var(--kraft-deep); }
.byo-media img { width: 100%; border-radius: var(--radius-lg); }

@media (max-width: 860px) {
  .byo-inner { grid-template-columns: 1fr; }
  .byo-media { order: -1; }
}

/* === Instagram feed === */
/*
 * Mockup Home l. 546 sets this section's background inline
 * (`style="background:var(--paper)"`) — canon §5 forbids that in a
 * `templates/` file, so it becomes this class instead (`instagram/grid`
 * puts `.ig` next to `.block` on the same `<section>`).
 */
.ig { background: var(--paper); }
.ig-head {
  text-align: center;
  margin-bottom: var(--sp-6);
}
.ig-head h2 {
  font-size: clamp(32px, 4vw, 50px);
  margin: var(--sp-2) 0 var(--sp-1);
}
.ig-head a {
  font-size: .95rem;
  font-weight: 600;
}
.ig-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-3);
}
.ig-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
}
.ig-item .placeholder {
  position: absolute;
  inset: 0;
  min-height: 0;
  border-radius: 0;
}
.ig-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(78, 92, 67, 0);
  transition: background var(--dur) var(--ease);
}
.ig-item:hover::after { background: rgba(78, 92, 67, .28); }

@media (max-width: 1024px) {
  .ig-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .ig-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
}

/* Category families grid ("Nuestras familias") — elegant photo cards. The
   image-cover fix lives in shop.css; this raises the home surface with a
   bottom-weighted scrim so the photo reads at the top and the name at the
   bottom, instead of a flat wash over the whole tile. Ink = --shop-text. */
.cats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
  justify-content: center;
}
.cats .cat {
  box-shadow: 0 20px 44px -26px rgba(61, 54, 48, .55);
  transition: transform .4s cubic-bezier(.22, 1, .36, 1), box-shadow .4s cubic-bezier(.22, 1, .36, 1);
}
.cats .cat::after {
  background: linear-gradient(to top,
    rgba(61, 54, 48, .82) 0%,
    rgba(61, 54, 48, .34) 44%,
    rgba(61, 54, 48, 0) 74%);
  opacity: 1;
}
.cats .cat h3 { text-shadow: 0 1px 14px rgba(61, 54, 48, .5); }
.cats .cat .count { text-shadow: 0 1px 8px rgba(61, 54, 48, .45); }
.cats .cat .go {
  box-shadow: 0 8px 20px -8px rgba(61, 54, 48, .55);
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
/* Hover: lift the tile and deepen the shadow (the photo also zooms, in
   shop.css). NOT a colour change — a global `a:hover` would otherwise tint the
   name the accent, invisible on the dark photo, so the cream is reasserted. */
.cats .cat:hover,
.cats .cat:focus-visible {
  color: var(--paper);
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -22px rgba(61, 54, 48, .6);
}
.cats .cat:hover .go,
.cats .cat:focus-visible .go { transform: rotate(-45deg) scale(1.12); }
@media (prefers-reduced-motion: reduce) {
  .cats .cat, .cats .cat img, .cats .cat .go { transition: none; }
  .cats .cat:hover, .cats .cat:focus-visible { transform: none; }
}
