/* Plantilla escritorio (desktop) */
@import url("colores.css");
@import url("moviles.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Cuerpo general */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  background: var(--fondo-degradado), url('/assets/img/ies-castelar-logo.png');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  font-family: Arial, sans-serif;
}

/* Cabecera */
header {
  background: var(--fondo-cabecera);
  color: var(--texto-cabecera);
  text-align: center;
  padding: 20px 10px;
  border-bottom: 3px solid var(--borde-cabecera);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  width: 100%;
}

header h1 {
  margin: 10px 0;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--titulo);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Rejilla de tarjetas */
main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  justify-items: center;
  align-items: center;
  gap: 24px;
  padding: 30px;
  width: 100%;
  max-width: 1400px;
  box-sizing: border-box;
  flex: 1;
}

/* Tarjeta */
.item {
  display: grid;
  place-items: center;
  background: var(--fondo-card);
  border: 1px solid var(--borde-card);
  padding: 0;
  border-radius: 12px;
  box-shadow: 8px 5px 8px var(--sombra-card);
  overflow: hidden;
  position: relative;
  width: 320px;
  height: 210px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item:hover {
  transform: scale(1.03);
  box-shadow: 10px 8px 12px var(--sombra-card-hover);
}

.overlay-link {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.overlay-link img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.overlay-link span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background: var(--fondo-overlay);
  padding: 10px 20px;
  border-radius: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  z-index: 10;
  max-width: 90%;
}

.overlay-link:hover span {
  background: var(--fondo-overlay-hover);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Pie de página */
footer {
  background: var(--fondo-pie);
  color: var(--texto-pie);
  text-align: center;
  padding: 15px 10px;
  font-size: 0.9rem;
  border-top: 3px solid var(--borde-pie);
  backdrop-filter: blur(6px);
  width: 100%;
}

footer p {
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}