/* =========================================================
   Academia de Contratación Pública de México, A.C.
   Identidad visual: manual corporativo (colores fríos,
   trama de cubos isométricos, bandas navy, tipografía
   humanista — Source Sans 3 como sustituto web de Myriad Pro)
   ========================================================= */
:root{
  --navy:      #1B2240;   /* banda oscura de títulos */
  --navy-2:    #2A335C;
  --steel:     #3D6C94;   /* azul acero / enlaces */
  --steel-2:   #5B7FA0;
  --slate:     #8B93B5;   /* gris lavanda del patrón */
  --cube-1:    #E7EAF3;
  --cube-2:    #CBD1E3;
  --cube-3:    #B9C0D8;
  --bg:        #F4F5FA;
  --card:      #FFFFFF;
  --text:      #22263B;
  --text-soft: #4C5268;
  --border:    #D9DDEA;
  --max: 1140px;
}
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family:'Source Sans 3','Segoe UI',sans-serif;
  font-size:17px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{ font-weight:700; margin:0 0 .4em; letter-spacing:.01em; }
a{ color:var(--steel); }
a:hover{ color:var(--navy-2); }
:focus-visible{ outline:2px solid var(--steel); outline-offset:3px; }
.wrap{ max-width:var(--max); margin:0 auto; padding:0 28px; }
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}

/* Trama de cubos isométricos (manual, pp. portada/fondos) */
.cube-bg{
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='102'%3E%3Cg%3E%3Cpath fill='%23E7EAF3' d='M30 0 60 17 30 34 0 17Z M0 51 30 68 0 85-30 68Z M60 51 90 68 60 85 30 68Z M30 102 60 119 30 136 0 119Z'/%3E%3Cpath fill='%23CBD1E3' d='M0 17 30 34 30 68 0 51Z M-30 68 0 85 0 119 -30 102Z M30 68 60 85 60 119 30 102Z'/%3E%3Cpath fill='%23B9C0D8' d='M60 17 30 34 30 68 60 51Z M30 68 0 85 0 119 30 102Z M90 68 60 85 60 119 90 102Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size:60px 102px;
}
.cube-bg-dark{
  background-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='102'%3E%3Cg%3E%3Cpath fill='%23222A4E' d='M30 0 60 17 30 34 0 17Z M0 51 30 68 0 85-30 68Z M60 51 90 68 60 85 30 68Z M30 102 60 119 30 136 0 119Z'/%3E%3Cpath fill='%231E2647' d='M0 17 30 34 30 68 0 51Z M-30 68 0 85 0 119 -30 102Z M30 68 60 85 60 119 30 102Z'/%3E%3Cpath fill='%23191F3C' d='M60 17 30 34 30 68 60 51Z M30 68 0 85 0 119 30 102Z M90 68 60 85 60 119 90 102Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size:60px 102px;
}

/* Banda de título estilo manual (rectángulo navy con texto claro) */
.band{
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color:#fff;
  display:inline-block;
  padding:10px 26px;
  font-size:clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  box-shadow: 4px 4px 0 rgba(139,147,181,.35);
}

/* ---------- header ---------- */
header.site{
  position:sticky; top:0; z-index:50;
  background: var(--navy);
  color:#fff;
  border-bottom:3px solid var(--steel);
}
.nav-inner{
  max-width:var(--max); margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  gap:22px; padding:12px 28px;
}
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color:#fff; min-width:0; }
.brand img{ height:44px; width:auto; display:block; }
.brand-name{ font-size:14px; font-weight:600; line-height:1.25; letter-spacing:.02em; }
nav.links{ display:flex; gap:22px; font-size:14.5px; flex-shrink:0; }
nav.links a{ color:#CBD1E3; text-decoration:none; font-weight:600; }
nav.links a:hover{ color:#fff; }
@media (max-width:860px){ .brand-name{ display:none; } nav.links{ gap:14px; font-size:13px; flex-wrap:wrap; } }

/* ---------- hero ---------- */
.hero{ color:#fff; padding:88px 0 76px; position:relative; }
.hero .wrap{ display:grid; grid-template-columns:1.1fr .9fr; gap:44px; align-items:center; }
@media (max-width:880px){ .hero .wrap{ grid-template-columns:1fr; } }
.hero h1{ font-size:clamp(1.9rem,4vw,3rem); line-height:1.12; }
.hero p.lede{ color:#C4CBE0; font-size:1.08rem; max-width:52ch; margin:16px 0 28px; }
.hero-logo{ display:flex; justify-content:center; }
.hero-logo img{ max-width:280px; width:70%; height:auto; filter:drop-shadow(0 10px 30px rgba(0,0,0,.35)); }
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:12px 22px; font-weight:600; font-size:15px;
  text-decoration:none; border-radius:3px;
  transition:background .15s ease, transform .15s ease;
}
.btn-primary{ background:var(--steel); color:#fff; }
.btn-primary:hover{ background:var(--steel-2); color:#fff; transform:translateY(-1px); }
.btn-ghost{ border:1px solid rgba(255,255,255,.4); color:#fff; }
.btn-ghost:hover{ border-color:#fff; color:#fff; }
.cta-row{ display:flex; gap:14px; flex-wrap:wrap; }

/* ---------- generic sections ---------- */
section{ padding:76px 0; }
.section-head{ margin-bottom:40px; }
.section-head p{ color:var(--text-soft); max-width:62ch; margin-top:18px; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:6px;
  padding:26px 24px;
}
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.grid-3{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:22px; }
@media (max-width:760px){ .grid-2{ grid-template-columns:1fr; } }

.mv-card h3{
  color:var(--navy);
  font-size:1.02rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  border-bottom:2px solid var(--steel);
  display:inline-block;
  padding-bottom:4px;
  margin-bottom:12px;
}
.mv-card p{ color:var(--text-soft); margin:0; }

.valores li{ margin-bottom:10px; color:var(--text-soft); }
.valores li b{ color:var(--navy); }
ul.plain{ list-style:none; padding:0; margin:0; }
.servicios li{
  padding:9px 0 9px 26px;
  border-bottom:1px solid var(--border);
  color:var(--text-soft);
  position:relative;
}
.servicios li::before{
  content:"";
  position:absolute; left:2px; top:16px;
  width:10px; height:10px;
  background:var(--steel);
  clip-path:polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); /* mini cubo */
}

/* tarjetas de acervo (home) */
.acervo-card{ display:flex; flex-direction:column; gap:8px; }
.acervo-card .num{ font-size:1.9rem; font-weight:700; color:var(--steel); line-height:1; }
.acervo-card h3{ font-size:1.06rem; color:var(--navy); margin:0; }
.acervo-card p{ color:var(--text-soft); font-size:.94rem; margin:0 0 8px; }
.acervo-card a{ font-weight:600; font-size:.95rem; text-decoration:none; margin-top:auto; }

/* ---------- videoteca ---------- */
.videoteca{ color:#fff; }
.videoteca .section-head p{ color:#C4CBE0; }
.video-frame{
  background:#151B33;
  border:1px solid rgba(139,147,181,.4);
  border-radius:6px; overflow:hidden;
  aspect-ratio:16/9; position:relative;
}
.video-facade{
  position:absolute; inset:0; width:100%;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  cursor:pointer; border:none; color:#fff;
  background:linear-gradient(rgba(21,27,51,.45), rgba(21,27,51,.75));
}
.play-ring{
  width:64px; height:64px; border-radius:50%;
  border:2px solid #fff;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s ease;
}
.video-facade:hover .play-ring{ background:rgba(61,108,148,.45); }
.play-ring svg{ width:20px; height:20px; fill:#fff; margin-left:3px; }
.fac-title{ font-weight:700; font-size:1.1rem; }
.fac-sub{ font-size:12px; letter-spacing:.08em; color:#AFC4D6; }
.video-frame iframe{ width:100%; height:100%; border:0; display:block; }
.channel-link-row{ margin-top:18px; font-size:15px; }
.channel-link-row a{ color:#CBD1E3; }
.channel-link-row a:hover{ color:#fff; }

/* ---------- footer ---------- */
footer.site{ background:var(--navy); color:#AEB5CF; padding:48px 0 26px; border-top:3px solid var(--steel); }
.foot-grid{ display:flex; justify-content:space-between; gap:34px; flex-wrap:wrap; padding-bottom:26px; border-bottom:1px solid rgba(139,147,181,.3); }
.foot-brand{ max-width:380px; }
.foot-brand .brand-name{ color:#fff; font-size:15px; }
.foot-brand p{ font-size:.92rem; margin-top:12px; }
.foot-contact{ font-size:14px; line-height:2; }
.foot-contact a{ color:#CBD1E3; text-decoration:none; }
.foot-contact a:hover{ color:#fff; }
.foot-bottom{ padding-top:20px; font-size:12.5px; color:#7D86A8; display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; }

/* ---------- biblioteca (library page) ---------- */
.lib-header{ color:#fff; padding:56px 0 46px; }
.lib-header p{ color:#C4CBE0; max-width:60ch; }
.lib-toolbar{ margin:26px 0 8px; display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.lib-search{
  flex:1; min-width:240px;
  padding:12px 16px;
  font:inherit; color:var(--text);
  background:#fff; border:1px solid var(--border); border-radius:4px;
}
.lib-search:focus{ border-color:var(--steel); outline:none; }
.lib-count{ font-size:13.5px; color:var(--text-soft); }
.lib-section{ margin:34px 0; }
.lib-section > h2{
  background:linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
  color:#fff; font-size:1.05rem; letter-spacing:.07em; text-transform:uppercase;
  padding:10px 18px; border-radius:4px 4px 0 0; margin:0;
  display:flex; justify-content:space-between; align-items:baseline; gap:12px;
}
.lib-section > h2 .sec-count{ font-size:.8rem; font-weight:400; color:#AEB5CF; letter-spacing:0; text-transform:none; }
.lib-section .sec-desc{ background:#EAEDF5; border:1px solid var(--border); border-top:none; padding:10px 18px; font-size:.92rem; color:var(--text-soft); margin:0; }
.lib-body{ background:var(--card); border:1px solid var(--border); border-top:none; border-radius:0 0 4px 4px; padding:10px 18px 16px; }
.lib-body ul{ list-style:none; margin:0; padding-left:18px; }
.lib-body > ul{ padding-left:0; }
details.dir{ margin:4px 0; }
details.dir > summary{
  cursor:pointer; font-weight:600; color:var(--navy);
  padding:6px 4px; border-radius:3px; list-style:none;
  display:flex; align-items:center; gap:8px;
}
details.dir > summary::-webkit-details-marker{ display:none; }
details.dir > summary::before{
  content:""; width:9px; height:9px; flex-shrink:0;
  background:var(--slate);
  clip-path:polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition:background .15s ease;
}
details.dir[open] > summary::before{ background:var(--steel); }
details.dir > summary:hover{ background:#F0F2F8; }
summary .dcount{ font-size:.78rem; color:var(--text-soft); font-weight:400; }
li.file{ padding:4px 4px 4px 2px; }
li.file a{
  text-decoration:none; font-size:.95rem;
  display:inline-flex; align-items:center; gap:8px;
}
li.file a::before{
  content:"PDF";
  font-size:9px; font-weight:700; letter-spacing:.05em;
  color:#fff; background:var(--steel-2);
  padding:2px 5px; border-radius:2px; flex-shrink:0;
}
li.file a:hover{ text-decoration:underline; }
li.file.hidden, details.dir.hidden{ display:none; }
