:root{
  --pleca-tecnm-h: 56px;
  --gobmx-offset: 60px;
  --site-nav-height: 64px;
}

.container{
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

body{
  padding-top: 0;
}

/* El header completo baja debajo de la barra gob.mx */
.site-header{
  margin-top: var(--gobmx-offset);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.header-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand-link{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo{
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.brand-text{
  display: grid;
}

.brand-title{
  font-weight: 700;
}

.brand-subtitle{
  color: var(--muted);
  font-size: .95rem;
}

/* navegación principal */
.site-nav{
  background: var(--primary);
  color: #fff;
  min-height: var(--site-nav-height);
  width: 100%;
  z-index: 950;
  opacity: 1;
}

.site-nav.is-fixed{
  position: fixed;
  top: var(--gobmx-offset);
  left: 0;
  width: 100%;
  background: var(--primary);
  opacity: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.site-nav .nav-panel{
  z-index: 960;
}

.site-nav-placeholder{
  display: none;
  height: var(--site-nav-height);
}

.site-nav-placeholder.active{
  display: block;
}

.nav-inner{
  padding: 10px 0;
}

.nav-list{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.site-main{
  min-height: 60vh;
  padding-top: 0;
}

.section{
  padding: 34px 0;
}

.section-alt{
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header{
  margin-bottom: 18px;
}

.section-header h2{
  margin: 0 0 6px;
}

.section-header p{
  margin: 0;
  color: var(--muted);
}

.grid{
  display: grid;
  gap: 16px;
}

.cards-3{
  grid-template-columns: repeat(3, 1fr);
}

.cards-2{
  grid-template-columns: repeat(2, 1fr);
}

/* footer */
.site-footer{
  background: #1B396A;
  color: #e5e7eb;
  padding: 28px 0 18px;
  margin: 0;
}

.footer-grid{
  display: grid;
  gap: 18px;
  grid-template-columns: 2fr 1fr 1fr;
}

.footer-title{
  font-size: 1rem;
  margin: 0 0 10px;
}

.footer-links{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-bottom{
  border-top: 1px solid rgba(229,231,235,.12);
  margin-top: 16px;
  padding-top: 12px;
  color: rgba(229,231,235,.8);
}

/* pleca institucional */
.pleca{
  background: #fff;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.pleca-inner{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  flex-wrap: nowrap;
}

.pleca-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.pleca-link:hover{
  background: var(--surface-2);
  text-decoration: none;
}

.pleca-link--tecnm img{
  height: var(--pleca-tecnm-h);
  width: auto;
  display: block;
}

.pleca-link--chiapas img{
  height: var(--pleca-tecnm-h);
  width: auto;
  display: block;
}

.pleca-link--instituto img{
  height: calc(var(--pleca-tecnm-h) * 0.8);
  width: auto;
  display: block;
}

.pleca-link--sep img{
  height: calc(var(--pleca-tecnm-h) * 0.82);
  width: auto;
  max-width: 380px;
  display: block;
}

/* mapa footer */
.footer-media{
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(229,231,235,.12);
  background: rgba(255,255,255,.06);
  min-height: 260px;
  position: relative;
}

.footer-map-iframe{
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
}

.footer-map-open{
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}

.footer-map-open:hover{
  background: rgba(0,0,0,.70);
  text-decoration: none;
}

/* anclas */
html{
  scroll-padding-top: calc(var(--gobmx-offset) + var(--site-nav-height) + 16px);
}

section[id],
article[id],
div[id]{
  scroll-margin-top: calc(var(--gobmx-offset) + var(--site-nav-height) + 16px);
}

/* responsive */
@media (max-width: 900px){
  :root{
    --pleca-tecnm-h: 44px;
  }

  .cards-3,
  .cards-2,
  .footer-grid{
    grid-template-columns: 1fr;
  }

  .header-top{
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand toggle"
      "search search";
    align-items: center;
    gap: 12px;
  }

  .brand{
    grid-area: brand;
  }

  .nav-toggle{
    grid-area: toggle;
    justify-self: end;
  }

  .header-actions{
    grid-area: search;
  }

  .search,
  .search input{
    width: 100%;
  }

  .nav-panel{
    position: static;
    box-shadow: none;
    border-radius: 12px;
    margin-top: 8px;
  }

  .pleca-inner{
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .footer-media,
  .footer-map-iframe{
    min-height: 220px;
  }
}

@media (max-width: 700px){
  .gov-subtitle{
    display: none;
  }

  .gov-title{
    font-size: .9rem;
  }
}

@media (min-width: 901px){
  .nav-list{
    flex-wrap: nowrap;
  }
}
@media (max-width: 900px){
  :root{
    --pleca-tecnm-h: 44px;
    --gobmx-offset: 56px;
  }
}