/* site.css — Casey's New Orleans Snowballs
   Hand-authored clone stylesheet. Reproduces the live Squarespace look
   (rainbow gradient, translucent cards, pill buttons, rotating image
   borders) using tokens harvested in docs/reference/theme-harvest.md.
   Do NOT invent colors — every value here traces back to that harvest. */

/* ==========================================================================
   1. Custom properties — the full palette
   ========================================================================== */
:root {
  --red: #F8333C;      /* gradient start, errors/accents, image border */
  --orange: #F1592C;   /* gradient 25% */
  --amber: #FBA619;    /* gradient 50% */
  --yellow: #FFDE40;   /* image border (separate from amber) */
  --green: #6BBE50;    /* gradient 75% */
  --blue: #3DACE2;     /* header, buttons, image border, gradient-adjacent */
  --sky: #54C8ED;      /* header gradient end, rainbow gradient 100% */
  --ink: #07151B;      /* body text */
  --card: rgba(255, 255, 255, 0.7); /* translucent card fill */
  --card-solid: #ffffff;

  --rainbow-gradient: linear-gradient(
    110deg,
    var(--red) 0%,
    var(--orange) 25%,
    var(--amber) 50%,
    var(--green) 75%,
    var(--sky) 100%
  );

  --header-gradient: linear-gradient(
    80deg,
    rgba(84, 200, 237, 1),
    rgba(84, 200, 237, 0)
  );

  --radius-card: 12px;
  --radius-btn: 15px;
  --frame-width: 7px;

  --header-height: 72px;
  --container-max: 1100px;
  --container-pad: 20px;

  --font-display: 'Lobster', cursive;
  --font-body: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;

  --focus-ring: 3px solid var(--blue);
}

/* ==========================================================================
   2. Reset-lite + base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  padding-top: var(--header-height); /* clear the fixed header */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
}

/* ==========================================================================
   3. Site-wide rainbow background
   ========================================================================== */
.site-wrapper,
body {
  background-image: var(--rainbow-gradient);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
}

@media (max-width: 480px) {
  .site-wrapper,
  body {
    background-image: linear-gradient(
      90deg,
      var(--red) 0%,
      var(--orange) 25%,
      var(--amber) 50%,
      var(--green) 75%,
      var(--sky) 100%
    );
    /* fixed attachment is unreliable on mobile Safari; scroll keeps full coverage */
    background-attachment: scroll;
  }
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 15px;
}

@media (min-width: 768px) {
  .card {
    padding: 25px;
  }
}

/* Single-column mobile-first grid; opens up above 767px where the live
   design uses multi-column layout (feature rows, galleries). */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .grid--2col {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */
/* NOTE: white-on-var(--blue) measures ~2.56:1 (fails WCAG AA 4.5:1 normal
   text and 3:1 large/bold text). This reproduces the live brand color as
   harvested — see task-4-report.md "NEEDS MARS" for the flagged conflict.
   Do not silently darken --blue or swap text color here. */
.btn {
  display: inline-block;
  background: var(--blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 1.2em 2em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  filter: brightness(0.92);
}

.btn:active {
  transform: translateY(1px);
}

.btn--outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}

/* ==========================================================================
   6. Image frames — 7px rotating brand-color borders
   ========================================================================== */
.img-frame--blue,
.img-frame--red,
.img-frame--yellow {
  border-style: solid;
  border-width: var(--frame-width);
  border-radius: var(--radius-card);
  display: inline-block;
  overflow: hidden;
}

.img-frame--blue {
  border-color: var(--blue);
}

.img-frame--red {
  border-color: var(--red);
}

.img-frame--yellow {
  border-color: var(--yellow);
}

.img-frame--blue img,
.img-frame--red img,
.img-frame--yellow img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   7. Typography
   ========================================================================== */
h1,
.display {
  font-family: var(--font-display);
  font-weight: 400;
}

h1 {
  font-size: 2.75rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 3.5rem;
  }
}

h2 {
  font-size: 1.75rem;
  font-family: var(--font-body);
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
}

small,
.text-small {
  font-size: 0.9rem; /* ~15.3px on a 17px base — floor respected */
}

/* NOTE: --red on .card composited over the red gradient stop measures
   ~2.48:1 (fails AA even at the large-text 3:1 threshold). Flagged
   NEEDS MARS in task-4-report.md rather than silently darkening --red. */
.text-accent {
  color: var(--red);
}

/* ==========================================================================
   8. Header / nav
   ========================================================================== */
/* NOTE: white nav text near the left edge of the header, where the
   rgba(84,200,237,1) overlay is fully opaque (~--sky solid), measures
   ~1.93:1 (fails AA). Flagged NEEDS MARS — fixing invisibly is not
   possible without altering the brand header color/gradient. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--blue);
  background-image: var(--header-gradient);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

/* WCAG 2.2 SC 2.5.8 Target Size: plain-text nav links only get their
   clickable box widened via padding (not .btn, which already has its own
   pill padding) so the tap target reaches ~44px without changing the
   visible text position (header row is vertically centered). */
.site-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  padding: 14px 2px;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-header .brand {
  font-family: var(--font-display);
  color: #ffffff;
  font-size: 1.5rem;
  text-decoration: none;
}

/* Catering dropdown — native <details>/<summary>, no JS required,
   keyboard-operable (Enter/Space toggles, Tab moves through items). */
.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: inline-flex;
  align-items: center;
  padding: 14px 2px;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary:hover {
  text-decoration: underline;
}

.nav-dropdown[open] summary {
  text-decoration: underline;
}

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0;
  list-style: none;
  background-color: var(--blue);
  min-width: 160px;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.nav-dropdown__menu li {
  padding: 0;
}

.nav-dropdown__menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.nav-dropdown__menu a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
  background: rgba(7, 21, 27, 0.85);
  color: #ffffff;
  padding: 40px 0;
  margin-top: 40px;
}

.site-footer a {
  color: #ffffff;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .site-footer .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ==========================================================================
   10. Accessibility
   ========================================================================== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-card) 0;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   11. Forms
   ========================================================================== */
input,
textarea,
select {
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: var(--radius-card);
  border: 1px solid rgba(7, 21, 27, 0.2);
  padding: 0.75em 1em;
  background: var(--card-solid);
  color: var(--ink);
  width: 100%;
}

.form-card {
  background: var(--card-solid);
  padding: 24px;
  max-width: 640px;
}

@media (min-width: 768px) {
  .form-card {
    padding: 40px;
  }
}

.form-card fieldset {
  border: none;
  padding: 0;
  margin: 0 0 24px;
}

.form-card fieldset legend {
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0;
  margin-bottom: 16px;
}

.form-card .form-subfield {
  margin: 16px 0;
}

.form-card .form-subfield legend {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-required {
  color: var(--red, #c0392b);
}

.form-required-note {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 8px;
}

.form-radio-row,
.form-checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-radio-row label,
.form-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.form-radio-row input,
.form-checkbox-row input {
  width: auto;
}

/* Step visibility is controlled by the `hidden` attribute once form.js
   enhances the form. Without JS, [hidden] is never set, so every fieldset
   stays visible and the plain POST fallback still works. */
.form-step[hidden] {
  display: none;
}

.form-progress {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 20px;
}

.form-nav {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

[aria-invalid="true"] {
  border-color: var(--red, #c0392b) !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.25);
}

.form-error {
  color: var(--red, #c0392b);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 6px 0 0;
}

.form-success {
  max-width: 640px;
  text-align: center;
  padding: 40px 24px;
}

/* Honeypot: visually hidden, but present in the accessibility tree removal
   is intentional (aria-hidden + tabindex="-1" in markup) so screen-reader
   and keyboard users never encounter it. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
