/* ==========================================================================
   Khris & George — layout.css
   Page shell: header, navigation, hero, sections, grids, footer.
   ========================================================================== */

/* --- Wrappers ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.25rem, 5vw, 3.75rem); }
.section--panel { background: var(--panel-soft); }
.section--dark { background: var(--ink); color: var(--on-dark-soft); }
.section--dark h2, .section--dark h3 { color: var(--on-dark); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { margin-top: 1rem; }

/* Header row with a title on the left and a link on the right */
.section-head--split {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  justify-content: space-between;
  max-width: none;
}

/* --- Site header ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--on-dark);
  border-bottom: 1px solid var(--line-dark);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  color: var(--on-dark);
}
.wordmark span:first-child {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.wordmark span:last-child {
  margin-top: 0.4rem;
  font-size: 0.55rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}

/* Desktop nav */
.nav { display: none; }
.nav ul {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  list-style: none;
}
.nav a {
  position: relative;
  display: block;
  padding: 0.35rem 0;
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--on-dark); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-dark);
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }

.basket-btn { position: relative; }
.basket-count {
  position: absolute;
  top: 0.35rem;
  right: 0.3rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--on-dark);
  color: var(--ink);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}
.basket-count[hidden] { display: none; }

/* Mobile nav panel */
.mobile-nav {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  background: var(--ink);
  transition: grid-template-rows 0.4s var(--ease);
}
.mobile-nav[data-open="true"] { grid-template-rows: 1fr; }
.mobile-nav > div { overflow: hidden; }

.mobile-nav ul { list-style: none; padding: 0.5rem 0 1.75rem; }
.mobile-nav li { border-top: 1px solid var(--line-dark); }
.mobile-nav a {
  display: block;
  padding: 1rem 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--on-dark);
}
.mobile-nav a[aria-current="page"] { color: var(--on-dark-soft); }

/* --- Hero ----------------------------------------------------------------- */
.hero {
  display: grid;
  place-items: center;
  min-height: clamp(26rem, 62vh, 40rem);
  padding-block: clamp(3.5rem, 9vw, 7rem);
  text-align: center;
  background: var(--bg);
}
.hero-inner { max-width: 44rem; }
.hero h1 { margin-bottom: 1.5rem; }
.hero p { margin-inline: auto; max-width: 34rem; }
.hero .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  margin-top: 2.25rem;
}

/* Page hero (interior pages) */
.page-hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.page-hero p { max-width: 40rem; margin-inline: auto; margin-top: 1.25rem; }

/* --- Grids ---------------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }

/* Two-column text/image split */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split__media { background: var(--panel); }
.split--reverse .split__media { order: 2; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--on-dark-soft);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}
.footer-top {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line-dark);
}
.footer-brand { max-width: 22rem; }
.footer-brand .wordmark { margin-bottom: 1.25rem; }
.footer-brand p { font-size: var(--step--1); line-height: 1.8; }

.footer-cols {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.footer-cols h4 {
  margin-bottom: 1rem;
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.footer-cols ul { list-style: none; }
.footer-cols li + li { margin-top: 0.6rem; }
.footer-cols a {
  font-size: var(--step--1);
  color: var(--on-dark-soft);
  transition: color 0.25s var(--ease);
}
.footer-cols a:hover { color: var(--on-dark); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  font-size: var(--step--1);
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; }
.footer-bottom a:hover { color: var(--on-dark); }

.social { display: flex; gap: 0.75rem; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: var(--on-dark-soft);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.social a:hover { border-color: var(--on-dark); color: var(--on-dark); }
.social svg { width: 16px; height: 16px; }

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 48rem) {          /* 768px */
  .split { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1.4fr; }
  .footer-bottom { flex-wrap: nowrap; }
}

@media (min-width: 62rem) {          /* 992px */
  .nav { display: block; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none; }
  .header-bar { min-height: 5rem; }
}
