/* Em Busca da Flor Favorita — folha de estilo
   Paleta: papel #FAF5EE · tinta #1E1A17 · verde #2F4436 · terracota #B4542F */

:root {
  --paper: #FAF5EE;
  --ink: #1E1A17;
  --ink-soft: #4A423A;
  --muted: #8A7F72;
  --muted-2: #9C8F80;
  --green: #2F4436;
  --green-dark: #1E2E24;
  --terracota: #B4542F;
  --line: #E0D6C6;
  --line-2: #CFC3B1;
  --line-3: #DCD1BF;
  --clay: #EADFCE;
  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--terracota); }

input, textarea, select, button { font-family: inherit; color: inherit; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }
::selection { background: #E8D9C4; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page { min-height: 100vh; padding: 0 0 120px; }

/* Rótulos em versalete ------------------------------------------------- */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--xs { font-size: 10px; }

/* Cabeçalho ------------------------------------------------------------ */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--gutter) 0;
}

.wordmark {
  font-family: 'Instrument Serif', serif;
  font-size: 19px;
  letter-spacing: 0.01em;
}

/* Abertura ------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  padding: clamp(36px, 7vw, 84px) var(--gutter) 0;
}

.hero-copy { max-width: 620px; }

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(46px, 8.2vw, 108px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero-title em { font-style: italic; }

.hero-lede {
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.5;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 26px 0 0;
  text-wrap: pretty;
}

.progress { margin-top: clamp(34px, 5vw, 58px); max-width: 460px; }

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress-track {
  margin-top: 10px;
  height: 1px;
  background: var(--line);
  position: relative;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: -1px;
  height: 3px;
  width: 0.6%;
  background: var(--green);
  transition: width 0.6s ease;
}

.hero-photo {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: var(--clay);
  aspect-ratio: 4 / 3.4;
  min-height: 220px;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Números -------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: #E4DACA;
  margin: clamp(48px, 8vw, 96px) var(--gutter) 0;
}

.stat { background: var(--paper); padding: 26px 4px 4px 22px; }
.stat:first-child { padding-left: 0; }

.stat-value {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1;
  margin-top: 12px;
}

.stat-value--sm {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  margin-top: 16px;
  text-wrap: pretty;
}

/* A coleção ------------------------------------------------------------ */

.collection { padding: clamp(56px, 9vw, 104px) var(--gutter) 0; }

.collection-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.section-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 44px);
  margin: 0;
  letter-spacing: -0.01em;
}

.search {
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  padding: 8px 2px;
  font-size: 15px;
  font-weight: 300;
  width: min(300px, 100%);
}

.tabs {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 22px;
}

.tab {
  border: none;
  background: none;
  padding: 4px 0;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--muted-2);
  border-bottom: 1px solid transparent;
}
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.filters {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
  margin-top: 26px;
  font-size: 13px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  padding: 5px 18px 5px 0;
  font-size: 14px;
  cursor: pointer;
}
.select--species { min-width: 150px; }
.select--family { min-width: 140px; }
.select--origin { min-width: 130px; }
.select--score { min-width: 110px; }

.results {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 34px;
}

.results-count {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.link-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracota);
  padding: 0;
}

/* Grade de flores ------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 21vw, 236px), 1fr));
  gap: clamp(18px, 2.4vw, 40px) clamp(14px, 1.8vw, 28px);
  margin-top: 28px;
}

.card {
  cursor: pointer;
  animation: rise 0.5s ease both;
  text-align: left;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

.card-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  overflow: hidden;
  background: var(--clay);
}

.card-block { position: absolute; inset: 0; }

.card-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.card:hover .card-img, .card:focus-visible .card-img { transform: scale(1.045); }

.card-marker {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(250, 245, 238, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 11px;
}

.card-names { min-width: 0; }

.card-species {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(15px, 1.3vw, 19px);
  line-height: 1.2;
}

.card-color {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
  margin-top: 2px;
}

.card-score { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

.card-dyed {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 6px;
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: clamp(40px, 6vw, 64px);
}

.btn-ghost {
  border: 1px solid var(--line-3);
  background: none;
  border-radius: 100px;
  padding: 13px 30px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--ink); }

.empty {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  color: var(--muted);
  margin: 60px 0 0;
}

/* Ficha da flor -------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 23, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(0px, 4vh, 48px) clamp(0px, 4vw, 40px);
  overflow-y: auto;
}

.modal {
  background: var(--paper);
  border-radius: 6px;
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  overflow: hidden;
  animation: rise 0.35s ease both;
}

.modal:focus { outline: none; }

.modal-photo-wrap { position: relative; min-height: 300px; background: var(--clay); }
.modal-photo { position: absolute; inset: 0; }

.modal-body { padding: clamp(26px, 3.4vw, 44px); }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.05;
  margin: 8px 0 0;
}

.modal-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  padding: 0;
}

.modal-origin {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 16px 0 0;
  text-wrap: pretty;
}

.rule { height: 1px; background: var(--line); margin: 26px 0; }

.given-tabs { display: flex; gap: 18px; margin-top: 12px; }

.score-block { margin-top: 28px; }
.score-head { display: flex; justify-content: space-between; align-items: baseline; }

.score-value {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  line-height: 1;
}

.score-row { display: flex; gap: 5px; margin-top: 10px; }

.score-btn {
  flex: 1;
  border: none;
  cursor: pointer;
  height: 30px;
  border-radius: 3px;
  font-size: 12px;
  background: #EFE7DA;
  color: #6B6157;
}
.score-btn.is-on { background: var(--green); color: var(--paper); }

.fav-btn {
  margin-top: 24px;
  background: none;
  border-radius: 100px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.fav-btn.is-on { border-color: var(--terracota); color: var(--terracota); }

.field-block { margin-top: 26px; }

.text-input {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  font-size: 13px;
  font-weight: 300;
  padding: 6px 0;
}

.textarea {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  resize: vertical;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  padding: 6px 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 22px;
  margin-top: 26px;
}
.meta-grid .field { gap: 8px; }

.meta-input {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  font-size: 14px;
  padding: 5px 0;
}
select.meta-input { cursor: pointer; }

.save-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.btn-primary {
  border: none;
  background: var(--green);
  color: var(--paper);
  border-radius: 100px;
  padding: 13px 28px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--green-dark); }

.saved-hint { font-size: 12px; color: var(--muted); }

/* Rodapé --------------------------------------------------------------- */

.footer { padding: clamp(60px, 9vw, 110px) var(--gutter) 0; }

.footer p {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.3;
  max-width: 24ch;
  margin: 0;
  color: var(--green);
}

/* Telas estreitas ------------------------------------------------------ */

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero-photo { order: -1; aspect-ratio: 3 / 2; }
}

/* Abaixo disto os números ficam em duas colunas fixas, para que a coluna da
   esquerda continue alinhada à margem em todas as linhas. */
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 22px 4px 4px 16px; }
  .stat:nth-child(2n + 1) { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .modal { animation: none; }
  .card-img, .progress-fill { transition: none; }
}
