/*
  File: css/styles.css
  Purpose: Global styles for the Super Ice Creams wireframe portal.
           Defines CSS custom properties (color palette, spacing, type),
           a small reset, base typography, layout primitives, header,
           footer, and responsive behavior. Component-specific styles
           live in components.css.
*/

/* ---------- Design tokens (palette, spacing, type) ---------- */
:root {
  /* Pastel palette (WCAG-friendly text contrast on light surfaces) */
  --color-bg:           #FFF7F2;
  --color-surface:      #FFFFFF;
  --color-primary:      #FF8FAB;
  --color-primary-ink:  #7A2A44;
  --color-secondary:    #A0E7E5;
  --color-accent:       #FFD6A5;
  --color-accent-2:     #CDB4DB;
  --color-text:         #2B2B3A;
  --color-muted:        #6B6B7B;
  --color-border:       #F1E4DA;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Radii & shadow */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(43, 43, 58, 0.06);
  --shadow-md: 0 6px 18px rgba(43, 43, 58, 0.08);

  /* Type — system font stack only (no remote fonts) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Layout */
  --container-max: 1100px;

  /* Reserved space for the fixed footer (kept in sync with footer padding). */
  --footer-height: 5.5rem;
}

/* ---------- Minimal reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;

  /* Reserve space at the bottom so page content is never hidden
     behind the fixed footer. Tweak --footer-height if footer grows. */
  padding-bottom: var(--footer-height);
}

h1, h2, h3 { line-height: 1.2; color: var(--color-primary-ink); margin: 0 0 var(--space-3); }
h1 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem); }
h2 { font-size: clamp(1.25rem, 1.5vw + 0.75rem, 1.75rem); }
p  { margin: 0 0 var(--space-4); }

a {
  color: var(--color-primary-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

/* Visible focus ring on all interactive elements */
:focus-visible {
  outline: 3px solid var(--color-primary-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.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 for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary-ink);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { left: var(--space-3); top: var(--space-3); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-primary-ink);
  font-weight: 700;
  font-size: 1.1rem;
}
.brand__mark {
  display: inline-flex;
  width: 32px; height: 32px;
}

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  position: relative;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  display: block;
  width: 18px; height: 2px;
  background: var(--color-primary-ink);
  border-radius: 2px;
  position: relative;
}
.nav-toggle__bar::before { position: absolute; top: -6px; left: 0; width: 18px; }
.nav-toggle__bar::after  { position: absolute; top:  6px; left: 0; width: 18px; }

.primary-nav { width: 100%; display: none; }
.primary-nav.is-open { display: block; }

.primary-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
}
.primary-nav__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
}
.primary-nav__link:hover { background: var(--color-bg); }
.primary-nav__link.is-active {
  background: var(--color-primary);
  color: var(--color-primary-ink);
}

/* Tablet+ : horizontal nav, hide hamburger */
@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .primary-nav { display: block !important; width: auto; }
  .primary-nav__list {
    flex-direction: row;
    gap: var(--space-2);
    padding-top: 0;
  }
}

/* ---------- Main / Sections ---------- */
main.container { padding-top: var(--space-6); padding-bottom: var(--space-7); }

.page-head { margin-bottom: var(--space-5); }
.page-head__title { margin-bottom: var(--space-2); }
.page-head__lede  { color: var(--color-muted); max-width: 60ch; }

.section { margin-top: var(--space-7); }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.section__title { margin: 0; }
.section__link { font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6) 0;
}
.hero__title { margin-bottom: var(--space-3); }
.hero__lede  { color: var(--color-muted); max-width: 50ch; }
.hero__cta   { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero__art   { max-width: 320px; margin: 0 auto; }

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.2fr 1fr; gap: var(--space-7); }
  .hero__art { max-width: 100%; }
}

/* ---------- Prose (long-form text on About) ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--space-6); }
.prose ul { padding-left: var(--space-5); list-style: disc; }
.prose ul li { margin-bottom: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-7);

  /* Always visible: pin to the bottom of the viewport on every page. */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(43, 43, 58, 0.06);
}
.site-footer__inner {
  padding: var(--space-5) var(--space-4);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.site-footer__muted { color: var(--color-muted); margin: 0; }
.site-footer p { margin: 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
