/* ====================================================
   gva-estilos.css — Estilos corporatius GVA
   v2.0 — Material Design 3 / Inter
   ==================================================== */

/* --- Tipografia Inter per a capçalera i peu ----------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

#pan_superior,
#pan_inferior,
#pan_superior .titulo,
#pan_superior .enlaceCabecera,
#pan_superior .cabeceraIdioma,
#pan_inferior .textoPie,
.header-ver-select {
  font-family: 'Inter', system-ui, sans-serif;
}

/* --- Variable: alçada capçalera GVA ------------------- */
:root {
  --gva-header-height: 80px;
}

/* --- Skip link ---------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: #003e6f;
  color: #fff;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

/* ==========================================================
   GVA HEADER (#pan_superior)
   White header with bottom border — matches plantilla_base
   ========================================================== */
#pan_superior {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--gva-header-height);
  padding: 0 1.5rem;
  overflow: hidden;
  border-bottom: 1px solid #e1e2e4;
  background: #fff;
  z-index: 1001;
  box-sizing: border-box;
}

/* --- Layout interior ---------------------------------- */
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1.5rem;
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: 1;
}

/* --- Logos -------------------------------------------- */
#imgGVA, #imgICV {
  display: flex;
  align-items: center;
  height: 60px;
  line-height: 0;
  transition: opacity 0.2s ease;
}
#imgGVA:hover, #imgICV:hover { opacity: 0.75; }

#imgGVA img { height: 60px; width: auto; max-width: 150px; }
#imgICV img { height: 60px; width: auto; max-width: 180px; }

/* --- Títol i capçalera dreta -------------------------- */
.titulo {
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
  color: #000000;
  letter-spacing: -0.02em;
}

#divCabeceraD {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  height: 100%;
  min-width: 165px;
  justify-content: space-around;
  flex-shrink: 0;
  gap: 0.35rem;
}

/* Fila inferior de la dreta: versió + idioma junts */
.header-controls-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Selector de versió dins la capçalera */
.header-ver-select {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--color-text, #191c1e);
  cursor: pointer;
  transition: background 0.15s ease;
}
.header-ver-select:hover { background: #e2e8f0; }

#divIdioma { min-width: 50px; }

/* Forzar color oscuro en selector de versión y texto de idioma */
#verSelect,
#divIdioma,
#divIdioma * {
  color: #000000 !important;
}

.enlaceCabecera {
  text-align: right;
  color: #000000;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.enlaceCabecera:hover { text-decoration: underline; color: #003e6f; }
#cabeceraNomICV { font-size: 12px; }
.cabeceraIdioma {
  font-size: 11px;
  font-weight: 700;
}
.cabeceraIdioma:hover { color: #003e6f; }
#divIdioma span[aria-hidden] { font-size: 11px; color: #94a3b8; }

/* --- Botó hamburger dins la capçalera (mòbil) --------- */
.header__menu-btn {
  display: none;
  background: none;
  border: 1px solid #e1e2e4;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 8px;
  color: #475569;
  line-height: 1;
  height: 40px;
  flex-shrink: 0;
  order: -1;
  transition: background 0.15s ease;
}
.header__menu-btn:hover { background: #f1f5f9; }

@media (max-width: 750px) {
  .header__menu-btn { display: flex; align-items: center; justify-content: center; }
}

/* Improve hamburger visibility inside the GVA header (mobile) */
.header__menu-btn .hamburger,
.header__menu-btn .hamburger::before,
.header__menu-btn .hamburger::after {
  background: #475569 !important;
  width: 22px !important;
  height: 2px !important;
}
.header__menu-btn .hamburger::before { top: -7px !important; }
.header__menu-btn .hamburger::after  { top:  7px !important; }

@media (min-width: 751px) {
  .header__menu-btn { display: none !important; }
}

/* ==========================================================
   LAYOUT
   ========================================================== */

/* Sidebar: s'enganxa just davall de pan_superior */
@media (min-width: 751px) {
  #sidebar {
    top: var(--gva-header-height) !important;
    height: calc(100vh - var(--gva-header-height) - var(--footer-height, 30px)) !important;
  }
}
/* Sidebar mòbil: padding-top per als dos headers */ 
@media (max-width: 750px) {
  #sidebar { padding-top: var(--gva-header-height) !important; }
}

/* ==========================================================
   GVA FOOTER (#pan_inferior)
   ========================================================== */

/* Clean, light footer */
#site-footer {
  background: #f8fafc !important;
  color: #000000 !important;
  border-top: 1px solid #e1e2e4 !important;
  padding: 0 !important;
}

#pan_inferior {
  text-align: center;
  font-size: 12px;
  background: #f8fafc;
  width: 100%;
}

.piePagina {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 1rem;
}

.textoPie {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.5em;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #000000;
}

.separador   { color: #000000; }
.enlacePie   { color: #64748b; text-decoration: none; }
.enlacePie:hover { text-decoration: underline; color: #003e6f; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */

/* <= 1000px: logotips sense text (gestionat per <picture>) */
@media only screen and (max-width: 1000px) {
  #imgGVA img { width: 25px; height: auto; max-width: 25px; }
  #imgICV img { width: 60px; height: auto; max-width: 60px; }
  #divCabeceraD { min-width: 120px; }
}

/* <= 850px */
@media only screen and (max-width: 850px) {
  :root { --gva-header-height: 56px; }
  #cabeceraNomICV { display: none; }
  #divCabeceraD   { min-width: 0; justify-content: center; }
  .titulo         { font-size: 1.1rem; margin: 0 5px; }
  #pan_superior   { height: 56px; padding: 0 0.75rem; }
  #imgGVA img,
  #imgICV img     { height: 38px; width: auto; }
}

/* <= 550px: keep ICV logo visible; shrink title instead of hiding it */
@media only screen and (max-width: 550px) {
  #imgICV { display: flex !important; }
  .header-title { min-width: 0; }
  .titulo { font-size: 0.9rem; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cabeceraIdioma { font-size: 10px; }
}

/* Small screens: reduce gap so controls don't overflow */
@media (max-width: 750px) {
  #imgGVA { margin-left: 4px; }
  .header-inner { gap: 0.5rem; }
}

/* <= 450px */
@media only screen and (max-width: 450px) {
  .cabeceraIdioma { font-size: 9px; }
}
