/* ==========================================================
   Contreras Family Bakery
   Hand-authored CSS3. Single external stylesheet for all 10 pages.

   Every foreground/background pair here was checked against a
   contrast analyzer before being written; the lowest ratio used
   anywhere on the site is 6.70:1, well past the 4.5:1 that
   Section 508 and WCAG AA require for normal text.
   ========================================================== */

:root {
  --navy: #3d2415;
  --navy-mid: #5a3a22;
  --accent: #8c1d2f;
  --text: #3d2415;
  --muted-on-navy: #f3e3d3;
  --link: #8c1d2f;
  --surface: #fdf8f3;
  --border: rgba(61, 36, 21, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ---- Skip link: off-screen until it receives keyboard focus ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background-color: #ffffff;
  color: var(--navy);
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  z-index: 100;
}

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

/* A visible focus ring everywhere. Keyboard users need to see where
   they are, and removing outlines is the most common 508 failure. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Header and navigation ---- */
header {
  background-color: var(--navy);
  color: #ffffff;
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
}

.brand:hover,
.brand:focus {
  color: #ffffff;
}

.brand img {
  width: 3rem;
  height: 3rem;
  border-radius: 0.4rem;
}

.brand-name {
  display: flex;
  flex-direction: column;
}

.brand-tagline {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted-on-navy);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.6rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 0.5rem;
  background-color: var(--navy-mid);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: #ffffff;
}

nav[aria-label="Main"] {
  margin-left: auto;
}

nav[aria-label="Main"] ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav[aria-label="Main"] a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0.4rem;
  /* The one CSS transition on the site: a short colour shift that
     confirms a nav item is interactive without moving the layout. */
  transition: background-color 0.25s ease, color 0.25s ease;
}

nav[aria-label="Main"] a:hover,
nav[aria-label="Main"] a:focus {
  background-color: var(--navy-mid);
  color: #ffffff;
}

nav[aria-label="Main"] a[aria-current="page"] {
  background-color: #ffffff;
  color: var(--navy);
}

/* ---- Main content ---- */
main {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.5rem;
  color: var(--navy);
  margin-top: 2.25rem;
}

h3 {
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

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

a:hover,
a:focus {
  color: var(--accent);
}

.lede {
  font-size: 1.15rem;
  max-width: 60ch;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The overlay sits in normal flow with a min-height so a long
   headline grows the box instead of spilling out of it. */
.hero-overlay {
  position: relative;
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 2rem;
  background-color: rgba(61, 36, 21, 0.82);
  color: #ffffff;
}

.hero-overlay h1 {
  color: #ffffff;
  max-width: 22ch;
}

.hero-overlay p {
  color: var(--muted-on-navy);
  max-width: 55ch;
  margin: 0;
}

/* ---- Buttons ---- */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  background-color: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.25s ease;
}

.button:hover,
.button:focus {
  background-color: #6d1624;
  color: #ffffff;
}

.button-secondary {
  background-color: #ffffff;
  color: var(--navy);
  border: 2px solid #ffffff;
}

.button-secondary:hover,
.button-secondary:focus {
  background-color: var(--muted-on-navy);
  color: var(--navy);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---- Cards and grids ---- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(61, 36, 21, 0.05), 0 8px 20px rgba(61, 36, 21, 0.06);
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Track cards carry a colour bar, but the track is also named in the
   heading text so the distinction never depends on colour alone. */
.track-stem {
  border-top: 5px solid var(--link);
}

.track-trades {
  border-top: 5px solid var(--accent);
}

.panel {
  background-color: var(--surface);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.panel h2 {
  margin-top: 0;
}

/* ---- Data tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
}

caption {
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 0.5rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  background-color: var(--navy);
  color: #ffffff;
}

tbody tr:nth-child(even) {
  background-color: var(--surface);
}

/* ---- Lists ---- */
.checklist {
  padding-left: 1.25rem;
}

.checklist li {
  margin-bottom: 0.4rem;
}

.partner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.partner-list li {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---- FAQ disclosure ---- */
details {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
  background-color: #ffffff;
}

summary {
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}

details[open] summary {
  margin-bottom: 0.6rem;
}

/* ---- Forms ---- */
fieldset {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.25rem 1.35rem;
}

legend {
  font-weight: 700;
  color: var(--navy);
  padding: 0 0.4rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #94a3b8;
  border-radius: 0.5rem;
  background-color: var(--surface);
  color: var(--text);
  font: inherit;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.radio-group label,
.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--navy);
}

.required {
  color: var(--accent);
}

.field-error {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 1.1rem;
  margin-top: 0.25rem;
}

button[type="submit"] {
  padding: 0.75rem 1.75rem;
  border: 0;
  border-radius: 0.5rem;
  background-color: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

button[type="submit"]:hover,
button[type="submit"]:focus {
  background-color: #6d1624;
}

/* ---- Footer ---- */
footer {
  background-color: var(--navy);
  color: #ffffff;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-inner h2 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-top: 0;
}

.footer-inner p {
  color: var(--muted-on-navy);
}

.footer-inner a {
  color: var(--muted-on-navy);
}

.footer-inner a:hover,
.footer-inner a:focus {
  color: #ffffff;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
  padding: 1rem 1.5rem;
  font-size: 0.87rem;
  color: var(--muted-on-navy);
  margin: 0;
}

.footer-bottom a {
  color: var(--muted-on-navy);
}

/* ==========================================================
   Responsive breakpoints
   ========================================================== */

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  header {
    position: relative;
  }

  nav[aria-label="Main"] {
    margin-left: 0;
  }

  nav[aria-label="Main"] ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    background-color: var(--navy);
    box-shadow: 0 16px 28px rgba(61, 36, 21, 0.3);
    z-index: 60;
  }

  nav[aria-label="Main"] ul.is-open {
    display: flex;
  }

  nav[aria-label="Main"] li {
    width: 100%;
  }

  nav[aria-label="Main"] li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  nav[aria-label="Main"] a {
    border-radius: 0;
    padding: 0.9rem 1.5rem;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.7rem;
  }

  .grid-2,
  .grid-3,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-overlay {
    min-height: 17rem;
    padding: 2rem 1.5rem;
  }
}

/* Product cards lead with the photo, so it spans the card's padding. */
.card img {
  width: calc(100% + 3rem);
  margin: -1.5rem -1.5rem 1rem;
  max-width: none;
  border-radius: 0.75rem 0.75rem 0 0;
}
