﻿/*
  Archivo documentado para el proyecto Autocolca.
  Archivo: style.css
  Para que sirve: Estilos de la pagina principal del directorio institucional: encabezado, navegacion, secciones, tarjetas y pie de pagina.

  Guia rapida de lectura:
  - Variables generales de color
  - Configuracion base del sitio
  - Header fijo y menu principal
  - Secciones de contenido
  - Tarjetas, botones e imagenes
  - Footer
  - Ajustes responsive

  Nota: estos comentarios solo ordenan y explican el codigo.
  No cambian el diseno ni el funcionamiento de la pagina.
*/
:root {
  --green-900: #0f3d2a;
  --green-800: #155337;
  --green-700: #1f6b46;
  --green-600: #2f8f5b;
  --green-100: #e9f5ee;
  --ink: #1f2f27;
  --muted: #607267;
  --line: #dce7df;
  --paper: #ffffff;
  --soft: #f4f7f2;
  --sand: #f3efe4;
  --gold: #ad7a2e;
  --blue: #2d6f8c;
  --wine: #8b4b5a;
  --shadow: 0 16px 34px rgba(15, 61, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.90), rgba(244,247,242,0.94)),
    url("../img/fondo.png") center/cover fixed no-repeat;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

#main-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 92px;
  min-height: 92px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 61, 42, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  min-width: 390px;
}

.logo {
  width: 210px;
  height: 210px;
  object-fit: contain;
  transform: translate(-30px, -36px);
}

.brand strong {
  display: block;
  color: var(--green-800);
  font-size: 1.18rem;
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.brand span {
  transform: translate(-58px, -2px);
}

.menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.menu ul {
  display: flex;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--green-900);
  font-weight: 700;
  font-size: 0.94rem;
}

.menu a:hover {
  background: var(--green-100);
}

.logos-container {
  display: flex;
  justify-content: flex-end;
  min-width: 170px;
}

.logos {
  max-width: 170px;
  height: 56px;
  object-fit: contain;
}

#inicio,
#distritos,
#servicios,
#mapa,
#galeria {
  scroll-margin-top: 104px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: end;
  gap: 28px;
  min-height: calc(100vh - 82px);
  padding: clamp(52px, 7vw, 92px) clamp(18px, 6vw, 82px) 48px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(90deg, rgba(15, 61, 42, 0.95) 0%, rgba(15, 61, 42, 0.80) 44%, rgba(15, 61, 42, 0.35) 100%),
    url("../img/fondo.png") center/cover no-repeat;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  width: min(980px, 92%);
  height: 46px;
  transform: translateX(-50%);
  background: url("../img/bordado.png") center/contain no-repeat;
  opacity: 0.85;
  pointer-events: none;
}

.hero::before {
  top: 18px;
}

.hero::after {
  bottom: 44px;
}

.hero-media {
  position: absolute;
  right: clamp(18px, 6vw, 92px);
  bottom: 126px;
  width: min(24vw, 230px);
  aspect-ratio: 1;
  background: url("../img/vicuña2.png") center/contain no-repeat;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.22));
  opacity: 0.9;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 850px;
}

.eyebrow,
.section-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow {
  color: #eaf8ef;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 18px;
  font-size: clamp(2.6rem, 6vw, 5.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.90);
  font-size: clamp(1.04rem, 1.9vw, 1.35rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

.btn-primary {
  background: white;
  color: var(--green-900);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: white;
}

.hero-panel {
  position: relative;
  z-index: 1;
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hero-panel strong,
.hero-panel span {
  display: block;
}

.hero-panel strong {
  color: var(--green-800);
  margin-bottom: 8px;
}

.hero-panel span {
  color: var(--muted);
  line-height: 1.55;
}

.institution-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(1120px, calc(100% - 36px));
  margin: -26px auto 34px;
  position: relative;
  z-index: 2;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.institution-strip article {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.institution-strip article:last-child {
  border-right: 0;
}

.institution-strip strong,
.institution-strip span {
  display: block;
}

.institution-strip strong {
  color: var(--green-800);
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.institution-strip span {
  color: var(--muted);
  line-height: 1.45;
}

.section-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto 34px;
  padding: 42px 0;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 780px;
  margin: 0 auto 26px;
  text-align: center;
}

.section-heading.align-left {
  align-items: flex-start;
  margin-left: 0;
  text-align: left;
}

.section-heading.align-left .section-tag {
  margin-left: 0;
  margin-right: 0;
}

.section-tag {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--green-800);
  background: var(--green-100);
  margin: 0 auto 8px;
}

.section-heading h2 {
  position: relative;
  display: block;
  padding-bottom: 24px;
  margin: 0 0 12px;
  color: var(--green-900);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
}

.section-heading h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 280px;
  max-width: 92vw;
  height: 20px;
  transform: translateX(-50%);
  background: url("../img/bordado2.svg") center/contain no-repeat;
  opacity: 0.86;
  pointer-events: none;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.distritos-section,
.services-overview,
.mapa-section,
.galeria-section {
  padding: 42px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.distritos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.distritos-col {
  min-height: 100%;
  padding: 22px 18px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent, var(--green-600));
}

.distritos-col h3 {
  margin: 0 0 16px;
  color: var(--accent-dark, var(--green-900));
  font-size: 1.14rem;
}

.distritos-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.distritos-col li + li {
  margin-top: 8px;
}

.distritos-col a,
.district-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  background: #f8faf7;
  border: 1px solid #edf2ed;
  font-weight: 700;
}

.district-pending {
  color: #7a857e;
  background: #f2f5f2;
}

.district-pending small {
  color: #8b968f;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.distritos-col a:hover {
  color: white;
  background: var(--accent, var(--green-600));
  border-color: var(--accent, var(--green-600));
}

.margen-izquierda {
  --accent: var(--green-600);
  --accent-dark: var(--green-800);
}

.margen-derecha {
  --accent: var(--blue);
  --accent-dark: #204f65;
}

.parte-alta {
  --accent: var(--gold);
  --accent-dark: #754e1f;
}

.parte-baja {
  --accent: var(--wine);
  --accent-dark: #673642;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.service-grid article {
  padding: 20px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.service-grid strong,
.service-grid span {
  display: block;
}

.service-grid strong {
  color: var(--green-800);
  margin-bottom: 8px;
  font-size: 1.04rem;
}

.service-grid span {
  color: var(--muted);
  line-height: 1.55;
}

.map-container {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31, 47, 39, 0.08);
}

.visual-gallery {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  grid-auto-rows: 220px;
  gap: 14px;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f8faf7;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31, 47, 39, 0.08);
}

.gallery-card-large {
  grid-row: span 2;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Las imagenes de Identidad visual usan el mismo estilo del cuadro Valle del Colca. */
.gallery-card:not(.gallery-card-large) img {
  object-fit: cover;
  padding: 0;
  background: transparent;
}

.gallery-card div {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  color: white;
  background: rgba(15, 61, 42, 0.82);
  backdrop-filter: blur(8px);
}

.gallery-card strong,
.gallery-card span {
  display: block;
}

.gallery-card strong {
  font-size: 1rem;
  margin-bottom: 3px;
}

.gallery-card span {
  color: rgba(255,255,255,0.86);
  font-size: 0.88rem;
  line-height: 1.4;
}

footer {
  padding: 28px 18px 34px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.70);
  border-top: 1px solid var(--line);
}

@media (max-width: 1080px) {
  .brand {
    min-width: 190px;
  }

  .menu a {
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 120px;
  }

  .hero-panel {
    position: static;
    max-width: 420px;
    margin-top: 20px;
  }

  .distritos-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visual-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-card-large {
    grid-row: span 1;
  }
}

@media (max-width: 720px) {
  #main-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: auto;
    height: auto;
    padding: 10px 14px 12px;
  }

  .brand {
    justify-content: center;
    min-width: 0;
    width: 100%;
    gap: 8px;
  }

  .logo {
    width: 86px;
    height: 86px;
    transform: translateY(-14px);
  }

  .brand span {
    transform: translateX(-18px);
  }

  .brand strong {
    font-size: 1rem;
  }

  .brand small {
    font-size: 0.72rem;
  }

  .menu {
    position: static;
    left: auto;
    transform: none;
    width: 100%;
  }

  .menu ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .menu a {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  #inicio,
  #distritos,
  #servicios,
  #mapa,
  #galeria {
    scroll-margin-top: 132px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 82px 18px 66px;
  }

  .hero-content {
    display: contents;
  }

  .hero::before,
  .hero::after {
    left: 50%;
    width: min(320px, 82vw);
    height: 32px;
    transform: translateX(-50%);
    opacity: 0.58;
  }

  .hero::before {
    top: 14px;
  }

  .hero::after {
    bottom: 14px;
  }

  .hero-media {
    position: relative;
    right: auto;
    bottom: auto;
    display: block;
    width: min(230px, 70vw);
    min-height: 172px;
    justify-self: center;
    order: 5;
    opacity: 0.94;
  }

  .eyebrow {
    order: 1;
    justify-self: start;
  }

  .hero h1 {
    order: 2;
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .hero p {
    order: 3;
  }

  .hero-actions {
    order: 4;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
  }

  .hero-panel {
    order: 6;
    width: min(100%, 360px);
    justify-self: center;
    text-align: center;
    padding: 16px;
  }

  .btn-primary,
  .btn-secondary {
    width: auto;
    flex: 1 1 0;
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .institution-strip {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 520px);
    margin-top: -18px;
  }

  .institution-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .institution-strip article:last-child {
    border-bottom: 0;
  }

  .section-shell {
    width: min(100% - 28px, 520px);
    padding: 34px 18px;
    margin-bottom: 26px;
  }

  .section-heading h2 {
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }

  .section-heading h2::after {
    width: 210px;
  }

  .distritos-section,
  .services-overview,
  .mapa-section,
  .galeria-section {
    padding: 28px 16px;
  }

  .distritos-grid,
  .service-grid,
  .visual-gallery {
    grid-template-columns: 1fr;
  }

  .distritos-col,
  .service-grid article {
    padding: 18px 14px;
  }

  .distritos-col a,
  .district-pending {
    min-height: 44px;
  }

  .visual-gallery {
    grid-auto-rows: 220px;
  }

  .gallery-card-large {
    grid-row: span 1;
  }

  .map-container iframe {
    height: 340px;
  }
}