/* RESET + VARIABLES */
*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root{
  --bg: #f6f7f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;

  /* Badalona vibes: mar + eco */
  --primary: #0b5d8a;     /* azul mar */
  --primary-2: #0ea5a4;   /* turquesa */
  --accent: #2e7d32;      /* verde eco */
  --soft: #eaf4ff;
  --border: #e5e7eb;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* SCROLL + ANCLAS (FIX) */
html{
  scroll-behavior: smooth;

  /* Compensa header sticky + nav */
  scroll-padding-top: 170px;
}

body{
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  background: radial-gradient(1200px 600px at 10% 0%, var(--soft), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, #eafaf4, transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: auto;
}

/* CABECERA */
.header-principal{
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  padding: 26px 0;
  position: static;   
  top: auto;          
  z-index: auto;      
  box-shadow: 0 8px 20px rgba(0,0,0,.10);
}



.header-contenido{
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
}

.logo{
  width: 64px;
  background: rgba(255,255,255,.18);
  padding: 10px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.titulo-header{
  flex: 1;
  text-align: center;
  color: white;
}

.titulo-header h1{
  font-size: 2.1rem;
  margin: 4px 0;
}

.titulo-header p{
  font-size: 1rem;
  opacity: .92;
}

/* MENÚ */
nav{
  background: rgba(255,255,255,.70);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

nav ul{
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 8px;
}

nav ul li{ margin: 0; }

nav ul li a{
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 999px;
  transition: transform .15s ease, background-color .15s ease;
}

nav ul li a:hover{
  background: rgba(14,165,164,.12);
  transform: translateY(-1px);
}

nav ul li a.active{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
}

/* CONTENIDO + SECTIONS */
main{
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 15px;
  margin-bottom: 0;
  padding-bottom: 0;
}

section{
  background: var(--card);
  margin-bottom: 20px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  /* Compensa anclas por si alguna usa scroll-margin */
  scroll-margin-top: 170px;
}

section h2{
  color: var(--primary);
  margin-bottom: 10px;
}

/* Ajuste intro de Medidas  */
.plan-areas{
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.plan-areas p{ margin-bottom: 0; }

/* LISTAS / DEFINICIÓN */
ul{ margin-left: 20px; }
li{ margin-bottom: 6px; }

dl{ margin: 10px 0; }
dt{ font-weight: bold; color: var(--primary); }
dd{ margin-left: 20px; margin-bottom: 10px; color: var(--muted); }

/* TARJETAS (GRID) */
.grid-cards{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 10px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}

.tag{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14,165,164,.15);
  color: var(--primary);
  font-weight: 800;
  font-size: .85rem;
  margin-bottom: 10px;
}

/* Indicadores dentro de cards */
.mini-indicadores{
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted);
}
.mini-indicadores li{ margin: 4px 0; }

/* Responsive: en móvil 1 columna */
@media (max-width: 780px){
  .grid-cards{ grid-template-columns: 1fr; }
}



/* EVENTOS - TIMELINE  */
.eventos-timeline{
  list-style: none;
  margin-top: 20px;
  padding-left: 30px;
  position: relative;
}

.eventos-timeline::before{
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #b2dfdb;
}

.eventos-timeline li{
  position: relative;
  padding-left: 30px;
  margin-bottom: 30px;
}

.eventos-timeline li::before{
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: #009688;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #e0f2f1;
}

.eventos-timeline h4{
  margin: 0;
  color: #004d40;
  font-size: 1rem;
}

.eventos-timeline p{
  margin: 4px 0 0;
  color: #555;
  font-size: 0.95rem;
}

/* Imagen dentro del último evento */
.timeline-imagen{ margin-top: 14px; }
.timeline-imagen img{
  max-width: 420px;
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* TABLAS */
table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

table th, table td{
  border: 1px solid #cfd8dc;
  padding: 10px;
  text-align: left;
}

table th{
  background: rgba(14,165,164,.10);
  color: var(--text);
}

/* IMÁGENES */
img{
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border-radius: 10px;
}

/* GALERÍA (GRID) */
.galeria{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.galeria figure{ text-align: center; }

.galeria figcaption{
  font-size: 0.92em;
  margin-top: 6px;
  color: var(--muted);
}

/* FORMULARIOS */
form{
  display: flex;
  flex-direction: column;
}

form label{
  margin-top: 10px;
  font-weight: 700;
}

form input, form textarea, form select{
  padding: 10px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

form input[type="submit"]{
  margin-top: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 800;
}

form input[type="submit"]:hover{
  filter: brightness(0.95);
}

/* CITAS */
blockquote{
  background: rgba(14,165,164,.08);
  border-left: 6px solid var(--primary-2);
  padding: 12px;
  margin: 15px 0;
  font-style: italic;
  border-radius: 12px;
}

q{ font-style: italic; }

/* FOOTER */
footer{
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: white;
  text-align: center;
  padding: 26px 15px;
  margin-top: 30px;
  position: static !important;
}

footer p{
  font-size: 0.95rem;
  letter-spacing: 0.4px;
}

footer a{
  color: white;
  text-decoration: none;
}

footer a:hover{
  text-decoration: underline;
}

/* BOTÓN VOLVER ARRIBA */
.to-top{
  position: fixed;
  right: 16px;
  bottom: 24px; 
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  font-weight: 900;
  transition: transform .15s ease;
}

.to-top:hover{ transform: translateY(-2px); }

/* MODAL GALERÍA */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 9999;
}

.modal.open{ display: grid; }

.modal img{
  max-width: min(900px, 95vw);
  max-height: 75vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}

.modal p{
  color: white;
  margin-top: 10px;
  text-align: center;
}

.modal-close{
  position: absolute;
  top: 14px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.18);
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* DETAILS / Acordeones  */
details{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  background: rgba(14,165,164,.06);
}

summary{
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

summary::-webkit-details-marker{ display: none; }

details[open]{ background: rgba(14,165,164,.10); }

/* ODS desplegables */
.ods-lista details{
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.ods-lista summary{
  font-weight: 700;
  color: var(--primary);
}

.ods-lista summary::before{
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.ods-lista details[open] summary::before{
  transform: rotate(90deg);
}

.ods-lista details p{
  margin-top: 10px;
  color: var(--muted);
}

/* RETO 7 DÍAS */
#reto ol{
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: dia;
}

#reto ol li{
  counter-increment: dia;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(14,165,164,.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

#reto ol li::before{
  content: counter(dia);
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 900;
}

/* AVISO ANÓNIMO */
.aviso-anonimo{
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.15);
  color: var(--text);
}

/* Arreglar listas dentro de details */
details ol,
details ul{
  margin-left: 0;
  padding-left: 22px;
}

details li{
  margin-bottom: 8px;
}

html{ scroll-padding-top: 80px; }
section{ scroll-margin-top: 80px; }

/* Enlaces: mismo color aunque estén visitados */

a,
a:visited {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header: nunca subrayar enlaces */
nav a:hover,
nav a:focus {
  text-decoration: none;
}

/* Flecha subir arriba: nunca subrayar ni cambiar estilo */
.to-top,
.to-top:visited,
.to-top:hover,
.to-top:focus{
  text-decoration: none;
  color: white;
}
