/* Cuerpo de Bomberos de Casablanca — sistema visual
   Paleta y tipografía derivadas del escudo real (1949): granate + bronce. */

:root {
  --garnet: #6b1220;
  --garnet-deep: #410b14;
  --garnet-ink: #2a0a10;
  --brass: #a8822f;
  --brass-bright: #d8b45a;
  --ivory: #faf7f0;
  --rosewash: #f4e7e2;
  --ink: #2a221d;
  --ink-soft: #5c5047;
  --sombra: rgba(42, 10, 16, 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(--brass-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(--garnet-ink);
  border-bottom: 3px solid var(--brass);
  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: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ivory);
  padding: 2px;
  box-shadow: 0 0 0 2px var(--brass);
  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(--brass-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: #e6d9cf;
  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(--brass-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(--garnet-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, 247, 240, 0.12);
  }
}

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

.hero-ceremonial {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(216, 180, 90, 0.18), transparent 55%),
    linear-gradient(160deg, var(--garnet) 0%, var(--garnet-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(--brass);
  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: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.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: #e9dccf;
}

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

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

.hero-pagina {
  background: linear-gradient(160deg, var(--garnet) 0%, var(--garnet-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: #e9dccf;
  max-width: 520px;
  margin: 0 auto;
}

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

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

.btn:hover {
  background: var(--brass-bright);
  border-color: var(--brass-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(--garnet-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(--garnet);
}

.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(--rosewash);
}

.placeholder-note {
  font-style: italic;
  color: #8a7b6e;
  font-size: 0.85rem;
}

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

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

.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(168, 130, 47, 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(--brass-bright);
  line-height: 1;
}

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

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

.placa {
  background: var(--ivory);
  border: 1px solid #e4d4c3;
  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 #e4d4c3;
}

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

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

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

.placa dt {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--garnet);
  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(--garnet);
  margin-bottom: 0.75rem;
}

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

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

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

.servicio-fila .cruz {
  color: var(--brass);
  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;
}

/* ---------- Roster de compañías ---------- */

.roster {
  border-top: 1px solid #d8c4ae;
}

.roster-fila {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 0.5rem;
  border-bottom: 1px solid #d8c4ae;
  transition: background var(--duracion-transicion);
}

.roster-fila:hover {
  background: var(--rosewash);
}

.roster-numero {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--brass);
  min-width: 3rem;
}

.roster-cruz {
  color: var(--brass);
  min-width: 3rem;
}

.roster-info h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--garnet);
}

.roster-info p {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* ---------- 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 #c9b49a;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a4917d;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

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

/* ---------- Formulario voluntario ---------- */

.form-box {
  background: var(--ivory);
  border: 1px solid #e4d4c3;
  border-radius: 4px;
  padding: 2.25rem;
  max-width: 640px;
  margin: 0 auto;
}

.form-box h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--garnet);
  font-size: 0.92rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid #c9b49a;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: 2px solid var(--brass-bright);
  border-color: var(--brass);
}

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

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

.requisitos li .cruz {
  color: var(--brass);
  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 #e4d4c3;
  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 #e4d4c3;
}

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

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

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

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

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

.footer-grid h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brass-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: #94806f;
  border-top: 1px solid rgba(168, 130, 47, 0.3);
  padding-top: 1.1rem;
}

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

.timeline {
  border-left: 1px solid var(--brass);
  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(--brass);
  border-radius: 50%;
}

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

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

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

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