/**
 * Consecratio Mundi - Modular Block System (.cb-*)
 * Estilos encapsulados para el constructor de bloques y páginas dinámicas
 */

/* ==========================================================================
   1. CONTENEDORES Y TIPOGRAFÍA BASE DE BLOQUES
   ========================================================================== */
.cb-section {
  padding: 60px 20px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .cb-section {
    padding: 38px 16px;
  }
}

.cb-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  box-sizing: border-box;
}

.cb-container-narrow {
  max-width: 860px;
}

.cb-container-wide {
  max-width: 1360px;
}

/* ==========================================================================
   2. FONDOS DE SECCIÓN (TEMAS VISUALES)
   ========================================================================== */
/* Fondo Azul Consecratio */
.cb-bg-navy {
  background: linear-gradient(145deg, #0b1e3d 0%, #061124 100%);
  color: #e2e8f0;
}

.cb-bg-navy h1, .cb-bg-navy h2, .cb-bg-navy h3, .cb-bg-navy h4 {
  color: #fff;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.cb-bg-navy p, .cb-bg-navy li {
  color: #cbd5e1;
  line-height: 1.7;
}

.cb-bg-navy a {
  color: #bfa15f;
  text-decoration: underline;
}

/* Fondo Crema Sacro */
.cb-bg-cream {
  background-color: #fcf9f2;
  color: #334155;
  border-top: 1px solid rgba(191, 161, 95, 0.2);
  border-bottom: 1px solid rgba(191, 161, 95, 0.2);
}

.cb-bg-cream h1, .cb-bg-cream h2, .cb-bg-cream h3, .cb-bg-cream h4 {
  color: #0b1e3d;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.cb-bg-cream p, .cb-bg-cream li {
  color: #475569;
  line-height: 1.75;
}

/* Fondo Blanco */
.cb-bg-white {
  background-color: #ffffff;
  color: #1e293b;
}

.cb-bg-white h1, .cb-bg-white h2, .cb-bg-white h3, .cb-bg-white h4 {
  color: #0b1e3d;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.cb-bg-white p, .cb-bg-white li {
  color: #475569;
  line-height: 1.75;
}

/* ==========================================================================
   3. SISTEMA DE COLUMNAS FLEXIBLES (1, 2, 3 Y 4 COLS)
   ========================================================================== */
.cb-row {
  display: grid;
  gap: 28px;
  width: 100%;
}

.cb-cols-1 {
  grid-template-columns: 1fr;
}

.cb-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cb-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cb-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
  .cb-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .cb-cols-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .cb-cols-4, .cb-cols-3, .cb-cols-2 {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.cb-col-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cb-bg-navy .cb-col-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cb-col-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   4. BLOQUE HERO BANNER (.cb-hero)
   ========================================================================== */
.cb-hero {
  position: relative;
  background: linear-gradient(135deg, #0b1e3d 0%, #152d59 60%, #071326 100%);
  color: #fff;
  padding: 80px 20px 70px;
  text-align: center;
  overflow: hidden;
  border-bottom: 3px solid #bfa15f;
}

.cb-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(191, 161, 95, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cb-hero-tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #bfa15f;
  font-weight: 700;
  margin-bottom: 12px;
}

.cb-hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  color: #ffffff;
  margin: 0 auto 16px;
  max-width: 900px;
  line-height: 1.15;
}

.cb-hero-excerpt {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #cbd5e1;
  max-width: 760px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.cb-hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.cb-btn-primary {
  background: #bfa15f;
  color: #0b1e3d !important;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cb-btn-primary:hover {
  background: #d4b875;
  transform: translateY(-2px);
}

.cb-btn-outline {
  background: transparent;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cb-btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

/* ==========================================================================
   5. BLOQUE BUSCADOR (.cb-search)
   ========================================================================== */
.cb-search-widget {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  padding: 6px 8px 6px 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  max-width: 680px;
  margin: 0 auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cb-search-widget:focus-within {
  border-color: #bfa15f;
  box-shadow: 0 8px 24px rgba(191, 161, 95, 0.25);
}

.cb-search-icon {
  color: #bfa15f;
  font-size: 1.15rem;
  margin-right: 12px;
}

.cb-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #0f172a;
  background: transparent;
  min-width: 140px;
}

.cb-search-btn {
  background: #0b1e3d;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.cb-search-btn:hover {
  background: #1e3a6d;
}

/* ==========================================================================
   6. BLOQUE CITA PATRÍSTICA / LEMA (.cb-quote)
   ========================================================================== */
.cb-quote-box {
  position: relative;
  padding: 36px 40px;
  border-left: 4px solid #bfa15f;
  background: rgba(191, 161, 95, 0.06);
  border-radius: 0 12px 12px 0;
  margin: 24px 0;
}

.cb-bg-navy .cb-quote-box {
  background: rgba(255, 255, 255, 0.04);
  border-left-color: #bfa15f;
}

.cb-quote-mark {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: #bfa15f;
  opacity: 0.4;
  position: absolute;
  top: 14px;
  left: 14px;
}

.cb-quote-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  line-height: 1.45;
  margin: 0 0 14px;
}

.cb-quote-author {
  font-size: 0.95rem;
  font-weight: 700;
  color: #bfa15f;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cb-quote-source {
  font-size: 0.85rem;
  color: #64748b;
  font-style: normal;
}

/* ==========================================================================
   7. BLOQUE GALERÍA GRID (.cb-gallery)
   ========================================================================== */
.cb-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.cb-gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.cb-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.cb-gallery-item:hover img {
  transform: scale(1.06);
}

.cb-gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  background: linear-gradient(to top, rgba(11, 30, 61, 0.9), transparent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cb-gallery-item:hover .cb-gallery-caption {
  transform: translateY(0);
}

/* ==========================================================================
   8. BLOQUE CARRUSEL / SLIDER (.cb-carousel)
   ========================================================================== */
.cb-carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.cb-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cb-carousel-track::-webkit-scrollbar {
  display: none;
}

.cb-carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.cb-carousel-slide-content {
  background: rgba(11, 30, 61, 0.85);
  color: #fff;
  padding: 30px 40px;
  border-radius: 10px;
  max-width: 680px;
  margin: 20px;
  border-left: 4px solid #bfa15f;
  text-align: center;
}

.cb-carousel-ctrl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  border: none;
  font-size: 1.2rem;
  color: #0b1e3d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  transition: all 0.2s ease;
}

.cb-carousel-ctrl:hover {
  background: #bfa15f;
  color: #fff;
}

.cb-carousel-ctrl.prev { left: 16px; }
.cb-carousel-ctrl.next { right: 16px; }

/* ==========================================================================
   9. BLOQUE ACORDEÓN / FAQ (.cb-accordion)
   ========================================================================== */
.cb-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.cb-accordion-item {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cb-bg-navy .cb-accordion-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.cb-accordion-item[open] {
  border-color: #bfa15f;
  box-shadow: 0 4px 14px rgba(191, 161, 95, 0.12);
}

.cb-accordion-header {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0b1e3d;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.cb-bg-navy .cb-accordion-header {
  color: #fff;
}

.cb-accordion-header::-webkit-details-marker {
  display: none;
}

.cb-accordion-header::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.85rem;
  color: #bfa15f;
  transition: transform 0.25s ease;
}

.cb-accordion-item[open] .cb-accordion-header::after {
  transform: rotate(180deg);
}

.cb-accordion-body {
  padding: 0 20px 20px;
  color: #475569;
  line-height: 1.65;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}

.cb-bg-navy .cb-accordion-body {
  color: #cbd5e1;
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   10. TARJETAS / PILARES (.cb-cards)
   ========================================================================== */
.cb-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(191, 161, 95, 0.15);
  color: #bfa15f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.cb-card-title {
  font-size: 1.25rem;
  margin: 0 0 10px;
  font-weight: 700;
}

.cb-card-text {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}
