/* ============================================================
   Recambiofácil — Glosario de término
   Scope: .glossary-term (applied to <main>)
   Convention: all selectors hang off .glossary-term
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap');

/* ── Reset & tokens ─────────────────────────────────────────── */

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

:root {
  --rf-orange:  #E85D04;
  --rf-dark:    #111111;
  --rf-gray-bg: #F4F3F0;
  --rf-border:  #E2E0DC;
  --rf-text:    #111111;
  --rf-text2:   #555555;
  --rf-text3:   #888888;
  --rf-white:   #ffffff;
  --rf-font:    'Open Sans', system-ui, sans-serif;
}

body {
  font-family: var(--rf-font);
  color: var(--rf-text);
  background: var(--rf-white);
  line-height: 1.6;
  font-size: 16px;
}





/* ── Breadcrumb ─────────────────────────────────────────────── */

.bc {
  background: var(--rf-white);
  border-bottom: 1px solid var(--rf-border);
  padding: 9px 0;
}

.bc-w {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--rf-text3);
}

.bc-w a {
  color: var(--rf-text3);
}

.bc-w a:hover {
  color: var(--rf-orange);
}

.bc-sep {
  color: var(--rf-border);
}

.bc-cur {
  color: var(--rf-text);
  font-weight: 600;
}


/* ── Page layout ────────────────────────────────────────────── */

.term-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 64px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}


/* ── Main content area ──────────────────────────────────────── */

/* h1 — term title */
.glossary-term h1 {
  font-size: 40px;
  font-weight: 800;
  color: var(--rf-text);
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rf-border);
}

.glossary-term h1 em {
  color: var(--rf-orange);
  font-style: normal;
}

/* Hero image */
.glossary-term > img,
.glossary-term img:first-of-type {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  margin-bottom: 32px;
  border: 1px solid var(--rf-border);
}

/* h2 — section headings */
.glossary-term h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--rf-text);
  line-height: 1.2;
  letter-spacing: -0.2px;
  margin-top: 36px;
  margin-bottom: 14px;
}

.glossary-term h2:first-of-type {
  margin-top: 0;
}

/* h3 */
.glossary-term h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--rf-text);
  margin-bottom: 10px;
}

/* Paragraphs */
.glossary-term p {
  font-size: 15px;
  color: var(--rf-text2);
  line-height: 1.75;
  margin-bottom: 12px;
}

.glossary-term p:last-child {
  margin-bottom: 0;
}

/* Lists */
.glossary-term ul,
.glossary-term ol {
  font-size: 15px;
  color: var(--rf-text2);
  line-height: 1.75;
  padding-left: 1.25rem;
  margin-bottom: 12px;
}

.glossary-term li {
  margin-bottom: 6px;
}

/* Strong / em inside content */
.glossary-term strong {
  color: var(--rf-text);
  font-weight: 700;
}

.glossary-term em {
  color: var(--rf-orange);
  font-style: normal;
}

/* Inline code */
.glossary-term code {
  font-size: 13px;
  background: var(--rf-gray-bg);
  border: 1px solid var(--rf-border);
  padding: 1px 5px;
  border-radius: 2px;
  font-family: 'Courier New', monospace;
  color: var(--rf-text);
}


/* ── Table ──────────────────────────────────────────────────── */

.glossary-term table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
  overflow-x: auto;
  display: block; /* allows horizontal scroll on narrow viewports */
}

.glossary-term thead {
  background: var(--rf-dark);
  color: var(--rf-white);
}

.glossary-term th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.glossary-term td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rf-border);
  color: var(--rf-text2);
  vertical-align: top;
}

.glossary-term tbody tr:last-child td {
  border-bottom: none;
}

.glossary-term tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.glossary-term tbody td:first-child {
  font-weight: 700;
  color: var(--rf-text);
}


/* ── FAQ — <details> / <summary> ───────────────────────────── */

.glossary-term details {
  border-bottom: 1px solid var(--rf-border);
}

.glossary-term details:first-of-type {
  border-top: 1px solid var(--rf-border);
}

.glossary-term details summary {
  padding: 14px 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--rf-text);
  user-select: none;
  transition: color 0.15s;
}

.glossary-term details summary:hover {
  color: var(--rf-orange);
}

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

.glossary-term details summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 300;
  color: var(--rf-orange);
  flex-shrink: 0;
  transition: transform 0.2s;
}

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

/* Content inside open <details> */
.glossary-term details .faq-content,
.glossary-term details p {
  font-size: 13px;
  color: var(--rf-text2);
  padding: 2px 4px 14px;
  margin: 0;
  line-height: 1.7;
}

/* FAQ section heading spacing */
.glossary-term h2 + details {
  margin-top: 4px;
}


/* ── Tip / callout block (optional, .tip class) ─────────────── */

.glossary-term .tip {
  background: var(--rf-gray-bg);
  border-left: 3px solid var(--rf-orange);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.glossary-term .tip p {
  font-size: 14px;
  color: var(--rf-text2);
  margin: 0;
  line-height: 1.65;
}


/* ── Sidebar ────────────────────────────────────────────────── */

.term-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Light card */
.sidebar-card {
  background: var(--rf-gray-bg);
  border: 1px solid var(--rf-border);
  padding: 20px;
}

/* Dark CTA card */
.sidebar-card-dark {
  background: var(--rf-dark);
  border: 1px solid var(--rf-border);
  padding: 20px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--rf-text3);
  margin-bottom: 14px;
}

/* CTA card text */
.sidebar-cta-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--rf-white);
  margin-bottom: 8px;
  line-height: 1.3;
}

.sidebar-cta-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.55;
  margin-bottom: 16px;
}

.sidebar-cta-btn {
  display: inline-block;
  background: var(--rf-orange);
  color: var(--rf-white);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 16px;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: opacity 0.15s;
}

.sidebar-cta-btn:hover {
  opacity: 0.9;
  text-decoration: none;
  color: var(--rf-white);
}

/* A–Z navigator */
.sidebar-az {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sidebar-az a {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--rf-text2);
  background: var(--rf-white);
  border: 1px solid var(--rf-border);
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.15s;
}

.sidebar-az a:hover {
  background: var(--rf-orange);
  color: var(--rf-white);
  border-color: var(--rf-orange);
  text-decoration: none;
}


/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 860px) {
  .term-layout {
    grid-template-columns: 1fr;
    padding: 24px 20px 48px;
  }

  .term-sidebar {
    position: static;
  }

  .glossary-term h1 {
    font-size: 30px;
  }

  .glossary-term h2 {
    font-size: 19px;
  }

  .bc-w {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .term-layout {
    padding: 16px 16px 40px;
  }

  .glossary-term h1 {
    font-size: 26px;
  }
}
