/* ============================================
   TRAMITES.CSS — Municipios.com.mx
   Sistema de artículos de trámites municipales
   ============================================ */

:root {
  --t-verde: #006847;
  --t-verde-claro: #e8f5e9;
  --t-rojo: #ce1126;
  --t-dorado: #d4a017;
  --t-gris-bg: #f8f9fa;
  --t-gris-texto: #5f6368;
  --t-gris-borde: #dadce0;
  --t-texto: #202124;
  --t-blanco: #ffffff;
  --t-sombra: 0 2px 8px rgba(0,0,0,.08);
  --t-radio: 8px;
  --t-font: 'Roboto', 'Segoe UI', Arial, sans-serif;
  --t-max-ancho: 820px;
}

/* ---- Reset parcial (sólo trámites) ---- */
.tramite-wrap { font-family: var(--t-font); color: var(--t-texto); line-height: 1.7; }
.tramite-wrap *, .tramite-wrap *::before, .tramite-wrap *::after { box-sizing: border-box; }

/* ---- Breadcrumbs ---- */
.t-breadcrumbs { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0 0 1.5rem; font-size: .88rem; color: var(--t-gris-texto); }
.t-breadcrumbs li::after { content: '›'; margin-left: .4rem; color: var(--t-gris-borde); }
.t-breadcrumbs li:last-child::after { content: ''; }
.t-breadcrumbs a { color: var(--t-verde); text-decoration: none; }
.t-breadcrumbs a:hover { text-decoration: underline; }

/* ---- Título principal ---- */
.t-titulo { font-size: 2rem; font-weight: 700; color: var(--t-verde); margin: 0 0 .5rem; line-height: 1.25; }
.t-subtitulo { font-size: 1rem; color: var(--t-gris-texto); margin: 0 0 1.5rem; }

/* ---- Actualización ---- */
.t-actualizacion { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--t-gris-texto); background: var(--t-gris-bg); padding: .3rem .7rem; border-radius: 4px; margin-bottom: 1.5rem; }
.t-actualizacion svg { width: 14px; height: 14px; fill: var(--t-gris-texto); }

/* ---- Respuesta rápida ---- */
.t-respuesta-rapida { background: linear-gradient(135deg, var(--t-verde-claro), #c8e6c9); border-left: 4px solid var(--t-verde); padding: 1.2rem 1.5rem; border-radius: var(--t-radio); margin-bottom: 2rem; font-size: 1.05rem; }
.t-respuesta-rapida p { margin: 0; }

/* ---- Tabla resumen ---- */
.t-tabla-info { width: 100%; border-collapse: collapse; margin-bottom: 2rem; font-size: .95rem; background: var(--t-blanco); box-shadow: var(--t-sombra); border-radius: var(--t-radio); overflow: hidden; }
.t-tabla-info caption { font-weight: 700; padding: .8rem 1rem; background: var(--t-verde); color: var(--t-blanco); text-align: left; font-size: 1rem; }
.t-tabla-info th, .t-tabla-info td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--t-gris-borde); }
.t-tabla-info th { background: var(--t-gris-bg); font-weight: 600; width: 35%; color: var(--t-texto); }
.t-tabla-info tr:last-child th, .t-tabla-info tr:last-child td { border-bottom: none; }
.t-tabla-info a { color: var(--t-verde); font-weight: 500; }

/* ---- Secciones ---- */
.t-seccion { margin-bottom: 2rem; }
.t-seccion h2 { font-size: 1.5rem; color: var(--t-verde); font-weight: 700; margin: 0 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--t-verde-claro); }
.t-seccion h3 { font-size: 1.15rem; color: var(--t-texto); font-weight: 600; margin: 1rem 0 .5rem; }
.t-seccion p { margin: 0 0 .8rem; }
.t-seccion ul, .t-seccion ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.t-seccion li { margin-bottom: .35rem; }

/* ---- Lista de requisitos / pasos ---- */
.t-lista-pasos { list-style: none; padding: 0; counter-reset: paso; }
.t-lista-pasos li { counter-increment: paso; padding: .9rem 1rem .9rem 3.5rem; position: relative; margin-bottom: .6rem; background: var(--t-gris-bg); border-radius: var(--t-radio); border: 1px solid var(--t-gris-borde); }
.t-lista-pasos li::before { content: counter(paso); position: absolute; left: 1rem; top: .85rem; width: 28px; height: 28px; border-radius: 50%; background: var(--t-verde); color: var(--t-blanco); font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; }

/* ---- Alertas / tips ---- */
.t-alerta { padding: 1rem 1.2rem; border-radius: var(--t-radio); margin-bottom: 1.5rem; display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; }
.t-alerta svg { flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; }
.t-alerta-info { background: #e3f2fd; border-left: 4px solid #1976d2; }
.t-alerta-info svg { fill: #1976d2; }
.t-alerta-aviso { background: #fff3e0; border-left: 4px solid #ef6c00; }
.t-alerta-aviso svg { fill: #ef6c00; }
.t-alerta-error { background: #fce4ec; border-left: 4px solid var(--t-rojo); }
.t-alerta-error svg { fill: var(--t-rojo); }
.t-alerta-exito { background: var(--t-verde-claro); border-left: 4px solid var(--t-verde); }
.t-alerta-exito svg { fill: var(--t-verde); }

/* ---- FAQ ---- */
.t-faq { margin-bottom: 2rem; }
.t-faq-item { border: 1px solid var(--t-gris-borde); border-radius: var(--t-radio); margin-bottom: .6rem; overflow: hidden; }
.t-faq-pregunta { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; background: var(--t-gris-bg); cursor: pointer; font-weight: 600; font-size: 1rem; border: none; width: 100%; text-align: left; color: var(--t-texto); transition: background .2s; }
.t-faq-pregunta:hover { background: #eee; }
.t-faq-pregunta::after { content: '+'; font-size: 1.4rem; color: var(--t-verde); font-weight: 700; transition: transform .25s; }
.t-faq-item.open .t-faq-pregunta::after { content: '−'; }
.t-faq-respuesta { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; padding: 0 1.2rem; }
.t-faq-item.open .t-faq-respuesta { max-height: 600px; padding: 1rem 1.2rem; }
.t-faq-respuesta p { margin: 0 0 .5rem; font-size: .95rem; }

/* ---- Fuentes oficiales ---- */
.t-fuentes { background: var(--t-gris-bg); border-radius: var(--t-radio); padding: 1.2rem 1.5rem; margin-bottom: 2rem; }
.t-fuentes h2 { font-size: 1.2rem; margin-bottom: .6rem; border-bottom: none; }
.t-fuentes ul { list-style: disc; padding-left: 1.2rem; margin: 0; }
.t-fuentes li { margin-bottom: .4rem; font-size: .92rem; }
.t-fuentes a { color: var(--t-verde); word-break: break-all; }

/* ---- Relacionados ---- */
.t-relacionados { background: linear-gradient(135deg, #f3e5f5, #e8eaf6); border-radius: var(--t-radio); padding: 1.5rem; margin-bottom: 2rem; }
.t-relacionados h2 { color: var(--t-verde); font-size: 1.2rem; margin: 0 0 .8rem; border-bottom: none; }
.t-relacionados-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.t-relacionados-card { background: var(--t-blanco); border-radius: var(--t-radio); padding: .9rem 1rem; box-shadow: var(--t-sombra); transition: transform .2s, box-shadow .2s; }
.t-relacionados-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.t-relacionados-card a { color: var(--t-verde); text-decoration: none; font-weight: 600; font-size: .95rem; }
.t-relacionados-card a:hover { text-decoration: underline; }
.t-relacionados-card .t-rel-desc { font-size: .82rem; color: var(--t-gris-texto); margin-top: .3rem; }

/* ---- Bloque AdSense (espaciadores) ---- */
.t-ad-slot { margin: 2rem 0; min-height: 90px; text-align: center; }

/* ---- Enlace municipio ---- */
.t-enlace-municipio { display: inline-flex; align-items: center; gap: .5rem; background: var(--t-verde); color: var(--t-blanco); padding: .7rem 1.2rem; border-radius: var(--t-radio); text-decoration: none; font-weight: 600; transition: background .2s; }
.t-enlace-municipio:hover { background: #004d33; color: var(--t-blanco); }
.t-enlace-municipio svg { width: 18px; height: 18px; fill: var(--t-blanco); }

/* ---- Index de trámites ---- */
.t-index-hero { text-align: center; padding: 3rem 1rem 2rem; background: linear-gradient(135deg, var(--t-verde), #004d33); color: var(--t-blanco); border-radius: var(--t-radio); margin-bottom: 2.5rem; }
.t-index-hero h1 { font-size: 2.2rem; margin: 0 0 .5rem; }
.t-index-hero p { font-size: 1.1rem; opacity: .9; max-width: 600px; margin: 0 auto; }

.t-categorias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.t-cat-card { background: var(--t-blanco); border-radius: var(--t-radio); box-shadow: var(--t-sombra); padding: 1.5rem; border-top: 4px solid var(--t-verde); transition: transform .2s, box-shadow .2s; }
.t-cat-card:hover { transform: translateY(-4px); box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.t-cat-card h2 { font-size: 1.3rem; color: var(--t-verde); margin: 0 0 .5rem; }
.t-cat-card h2 a { color: var(--t-verde); text-decoration: none; }
.t-cat-card h2 a:hover { text-decoration: underline; }
.t-cat-card p { font-size: .92rem; color: var(--t-gris-texto); margin: 0 0 .8rem; }
.t-cat-card ul { list-style: none; padding: 0; margin: 0; }
.t-cat-card li { padding: .35rem 0; border-bottom: 1px solid var(--t-gris-borde); }
.t-cat-card li:last-child { border-bottom: none; }
.t-cat-card li a { color: var(--t-texto); text-decoration: none; font-size: .9rem; }
.t-cat-card li a:hover { color: var(--t-verde); text-decoration: underline; }

.t-cat-icon { font-size: 2rem; margin-bottom: .5rem; display: block; }

/* ---- ToC (tabla de contenidos) ---- */
.t-toc { background: var(--t-gris-bg); border: 1px solid var(--t-gris-borde); border-radius: var(--t-radio); padding: 1.2rem 1.5rem; margin-bottom: 2rem; }
.t-toc h2 { font-size: 1.05rem; margin: 0 0 .6rem; padding: 0; border: none; }
.t-toc ol { padding-left: 1.4rem; margin: 0; }
.t-toc li { margin-bottom: .3rem; font-size: .92rem; }
.t-toc a { color: var(--t-verde); text-decoration: none; }
.t-toc a:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .t-titulo { font-size: 1.5rem; }
  .t-tabla-info th { width: 40%; }
  .t-categorias-grid { grid-template-columns: 1fr; }
  .t-relacionados-grid { grid-template-columns: 1fr; }
  .t-index-hero h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .t-titulo { font-size: 1.3rem; }
  .t-lista-pasos li { padding-left: 3rem; }
  .t-faq-pregunta { font-size: .92rem; padding: .8rem 1rem; }
}

/* ---- Print ---- */
@media print {
  .t-ad-slot, .t-faq-pregunta::after { display: none; }
  .t-faq-respuesta { max-height: none !important; padding: .5rem 0 !important; }
  .t-respuesta-rapida { border-left-color: #333; }
}
