/* =========================================================================
   SISTEMA NACIONAL DE REINCORPORACIÓN — MICROSITIO (CORREGIDO CONTRASTE)
   ========================================================================= */

/* ---------- 1. TOKENS Y AJUSTES WCAG ---------- */
:root{
  --navy-950:#071527;
  --navy-900:#0c2745;
  --navy-800:#123761;
  --navy-700:#1c4a7d;
  
  /* Ajuste de variables para cumplir WCAG AA (Mínimo ratio 4.5:1) */
  --ink:#0f172a;           /* Texto principal ultra oscuro */
  --slate:#334155;         /* Reemplazado #5b6b7c por #334155 (Contraste 9.5:1 sobre blanco) */
  --slate-soft:#475569;    /* Para notas secundarias con legibilidad real */
  
  --paper:#ffffff; 
  --paper-2:#ffffff;
  --white:#ffffff;

  --yellow:#ffc72c;
  --yellow-deep:#b38000;   /* Oscurecido para lecturas o fondos claros */
  --flag-blue:#0033a0;
  --flag-red:#ce1126;

  --line:rgba(8,24,43,.18);
  --line-strong:rgba(8,24,43,.35);
  --shadow-sm:0 2px 10px rgba(8,24,43,.06);
  --shadow-md:0 12px 30px rgba(8,24,43,.10);
  --shadow-lg:0 24px 60px rgba(8,24,43,.16);

  --font-display:'Montserrat',sans-serif;
  --font-body:'Work Sans',sans-serif;

  --radius-sm:10px;
  --radius-md:16px;
  --radius-lg:24px;

  --container:1180px;
  --dur:.5s;
  --ease:cubic-bezier(.22,.9,.28,1);
}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important;}
}

/* ---------- 2. RESET Y REGLAS DE ANULACIÓN DE SHAREPOINT ---------- */
*,*::before,*::after{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:var(--font-body);
  font-size: 16px;
  color:var(--ink) !important;
  background:var(--paper);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{max-width:100%; display:block;}
a{color:inherit; text-decoration:none;}
ul{list-style:none;}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}

/* Aislar tipografías de SharePoint */
h1, h2, h3, h4, h5, h6 {
  font-family:var(--font-display) !important; 
  line-height:1.2; 
  letter-spacing:-.01em;
}

.container{width:100%; max-width:var(--container); margin-inline:auto; padding-inline:24px;}
:focus-visible{outline:3px solid var(--flag-blue); outline-offset:3px; border-radius:4px;}

/* ---------- 3. UTILIDADES TIPOGRÁFICAS ---------- */
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--font-display); font-weight:700; font-size:.75rem;
  letter-spacing:.14em; text-transform:uppercase; color:var(--flag-blue) !important;
}
.eyebrow::before{content:''; width:8px; height:8px; border-radius:50%; background:var(--yellow); box-shadow:0 0 0 4px rgba(255,199,44,.25);}
.eyebrow.on-dark{color:var(--yellow) !important;}

.section-head{max-width:760px; margin-bottom:44px;}
.section-head h2{font-size:clamp(1.7rem,3vw,2.5rem); font-weight:800; margin-top:10px; color:var(--navy-950) !important;}
.section-head p{font-size:1.05rem; color:var(--slate) !important; margin-top:14px; max-width:64ch;}
.section-head.center{margin-inline:auto; text-align:center;}

.section{padding:96px 0;}
.section.alt{background:var(--paper-2);}
.section.dark{background:linear-gradient(180deg,var(--navy-950),var(--navy-900)); color:var(--white) !important;}
.section.dark .section-head h2{color:#ffffff !important;}
.section.dark .section-head p{color:rgba(255,255,255,.9) !important;}

/* ---------- 4. BOTONES ---------- */
.btn{
  display:inline-flex; align-items:center; gap:10px;
  font-family:var(--font-display); font-weight:700; font-size:.86rem;
  padding:14px 26px; border-radius:100px; white-space:nowrap;
  transition:transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.btn i{font-size:.85em;}
.btn-primary{background:var(--yellow); color:var(--navy-950) !important; box-shadow:var(--shadow-sm);}
.btn-primary:hover{background:#e8a800; transform:translateY(-3px); box-shadow:var(--shadow-md);}
.btn-outline{background:transparent; color:var(--white) !important; border:1.5px solid rgba(255,255,255,.6);}
.btn-outline:hover{background:rgba(255,255,255,.1); border-color:#fff; transform:translateY(-3px);}
.btn-ghost{background:var(--white); color:var(--navy-950) !important; border:2px solid var(--navy-700);}
.btn-ghost:hover{border-color:var(--flag-blue); color:var(--flag-blue) !important; transform:translateY(-3px); box-shadow:var(--shadow-sm);}
.btn-sm{padding:10px 18px; font-size:.78rem;}
.btn[disabled],.btn.is-soon{opacity:.6; pointer-events:none;}

/* ---------- 5. HERO ---------- */
.hero{
  position:relative; overflow:hidden; color:#fff !important;
  background:radial-gradient(1100px 600px at 82% -10%, rgba(255,199,44,.16), transparent 60%),
             linear-gradient(160deg,var(--navy-950) 10%, var(--navy-900) 55%, var(--navy-800) 100%);
  padding:168px 0 110px;
}
.hero-net{position:absolute; inset:0; z-index:0; opacity:.5; pointer-events:none;}
.hero-inner{position:relative; z-index:2; display:grid; grid-template-columns:1.15fr .85fr; gap:40px; align-items:center;}
.hero-copy .eyebrow{margin-bottom:18px;}
.hero h1{font-size:clamp(2.4rem,4.6vw,3.9rem); font-weight:800; max-width:16ch; color:#ffffff !important;}
.hero-lead{margin-top:22px; font-size:1.12rem; color:rgba(255,255,255,.92) !important; max-width:56ch;}
.hero-actions{display:flex; flex-wrap:wrap; gap:16px; margin-top:34px;}

.hero-badge-card{
  position:relative; justify-self:end; width:100%; max-width:360px;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25);
  border-radius:var(--radius-lg); padding:30px; backdrop-filter:blur(6px);
}
.hero-badge-card h3{font-size:1rem; font-weight:700; color:var(--yellow) !important; margin-bottom:6px;}
.hero-badge-card p{font-size:.85rem; color:rgba(255,255,255,.9) !important;}
.hero-badge-ring{
  width:64px; height:64px; border-radius:50%; margin-bottom:18px;
  background:conic-gradient(var(--yellow),var(--flag-blue),var(--flag-red),var(--yellow));
  display:flex; align-items:center; justify-content:center;
}
.hero-badge-ring i{width:52px; height:52px; border-radius:50%; background:var(--navy-950); display:flex; align-items:center; justify-content:center; color:var(--yellow) !important; font-size:1.3rem;}

.stat-row{position:relative; z-index:2; margin-top:64px; display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:rgba(255,255,255,.2); border-radius:var(--radius-md); overflow:hidden;}
.stat-item{background:rgba(255,255,255,.06); padding:22px 20px; text-align:left;}
.stat-item strong{display:block; font-family:var(--font-display); font-size:1.7rem; font-weight:800; color:var(--yellow) !important;}
.stat-item span{display:block; font-size:.78rem; color:rgba(255,255,255,.88) !important; margin-top:4px;}

@media (max-width:960px){
  .hero-inner{grid-template-columns:1fr;}
  .hero-badge-card{justify-self:start; max-width:420px;}
  .stat-row{grid-template-columns:repeat(2,1fr);}
}

/* ---------- 6. SCROLL REVEAL ---------- */
.reveal{opacity:0; transform:translateY(26px); transition:opacity .7s var(--ease), transform .7s var(--ease);}
.reveal.in{opacity:1; transform:translateY(0);}
.reveal-scale{opacity:0; transform:scale(.92); transition:opacity .6s var(--ease), transform .6s var(--ease);}
.reveal-scale.in{opacity:1; transform:scale(1);}

/* ---------- 7. QUÉ ES / DEFINICIÓN ---------- */
.definition{display:grid; grid-template-columns:1.1fr .9fr; gap:56px; align-items:start;}
.definition-lead{font-size:1.18rem; color:var(--navy-950) !important; font-weight:600; margin-bottom:18px;}
.definition p{color:var(--slate) !important; margin-bottom:16px;}
.norm-card{
  margin-top:26px; background:var(--white); border:1px solid var(--line-strong); border-left:5px solid var(--yellow);
  border-radius:var(--radius-md); padding:26px 28px; box-shadow:var(--shadow-sm);
}
.norm-card h4{font-size:.95rem; color:var(--navy-950) !important; margin-bottom:8px;}
.norm-card p{font-size:.92rem; color:var(--slate) !important; margin-bottom:16px;}

.media-stack{display:flex; flex-direction:column; gap:18px;}
.video-card{
  position:relative; border-radius:var(--radius-lg); overflow:hidden; background:var(--navy-950);
  aspect-ratio:16/10; display:flex; align-items:center; justify-content:center; color:#fff !important;
  box-shadow:var(--shadow-md);
}
.video-card figcaption{position:absolute; left:18px; bottom:16px; z-index:2; font-size:.82rem; color:#ffffff !important; font-family:var(--font-display); font-weight:600;}

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

/* ---------- 8. OBJETIVOS ---------- */
.grid-objetivos{display:grid; grid-template-columns:repeat(3,1fr); gap:22px;}
.obj-card{
  background:var(--white); border:1px solid var(--line-strong); border-radius:var(--radius-md);
  padding:28px 26px; transition:transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.obj-card:hover{transform:translateY(-8px); box-shadow:var(--shadow-md); border-color:var(--navy-700);}
.obj-icon{
  width:48px; height:48px; border-radius:12px; background:#f1f5f9; color:var(--flag-blue) !important;
  display:flex; align-items:center; justify-content:center; font-size:1.15rem; margin-bottom:18px;
  transition:background-color .4s var(--ease), color .4s var(--ease), transform .4s var(--ease);
}
.obj-card:hover .obj-icon{background:var(--navy-950); color:var(--yellow) !important; transform:rotate(-6deg) scale(1.06);}
.obj-card h3{font-size:1.02rem; font-weight:700; color:var(--navy-950) !important; margin-bottom:10px;}
.obj-card p{font-size:.88rem; color:var(--slate) !important;}

@media (max-width:960px){ .grid-objetivos{grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .grid-objetivos{grid-template-columns:1fr;} }

/* ---------- 9. ENTIDADES ---------- */
.tabs{display:flex; flex-wrap:wrap; gap:10px; margin-bottom:36px;}
.tab-btn{
  padding:11px 22px; border-radius:100px; border:1.5px solid var(--line-strong); background:var(--white);
  font-family:var(--font-display); font-weight:700; font-size:.8rem; color:var(--slate) !important;
  transition:all .3s var(--ease);
}
.tab-btn:hover{border-color:var(--flag-blue); color:var(--flag-blue) !important;}
.tab-btn.active{background:var(--navy-950); border-color:var(--navy-950); color:#ffffff !important;}

.tab-panel{display:none;}
.tab-panel.active{display:block;}

.entity-group{margin-bottom:34px;}
.entity-group-title{
  font-family:var(--font-display); font-weight:700; font-size:.78rem; letter-spacing:.06em;
  text-transform:uppercase; color:var(--flag-blue) !important; margin-bottom:16px; display:flex; align-items:center; gap:10px;
}
.entity-group-title::after{content:''; flex:1; height:1px; background:var(--line-strong);}
.entity-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px;}

.entity-card{
  display:flex; align-items:center; gap:14px; background:var(--white); border:1px solid var(--line-strong);
  border-radius:var(--radius-sm); padding:14px 16px;
  transition:transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.entity-card:hover{transform:translateY(-5px); box-shadow:var(--shadow-sm); border-color:var(--flag-blue);}
.entity-ico{
  width:38px; height:38px; border-radius:9px; background:#f1f5f9; color:var(--navy-800) !important; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:.95rem;
  transition:background-color .35s var(--ease), color .35s var(--ease);
}
.entity-card:hover .entity-ico{background:var(--yellow); color:var(--navy-950) !important;}
.entity-card span{font-size:.85rem; font-weight:600; color:var(--navy-950) !important; line-height:1.3;}

.territorial-wrap{display:grid; grid-template-columns:repeat(2,1fr); gap:20px;}
.territorial-card{
  background:var(--navy-950); border-radius:var(--radius-md); padding:32px;
  transition:transform .4s var(--ease), box-shadow .4s var(--ease);
  position:relative; overflow:hidden;
}
.territorial-card::after{content:''; position:absolute; right:-30px; bottom:-30px; width:120px; height:120px; border-radius:50%; background:rgba(255,199,44,.1);}
.territorial-card:hover{transform:translateY(-8px); box-shadow:var(--shadow-lg);}
.territorial-card i{font-size:1.6rem; color:var(--yellow) !important; margin-bottom:14px; display:block;}
.territorial-card h4{font-family:var(--font-display); font-weight:700; margin-bottom:8px; color:#ffffff !important;}
.territorial-card p{font-size:.88rem; color:rgba(255,255,255,.92) !important; position:relative; z-index:2; line-height:1.5;}

.invitados-note{
  display:flex; gap:14px; background:#fffbeb; border:1px solid #fde68a; border-radius:var(--radius-md);
  padding:20px 22px; margin-bottom:28px; align-items:flex-start;
}
.invitados-note i{color:#b45309 !important; font-size:1.1rem; margin-top:2px;}
.invitados-note p{font-size:.88rem; color:#78350f !important;}

@media (max-width:720px){ .territorial-wrap{grid-template-columns:1fr;} }

/* ---------- 10. ESTRUCTURA / ORGANIGRAMA ---------- */
.org-support-row{display:flex; align-items:center; justify-content:center; gap:18px; margin-bottom:6px; flex-wrap:wrap;}
.org-node{
  background:var(--white); border:2px solid var(--navy-700); border-radius:14px; padding:16px 22px;
  font-family:var(--font-display); font-weight:700; font-size:.86rem; color:var(--navy-950) !important;
  text-align:center; box-shadow:var(--shadow-sm); transition:transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.org-node:hover{transform:translateY(-4px); box-shadow:var(--shadow-md); border-color:var(--flag-blue);}
.org-node.root{background:var(--navy-950); color:#ffffff !important; padding:20px 34px; font-size:1rem; border-color:var(--navy-950);}
.org-node.support{background:#f1f5f9; font-size:.78rem; max-width:220px; color:var(--navy-950) !important; border-color:var(--navy-700);}
.org-connector-arrow{color:var(--navy-800) !important; font-size:1.2rem;}

.org-trunk{width:3px; height:34px; background:var(--navy-800) !important; margin:0 auto;}

.org-tier{position:relative; display:flex; justify-content:center; gap:26px; padding-top:34px; flex-wrap:wrap;}
.org-tier::before{content:''; position:absolute; top:0; left:16.6%; right:16.6%; height:3px; background:var(--navy-800) !important;}
.org-col{flex:1; min-width:220px; max-width:340px; display:flex; flex-direction:column; align-items:center; position:relative;}
.org-col::before{content:''; position:absolute; top:-34px; left:50%; width:3px; height:34px; background:var(--navy-800) !important;}
.org-col .org-node{width:100%;}
.org-col .org-trunk{height:26px;}
.org-leafs{display:flex; gap:14px; margin-top:0; width:100%;}
.org-leafs .org-node{flex:1; font-size:.78rem; padding:14px 12px; font-weight:600;}
.org-leaf-single{width:100%;}

@media (max-width:900px){
  .org-tier{flex-direction:column; align-items:center; padding-top:0;}
  .org-tier::before{display:none;}
  .org-col{max-width:420px; width:100%;}
  .org-col::before{display:none;}
  .org-col .org-trunk{display:none;}
  .org-support-row{flex-direction:column;}
  .org-connector-arrow{transform:rotate(90deg);}
}

/* Acordeón */
.accordion{margin-top:64px; border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-md);}
.acc-item + .acc-item{border-top:1px solid rgba(255,255,255,.15);}
.acc-head{
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:20px;
  background:var(--navy-900); color:#ffffff !important; padding:22px 28px; text-align:left;
  transition:background-color .3s var(--ease);
}
.acc-item.active .acc-head{background:var(--navy-800);}
.acc-head:hover{background:var(--navy-800);}
.acc-title{display:flex; align-items:center; gap:16px;}
.acc-num{font-family:var(--font-display); font-weight:800; color:var(--yellow) !important; font-size:.85rem;}
.acc-title h4{font-family:var(--font-display); font-weight:700; font-size:1rem; color:#ffffff !important;}
.acc-toggle{
  width:32px; height:32px; border-radius:50%; background:rgba(255,255,255,.15); display:flex; align-items:center; justify-content:center;
  color:#ffffff !important; flex-shrink:0; transition:transform .4s var(--ease), background-color .3s var(--ease);
}
.acc-item.active .acc-toggle{transform:rotate(45deg); background:var(--yellow); color:var(--navy-950) !important;}

.acc-panel{max-height:0; overflow:hidden; background:var(--white); transition:max-height .5s var(--ease);}
.acc-panel-inner{padding:30px 28px 34px;}
.acc-panel-inner p{color:var(--slate) !important; font-size:.92rem; margin-bottom:20px; max-width:76ch;}
.acc-chip-title{font-family:var(--font-display); font-weight:700; font-size:.75rem; letter-spacing:.05em; text-transform:uppercase; color:var(--flag-blue) !important; margin-bottom:12px;}
.chip-list{display:flex; flex-wrap:wrap; gap:9px;}
.chip{
  font-size:.78rem; padding:8px 14px; border-radius:100px; background:#f1f5f9; color:var(--navy-950) !important;
  border:1px solid var(--line-strong); transition:transform .3s var(--ease), background-color .3s var(--ease);
}
.chip:hover{background:var(--yellow); color:var(--navy-950) !important; transform:translateY(-2px);}
.acc-note{margin-top:18px; font-size:.82rem; color:var(--slate-soft) !important; font-style:italic;}

/* ---------- 11. RECURSOS ---------- */
.grid-recursos{display:grid; grid-template-columns:repeat(4,1fr); gap:22px;}
.res-card{
  background:var(--white); border:1px solid var(--line-strong); border-radius:var(--radius-md); padding:28px 24px;
  display:flex; flex-direction:column; height:100%;
  transition:transform .4s var(--ease), box-shadow .4s var(--ease);
}
.res-card:hover{transform:translateY(-8px); box-shadow:var(--shadow-md);}
.res-ico{width:50px; height:50px; border-radius:12px; background:var(--navy-950); color:var(--yellow) !important; display:flex; align-items:center; justify-content:center; font-size:1.2rem; margin-bottom:18px;}
.res-card h4{font-size:.98rem; font-weight:700; color:var(--navy-950) !important; margin-bottom:10px;}
.res-card p{font-size:.84rem; color:var(--slate) !important; margin-bottom:22px; flex:1;}
.res-tag{display:inline-block; align-self:flex-start; font-size:.66rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; background:#fef3c7; color:#92400e !important; padding:4px 10px; border-radius:100px; margin-bottom:14px;}

@media (max-width:960px){ .grid-recursos{grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .grid-recursos{grid-template-columns:1fr;} }

/* ---------- 12. INSTAGRAM EMBEDS ---------- */
.insta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  justify-items: center;
  align-items: start;
}
.insta-embed-container {
  width: 100%;
  max-width: 540px; 
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
}
.insta-embed-container iframe {
  border-radius: var(--radius-sm) !important;
}

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

/* ---------- 13. VARIOS ---------- */
.hidden-sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}