/* Grontuku — hoja de estilos común */

:root {
  --bg: #eef4f1;
  --bg-alt: #dfeae5;
  --bg-dark: #1c2a28;
  --ink: #16211f;
  --ink-soft: #5f7370;
  --ink-inv: #eef4f1;
  --accent: #2f6f63;
  --accent-2: #c25340;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --step: 84px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- rejilla ---------- */

.wrap {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 26px;
}

.col-main { grid-column: 1 / 8; min-width: 0; }
.col-side { grid-column: 10 / 13; min-width: 0; }

/* ---------- cabecera ---------- */

.site-head {
  border-bottom: 1px solid rgba(22, 33, 31, 0.16);
  padding: 22px 0;
}

.site-head .grid { align-items: baseline; row-gap: 12px; }

.brand {
  grid-column: 1 / 5;
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand span { color: var(--accent-2); }

.site-nav { grid-column: 5 / 13; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  justify-content: flex-end;
}

.site-nav a {
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.site-nav a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--accent-2);
}

/* ---------- primer bloque ---------- */

.hero { padding: calc(var(--step) * 0.95) 0 var(--step); }

.hero h1 {
  grid-column: 1 / 9;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 5vw, 4.05rem);
  line-height: 1.07;
  letter-spacing: -0.015em;
  margin: 0 0 34px;
}

.hero-intro { grid-column: 1 / 7; }
.hero-intro p { margin: 0 0 18px; }
.hero-intro p:last-child { margin-bottom: 0; }
.lead { font-size: 1.12rem; }

/* columna-índice */

.indexcol {
  grid-column: 10 / 13;
  grid-row: 1 / span 2;
  align-self: start;
  border-top: 1px solid var(--accent);
  padding-top: 12px;
}

.indexcol h2,
.indexcol p.idx-title {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0 0 14px;
}

.indexcol ol,
.indexcol ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.indexcol li {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 11px;
  display: flex;
  gap: 10px;
}

.indexcol .num {
  color: var(--accent-2);
  font-family: var(--serif);
  font-size: 12px;
  padding-top: 1px;
  min-width: 18px;
}

.indexcol a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(47, 111, 99, 0.35); }
.indexcol a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.indexcol .idx-mail { word-break: break-word; }

/* ---------- secciones ---------- */

.band { padding: var(--step) 0; }
.band-alt { background: var(--bg-alt); }
.band-tight { padding-top: 0; }

.band-dark {
  background: var(--bg-dark);
  color: var(--ink-inv);
}

.band-dark h2, .band-dark h3 { color: var(--ink-inv); }
.band-dark .rule { background: rgba(238, 244, 241, 0.28); }
.band-dark .caption { color: #a9bfba; }
.band-dark a { color: #8fc4b8; }

.section-num {
  grid-column: 10 / 13;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  padding-top: 6px;
}

.band-dark .section-num { color: #d98773; }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  margin: 0 0 20px;
}

h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.4;
  margin: 32px 0 10px;
}

p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }

.rule {
  height: 1px;
  background: rgba(22, 33, 31, 0.2);
  margin: 0 0 26px;
}

.text ul, .text ol {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}

.text ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
}

.text ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 9px;
  height: 1px;
  background: var(--accent);
}

.text ol {
  counter-reset: st;
}

.text ol li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 9px;
  counter-increment: st;
}

.text ol li::before {
  content: counter(st, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--serif);
  font-size: 12px;
  color: var(--accent-2);
}

.band-dark .text ul li::before { background: #8fc4b8; }
.band-dark .text ol li::before { color: #d98773; }

/* ---------- imágenes ---------- */

.figure-main {
  grid-column: 1 / 9;
  margin: 0;
}

.figure-main img { width: 100%; }

.caption {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 10px;
}

.caption-side {
  grid-column: 10 / 13;
  align-self: end;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  border-top: 1px solid var(--accent-2);
  padding-top: 10px;
}

.figure-detail {
  grid-column: 8 / 13;
  margin: 0;
}

.figure-detail img { width: 100%; }

.detail-text { grid-column: 1 / 7; }

/* ---------- contacto ---------- */

.contact-line {
  grid-column: 1 / 8;
}

.contact-line .mail {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
}

/* ---------- pie ---------- */

.site-foot {
  background: var(--bg-alt);
  padding: 60px 0 46px;
}

.foot-top { row-gap: 20px; }

.foot-brand {
  grid-column: 1 / 7;
  font-family: var(--serif);
  font-size: 1.4rem;
}

.foot-index { grid-column: 8 / 13; }

.foot-index ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  justify-content: flex-end;
}

.foot-index a { font-size: 13px; color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(47, 111, 99, 0.4); }
.foot-index a:hover { color: var(--accent); }

.foot-rule { height: 1px; background: rgba(22, 33, 31, 0.22); margin: 26px 0 22px; }

.foot-bottom { row-gap: 12px; }
.foot-mail { grid-column: 1 / 7; font-size: 14px; }
.foot-note { grid-column: 7 / 13; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }

/* ---------- páginas de texto ---------- */

.page-head { padding: calc(var(--step) * 0.8) 0 34px; }

.page-head h1 {
  grid-column: 1 / 9;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}

.page-head .page-sub { grid-column: 1 / 7; color: var(--ink-soft); }

.page-body { padding-bottom: var(--step); }
.page-body h2 { margin-top: 0; }
.page-body section { margin-bottom: 46px; }
.page-body section:last-child { margin-bottom: 0; }

/* ---------- adaptación ---------- */

@media (max-width: 1000px) {
  :root { --step: 64px; }
  .col-main, .hero h1, .hero-intro, .figure-main, .contact-line,
  .page-head h1, .page-head .page-sub { grid-column: 1 / 10; }
  .col-side, .indexcol, .section-num, .caption-side { grid-column: 10 / 13; }
  .detail-text { grid-column: 1 / 8; }
  .figure-detail { grid-column: 8 / 13; }
  .foot-brand, .foot-mail { grid-column: 1 / 7; }
  .foot-index, .foot-note { grid-column: 7 / 13; }
}

@media (max-width: 760px) {
  :root { --step: 50px; }

  body { font-size: 16.5px; }

  .wrap { padding-left: 20px; padding-right: 20px; }

  .grid { display: block; }

  .site-head .grid { display: block; }
  .brand { display: inline-block; margin-bottom: 14px; }
  .site-nav ul { justify-content: flex-start; gap: 6px 18px; }

  .hero { padding-top: 36px; }
  .hero h1 { margin-bottom: 26px; }

  .indexcol {
    order: -1;
    margin: 0 0 34px;
    border-top: 1px solid var(--accent);
    padding-top: 12px;
  }

  .hero .indexcol { margin-bottom: 32px; }

  .indexcol ol, .indexcol ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
  }

  .indexcol li { margin-bottom: 6px; }

  .section-num { margin-bottom: 10px; padding-top: 0; }

  .figure-detail { margin: 26px 0 0; }
  .figure-main { margin-bottom: 4px; }
  .caption-side { border-top: 1px solid var(--accent-2); padding-top: 8px; margin-top: 12px; }

  .foot-index ul { justify-content: flex-start; }
  .foot-note { margin-top: 10px; }
  .foot-mail { margin-bottom: 4px; }
}

@media (max-width: 760px) {
  /* la columna-índice aparece antes del titular en pantallas estrechas */
  .hero .grid,
  .page-head .grid { display: flex; flex-direction: column; }
  .hero h1, .page-head h1 { order: 1; }
  .hero-intro, .page-head .page-sub { order: 2; }
}
