/* ============================================================
   Layout: grids, page compositions, Astra overrides, responsive
   ============================================================ */

/* ---- Grids ---- */
.g-grid {
  display: grid;
  gap: var(--g-sp-3);
}
.g-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.g-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}
.g-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.g-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.g-grid--products {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.g-grid--gallery {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
@media (max-width: 600px) {
  .g-grid--gallery { grid-template-columns: repeat(2, 1fr); }
}
.g-grid--ba {
  grid-template-columns: repeat(3, 1fr);
}

/* ---- Split layouts ---- */
.g-split {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.g-split.is-reverse .g-split__media {
  order: 2;
}
.g-split__body {
  max-width: 100%;
}

/* ---- Intro / lead block ---- */
.g-intro {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

/* ---- Contact layout ---- */
.g-contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.g-contact-cards {
  display: grid;
  gap: 1rem;
  margin-bottom: var(--g-sp-3);
}

/* ---- Page hero (inner pages, compact) ---- */
.giorgio-pagehero {
  position: relative;
  overflow: hidden;
  background: var(--g-charcoal);
  color: var(--g-text-on-dark);
}
.giorgio-pagehero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      110% 130% at 90% 0%,
      rgba(212, 103, 1, 0.3),
      transparent 50%
    ),
    linear-gradient(160deg, #3b3f49, var(--g-charcoal-deep));
}
.giorgio-pagehero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 39.5H40M19.5 0V40' stroke='%23ffffff' stroke-opacity='0.04'/%3E%3C/svg%3E");
}
.giorgio-pagehero__inner {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.giorgio-pagehero h1 {
  color: var(--g-white);
}
.giorgio-pagehero p {
  color: var(--g-text-on-dark);
  font-size: var(--g-fs-lg);
  margin-top: 0.5rem;
}
.giorgio-breadcrumb {
  font-size: var(--g-fs-sm);
  color: var(--g-muted-on-dark);
  margin-bottom: 1rem;
}
.giorgio-breadcrumb a {
  color: var(--g-muted-on-dark);
}
.giorgio-breadcrumb a:hover {
  color: var(--g-orange);
}

/* ====================== Custom header (.gh) ====================== */
.gh {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--g-charcoal);
  transition: box-shadow var(--g-transition);
}
.giorgio-scrolled .gh {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.admin-bar .gh {
  top: 32px;
}
@media (max-width: 782px) {
  .admin-bar .gh {
    top: 46px;
  }
}

.gh-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.gh-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 76px;
}
.gh-logo {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.gh-logo__img {
  max-height: 60px;
  width: auto;
  display: block;
}
.gh-logo__text {
  font-family: var(--g-font-display);
  font-size: 1.4rem;
  color: #fff;
  font-weight: 700;
}

/* Desktop nav */
.gh-nav .gh-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.gh-menu li {
  margin: 0;
  position: relative;
}
.gh-menu a {
  display: block;
  padding: 0.55rem 0.9rem;
  color: var(--g-text-on-dark);
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: var(--g-radius-sm);
  transition: color var(--g-transition);
}
.gh-menu a:hover,
.gh-menu .current-menu-item > a,
.gh-menu .current_page_item > a,
.gh-menu .current-menu-ancestor > a {
  color: var(--g-orange);
}
.gh-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  background: var(--g-charcoal-deep);
  border-radius: var(--g-radius-sm);
  box-shadow: var(--g-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity var(--g-transition),
    transform var(--g-transition),
    visibility var(--g-transition);
  z-index: 5;
}
.gh-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Burger */
.gh-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  flex: none;
}
.gh-burger span {
  display: block;
  height: 2px;
  width: 24px;
  margin: 0 auto;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
}
.gh-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.gh-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.gh-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
/* Neutralise Astra's default <button> blue background/outline on hover/focus */
.gh-burger:hover,
.gh-burger:focus,
.gh-burger:focus-visible,
.gh-burger:active {
  background: none !important;
  box-shadow: none !important;
  outline: none !important;
}
.gh-burger:hover span {
  background: var(--g-orange);
}

/* Overlay + slide-in drawer */
.gh-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(43, 45, 53, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gh-overlay.is-open {
  opacity: 1;
}
.gh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1101;
  width: min(86vw, 340px);
  background: var(--g-charcoal-deep);
  transform: translateX(100%);
  transition: transform 0.32s ease;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.2rem 1.8rem;
  overflow-y: auto;
}
.gh-drawer.is-open {
  transform: translateX(0);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.4);
}
.gh-drawer__close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 0 !important;
  border-radius: 50% !important;
  padding: 0 !important;
  min-width: 0 !important;
  cursor: pointer;
  transition:
    background var(--g-transition),
    color var(--g-transition);
}
/* Keep it a circle with brand colours in every state (override Astra's <button> styles) */
.gh-drawer__close:hover,
.gh-drawer__close:focus,
.gh-drawer__close:focus-visible,
.gh-drawer__close:active {
  background: var(--g-orange) !important;
  color: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}
.gh-drawer__nav {
  margin-top: 1rem;
}
.gh-drawer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gh-drawer__menu li {
  margin: 0;
}
.gh-drawer__menu a {
  display: block;
  padding: 1rem 0.4rem;
  color: var(--g-text-on-dark);
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color var(--g-transition);
}
.gh-drawer__menu a:hover,
.gh-drawer__menu .current-menu-item > a {
  color: var(--g-orange);
}
.gh-drawer__menu .sub-menu {
  list-style: none;
  margin: 0 0 0 0.8rem;
  padding: 0;
}
.gh-drawer__menu .sub-menu a {
  font-size: 1rem;
}
.gh-drawer__foot {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.gh-drawer__foot .btn {
  width: 100%;
}
.gh-drawer__lang {
  align-self: flex-start;
}
body.gh-drawer-open {
  overflow: hidden;
}

/* Header responsive: tablet & mobile */
@media (max-width: 900px) {
  .gh-nav {
    display: none;
  }
  .gh-burger {
    display: flex;
  }
  .gh-bar__inner {
    min-height: 62px;
  }
  .gh-logo__img {
    max-height: 42px;
  }
  /* On mobile the language toggle lives in the drawer menu, so hide the duplicate in the topbar. */
  .giorgio-topbar .giorgio-lang-switch {
    display: none;
  }
}

/* ---- Hero: uniform height across ALL pages, content-left, optional background photo ---- */
:root {
  --g-hero-h: clamp(594px, 75vh, 858px);
}
.giorgio-hero__inner,
.giorgio-pagehero__inner {
  min-height: var(--g-hero-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* content LEFT, not centered */
  text-align: left;
}
.giorgio-hero h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.9rem);
  max-width: 600px;
}
.giorgio-hero__sub {
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  max-width: 470px;
}
.giorgio-hero .g-eyebrow {
  font-size: 0.8rem;
}
.giorgio-hero__meta {
  max-width: 600px;
}

/* Inner-page hero background photo (same left-dark / right-clear treatment) */
.giorgio-pagehero__img {
  position: absolute;
  inset: 0;
}
.giorgio-pagehero__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.giorgio-pagehero__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(43, 45, 53, 0.95) 0%,
    rgba(43, 45, 53, 0.82) 30%,
    rgba(43, 45, 53, 0.45) 60%,
    rgba(43, 45, 53, 0.12) 100%
  );
}
.giorgio-pagehero h1 {
  max-width: 600px;
}
.giorgio-pagehero p {
  max-width: 520px;
}
.giorgio-pagehero__actions {
  margin-top: var(--g-sp-3);
}
#contact-form,
#products {
  scroll-margin-top: 110px;
}
.giorgio-pagehero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  margin-top: 1.6rem;
}
/* Keep the subject centred when the wide banner crops the photo top/bottom. */
.giorgio-pagehero__img img,
.giorgio-hero__img img {
  object-position: center;
}
/* Product heroes: bias the crop upward so the product (cap/label) shows. Nudge 25%–50%. */
.giorgio-product-single .giorgio-pagehero__img img {
  object-position: center 10%;
}
/* PRODUCT pages only: cap the hero photo so it stops enlarging past 2000px wide (centered in the
   section). Below 2000px it's full-bleed exactly as before. On wider screens the photo casts a
   soft shadow and the exposed sides show a branded dark gradient (orange hint + depth) instead of
   flat black, so the gaps read as intentional. Other pages' heroes are untouched. */
.giorgio-product-single .giorgio-pagehero {
  background:
    radial-gradient(
      90% 120% at 85% 0%,
      rgba(212, 103, 1, 0.22),
      transparent 55%
    ),
    linear-gradient(160deg, #3b3f49, var(--g-charcoal-deep));
}
.giorgio-product-single .giorgio-pagehero__img {
  left: 50%;
  right: auto;
  width: min(100%, 1750px);
  transform: translateX(-50%);
  box-shadow: 0 0 100px 30px rgba(0, 0, 0, 0.55);
}

/* Hero responsive: on phones the text spans more width, so extend the left dark gradient further
   right for readability (still left-weighted — the right edge stays clearer, not the whole image). */
@media (max-width: 800px) {
  .giorgio-hero__img::after,
  .giorgio-pagehero__img::after {
    background: linear-gradient(
      90deg,
      rgba(43, 45, 53, 0.95) 0%,
      rgba(43, 45, 53, 0.9) 45%,
      rgba(43, 45, 53, 0.68) 78%,
      rgba(43, 45, 53, 0.3) 100%
    );
  }
  .giorgio-hero__inner,
  .giorgio-pagehero__inner {
    max-width: 100%;
  }
  :root {
    --g-hero-h: clamp(484px, 73vh, 638px);
  }
  /* Shift the hero photo focal point on phones (equivalent of background-position: 70% center). */
  .giorgio-hero__img img,
  .giorgio-pagehero__img img,
  .giorgio-product-single .giorgio-pagehero__img img {
    object-position: 70% center;
  }
}

/* ---- Scroll reveal (the .g-reveal class is added by JS only, so no-JS stays visible) ---- */
.g-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
  will-change: opacity, transform;
}
.g-reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .g-reveal,
  .g-reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Full-bleed page layout (modern look): the Astra content wrapper goes full width with no
   padding, so the heroes and section backgrounds span edge-to-edge and the hero sits flush
   under the sticky header. Reading width + side gutters are handled by our own .g-container
   inside every section. */
body.giorgio .site-content .ast-container {
  max-width: 100% !important;
  padding: 0 !important;
}
body.giorgio #primary {
  margin: 0 !important;
  padding: 0 !important;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
  .g-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .g-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .g-grid--ba {
    grid-template-columns: repeat(2, 1fr);
  }
  .g-intro {
    grid-template-columns: 1fr;
  }
  .g-split {
    grid-template-columns: 1fr;
  }
  .g-split.is-reverse .g-split__media {
    order: 0;
  }
  .g-contact-layout {
    grid-template-columns: 1fr;
  }
  .giorgio-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .g-grid--3,
  .g-grid--4,
  .g-grid--2,
  .g-grid--ba {
    grid-template-columns: 1fr;
  }
  .wpcf7 .g-form-grid {
    grid-template-columns: 1fr;
  }
  .giorgio-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--g-sp-4);
  }
  .giorgio-topbar__contact .giorgio-topbar__hide-sm {
    display: none;
  }
  .giorgio-cta__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .giorgio-hero__meta {
    gap: 1rem 1.5rem;
  }
}

/* Keep products at 2 per row across the whole phone range (the auto-fill above would otherwise
   drop to 1 column around 440-480px once the container padding is accounted for). */
@media (max-width: 600px) {
  .g-grid--products {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .g-card:hover,
  .btn:hover,
  .g-product:hover {
    transform: none;
  }
}
