/* DoarTupa — estilos
   Mobile-first. Sem dependências. Paleta terrosa. */

:root {
  --bg:        oklch(0.972 0.018 75);
  --paper:     oklch(0.995 0.008 80);
  --ink:       oklch(0.22 0.025 50);
  --muted:     oklch(0.48 0.018 60);
  --line:      oklch(0.88 0.02 70);
  --soft:      oklch(0.93 0.04 60);
  --accent:    oklch(0.60 0.135 40);
  --accent-ink:oklch(0.34 0.10 40);
  --wa:        oklch(0.62 0.16 150);
  --wa-ink:    oklch(0.40 0.13 150);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --maxw: 720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ─── Hero ─────────────────────────────── */
.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 28px 16px 22px;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.logo {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 7vw, 38px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.logo em { color: var(--accent); font-style: italic; font-weight: 500; }
.h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 5.5vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 10px;
  text-wrap: balance;
}
.hero-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
  text-wrap: pretty;
}
.cta-doar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 16px;
  background: var(--accent); color: white;
  border: 1px solid var(--accent-ink);
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  transition: transform 80ms ease;
}
.cta-doar:active { transform: scale(0.985); }

/* ─── Items grid ───────────────────────── */
.section {
  padding: 18px 16px 32px;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto 14px;
}
.section-head h2 {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: 18px; letter-spacing: -0.01em;
}
.section-head .count { font-size: 12px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  text-align: left; padding: 0;
  cursor: pointer;
  font-family: inherit; color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(80,50,30,0.08);
  outline: none;
}
.card-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--soft);
  background-image: repeating-linear-gradient(
    135deg,
    oklch(0.88 0.035 50) 0 14px,
    oklch(0.82 0.045 50) 14px 28px
  );
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .ph-label {
  position: absolute; left: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 10px;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.35);
  padding: 2px 6px; border-radius: 4px;
}
.badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 600;
  padding: 3px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.photo-count {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.55); color: white;
  font-size: 10.5px; padding: 3px 7px; border-radius: 999px;
}
.card-body { padding: 10px 12px 12px; }
.card-title {
  font-family: var(--serif); font-weight: 500;
  font-size: 15px; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex; gap: 6px; align-items: center;
  font-size: 10.5px; color: var(--muted);
}

/* ─── Footer ───────────────────────────── */
.footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 24px 16px 32px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer p { margin: 0 0 12px; line-height: 1.5; }
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 11px;
}

/* ─── Detail modal ─────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(34,25,15,0.55);
  display: none;
}
.modal-backdrop.open { display: block; }
.modal {
  position: fixed; inset: 0; z-index: 101;
  background: var(--bg);
  overflow-y: auto;
  display: none;
  animation: slideUp 240ms cubic-bezier(.2,.7,.2,1);
}
.modal.open { display: block; }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--bg) 80%, transparent);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.modal-content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 32px;
}
.modal-photo {
  aspect-ratio: 1 / 1;
  background-image: repeating-linear-gradient(
    135deg,
    oklch(0.88 0.035 50) 0 18px,
    oklch(0.82 0.045 50) 18px 36px
  );
  border-radius: 14px;
  position: relative; overflow: hidden;
}
@media (min-width: 700px) {
  .modal-photo { aspect-ratio: 4 / 3; }
}
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-dots {
  display: flex; justify-content: center; gap: 6px; margin: 10px 0 0;
}
.modal-dots span {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--line);
}
.modal-dots span.on { background: var(--ink); }
.modal-title {
  font-family: var(--serif); font-weight: 500;
  font-size: 26px; line-height: 1.15; letter-spacing: -0.015em;
  margin: 18px 0 8px;
  text-wrap: balance;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip {
  font-size: 11.5px; color: var(--muted);
  background: var(--soft); padding: 4px 10px; border-radius: 999px;
}
.modal-desc {
  font-size: 15px; line-height: 1.55; color: var(--ink);
  margin: 0 0 18px; text-wrap: pretty;
}
.donor-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px; margin: 0 0 14px;
}
.donor-avatar {
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--soft); color: var(--accent-ink);
  font-family: var(--serif); font-size: 17px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
.donor-label { font-size: 11px; color: var(--muted); }
.donor-name { font-size: 14.5px; font-weight: 500; color: var(--ink); }

.cta-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 18px;
  background: var(--wa); color: white;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(20,140,80,0.25);
}
.cta-wa:active { transform: scale(0.99); }
.cta-fineprint {
  text-align: center; font-size: 11px; color: var(--muted);
  margin: 8px 0 0;
}

/* utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* prevent scroll when modal open */
body.no-scroll { overflow: hidden; }
