/* =====================================================================
   AmiGas LP · Páginas legales
   Complemento del framework GOB.mx (https://framework-gb.cdn.gob.mx/)
   El framework aporta encabezado, pie, tipografía y Bootstrap 3.
   Aquí solo se estiliza el contenido propio de los documentos, con la
   paleta de la Guía de Identidad 2024‑2030.
   ===================================================================== */
:root {
  --guinda-oscuro: #611232;
  --guinda: #9b2247;
  --dorado: #a57f2c;
  --dorado-claro: #e6d194;
  --verde: #1e5b4f;
  --negro-neutro: #161a1d;
  --gris-70: #4d4d4d;
  --gris-20: #cccccc;
  --gris-fondo: #f5f5f5;
  --guinda-suave: #f7ecef;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; } /* Bootstrap ya lo aplica; se repite por si el CDN tarda */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

/* Barra de progreso de lectura (no usar .progress: es clase de Bootstrap) */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--dorado); z-index: 2000; transition: width .1s linear; }

/* Franja provisional mientras gobmx.js inserta el encabezado oficial */
.gmx-placeholder { position: fixed; top: 0; left: 0; right: 0; height: 80px; background: var(--guinda-oscuro); z-index: 1000; transition: opacity .3s; }
.gmx-placeholder--hide { opacity: 0; pointer-events: none; }

/* Navegación entre documentos (nav-tabs del framework).
   El framework pinta la pestaña activa en guinda: el texto debe ir en blanco. */
.doc-nav { margin: 4px 0 0; }
.doc-nav > li > a { color: var(--gris-70); font-weight: 600; }
.doc-nav > li > a:hover,
.doc-nav > li > a:focus { color: var(--guinda-oscuro); }
.nav-tabs.doc-nav > li.active > a,
.nav-tabs.doc-nav > li.active > a:hover,
.nav-tabs.doc-nav > li.active > a:focus {
  color: #fff !important;
  background-color: var(--guinda-oscuro) !important;
  border-color: var(--guinda-oscuro);
  cursor: default;
}

/* Título del documento */
.doc-hero { padding: 28px 0 8px; }
.doc-hero .org { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--guinda); }
.doc-hero h1 { margin: 0; font-size: 36px; line-height: 1.2; color: var(--negro-neutro); }
.pleca { display: block; width: 48px; height: 5px; background: var(--dorado); margin: 14px 0 10px; }
.doc-hero .meta { margin: 0; color: var(--gris-70); font-size: 14px; }

/* Distribución */
.layout { display: flex; gap: 30px; align-items: flex-start; padding: 20px 0 48px; }
.toc { flex: 0 0 270px; }
.doc-content { flex: 1 1 auto; min-width: 0; font-size: 16px; line-height: 1.7; color: var(--negro-neutro); }

/* Índice */
.toc { position: sticky; top: 80px; background: #fff; border: 1px solid var(--gris-20); border-top: 4px solid var(--guinda-oscuro); border-radius: var(--radius); padding: 16px; max-height: calc(100vh - 100px); overflow: auto; }
.toc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--guinda); margin: 0 0 10px; font-weight: 700; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 8px; padding: 7px 8px; color: var(--negro-neutro); text-decoration: none; font-size: 14px; line-height: 1.4; border-left: 3px solid transparent; }
.toc a::before { content: counter(toc) "."; color: var(--dorado); font-weight: 700; min-width: 20px; }
.toc a:hover, .toc a:focus { background: var(--guinda-suave); text-decoration: none; color: var(--guinda-oscuro); }
.toc a.active { border-left-color: var(--dorado); background: var(--guinda-suave); font-weight: 600; color: var(--guinda-oscuro); }

@media (max-width: 991px) {
  .layout { flex-direction: column; gap: 18px; }
  .toc { position: static; flex-basis: auto; width: 100%; max-height: none; }
  .toc[data-collapsed="true"] ol { display: none; }
  .toc h2 { cursor: pointer; display: flex; justify-content: space-between; margin: 0; }
  .toc h2::after { content: "▾"; }
  .toc[data-collapsed="false"] h2 { margin-bottom: 10px; }
}

/* Herramientas */
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.search { flex: 1 1 260px; position: relative; margin: 0; font-weight: 400; }
.search input { width: 100%; height: 42px; padding: 8px 12px 8px 38px; border: 1px solid var(--gris-20); border-radius: var(--radius); background: #fff; color: var(--negro-neutro); font-size: 15px; }
.search input:focus { outline: 2px solid var(--guinda); outline-offset: 1px; border-color: var(--guinda); }
.search::before { content: ""; position: absolute; left: 13px; top: 50%; width: 12px; height: 12px; border: 2px solid var(--gris-70); border-radius: 50%; transform: translateY(-60%); }
.search::after { content: ""; position: absolute; left: 24px; top: 58%; width: 2px; height: 7px; background: var(--gris-70); transform: rotate(-45deg); }
.search-count { font-size: 13px; color: var(--gris-70); align-self: center; min-width: 110px; }
.doc-btn { font-size: 14px; font-weight: 600; border: 1px solid var(--guinda); background: #fff; color: var(--guinda); padding: 9px 16px; border-radius: var(--radius); cursor: pointer; }
.doc-btn:hover { background: var(--guinda); color: #fff; }
.doc-btn:focus-visible { outline: 2px solid var(--dorado); outline-offset: 2px; }

/* Secciones */
.intro { margin: 0 0 20px; color: var(--gris-70); }
.section { background: #fff; border: 1px solid var(--gris-20); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.section > h2 { margin: 0; background: var(--gris-fondo); font-size: 18px; font-weight: 700; color: var(--guinda-oscuro); padding: 13px 18px; border-left: 5px solid var(--guinda); border-bottom: 1px solid var(--gris-20); display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; user-select: none; line-height: 1.35; }
.section > h2::after { content: "−"; font-size: 22px; color: var(--dorado); flex-shrink: 0; }
.section.collapsed > h2::after { content: "+"; }
.section.collapsed > h2 { border-bottom-color: transparent; }
.section.collapsed > .section__body { display: none; }
.section > h2:focus-visible { outline: 2px solid var(--dorado); outline-offset: -2px; }
.section__body { padding: 18px 22px; }
.section__body p { margin: 0 0 12px; }
.section__body p:last-child { margin-bottom: 0; }
.section__body ul { margin: 0 0 12px; padding-left: 22px; }
.section__body li { margin-bottom: 6px; }
.section__body li::marker { color: var(--guinda); }
.section__body ul ul { margin-top: 6px; list-style: circle; }
.section__body strong { color: var(--guinda-oscuro); }
.section__body a, a.link { color: var(--guinda); font-weight: 600; }
.callout { border-left: 4px solid var(--dorado); background: var(--guinda-suave); padding: 12px 16px; }
mark { background: var(--dorado-claro); color: inherit; padding: 0 2px; border-radius: 2px; }
mark.current { outline: 2px solid var(--guinda); }
.hidden-by-search { display: none; }
.no-results { display: none; text-align: center; color: var(--gris-70); padding: 30px; }
.updated { text-align: right; color: var(--gris-70); font-size: 14px; margin-top: 12px; }

/* Datos de contacto de la dependencia (el pie oficial lo pone gobmx.js) */
.doc-contact { margin-top: 28px; padding: 18px 22px; border-top: 4px solid var(--dorado); background: var(--gris-fondo); border-radius: var(--radius); font-size: 14.5px; }
.doc-contact h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--guinda-oscuro); }
.doc-contact p { margin: 0 0 6px; }
.doc-contact a { color: var(--guinda); font-weight: 600; }

/* Volver arriba */
.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--dorado); background: var(--guinda-oscuro); color: #fff; font-size: 20px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1500; }
.to-top.visible { opacity: 1; pointer-events: auto; }

@media (max-width: 600px) {
  .doc-hero h1 { font-size: 28px; }
  .doc-nav > li > a { padding: 8px 10px; font-size: 13px; }
  .section__body { padding: 14px 16px; }
}

/* Impresión */
@media print {
  .toc, .tools, .to-top, .read-progress, .doc-nav, .breadcrumb { display: none !important; }
  .layout { display: block; padding: 0; }
  .section { break-inside: avoid; }
  .section.collapsed > .section__body { display: block; }
  .section > h2::after { content: none; }
}
