/* =========================================================
   GUÍA DE BIENESTAR CANINO — DISEÑO PARA ESTUDIAR
   ========================================================= */

:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #1f2933;
  --muted: #667085;
  --line: #dfe7e2;
  --accent: #176b5b;
  --accent-dark: #0f5145;
  --accent-soft: #e6f3ef;
  --gold: #b7791f;
  --gold-soft: #fff5df;
  --danger: #a63d40;
  --danger-soft: #fff0f0;
  --warning: #9a6700;
  --warning-soft: #fff7df;
  --shadow: 0 8px 28px rgba(25, 45, 37, .07);
  --radius: 16px;
  --content: 1040px;
}

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

html {
  scroll-behavior: smooth;
}

body.study-page {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(23, 107, 91, .08), transparent 32rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.7;
  font-size: 17px;
}

/* ---------- Cabecera ---------- */

.site-header {
  background: linear-gradient(135deg, #123f37, #176b5b);
  color: #fff;
  padding: 2.75rem 1.25rem 3rem;
  box-shadow: 0 10px 30px rgba(15, 81, 69, .18);
}

.top-nav {
  width: min(var(--content), 100%);
  margin: 0 auto 1.5rem;
  min-height: 1px;
}

.page-title {
  width: min(var(--content), 100%);
  margin: 0 auto;
  max-width: 980px;
  font-size: clamp(1.65rem, 3.5vw, 2.65rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}

/* ---------- Contenedor principal ---------- */

.study-main {
  width: min(var(--content), calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.study-section {
  position: relative;
  margin: 0 0 2rem;
  padding: 2rem clamp(1.1rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.study-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--accent);
}

.section-title {
  margin: 0 0 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--accent-dark);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.25;
}

/* ---------- Listas / temas ---------- */

.topic-list,
.detail-list,
.sub-detail-list {
  margin: 0;
}

.topic-list {
  padding-left: 1.35rem;
}

.topic {
  margin: 0 0 1.35rem;
  padding: 1.1rem 1.15rem 1.15rem;
  background: var(--surface-soft);
  border: 1px solid #e7eee9;
  border-radius: 12px;
}

.topic:last-child {
  margin-bottom: 0;
}

.topic::marker {
  color: var(--accent);
  font-weight: 800;
}

.topic-title {
  display: block;
  margin-bottom: .55rem;
  color: #173f37;
  font-size: 1.04em;
  line-height: 1.45;
}

.detail-list {
  padding-left: 1.25rem;
}

.detail-item {
  margin: .45rem 0;
  padding-left: .2rem;
}

.detail-item::marker,
.sub-detail-item::marker {
  color: #5d756d;
}

.sub-detail-list {
  margin-top: .35rem;
  padding-left: 1.25rem;
}

.sub-detail-item {
  margin: .3rem 0;
}

strong {
  color: #173f37;
}

em {
  color: var(--danger);
}

/* ---------- Puntos numerados que conviene memorizar ---------- */

.freedom-card,
.indicator-card {
  margin: .65rem 0;
  padding: .85rem 1rem;
  background: var(--accent-soft);
  border: 1px solid #cce5dd;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  list-style-position: outside;
}

.freedom-card::marker,
.indicator-card::marker {
  color: var(--accent-dark);
  font-weight: 800;
}

/* ---------- Cinco momentos ---------- */

.moment-card {
  margin: .65rem 0;
  padding: .9rem 1rem;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.moment-card strong {
  color: var(--accent-dark);
}

/* ---------- Gravedad de incidencias ---------- */

.severity {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  margin: .8rem 0;
}

.severity-low {
  background: var(--warning-soft);
  border: 1px solid #f0d89b;
}

.severity-high {
  background: #fff1e8;
  border: 1px solid #efc8ad;
}

.severity-critical {
  background: var(--danger-soft);
  border: 1px solid #edc1c4;
}

.severity-low > strong,
.severity-high > strong,
.severity-critical > strong {
  display: block;
  margin-bottom: .35rem;
}

/* ---------- Énfasis por sección ---------- */

.section-intro::before {
  background: #176b5b;
}

.section-evaluation::before {
  background: #356aa0;
}

.section-freedoms::before {
  background: #8b6b2b;
}

.section-indicators::before {
  background: #7a5aa6;
}

.section-moments::before {
  background: #b66b31;
}

.section-rsce::before {
  background: #3f7d54;
}

/* ---------- Footer ---------- */

.site-footer {
  min-height: 2rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  body.study-page {
    font-size: 16px;
  }

  .site-header {
    padding: 2rem 1rem 2.25rem;
  }

  .study-main {
    width: min(100% - 1rem, var(--content));
    margin-top: 1rem;
  }

  .study-section {
    padding: 1.35rem .9rem 1.5rem 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .topic-list {
    padding-left: 1.15rem;
  }

  .topic {
    padding: .85rem .8rem .9rem;
  }

  .detail-list,
  .sub-detail-list {
    padding-left: 1rem;
  }
}

/* ---------- Impresión ---------- */

@media print {
  :root {
    --bg: #fff;
  }

  body.study-page {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-header {
    color: #000;
    background: #fff;
    box-shadow: none;
    padding: 0 0 1rem;
  }

  .page-title,
  .section-title,
  strong {
    color: #000;
  }

  .study-main {
    width: 100%;
    margin: 0;
  }

  .study-section {
    box-shadow: none;
    break-inside: avoid;
    border-color: #bbb;
  }

  .topic,
  .freedom-card,
  .indicator-card,
  .moment-card,
  .severity {
    break-inside: avoid;
  }

  .study-section::before {
    display: none;
  }
}
