:root {
  --azul-oscuro: #0D1B2A;
  --azul: #1B9AAA;
  --cian: #90E0EF;
  --fondo-card: #12263A;
  --gris-claro: #F5F5F5;
  --dorado: #FFD700;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--azul-oscuro);
  color: var(--gris-claro);
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
}

header {
  background: var(--azul);
  color: #fff;
  padding: 1.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 8px rgba(0,0,0,0.16);
}

.logo {
  font-size: 2.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 1rem;
}

header nav {
  display: flex;
  gap: 1.5rem;
}

header nav a {
  color: #fff;
  font-size: 1.4rem;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: background 0.18s;
}
header nav a:hover {
  background: var(--cian);
  color: var(--azul-oscuro);
}

.feed-main {
  max-width: 600px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

h2 {
  font-size: 2.1rem;
  color: var(--cian);
  text-align: center;
  margin-bottom: 2rem;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.card {
  background: var(--fondo-card);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.13);
  padding: 1.4rem 1.1rem 1.2rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 10px;
}

/* CONTENEDOR FLEXIBLE PARA LA IMAGEN */
.card .img-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  border-radius: 8px;
  min-height: 200px;
  max-height: 420px;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* O usa 'cover' si quieres que llene recortando */
  background: #222;
  border-radius: 8px;
  display: block;
}

.card h3 {
  font-size: 1.6rem;
  color: var(--cian);
  margin-bottom: 0.5rem;
}

.card .meta {
  color: var(--cian);
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 1.19rem;
  color: #eaeaea;
}

.card .acciones {
  display: flex;
  gap: 1.1rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.card .acciones a,
.card .acciones button {
  background: var(--azul);
  color: #fff;
  padding: 0.85rem 1.3rem;
  border: none;
  border-radius: 8px;
  font-size: 1.19rem;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  transition: background 0.18s;
}
.card .acciones a:hover,
.card .acciones button:hover {
  background: var(--cian);
  color: var(--azul-oscuro);
}

svg.icono-btn {
  width: 1.32em;
  height: 1.32em;
  vertical-align: middle;
  fill: currentColor;
}

.btn-volver {
  margin-top: 1.6rem;
  display: block;
  background: var(--azul);
  color: #fff;
  padding: 0.9rem 1.6rem;
  border-radius: 10px;
  font-size: 1.2rem;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: background 0.18s;
}
.btn-volver:hover {
  background: var(--cian);
  color: var(--azul-oscuro);
}

/* RESPONSIVE */
@media (max-width: 700px) {
  .feed-main { max-width: 99vw; }
  .card .img-wrapper { min-height: 130px; max-height: 190px; }
  h2 { font-size: 1.5rem; }
  header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .logo { font-size: 1.6rem; }
}

/* Para que todo sea aún más flexible en móviles */
@media (max-width: 400px) {
  .card .img-wrapper { min-height: 80px; max-height: 110px; }
  .card h3 { font-size: 1.1rem; }
  .card p, .card .meta { font-size: 0.92rem; }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem 0.8rem;
    gap: 0.7rem;
  }
  .logo {
    width: 100%;
    font-size: 1.3rem;
    justify-content: flex-start;
    gap: 0.7rem;
  }
  header nav {
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    align-items: flex-start;
  }
  header nav a, header nav span {
    font-size: 1.13rem;
    padding: 0.7rem 0.9rem;
    width: 100%;
    display: block;
  }
}

@media (max-width: 600px) {
  .logo {
    justify-content: center;
    text-align: center;
    width: 100%;
  }
  header nav {
    align-items: center;
  }
}

#municipio-select {
  appearance: none;
  -webkit-appearance: none;
  background: #1B9AAA;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.7em 2.4em 0.7em 1em;
  font-size: 1.08em;
  font-weight: 600;
  margin: 0 0.2em;
  outline: none;
  box-shadow: 0 2px 10px #0d1b2a16;
  cursor: pointer;
  transition: background .22s;
  position: relative;
}
#municipio-select:hover, #municipio-select:focus {
  background: #15788f;
  color: #fff;
}

#municipio-select option {
  color: #222;
  background: #fff;
}

/* Modal WebView */
#webview-modal {
  display: none;
  position: fixed; z-index: 99999; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.92); align-items: center; justify-content: center;
  transition: opacity .24s;
}
#webview-modal .webview-content {
  background: #fff; border-radius: 14px; width: 95vw; max-width: 600px; height: 82vh;
  box-shadow: 0 5px 40px #0006; overflow: hidden; display: flex; flex-direction: column; position: relative;
}
#webview-iframe {
  border: none; width: 100%; flex: 1; min-height: 340px;
}
#webview-close {
  position: absolute; right: 14px; top: 12px; background: #FC6161; color: #fff; border: none;
  border-radius: 9px; padding: 0.5em 1.4em; font-weight: bold; font-size: 1.13rem; z-index: 10; cursor: pointer;
  transition: background 0.2s;
}
#webview-close:hover { background: #e54040; }
.desc-link-externa, .desc-link-redsocial {
  color: #1467cc; text-decoration: underline; word-break: break-all;
  font-weight: bold;
}
.desc-link-redsocial {
  color: #2784D5;
}
