/* ==========================================================================
   TOKENS — paleta i tipografia
   ========================================================================== */
:root {
  --blau-upc: #007bc0;
  --blau-fosc: #00517e;
  --blau-nit: #0b2a3d;
  --gris-fons: #f4f6f8;
  --gris-vora: #dde3e8;
  --text-principal: #1c2733;
  --text-secundari: #4c5b6b;
  --blanc: #ffffff;

  --font-display: 'Roboto', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

body {
  font-family: var(--font-body);
  color: var(--text-principal);
  background-color: var(--gris-fons);
}

a {
  color: var(--blau-upc);
}

/* ==========================================================================
   CAPÇALERA
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 30;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 100%);
  transition: background-color 0.25s ease;
}

.site-header.is-scrolled {
  background-color: #0b0b0b;
  /* la barra negra al hacer scroll */
}

.logo-img {
  width: 220px;
  max-width: 40vw;
}

.cap-sites {
  font-size: clamp(0.875rem, 1.2vw + 0.5rem, 1.125rem);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

/* ----- ESTILOS PARA ORDENADOR (Pantallas grandes) ----- */
@media (min-width: 768px) {
  .cap-sites {
    color: #ffffff !important;
  }

  .cap-sites:hover {
    color: #cfe3f5 !important;
  }
}

/* ----- ESTILOS PARA MÓVIL (Offcanvas desplegado) ----- */
@media (max-width: 767px) {
  .logo-img {
    max-height: 35px;
  }

  .offcanvas {
    background-color: #2c2c2c !important;
  }

  .cap-sites {
    color: #ffffff !important;
    padding: 12px 0;
    border-bottom: 1px solid #444444;
    width: 100%;
  }

  .cap-sites:hover {
    color: #b0c4de !important;
  }
}

.cap-sites:hover {
  color: #0056b3;
}

#logoutLink {
  color: green;
}


/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 560px;
  height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(11, 42, 61, 0.1) 0%,
      rgba(11, 42, 61, 0.05) 45%,
      rgba(11, 42, 61, 0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 5;
  padding-top: clamp(120px, 30vh, 260px);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--blanc);
  font-size: clamp(4rem, 7vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--blanc);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  margin-top: 0.75rem;
  margin-bottom: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  width: clamp(50px, 40vw, 500px);
}

/* ==========================================================================
   TARGETES DE RECURSOS (encavalcades sobre el hero)
   ========================================================================== */
.cards-section {
  position: relative;
  padding-bottom: 4rem;
  margin-top: 50px;
}

.admin-section-title {
  color: green;
}

.resource-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--blanc);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(11, 42, 61, 0.18);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(11, 42, 61, 0.25);
}

.resource-card-img {
  height: 170px;
  width: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.resource-card-body {
  padding: 1.5rem 1.6rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-card-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--blau-fosc);
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.resource-card-body p {
  color: var(--text-secundari);
  font-size: 0.98rem;
  margin-bottom: 0;
}

/* ==========================================================================
   PEU DE PÀGINA
   ========================================================================== */
.site-footer {
  background-color: var(--blau-nit);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.5rem clamp(1rem, 4vw, 3rem);
}

.site-footer h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--blanc);
  margin-bottom: 0.4rem;
}

.site-footer p {
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   MODAL DE LOGIN — ajustos petits sobre Bootstrap
   ========================================================================== */
#loginModal .modal-content {
  border: none;
  border-radius: 6px;
}

#loginModal .modal-header {
  border-bottom: none;
}

#loginError {
  display: none;
}