/* Bomba Casablanca — Segunda Compañía — sistema visual
   Paleta y tipografía derivadas del escudo real de la compañía: azul y amarillo. */

:root {
  --blue: #1d5fa6;
  --blue-deep: #124074;
  --blue-ink: #0b2a4d;
  --gold: #ffd500;
  --gold-bright: #ffe14d;
  --gold-dark: #a88400;
  --ivory: #faf9f5;
  --skywash: #e8f1fb;
  --ink: #1c232b;
  --ink-soft: #4f5b68;
  --sombra: rgba(11, 42, 77, 0.16);
  --duracion-transicion: 0.2s;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  :root {
    --duracion-transicion: 0.01ms;
    --anillo-animacion: none;
  }

  .cresta-anillo {
    opacity: 1;
  }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-angosto {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Motivo cruz (del escudo) ---------- */

.cruz {
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--blue-ink);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--ivory);
  flex-shrink: 0;
}

.brand img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-size: 0.76rem;
  color: var(--gold-bright);
  display: block;
  margin-top: 0.1rem;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ivory);
  font-size: 1.6rem;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .brand-text h1 {
    font-size: 0.92rem;
  }

  .brand-text span {
    font-size: 0.68rem;
  }
}

.main-nav ul {
  display: flex;
  gap: 1.75rem;
}

.main-nav a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: #cfe0f2;
  padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: border-color var(--duracion-transicion), color var(--duracion-transicion);
}

.main-nav a:hover,
.main-nav a.active {
  border-color: var(--gold-bright);
  color: var(--ivory);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duracion-transicion) ease;
    background: var(--blue-deep);
  }

  .main-nav.open {
    max-height: 400px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
  }

  .main-nav a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(250, 249, 245, 0.12);
  }
}

/* ---------- Hero ceremonial (Inicio) ---------- */

.hero-ceremonial {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 213, 0, 0.18), transparent 55%),
    linear-gradient(160deg, var(--blue) 0%, var(--blue-ink) 100%);
  color: var(--ivory);
  text-align: center;
  padding: 4.5rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.cresta-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 1.75rem;
}

.cresta-anillo {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: var(--anillo-animacion, anillo-revela) 1.1s ease-out 0.15s forwards;
}

@keyframes anillo-revela {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cresta-wrap img {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.hero-ceremonial h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  max-width: 680px;
  margin: 0 auto 0.9rem;
  line-height: 1.18;
}

.hero-ceremonial p {
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2rem;
  color: #dcebfa;
}

.hero-acciones {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* Hero de Inicio: corte diagonal + composición a dos columnas en escritorio */

.hero-inicio {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 90%);
  padding-bottom: 6.5rem;
}

.hero-inicio + .ledger {
  position: relative;
  z-index: 2;
  margin-top: -4.5rem;
}

@media (min-width: 900px) {
  .hero-inicio .container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 2.5rem;
    text-align: left;
  }

  .hero-inicio .cresta-wrap {
    order: 2;
    width: 230px;
    height: 230px;
    margin: 0 auto;
  }

  .hero-inicio .cresta-wrap img {
    inset: 26px;
    width: calc(100% - 52px);
    height: calc(100% - 52px);
  }

  .hero-inicio .hero-texto {
    order: 1;
  }

  .hero-inicio h2,
  .hero-inicio p {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-inicio .hero-acciones {
    justify-content: flex-start;
  }
}

/* Hero compacto (páginas internas) */

.hero-pagina {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-ink) 100%);
  color: var(--ivory);
  padding: 3rem 1.5rem;
  text-align: center;
}

.hero-pagina h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  margin-bottom: 0.5rem;
}

.hero-pagina p {
  color: #dcebfa;
  max-width: 520px;
  margin: 0 auto;
}

.compania-apodo {
  font-style: italic;
  color: var(--gold-bright);
  margin-bottom: 0.4rem;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  background: var(--gold);
  color: var(--blue-ink);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.7rem;
  border: 1px solid var(--gold);
  border-radius: 3px;
  transition: background var(--duracion-transicion), border-color var(--duracion-transicion), transform var(--duracion-transicion);
}

.btn:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--ivory);
  color: var(--ivory);
}

.btn-outline:hover {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--blue-ink);
}

/* ---------- Secciones generales ---------- */

section {
  padding: 4rem 0;
}

.section-title {
  margin-bottom: 2.25rem;
}

.section-title.centrado {
  text-align: center;
}

.section-title h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--blue);
}

.section-title:not(.centrado) h2 {
  padding-left: 1rem;
  border-left: 4px solid var(--blue);
}

.section-title.centrado h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  background: var(--gold);
  margin: 0.65rem auto 0;
}

.section-title p {
  color: var(--ink-soft);
  margin-top: 0.4rem;
  max-width: 560px;
}

.section-title.centrado p {
  margin-left: auto;
  margin-right: auto;
}

.alt-bg {
  background: var(--skywash);
}

.placeholder-note {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ---------- Ledger de estadísticas ---------- */

.ledger {
  background: var(--blue-ink);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.ledger-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.ledger-item {
  flex: 1 1 160px;
  text-align: center;
  padding: 2rem 1.25rem;
  border-left: 1px solid rgba(255, 213, 0, 0.4);
}

.ledger-item:first-child {
  border-left: none;
}

.ledger-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.4rem;
  color: var(--gold-bright);
  line-height: 1;
}

.ledger-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: #c3d6ea;
}

/* ---------- Información institucional (definición) ---------- */

.placa {
  background: var(--ivory);
  border: 1px solid #d6e2ef;
  border-radius: 4px;
}

.placa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.placa-col {
  padding: 1.75rem 2rem;
  border-left: 1px solid #d6e2ef;
}

.placa-col:first-child {
  border-left: none;
}

@media (max-width: 700px) {
  .placa-col {
    border-left: none;
    border-top: 1px solid #d6e2ef;
  }

  .placa-col:first-child {
    border-top: none;
  }
}

.placa dt {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--blue);
  font-size: 0.74rem;
  letter-spacing: 0.3px;
}

.placa dd {
  margin: 0.15rem 0 1.1rem;
  font-size: 1.02rem;
}

.placa dd:last-child {
  margin-bottom: 0;
}

/* ---------- ¿Qué hacemos? ---------- */

.servicios-layout {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 760px) {
  .servicios-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.servicios-intro h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.servicios-intro p {
  color: var(--ink-soft);
}

.servicios-lista {
  border-top: 1px solid #d6e2ef;
}

.servicio-fila {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid #d6e2ef;
}

.servicio-fila .cruz {
  color: var(--gold-dark);
  margin-top: 0.2rem;
}

.servicio-fila h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.servicio-fila p {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* ---------- Galería ---------- */

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.galeria-item {
  background: var(--ivory);
  border: 1px dashed #a9c3dd;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.galeria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* ---------- Lightbox ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 35, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}

.lightbox-overlay.abierto {
  display: flex;
}

.lightbox-imagen {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  object-fit: contain;
  border: 2px solid var(--gold);
}

.lightbox-cerrar,
.lightbox-anterior,
.lightbox-siguiente {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--ivory);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem 1rem;
}

.lightbox-cerrar {
  top: 1rem;
  right: 1.5rem;
}

.lightbox-anterior {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-siguiente {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-cerrar:hover,
.lightbox-anterior:hover,
.lightbox-siguiente:hover {
  color: var(--gold-bright);
}

.requisitos {
  list-style: none;
  border-top: 1px solid #d6e2ef;
}

.requisitos li {
  padding: 0.7rem 0;
  border-bottom: 1px solid #d6e2ef;
  display: flex;
  gap: 0.7rem;
}

.requisitos li .cruz {
  color: var(--gold-dark);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ---------- Contacto ---------- */

.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 760px) {
  .contacto-grid {
    grid-template-columns: 1fr;
  }
}

.mapa-wrap {
  border: 1px solid #d6e2ef;
  border-radius: 4px;
  overflow: hidden;
}

.mapa-wrap iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
}

.contacto-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #d6e2ef;
}

.contacto-item:first-child {
  padding-top: 0;
}

.contacto-item .cruz {
  color: var(--gold-dark);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--blue-ink);
  color: #b7cce3;
  padding: 3rem 0 1.4rem;
  margin-top: 2rem;
  border-top: 3px solid var(--gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold-bright);
  margin-bottom: 0.8rem;
  font-size: 1.02rem;
}

.footer-grid ul li {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

.footer-grid a:hover {
  color: var(--ivory);
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: #7d93ac;
  border-top: 1px solid rgba(255, 213, 0, 0.3);
  padding-top: 1.1rem;
}

/* ---------- Historia (línea de tiempo) ---------- */

.timeline {
  border-left: 1px solid var(--gold);
  margin-left: 0.6rem;
  padding-left: 1.75rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.25rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.05rem;
  top: 0.4rem;
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 50%;
}

.timeline-item h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 0.25rem;
}

.timeline-item p {
  color: var(--ink-soft);
}

/* ---------- Organigrama ---------- */

.organigrama-nivel {
  margin-bottom: 2.75rem;
}

.organigrama-nivel:last-child {
  margin-bottom: 0;
}

.organigrama-nivel h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--blue);
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--gold);
}

.cargos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.cargo-card {
  background: var(--ivory);
  border: 1px solid #d6e2ef;
  border-top: 3px solid var(--gold);
  border-radius: 4px;
  padding: 1.35rem;
  text-align: center;
}

.cargo-titulo {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 0.3px;
  margin-bottom: 0.4rem;
}

.cargo-nombre {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.cargo-nombre.cargo-pendiente {
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  color: var(--ink-soft);
}

.cargo-card:has(.cargo-pendiente) {
  border-top-color: #d6e2ef;
}

.cargo-email {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: var(--blue);
  white-space: nowrap;
}

.cargo-email:hover {
  text-decoration-color: var(--gold);
}

/* ---------- Organigrama en árbol ---------- */

.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-parent {
  width: 100%;
  max-width: 260px;
}

.org-parent .cargo-titulo {
  color: var(--blue);
}

.org-stem {
  width: 1px;
  height: 28px;
  background: var(--gold);
}

.org-children {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 1.5rem;
  border-top: 1px solid var(--gold);
  padding-top: 28px;
}

.org-child {
  position: relative;
  width: 190px;
}

.org-child::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 50%;
  width: 1px;
  height: 28px;
  background: var(--gold);
}

@media (max-width: 600px) {
  .org-children {
    border-top: none;
    padding-top: 0;
    gap: 1rem;
  }

  .org-child::before {
    display: none;
  }
}

.cargo-foto {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.6rem;
  border: 2px solid var(--gold);
}

/* ---------- Material Mayor ---------- */

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.material-card {
  background: var(--ivory);
  border: 1px solid #d6e2ef;
  border-top: 3px solid var(--blue);
  border-radius: 4px;
  padding: 1.5rem;
}

.material-foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.material-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--blue);
  margin-bottom: 0.9rem;
}

.material-datos {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.8rem;
}

.material-datos dt {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.material-datos dd {
  font-size: 0.95rem;
}

.material-nota {
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.9rem;
}

.material-en-preparacion {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- 404 ---------- */

.hero-ceremonial .btn + .btn-outline {
  margin-left: 0.8rem;
}

/* ---------- Formulario de Postulación ---------- */

.form-postulacion {
  display: grid;
  gap: 1.25rem;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.campo label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.campo input,
.campo textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #c7d4e2;
  border-radius: 3px;
  background: var(--ivory);
  color: var(--ink);
}

.campo input:focus,
.campo textarea:focus {
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
  border-color: var(--blue);
}

.campo textarea {
  resize: vertical;
  min-height: 110px;
}

.campo-fila {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .campo-fila {
    grid-template-columns: 1fr;
  }
}

.campo-consentimiento {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
}

.campo-consentimiento input {
  width: auto;
  margin-top: 0.2rem;
}

.campo-consentimiento label {
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.campo-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-mensaje {
  padding: 0.9rem 1.1rem;
  border-radius: 3px;
  font-size: 0.92rem;
  display: none;
}

.form-mensaje.visible {
  display: block;
}

.form-mensaje.exito {
  background: #e6f4ea;
  color: #1e6b36;
  border: 1px solid #b7ddc3;
}

.form-mensaje.error {
  background: #fbe9e7;
  color: #9c2c1f;
  border: 1px solid #f0bcb4;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
