/* =========================
   Paleta institucional (TU paleta)
   ========================= */
:root{
  --c-primary: #282878;        /* 2747 CP */
  --c-primary-dark: #1e1248;   /* 275 CP */
  --c-ink: #121227;            /* 532 CP */
  --c-wine: #6F1132;           /* 209 CP */
  --c-accent: #E62645;         /* 192 CP */
  --c-sand: #C09B57;           /* 465 CP */
  --c-white: #FFFFFF;

  --c-border: #e5e7eb;
  --c-muted: #6b7280;
  --shadow: 0 6px 24px rgba(0,0,0,.06);
}

/* =========================
   Portada (mosaico de fracciones)
   ========================= */
.ct-mosaic-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:12px}
.ct-searchbar{display:flex;gap:8px}
.ct-searchbar input{padding:10px;border:1px solid var(--c-border);border-radius:10px}
.ct-searchbar button{padding:10px 16px;border:none;border-radius:10px;background:var(--c-primary);color:var(--c-white);cursor:pointer;font-weight:600}
.ct-searchbar button:focus,.ct-searchbar button:hover{filter:brightness(.95)}

.ct-frac-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}
.ct-frac-card{position:relative;border-radius:16px;overflow:hidden;min-height:140px;display:block;text-decoration:none;outline:none;transition:transform .15s ease, box-shadow .15s ease}
.ct-frac-card:hover,.ct-frac-card:focus{transform:translateY(-2px);box-shadow:0 10px 24px rgba(0,0,0,.15)}
.ct-frac-bg{position:absolute;inset:0;background-size:cover;background-position:center;filter:brightness(.55)}
.ct-frac-overlay{position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.25),rgba(0,0,0,.55))}
.ct-frac-content{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-end;padding:14px;color:var(--c-white)}
.ct-frac-roman{position:absolute;top:10px;right:12px;background:rgba(18,18,39,.55);backdrop-filter:blur(2px);padding:4px 8px;border-radius:999px;font-weight:700}
.ct-frac-title{font-weight:800;letter-spacing:.3px}
.ct-frac-count{opacity:.9;font-size:12px;margin-top:2px}

@media (max-width:1200px){ .ct-frac-grid{grid-template-columns:repeat(3,1fr)} }
@media (max-width:820px){  .ct-frac-grid{grid-template-columns:repeat(2,1fr)} }

/* =========================
   Detalle de fracci贸n (tarjeta blanca, estilo limpio)
   ========================= */
body{ background: #fafafa; }
.ct-detail{background:var(--c-white);border-radius:18px;padding:28px;box-shadow:var(--shadow)}
.ct-detail>h2{margin:6px 0 18px;color:var(--c-primary);letter-spacing:.4px;text-transform:uppercase;font-weight:800;font-size:28px}

.ct-detail-grid{display:grid;grid-template-columns:2fr 1fr;gap:36px}
.ct-breadcrumb{color:var(--c-muted);font-size:14px;margin-bottom:6px}
.ct-breadcrumb a{color:var(--c-accent);text-decoration:none;font-weight:600}
.ct-breadcrumb a:hover,.ct-breadcrumb a:focus{text-decoration:underline}

.ct-section{margin:20px 0 8px 0;color:var(--c-ink);font-weight:800}
.ct-year-list{list-style:none;padding:0;margin:0}
.ct-year-list li{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--c-border)}
.ct-year{min-width:64px;font-weight:700;color:var(--c-ink)}
.ct-dots{flex:1;border-bottom:1px dotted #cbd5e1;margin:0 6px}

.ct-download{display:inline-flex;align-items:center;gap:8px;text-decoration:none;color:var(--c-primary);font-weight:700}
.ct-download:hover,.ct-download:focus{color:var(--c-accent);text-decoration:none}
.ct-ico{width:18px;height:18px;display:inline-block;background:currentColor;mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M12 3a1 1 0 011 1v8.586l2.293-2.293a1 1 0 111.414 1.414l-4.005 4.005a1 1 0 01-1.414 0L7.283 11.707a1 1 0 111.414-1.414L11 12.586V4a1 1 0 011-1zm-7 14a1 1 0 011-1h12a1 1 0 110 2H6a1 1 0 01-1-1z"/></svg>') center/contain no-repeat;-webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M12 3a1 1 0 011 1v8.586l2.293-2.293a1 1 0 111.414 1.414l-4.005 4.005a1 1 0 01-1.414 0L7.283 11.707a1 1 0 111.414-1.414L11 12.586V4a1 1 0 011-1zm-7 14a1 1 0 011-1h12a1 1 0 110 2H6a1 1 0 01-1-1z"/></svg>') center/contain no-repeat}

.ct-line{border:none;border-top:1px solid var(--c-border);margin:12px 0}

.ct-detail-side .ct-side-box{border:1px solid var(--c-border);border-radius:14px;padding:16px 18px;background:var(--c-white);box-shadow:var(--shadow)}
.ct-detail-side h4{margin:0 0 8px;font-size:18px;color:var(--c-ink);font-weight:800}
.ct-detail-side p{color:var(--c-muted)}

.ct-side-btn{display:block;width:100%;margin-top:12px;padding:12px 14px;border-radius:10px;text-align:center;text-decoration:none;background:#f8fafc;border:1px solid var(--c-border);color:var(--c-ink);font-weight:700;transition:all .2s ease}
.ct-side-btn:hover{background:#f1f5f9}

@media (max-width:1000px){ .ct-detail-grid{grid-template-columns:1fr} }

/* =========================
   Tabs por Trimestre (si los usas)
   ========================= */
.ct-tabs{display:flex;gap:8px;margin:8px 0 14px;flex-wrap:wrap}
.ct-tab{padding:8px 12px;border:1px solid var(--c-border);border-radius:10px;cursor:pointer;text-decoration:none;color:var(--c-ink);user-select:none;background:var(--c-white);font-weight:600;transition:all .2s ease}
.ct-tab:hover,.ct-tab:focus{border-color:var(--c-primary);color:var(--c-primary)}
.ct-tab.active{background:var(--c-primary);color:var(--c-white);border-color:var(--c-primary)}
.ct-tabpanes>.ct-pane{display:none}
.ct-tabpanes>.ct-pane.active{display:block}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .ct-frac-card{transition:none}
}

/* ========= RESPONSIVE – Transparencia ========= */

/* Ajustes generales de tipografía/espaciado en viewports chicos */
@media (max-width: 1024px){
  .ct-mosaic-header h3 { font-size: 1.4rem; }
  .ct-detail { padding: 16px; }
}

/* Grilla de fracciones: 3 → 2 → 1 columnas */
@media (max-width: 1200px){
  .ct-frac-grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width: 820px){
  .ct-frac-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 640px){
  .ct-frac-grid{grid-template-columns:1fr}
  .ct-frac-card{min-height:120px}
  .ct-frac-title{font-size:1rem}
  .ct-frac-roman{top:8px;right:10px;font-size:.85rem}
}

/* Buscador en portada: apilar en móviles */
@media (max-width: 640px){
  .ct-mosaic-header{flex-direction:column; align-items:stretch; gap:10px}
  .ct-searchbar{width:100%}
  .ct-searchbar input{flex:1; width:100%}
  .ct-searchbar button{width:100%}
}

/* Detalle: grilla 2→1 columnas */
@media (max-width: 1000px){
  .ct-detail-grid{grid-template-columns:1fr}
  .ct-detail-side{order:2}
  .ct-detail-main{order:1}
}

/* Tabs de Trimestres: scroll horizontal táctil */
.ct-tabs{display:flex; gap:10px; margin:10px 0 14px; overflow:auto; -webkit-overflow-scrolling:touch}
.ct-tab{white-space:nowrap; padding:10px 14px; border-radius:12px; text-decoration:none;}

/* Listado por año: mejor toque en móviles */
@media (max-width: 640px){
  .ct-year-list li{gap:6px}
  .ct-year{min-width:52px}
  .ct-download{font-size:.95rem}
}

/* Tarjeta blanca del detalle separada del fondo */
@media (max-width: 640px){
  .ct-detail{margin:8px; border-radius:12px}
}

/* Botón lateral */
@media (max-width: 640px){
  .ct-side-box{padding:14px}
  .ct-side-btn{width:100%}
}

/* Accesibilidad de links/botones en táctil */
.ct-download, .ct-side-btn, .ct-tab { touch-action: manipulation; }

/* ===== Portada: buscador móvil mejorado ===== */
.ct-searchbar{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:12px;
}

/* Input más grande por defecto */
.ct-searchbar input{
  padding:12px 14px;
  border:1px solid var(--c-border);
  border-radius:12px;
  font-size:16px; /* evita zoom en iOS */
}

/* Botón normal en desktop */
.ct-searchbar button{
  padding:12px 18px;
  border:none;
  border-radius:12px;
  background:var(--c-primary);
  color:#fff;
  cursor:pointer;
}

/* — Móvil — */
@media (max-width: 768px){
  .ct-searchbar{
    grid-template-columns: 1fr;   /* apila input y botón */
  }
  .ct-searchbar input{
    height:52px;                   /* barra más alta */
  }
  .ct-searchbar button{
    width:56%;                     /* más pequeño */
    justify-self:center;           /* centrado */
    padding:10px 16px;
    font-size:15px;
    border-radius:14px;
  }
}