/* ============================================================
   site-chrome.css
   Header y footer del Ayuntamiento de Arapiles, autocontenidos.
   Se cargan sobre batalla.html y aula.html (que usan otras hojas
   de estilo). Todo va con prefijo .ayt- y fuentes con nombre propio
   para no colisionar con batalla.css ni aula.css.
   ============================================================ */

/* Fuentes con nombre único (evitan choque con las de cada web) */
@font-face {
  font-family: "AytInter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-variable.woff2") format("woff2");
}
@font-face {
  font-family: "AytSerif";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-serif-4/source-serif-4-latin-wght-normal.woff2") format("woff2");
}

/* Tokens */
.ayt-header, .ayt-footer {
  --ayt-inst-900: #7A1C16;
  --ayt-inst-700: #B02A22;
  --ayt-inst-500: #DC3C32;
  --ayt-inst-100: #FAE6E4;
  --ayt-inst-50:  #FBEAE8;
  --ayt-tinta:    #1A1A1A;
  --ayt-pizarra:  #3F4753;
  --ayt-gris-100: #F4F4F5;
  --ayt-gris-200: #E4E4E7;
  --ayt-gris-300: #D4D4D8;
  --ayt-gris-400: #A1A1AA;
  --ayt-gris-500: #71717A;
  font-family: "AytInter", system-ui, -apple-system, sans-serif;
}

/* Reset acotado al chrome (no depende del preflight de cada web) */
.ayt-header *, .ayt-footer *,
.ayt-header *::before, .ayt-footer *::before,
.ayt-header *::after, .ayt-footer *::after {
  box-sizing: border-box;
}
/* No reseteamos el color aquí: cada enlace fija el suyo con su clase. Un
   `color: inherit` con esta especificidad pisaría el blanco del botón CTA. */
.ayt-header a, .ayt-footer a { text-decoration: none; }
.ayt-header p, .ayt-footer p,
.ayt-header ul, .ayt-footer ul,
.ayt-header h2, .ayt-footer h2,
.ayt-footer address { margin: 0; }
.ayt-header ul, .ayt-footer ul { list-style: none; padding: 0; }
.ayt-header svg, .ayt-footer svg { display: block; }

.ayt-container {
  width: 100%;
  max-width: 1152px;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) { .ayt-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .ayt-container { padding-inline: 2rem; } }

.ayt-stripe {
  height: 4px;
  background: linear-gradient(to right, var(--ayt-inst-900), var(--ayt-inst-500), var(--ayt-inst-700));
}

/* ---------- HEADER ---------- */
.ayt-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ayt-gris-200);
  color: var(--ayt-tinta);
}

.ayt-utility { display: none; }
@media (min-width: 768px) {
  .ayt-utility {
    display: block;
    border-bottom: 1px solid var(--ayt-gris-100);
    background: rgba(250, 250, 250, 0.6);
  }
}
.ayt-utility__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.5rem;
  font-size: 12px;
  color: var(--ayt-pizarra);
}
.ayt-utility__loc { display: inline-flex; align-items: center; gap: 0.5rem; }
.ayt-utility__loc svg { width: 14px; height: 14px; color: var(--ayt-inst-700); }
.ayt-utility__links { display: flex; align-items: center; gap: 1.25rem; }
.ayt-utility__links a:hover { color: var(--ayt-inst-700); }
.ayt-utility__links li[aria-hidden] { color: var(--ayt-gris-300); }
.ayt-utility__links a[aria-label] { color: var(--ayt-inst-700); font-weight: 500; }
.ayt-utility__links a[aria-label]:hover { color: var(--ayt-inst-900); }

.ayt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}
@media (min-width: 768px) { .ayt-bar { padding-block: 1.25rem; } }

.ayt-brand { display: inline-flex; align-items: center; border-radius: 2px; }
.ayt-brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ayt-inst-500);
}
.ayt-brand__logo { height: 40px; width: auto; flex-shrink: 0; }
@media (min-width: 768px) { .ayt-brand__logo { height: 48px; } }
.ayt-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  border-left: 1px solid var(--ayt-gris-200);
  padding-left: 0.75rem;
  margin-left: 0.75rem;
}
.ayt-brand__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ayt-gris-500);
  font-weight: 600;
}
.ayt-brand__name {
  font-family: "AytSerif", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ayt-inst-900);
  letter-spacing: -0.01em;
}
@media (min-width: 640px) { .ayt-brand__name { font-size: 1.125rem; } }

.ayt-nav { display: none; }
@media (min-width: 1024px) {
  .ayt-nav { display: flex; align-items: center; gap: 0.25rem; }
}
.ayt-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.625rem 0.875rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--ayt-pizarra);
  border-radius: 6px;
  transition: color 0.15s;
}
.ayt-nav__link:hover { color: var(--ayt-inst-900); }
.ayt-nav__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ayt-inst-500);
}

/* Desplegables del header (escritorio) — abren con hover y con teclado (focus-within) */
.ayt-nav__item { position: relative; display: flex; }
.ayt-nav__caret {
  width: 14px;
  height: 14px;
  color: var(--ayt-gris-400);
  transition: transform 0.15s;
}
.ayt-nav__item:hover .ayt-nav__caret,
.ayt-nav__item:focus-within .ayt-nav__caret { transform: rotate(180deg); }
.ayt-nav__panel {
  position: absolute;
  left: 0;
  top: 100%;
  padding-top: 0.5rem; /* puente invisible para que el hover no se corte */
  min-width: 15rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.ayt-nav__item:hover .ayt-nav__panel,
.ayt-nav__item:focus-within .ayt-nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.ayt-nav__panel ul {
  background: #fff;
  border: 1px solid var(--ayt-gris-200);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 12px 32px -12px rgba(30, 20, 15, 0.25);
}
.ayt-nav__panel li a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 14px;
  color: var(--ayt-pizarra);
  transition: background-color 0.15s, color 0.15s;
}
.ayt-nav__panel li a:hover { background: var(--ayt-gris-100); color: var(--ayt-inst-900); }
.ayt-nav__panel li a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ayt-inst-500);
}
.ayt-nav__cta {
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--ayt-inst-900);
  color: #fff;
  transition: background-color 0.15s;
}
.ayt-nav__cta:hover { background: var(--ayt-inst-700); }
.ayt-nav__cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ayt-inst-500);
}
.ayt-nav__cta svg { width: 14px; height: 14px; }

.ayt-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--ayt-pizarra);
  cursor: pointer;
}
.ayt-burger:hover { background: var(--ayt-gris-100); }
.ayt-burger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ayt-inst-500);
}
.ayt-burger svg { width: 24px; height: 24px; }
@media (min-width: 1024px) { .ayt-burger { display: none; } }

.ayt-mobile {
  border-top: 1px solid var(--ayt-gris-200);
  background: #fff;
}
.ayt-mobile[hidden] { display: none; }
@media (min-width: 1024px) { .ayt-mobile { display: none; } }
.ayt-mobile__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-block: 1rem;
}
.ayt-mobile__nav a {
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ayt-pizarra);
  border-radius: 6px;
}
.ayt-mobile__nav a:hover { color: var(--ayt-inst-700); background: #FAFAFA; }
.ayt-mobile__cta {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid var(--ayt-inst-500);
  color: var(--ayt-inst-700) !important;
  font-weight: 600;
}
.ayt-mobile__cta:hover { background: var(--ayt-inst-500); color: #fff !important; }

/* Subsecciones del menú móvil (acordeón) */
.ayt-msub__row { display: flex; align-items: center; gap: 0.25rem; }
.ayt-msub__row > a { flex: 1; }
.ayt-msub__toggle {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ayt-gris-500);
  border-radius: 6px;
}
.ayt-msub__toggle:hover { background: #FAFAFA; }
.ayt-msub__toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ayt-inst-500); }
.ayt-msub__toggle svg { width: 20px; height: 20px; transition: transform 0.15s; }
.ayt-msub__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.ayt-msub__panel {
  list-style: none;
  margin: 0 0 0.25rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--ayt-gris-200);
}
.ayt-msub__panel[hidden] { display: none; }
.ayt-msub__panel a {
  display: block;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: var(--ayt-pizarra);
  border-radius: 6px;
}
.ayt-msub__panel a:hover { color: var(--ayt-inst-700); background: #FAFAFA; }

/* ---------- FOOTER ---------- */
.ayt-footer {
  position: relative;
  background: var(--ayt-inst-900);
  color: var(--ayt-gris-100);
  overflow: hidden;
}
.ayt-footer .ayt-stripe {
  position: absolute;
  inset-inline: 0;
  top: 0;
  background: linear-gradient(to right, var(--ayt-inst-700), var(--ayt-inst-500), var(--ayt-inst-700));
}
.ayt-footer__main { padding-block: 3.5rem; position: relative; }
@media (min-width: 1024px) { .ayt-footer__main { padding-block: 5rem; } }

.ayt-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 640px) { .ayt-footer__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
@media (min-width: 1024px) {
  .ayt-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.6fr; gap: 4rem; }
}

.ayt-footer__brandhead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ayt-footer__brandlogo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.ayt-footer__brandlogo img { width: 36px; height: 36px; }
.ayt-footer__brandtext { display: flex; flex-direction: column; line-height: 1.15; }
.ayt-footer__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ayt-inst-100);
  font-weight: 600;
}
.ayt-footer__name {
  font-family: "AytSerif", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.ayt-footer__desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(212, 212, 216, 0.9);
  max-width: 20rem;
}

.ayt-footer__h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1.25rem;
}
.ayt-footer__col ul { display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.875rem; }
.ayt-footer__col a, .ayt-footer__contact a {
  color: var(--ayt-gris-300);
  transition: color 0.15s;
}
.ayt-footer__col a:hover, .ayt-footer__contact a:hover { color: #fff; }
.ayt-footer__col a[aria-label] { display: inline-flex; align-items: center; gap: 0.25rem; }

.ayt-footer__contact address {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--ayt-gris-300);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  line-height: 1.6;
}

.ayt-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); position: relative; }
.ayt-footer__bottominner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: 1.5rem;
  font-size: 0.75rem;
  color: var(--ayt-gris-400);
}
@media (min-width: 768px) {
  .ayt-footer__bottominner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.ayt-footer__legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.ayt-footer__legal a { color: var(--ayt-gris-400); transition: color 0.15s; }
.ayt-footer__legal a:hover { color: #fff; }
.ayt-footer__credit a { color: var(--ayt-gris-300); }
.ayt-footer__credit a:hover { color: #fff; }
.ayt-footer a:focus-visible, .ayt-footer button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ayt-inst-900), 0 0 0 4px #fff;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ayt-header *, .ayt-footer * { transition-duration: 0.01ms !important; }
}

/* Patrimonio: sombreado sutil de Batalla/Aula en el desplegable El municipio */
.ayt-nav__panel li a.is-patrimonio{background:#f8f7f4}
.ayt-nav__panel li a.is-patrimonio:hover{background:#f1efea}
