/* DIY Screen Printing – Global Stylesheet */

/* ============================================================
   §1 – Design Tokens (:root custom properties)
   ============================================================ */

:root {
  /* === Colour palette === */
  --color-bg:           hsl(220, 15%, 8%);
  --color-bg-elevated:  hsl(220, 14%, 13%);
  --color-bg-section:   hsl(220, 13%, 11%);
  --color-text:         hsl(220, 10%, 90%);
  --color-text-muted:   hsl(220, 8%, 65%);
  --color-accent:       hsl(38, 95%, 55%);
  --color-accent-hover: hsl(38, 95%, 45%);
  --color-border:       hsl(220, 10%, 20%);
  --color-star:         hsl(42, 100%, 60%);

  /* === Typography === */
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs:  0.75rem;
  --font-size-sm:  0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:  1.125rem;
  --font-size-xl:  1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-weight-normal: 400;
  --font-weight-semi:   600;
  --font-weight-bold:   700;
  --line-height-tight:  1.25;
  --line-height-base:   1.6;

  /* === Spacing (8 px grid) === */
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* === Layout === */
  --container-max: 1200px;
  --container-pad: var(--space-4);

  /* === Radius === */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-btn:  6px;
  --radius-card: 12px;

  /* === Transitions === */
  --transition-fast: 80ms ease;
  --transition-base: 200ms ease;

  /* === Shadows === */
  --shadow-card: 0 2px 12px hsl(220 15% 4% / 0.6);
}

/* ============================================================
   §1a – CSS Reset
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ============================================================
   §2 – Body Base
   ============================================================ */

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   §3 – Layout Helpers
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  display: flex;
  flex-wrap: wrap;
}

/* ============================================================
   §4 – Typography Helpers
   ============================================================ */

.text-sm {
  font-size: var(--font-size-sm);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-muted {
  color: var(--color-text-muted);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-semi {
  font-weight: var(--font-weight-semi);
}

/* ============================================================
   §5 – Site header & nav
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
}

.nav__logo img,
.nav__logo svg {
  display: block;
  width: 160px;
  height: 40px;
}

/* Visually hidden checkbox – CSS hack for no-JS mobile menu */
.nav__checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Hamburger label – 44×44 px touch target */
.nav__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 10px;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition-base);
}

/* Nav links list */
.nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  /* Mobile: collapsed by default */
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
  /* Stack below header on mobile */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

/* Expand when checkbox is checked (CSS-only no-JS fallback) */
.nav__checkbox:checked ~ .nav__links {
  max-height: 500px;
}

/* Expand when JS adds open class */
.nav__links--open {
  max-height: 500px;
}

/* Individual nav link */
.nav__link {
  display: block;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.nav__link:hover {
  color: var(--color-accent);
}

/* Active link */
.nav__link--active {
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
  border-bottom: 2px solid var(--color-accent);
}

/* ============================================================
   §6 – Footer
   ============================================================ */

.site-footer {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
}

.footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.footer__nav a:hover {
  color: var(--color-accent);
}

/* Social icon link – 44×44 touch target */
.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer__social a:hover {
  color: var(--color-accent);
}

.footer__copy {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: 0;
}

.footer__copy a {
  color: var(--color-text-muted);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.footer__copy a:hover {
  color: var(--color-accent);
}

/* ============================================================
   §7 – Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
}

/* Primary – Accent_Color background, dark text */
.btn--primary {
  background: var(--color-accent);
  color: hsl(220, 15%, 8%);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-accent-hover);
  color: hsl(220, 15%, 8%);
  transition: var(--transition-fast);
}

/* Secondary – outlined */
.btn--secondary {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background: var(--color-accent);
  color: hsl(220, 15%, 8%);
  transition: var(--transition-fast);
}

/* ============================================================
   §8 – Hero section
   ============================================================ */

.hero {
  padding: var(--space-20) 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.hero__title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin: 0;
}

.hero__sub {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  margin: 0;
}

.hero__image picture img,
.hero__image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  display: block;
}

/* ============================================================
   §9 – Product & Kit cards
   ============================================================ */

article.product-card,
article.kit-card {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

article.product-card:hover,
article.kit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px hsl(220 15% 4% / 0.75);
}

.product-card picture img,
.product-card > img,
.kit-card picture img,
.kit-card > img {
  width: 100%;
  height: auto;
  display: block;
}

.product-card__body,
.kit-card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.product-card__name,
.kit-card__name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.product-card__desc,
.kit-card__desc {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  margin: 0;
}

.product-card__price,
.kit-card__price {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
  margin: 0;
}

/* ============================================================
   §10 – Review cards
   ============================================================ */

article.review-card {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}

.review-card__header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
}

.review-card__author {
  font-weight: var(--font-weight-semi);
  color: var(--color-text);
}

.review-card__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-star);
}

.review-card__stars svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.review-card__date {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.review-card__body {
  color: var(--color-text);
  line-height: var(--line-height-base);
  margin: 0;
}

/* ============================================================
   §11 – FAQ accordion
   ============================================================ */

.faq {
  padding: var(--space-20) 0;
}

.faq__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-8);
}

/* <dl> list reset */
.faq__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__question {
  margin: 0;
}

.faq__toggle {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: var(--space-4) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semi);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
}

.faq__toggle::after {
  content: '▼';
  display: inline-block;
  font-size: var(--font-size-sm);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-left: var(--space-4);
}

.faq__toggle[aria-expanded='true']::after {
  transform: rotate(180deg);
}

.faq__toggle:hover {
  color: var(--color-accent);
}

.faq__answer {
  padding: 0 0 var(--space-4);
  color: var(--color-text-muted);
}

/* Ensure the HTML hidden attribute is respected */
[hidden] {
  display: none !important;
}

/* ============================================================
   §12 – Blog resource cards
   ============================================================ */

article.blog-card {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-4);
  margin-bottom: var(--space-6);
}

.blog-card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
  margin-top: 0;
}

.blog-card__title a {
  color: var(--color-accent);
  text-decoration: none;
}

.blog-card__title a:hover {
  text-decoration: underline;
}

.blog-card__excerpt {
  color: var(--color-text-muted);
  margin: 0;
}

/* ============================================================
   §13 – Trust badges
   ============================================================ */

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-8) 0;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* ============================================================
   §14 – Comparison table
   ============================================================ */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-8) 0;
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  text-align: left;
}

.comparison-table th {
  background: var(--color-bg-elevated);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
}

.comparison-table tr:nth-child(even) {
  background: var(--color-bg-section);
}

/* ============================================================
   §15 – Fluid images (global base rule)
   ============================================================ */

img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   §20 – Breakpoints (mobile-first)
   ============================================================ */

/* ── Tablet: ≥ 768 px ──────────────────────────────────── */
@media (min-width: 768px) {

  /* Hide hamburger on tablet+ – nav links always visible */
  .nav__hamburger {
    display: none;
  }

  /* Nav links: always visible, horizontal row */
  .nav__links {
    position: static;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    background: none;
    border: none;
  }

  /* Hero: two-column layout */
  .hero__inner {
    grid-template-columns: 1fr 1fr;
  }

  /* Content grids: 2 columns */
  .products-grid,
  .kits-grid,
  .reviews-grid,
  .blog-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer: spread items across the row */
  .footer__inner {
    justify-content: space-between;
  }

}

/* ── Desktop: ≥ 1024 px ────────────────────────────────── */
@media (min-width: 1024px) {

  /* Larger hero title on desktop */
  .hero__title {
    font-size: var(--font-size-5xl);
  }

  /* Products, kits, and reviews: 3 columns */
  .products-grid,
  .kits-grid,
  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Blog: remains 2 columns on desktop */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Features: 3 columns */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

}

/* ── Wide desktop: ≥ 1440 px ───────────────────────────── */
@media (min-width: 1440px) {

  /* Expand container for very wide screens */
  .container {
    max-width: 1400px;
  }

}
