/* ==========================================================================
   NORA App – SEO Guide Pages
   Archivo compartido por todas las páginas de /seo/
   Diferenciación visual: cada página define --page-accent en un <style> inline
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables
   -------------------------------------------------------------------------- */
:root {
  --paper: #ffffff;
  --navy: #00274E;
  --ink: #00274E;
  --ink-mid: #0e2f5d;
  --ink-soft: #2d4f86;
  --gold: #c49a30;
  --gold-bright: #f0cb6a;
  --gold-soft: #f4e7cb;
  --gold-border: rgba(196, 154, 48, 0.22);
  --line: #dce6f4;
  --muted: #5a6f92;
  --bg-tint: #f5f7fb;
  --radius: 18px;
  --container: 1120px;
  --shadow: 0 16px 36px -26px rgba(0, 39, 78, 0.32);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Color de acento específico de cada página */
  --page-accent: var(--gold);
  --page-accent-soft: color-mix(in srgb, var(--page-accent) 12%, white);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(196, 154, 48, 0.45);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: min(92%, var(--container));
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  font-size: 0.94rem;
  font-family: inherit;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--lg {
  padding: 0.8rem 1.5rem;
  font-size: 0.97rem;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

.btn--primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 20px -8px rgba(0, 39, 78, 0.4);
}

.btn--primary:hover {
  background: var(--ink-mid);
  box-shadow: 0 10px 28px -8px rgba(0, 39, 78, 0.5);
}

.btn--secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn--secondary:hover {
  border-color: var(--page-accent);
  color: var(--page-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn--ghost:hover {
  background: var(--gold-soft);
  border-color: rgba(196, 154, 48, 0.35);
  color: var(--ink);
}

.btn--accent {
  background: var(--page-accent);
  color: #fff;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--page-accent) 60%, transparent);
}

.btn--accent:hover {
  filter: brightness(1.1);
}

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(227, 235, 245, 0.9);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-size: 0.95rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.91rem;
}

.site-nav a {
  position: relative;
  padding-bottom: 0.15rem;
  transition: color 0.2s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--page-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}

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

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  padding: 0.7rem 0;
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.breadcrumb a:hover {
  color: var(--page-accent);
}

.breadcrumb__sep {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Hero de guía SEO
   -------------------------------------------------------------------------- */
.seo-hero {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3.5rem);
  background:
    radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--page-accent) 8%, transparent) 0%, transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(14, 47, 93, 0.06) 0%, transparent 50%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.seo-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: color-mix(in srgb, var(--page-accent) 12%, white);
  border: 1px solid color-mix(in srgb, var(--page-accent) 30%, transparent);
  color: color-mix(in srgb, var(--page-accent) 80%, var(--ink));
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.seo-hero__eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
}

.seo-hero__title {
  margin: 0 0 0.85rem;
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  max-width: 22ch;
}

.seo-hero__lead {
  margin: 0 0 1.5rem;
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.65;
}

.seo-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* --------------------------------------------------------------------------
   Secciones
   -------------------------------------------------------------------------- */
.section {
  padding: clamp(2rem, 4.5vw, 3.8rem) 0;
}

.section--alt {
  background: #f7f9fc;
}

.section--accent {
  background: color-mix(in srgb, var(--page-accent) 5%, white);
}

.section-title {
  margin: 0 0 0.5rem;
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  letter-spacing: -0.01em;
  position: relative;
  width: fit-content;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.22rem;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--page-accent), transparent);
  border-radius: 999px;
}

.section-sub {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Grid de métricas (KPIs)
   -------------------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.metric-card:hover {
  border-color: color-mix(in srgb, var(--page-accent) 40%, transparent);
  transform: translateY(-2px);
}

.metric-card__label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.metric-card__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--page-accent);
  line-height: 1.15;
}

.metric-card__note {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* --------------------------------------------------------------------------
   Callout / info box
   -------------------------------------------------------------------------- */
.callout {
  background: color-mix(in srgb, var(--page-accent) 7%, white);
  border-left: 4px solid var(--page-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.3rem;
  margin: 1.2rem 0;
}

.callout p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.65;
}

.callout strong {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Tarjeta de caso práctico
   -------------------------------------------------------------------------- */
.case-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 1.4rem;
}

.case-card__header {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #fff;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.case-card__header-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.case-card__header-note {
  font-size: 0.8rem;
  opacity: 0.8;
}

.case-table {
  width: 100%;
  border-collapse: collapse;
}

.case-table tr {
  border-bottom: 1px solid var(--line);
}

.case-table tr:last-child {
  border-bottom: none;
}

.case-table td {
  padding: 0.85rem 1.4rem;
  font-size: 0.96rem;
}

.case-table td:last-child {
  text-align: right;
  font-weight: 600;
}

.case-table__row--accent td {
  background: color-mix(in srgb, var(--page-accent) 8%, white);
  color: color-mix(in srgb, var(--page-accent) 80%, var(--ink));
  font-weight: 700;
}

.case-table__row--total td {
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}

.case-disclaimer {
  padding: 0.65rem 1.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Pasos de metodología (reutiliza estructura de index.css)
   -------------------------------------------------------------------------- */
.steps {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
  list-style: none;
  padding: 0;
}

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.step__num {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: var(--page-accent);
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.step h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   FAQ accordion (idéntico a index.css)
   -------------------------------------------------------------------------- */
.faq {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.25s var(--ease);
}

.faq details[open] {
  border-color: color-mix(in srgb, var(--page-accent) 45%, transparent);
}

.faq summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.97rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  user-select: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--page-accent);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq__answer {
  padding: 0 1.15rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Fuentes oficiales
   -------------------------------------------------------------------------- */
.source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
  margin-top: 1.2rem;
}

.source-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.source-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.94rem;
}

.source-list li::before {
  content: "↗";
  color: var(--page-accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.source-list a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: rgba(45, 79, 134, 0.35);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.source-list a:hover {
  color: var(--page-accent);
  text-decoration-color: var(--page-accent);
}

/* --------------------------------------------------------------------------
   CTA final
   -------------------------------------------------------------------------- */
.seo-cta {
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(120deg, var(--ink), var(--ink-soft));
  color: #fff;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.seo-cta__text h2 {
  margin: 0 0 0.4rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  line-height: 1.15;
  max-width: 22ch;
}

.seo-cta__text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.97rem;
}

.seo-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.seo-cta .btn--secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
}

.seo-cta .btn--secondary:hover {
  border-color: #fff;
  color: rgba(255, 255, 255, 0.9);
}

.seo-cta .btn--ghost {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
}

.seo-cta .btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: transparent;
}

/* --------------------------------------------------------------------------
   Guías relacionadas
   -------------------------------------------------------------------------- */
.related-guides {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.related-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.related-guide-link:hover {
  border-color: var(--page-accent);
  color: var(--page-accent);
  background: color-mix(in srgb, var(--page-accent) 5%, white);
}

.related-guide-link::before {
  content: "→";
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-footer__links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
}

.site-footer__links a {
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}

.site-footer__links a:hover {
  color: var(--page-accent);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .site-nav a:not(.btn) {
    display: none;
  }
}

@media (max-width: 760px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .seo-hero {
    padding-top: 2rem;
  }

  .seo-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header__inner {
    min-height: 60px;
  }
}

@media (max-width: 520px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Reducción de movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
