/* Padaria Mundano — stylesheet
   Vanilla CSS only: custom properties, grid, flexbox, scroll-snap, clip-path. */

/* ---------- Fonts (self-hosted variable fonts) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("fonts/worksans-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --verde-mundano: #1e3a2b;
  --verde-mundano-escuro: #142819;
  --verde-suave: #e4eae0;
  --manteiga: #f0b429;
  --manteiga-escura: #c9910f;
  --papel: #faf6ec;
  --carvao: #2a2622;
  --tijolo: #9c4a32;
  --branco: #ffffff;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  --radius-sm: 8px;
  --radius-md: 16px;
  --container-width: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  background: var(--papel);
  color: var(--carvao);
  line-height: 1.55;
  font-size: 1rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--verde-mundano);
  line-height: 1.15;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.2rem, 5vw + 1rem, 3.6rem);
}

h2 {
  font-size: clamp(1.7rem, 3vw + 1rem, 2.5rem);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2xs);
}

p {
  max-width: 62ch;
}

/* Dark sections: headings inherit the light section color instead of the default green */
.hero h1,
.hero h2,
.baskets h2,
.baskets h3 {
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-sm);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--manteiga);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -100px;
  background: var(--manteiga);
  color: var(--carvao);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-sm);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn--primary {
  background: var(--manteiga);
  color: var(--carvao);
}

.btn--primary:hover {
  background: var(--manteiga-escura);
}

.btn--secondary {
  background: transparent;
  color: var(--papel);
  border-color: var(--papel);
}

.btn--secondary:hover {
  background: var(--papel);
  color: var(--verde-mundano-escuro);
}

.btn--small {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

.btn--outline {
  background: transparent;
  color: var(--verde-mundano);
  border-color: var(--verde-mundano);
}

.btn--outline:hover {
  background: var(--verde-mundano);
  color: var(--papel);
}

/* ---------- Header ---------- */
.site-header {
  background: var(--verde-mundano);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-block: var(--space-xs);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.logo__mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo__text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--papel);
}

.logo__accent {
  color: var(--manteiga);
}

.site-nav__list {
  display: flex;
  gap: var(--space-md);
}

.site-nav__list a {
  color: var(--papel);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav__list a:hover {
  color: var(--manteiga);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--papel);
  border-radius: 2px;
}

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

  .site-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--verde-mundano);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }

  .site-nav.is-open {
    max-height: 320px;
  }

  .site-nav__list {
    flex-direction: column;
    gap: 0;
    padding: var(--space-sm);
  }

  .site-nav__list a {
    display: block;
    padding: var(--space-xs) 0;
  }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--verde-mundano);
  color: var(--papel);
  position: relative;
  padding-block: var(--space-xl) calc(var(--space-xl) + 48px);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero__lede {
  margin-block: var(--space-sm) var(--space-md);
  font-size: 1.1rem;
  max-width: 46ch;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.hero__image {
  width: min(320px, 70vw);
  aspect-ratio: 1 / 0.8;
  margin-inline: auto;
  border-radius: 71% 29% 61% 39% / 51% 66% 34% 49%;
  background: linear-gradient(155deg, var(--manteiga) 0%, var(--manteiga-escura) 100%);
  position: relative;
  overflow: hidden;
  transform: rotate(-4deg);
}

.hero__image svg {
  transform: rotate(4deg);
}

.hero__image svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 800px) {
  .hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .hero__image {
    width: min(380px, 100%);
    margin-inline: 0 0 0 auto;
  }
}

/* Torn paper seam — used once, between hero and products */
.torn-edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 48px;
  line-height: 0;
}

.torn-edge svg {
  width: 100%;
  height: 100%;
}

/* ---------- Products ---------- */
.products {
  padding-block: var(--space-xl);
}

.product-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-sm);
  scroll-padding-inline: var(--space-sm);
}

.product-card {
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card--light {
  background: var(--branco);
}

.product-card--tint {
  background: var(--verde-suave);
}

.product-card__media {
  aspect-ratio: 4 / 3;
  background: rgba(30, 58, 43, 0.06);
}

.product-card__body {
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.product-card__body p {
  color: var(--carvao);
  font-size: 0.95rem;
}

.price {
  font-weight: 700;
  color: var(--tijolo);
  margin-top: var(--space-xs);
  font-size: 1.05rem;
}

@media (min-width: 860px) {
  .product-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
  }
}

/* ---------- Story ---------- */
.story {
  background: var(--verde-suave);
  padding-block: var(--space-xl);
}

.story__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.story__grid h2 {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  .story__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

/* ---------- Locations ---------- */
.locations {
  padding-block: var(--space-xl);
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

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

.location-card {
  background: var(--branco);
  border-left: 6px solid transparent;
  border-radius: 4px var(--radius-md) var(--radius-md) 4px;
  padding: var(--space-md);
}

.location-card--tijolo {
  border-left-color: var(--tijolo);
}

.location-card--manteiga {
  border-left-color: var(--manteiga-escura);
}

.location-card--verde {
  border-left-color: var(--verde-mundano);
}

.location-card__address,
.location-card__hours {
  font-size: 0.95rem;
  margin-top: var(--space-2xs);
}

.location-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.link-maps {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--verde-mundano);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Baskets ---------- */
.baskets {
  background: var(--verde-mundano-escuro);
  color: var(--papel);
  padding-block: var(--space-xl);
}

.baskets__lede {
  max-width: 50ch;
  margin-bottom: var(--space-lg);
  font-size: 1.05rem;
}

.basket-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

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

.basket-card {
  background: var(--papel);
  color: var(--carvao);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.basket-card h3 {
  color: var(--verde-mundano);
}

.basket-card .price {
  margin-bottom: var(--space-xs);
}

.basket-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ---------- Testimonials ---------- */
.testimonials {
  padding-block: var(--space-xl);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

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

.testimonial-card {
  background: var(--verde-suave);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.testimonial-card p:first-child {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--verde-mundano);
}

.testimonial-card__author {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--verde-mundano);
  color: var(--papel);
  padding-block: var(--space-lg) var(--space-md);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
}

.footer__brand p {
  margin-top: var(--space-2xs);
  color: var(--verde-suave);
  font-size: 0.9rem;
}

.footer__inner nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer__inner nav a:hover,
.footer__social a:hover {
  color: var(--manteiga);
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
}

.footer__copy {
  border-top: 1px solid rgba(250, 246, 236, 0.15);
  padding-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--verde-suave);
}

@media (min-width: 760px) {
  .footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: start;
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
