/* Dagaldoba — folha de espécimes */
:root {
  --bg: #f3ebe2;
  --sheet: #f8f2eb;
  --band: #e7d9cb;
  --deep: #1f4b4e;
  --ink: #2b201a;
  --muted: #7b6b5d;
  --on-deep: #f3ebe2;
  --accent: #b05a30;
  --teal: #2f7275;
  --gap: 88px;
  --pad: clamp(18px, 4.5vw, 64px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--bg); padding: 8px 14px;
}
.skip:focus { left: 8px; z-index: 10; }

/* ---------- Sheet (subloja com moldura) ---------- */
.sheet {
  max-width: 1280px;
  margin: 40px auto 0;
  background: var(--sheet);
  border: 1px solid var(--accent);
}
.page { margin-inline: 40px; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 28px;
  padding-inline: var(--pad);
}

/* ---------- Header ---------- */
.masthead {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 12px 32px;
  padding: 22px var(--pad);
  border-bottom: 1px solid rgba(43, 32, 26, .18);
}
.brand {
  font-weight: 800; font-size: 20px; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--teal); font-weight: 500; font-size: 13px; letter-spacing: .06em; margin-left: 10px; text-transform: uppercase; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-top: 64px; row-gap: 40px; }
.hero h1 {
  grid-column: 1 / 9;
  margin: 0;
  font-size: clamp(38px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 800;
}
.label {
  grid-column: 10 / 13;
  align-self: start;
  border: 1px solid var(--ink);
  font-size: 13px; line-height: 1.5;
  margin: 0;
}
.label dt { color: var(--teal); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; padding: 8px 12px 0; }
.label dd { margin: 0; padding: 0 12px 8px; border-bottom: 1px solid rgba(43, 32, 26, .2); }
.label dd:last-child { border-bottom: 0; }

.hero-figure { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; margin: 0; align-items: end; }
.hero-figure img { grid-column: 1 / 6; border: 1px solid var(--ink); width: 100%; }
.hero-figure figcaption { grid-column: 6 / 9; font-size: 13px; line-height: 1.55; color: var(--muted); padding-bottom: 4px; }
.hero-figure figcaption b { display: block; color: var(--teal); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; margin-bottom: 6px; }
.lede { grid-column: 1 / 8; font-size: 20px; line-height: 1.6; margin: 0; }

/* ---------- Separador com serifas ---------- */
.rule {
  position: relative;
  height: 1px; background: var(--teal);
  margin: var(--gap) var(--pad);
}
.rule::before, .rule::after {
  content: ""; position: absolute; top: -6px; width: 1px; height: 13px; background: var(--teal);
}
.rule::before { left: 0; }
.rule::after { right: 0; }

/* ---------- Secções ---------- */
.section { padding-block: 0; }
.section.band { background: var(--band); padding-block: var(--gap); }

.num {
  grid-column: 1 / -1;
  font-size: 13px; color: var(--teal); letter-spacing: .1em; text-transform: uppercase;
  margin: 0 0 10px;
}
.body { grid-column: 1 / 8; }
.body > :first-child { margin-top: 0; }
.aside { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 20px; align-self: start; }

h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15; letter-spacing: -.02em; font-weight: 700;
  margin: 0 0 22px;
}
h3 { font-size: 19px; line-height: 1.35; font-weight: 700; margin: 34px 0 10px; }
p { margin: 0 0 18px; }

.body ul, .body ol { padding-left: 1.2em; margin: 0 0 22px; }
.body li { margin-bottom: 8px; }
.body li::marker { color: var(--accent); }

.check { list-style: none; padding-left: 0 !important; }
.check li { position: relative; padding-left: 28px; }
.check li::before {
  content: ""; position: absolute; left: 2px; top: .52em;
  width: 11px; height: 11px; border: 1px solid var(--accent);
}

/* Plaquetas (tabelas-legenda) */
.plate { border: 1px solid var(--ink); background: var(--sheet); font-size: 13px; line-height: 1.55; }
.band .plate { background: #efe5da; }
.plate h3, .plate .plate-title {
  margin: 0; padding: 9px 14px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em; color: var(--teal);
  border-bottom: 1px solid var(--ink);
}
.plate p { margin: 0; padding: 10px 14px; }
.plate table { width: 100%; border-collapse: collapse; }
.plate th, .plate td { text-align: left; padding: 7px 14px; border-bottom: 1px solid rgba(43, 32, 26, .18); vertical-align: top; }
.plate tr:last-child th, .plate tr:last-child td { border-bottom: 0; }
.plate th { font-weight: 600; }
.plate .note { color: var(--muted); border-top: 1px solid rgba(43, 32, 26, .18); }

/* Separador substituído por plaqueta no campo direito */
.rule-plate {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 28px;
  margin: var(--gap) var(--pad); align-items: center;
}
.rule-plate::before { content: ""; grid-column: 1 / 9; height: 1px; background: var(--teal); }
.rule-plate .plate { grid-column: 9 / 13; }

/* Tabela de programa */
.schedule { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 22px; }
.schedule caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 8px; }
.schedule th, .schedule td { padding: 9px 10px 9px 0; border-bottom: 1px solid rgba(43, 32, 26, .2); text-align: left; vertical-align: top; }
.schedule thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--teal); font-weight: 600; border-bottom-color: var(--teal); }
.schedule td:first-child { color: var(--teal); font-variant-numeric: tabular-nums; width: 2.2em; }
.table-wrap { overflow-x: auto; }

/* Defeitos */
.defects { margin: 0 0 22px; }
.defects div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid rgba(43, 32, 26, .2); }
.defects dt { font-weight: 700; }
.defects dd { margin: 0; }

/* ---------- Secção de contraste ---------- */
.deep {
  background: var(--deep); color: var(--on-deep);
  padding-block: var(--gap);
}
.deep .num { color: #9fcfcf; }
.deep a { color: #f0b28f; }
.deep figure { grid-column: 8 / 13; margin: 0; grid-row: 2 / span 2; }
.deep figure img { border: 1px solid rgba(243, 235, 226, .6); width: 100%; }
.deep figcaption { font-size: 13px; color: #cfc2b4; margin-top: 10px; line-height: 1.5; }
.deep .body { grid-column: 1 / 7; grid-row: 2; }
.deep .body li::marker { color: #f0b28f; }
.deep .check li::before { border-color: #f0b28f; }

/* ---------- Contacto ---------- */
.contact { padding-bottom: var(--gap); }
.contact .mail { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; letter-spacing: -.01em; }

/* ---------- Páginas internas ---------- */
.doc-head { padding-top: 64px; }
.doc-head h1 {
  grid-column: 1 / 10; margin: 0;
  font-size: clamp(34px, 4.6vw, 60px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800;
}
.doc-head .lede { margin-top: 26px; }
.doc { padding-bottom: var(--gap); }
.doc .body h2 { margin-top: 48px; font-size: clamp(22px, 2.4vw, 28px); }
.doc .body h2:first-child { margin-top: 0; }
.updated { font-size: 13px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1280px; margin: 40px auto 40px;
  padding: 28px 0 0;
  border-top: 1px solid var(--ink);
}
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; padding-bottom: 18px; border-bottom: 1px solid rgba(43, 32, 26, .25); }
.foot-name { font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.foot-mail { font-size: 17px; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-top: 16px; font-size: 13px; color: var(--muted); }
.foot-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot-bottom a { color: var(--ink); }
.foot-bottom p { margin: 0; max-width: 46ch; }

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .hero h1 { grid-column: 1 / -1; }
  .label { grid-column: 1 / 8; }
  .hero-figure img { grid-column: 1 / 8; }
  .hero-figure figcaption { grid-column: 8 / 13; }
  .lede, .body, .doc-head h1 { grid-column: 1 / -1; }
  .aside { grid-column: 1 / -1; margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .rule-plate::before { grid-column: 1 / 6; }
  .rule-plate .plate { grid-column: 6 / 13; }
  .deep .body { grid-column: 1 / -1; grid-row: auto; }
  .deep figure { grid-column: 1 / 8; grid-row: auto; margin-top: 32px; }
}

@media (max-width: 640px) {
  :root { --gap: 52px; }
  body { font-size: 16.5px; }
  .page { margin-inline: 12px; }
  .sheet { margin-top: 12px; }
  .grid { column-gap: 0; }
  .masthead { flex-direction: column; align-items: flex-start; }
  .hero { padding-top: 40px; row-gap: 28px; }
  .label, .hero-figure img, .hero-figure figcaption, .deep figure { grid-column: 1 / -1; }
  .hero-figure { row-gap: 10px; }
  .lede { font-size: 18px; }
  .rule-plate { display: block; }
  .rule-plate::before { display: block; margin-bottom: 18px; }
  .defects div { grid-template-columns: 1fr; gap: 4px; }
  .site-footer { margin: 28px auto; }
  .foot-top, .foot-bottom { flex-direction: column; }
}
