/* Components — uses design tokens only.
   Updated to match designer PDFs (May 2026). */

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  text-align: center;
}

.section { padding: var(--space-8) 0; }
.section-tight { padding: var(--space-6) 0; }

@media (max-width: 768px) {
  :root { --container-pad: 16px; }
  .section { padding: var(--space-7) 0; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-navy-900);
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-4);
  font-weight: 600;
}

h1 { font-size: var(--text-h1); letter-spacing: var(--ls-tight); line-height: var(--lh-tight); }
h2 { font-size: var(--text-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p { margin: 0 0 var(--space-4); }
.small { font-size: var(--text-small); color: var(--color-muted); }

.kicker, .eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-gold-500);
  margin-bottom: var(--space-3);
}

@media (max-width: 768px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
  h4 { font-size: 18px; }
}

/* ---------- Links ---------- */
a { color: var(--color-navy-900); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.7);
  border-radius: 6px;
}

/* Gold action link with chevron — matches PDF "> Inscribirse" / "> Ver Horarios" */
.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-gold-500);
  text-decoration: none;
  font-size: var(--text-body);
}
.link-action::before { content: "›"; font-weight: 700; }
.link-action:hover { color: var(--color-gold-400); text-decoration: underline; }

/* ---------- Top Brand Ribbon (from PDFs) ---------- */
.brand-ribbon {
  background: var(--color-taupe-600);
  color: #fff;
  text-align: center;
  padding: 10px var(--container-pad);
  font-family: var(--font-body);
  font-size: var(--text-small);
  letter-spacing: 0.02em;
  font-weight: 500;
}
.brand-ribbon a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Header / Nav ---------- */
.header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo-img {
  height: 52px;
  width: auto;
  max-width: 340px;
  object-fit: contain;
  display: block;
}

@media (max-width: 640px) {
  .brand-logo-img { height: 42px; max-width: 260px; }
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 15px;
}

.nav a:hover { background: rgba(15, 46, 77, 0.06); color: var(--color-navy-900); text-decoration: none; }
.nav a.is-current { color: var(--color-navy-900); font-weight: 600; }

.lang-toggle-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-divider);
  background: var(--color-bg);
  color: var(--color-navy-900);
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}
.lang-toggle-btn:hover { background: var(--color-bg-subtle); border-color: var(--color-navy-900); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms, border-color 150ms, color 150ms, transform 150ms, opacity 150ms;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.7);
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--color-navy-900); color: #fff; }
.btn-primary:hover { background: var(--color-navy-800); }

.btn-secondary {
  background: #fff;
  color: var(--color-navy-900);
  border-color: var(--color-navy-900);
}
.btn-secondary:hover { background: var(--color-bg-subtle); }

.btn-taupe {
  background: var(--color-taupe-600);
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.btn-taupe:hover { background: var(--color-taupe-500); }

.btn-ghost { background: transparent; color: var(--color-navy-900); }
.btn-ghost:hover { background: rgba(15, 46, 77, 0.06); }

/* Button row helper */
.btn-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.btn-row.left { justify-content: flex-start; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}
.card:hover { box-shadow: var(--shadow-md); }

/* Feature card — matches PDF sacraments/formation tiles */
.feature-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-card);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: background-color 180ms, transform 180ms;
}
.feature-card:hover { background: var(--color-card-bg-hover); transform: translateY(-1px); }

.feature-card-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-2);
  display: grid;
  place-items: center;
}
.feature-card-icon svg { width: 100%; height: 100%; }

.feature-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-navy-900);
  margin: 0;
  line-height: 1.25;
}

.feature-card-desc {
  font-size: 14px;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
  flex: 1 0 auto;
}

.feature-card-link {
  margin-top: var(--space-2);
}

@media (max-width: 768px) {
  .card { padding: var(--space-4); }
  .feature-card { padding: var(--space-5) var(--space-4); }
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
.label {
  display: block;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-divider);
  background: #fff;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 15px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-navy-900);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.6);
}

/* ---------- Hero image (static) ---------- */
.hero-image {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 420px;
  height: clamp(280px, 48vh, 540px);
  background: #000;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Hero carousel ---------- */
.carousel {
  position: relative;
  overflow: hidden;
  background: #000;
}
.carousel-viewport {
  position: relative;
  width: 100%;
  height: 480px;
  height: clamp(320px, 56vh, 640px);
}
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease;
}
.carousel-slide.is-active { opacity: 1; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(17,24,39,0.35);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
  font-size: 24px;
  line-height: 1;
}
.carousel-arrow:hover { background: rgba(17,24,39,0.55); }
.carousel-arrow.left { left: 16px; }
.carousel-arrow.right { right: 16px; }

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 6;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  padding: 0;
}
.carousel-dot.is-active { background: var(--color-gold-500); }

/* ---------- Page intro (centered title + lede + buttons) ---------- */
.page-intro {
  text-align: center;
  padding: var(--space-7) var(--container-pad);
  max-width: var(--container-narrow);
  margin: 0 auto;
}
.page-intro h1 {
  font-size: 40px;
  margin-bottom: var(--space-4);
  color: var(--color-navy-900);
}
.page-intro .lede {
  font-size: 18px;
  color: var(--color-text);
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto var(--space-5);
}
@media (max-width: 768px) {
  .page-intro { padding: var(--space-6) var(--container-pad); }
  .page-intro h1 { font-size: 30px; }
  .page-intro .lede { font-size: 16px; }
}

/* ---------- Shield divider (gold lines + diocese shield) ---------- */
.shield-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin: var(--space-6) auto;
  max-width: 900px;
  padding: 0 var(--container-pad);
}
.shield-divider::before,
.shield-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-gold-500);
  opacity: 0.6;
}
.shield-divider-img {
  width: 38px;
  height: auto;
  flex-shrink: 0;
  display: block;
}

/* ---------- Step row (4-col next-step from Formation PDF) ---------- */
.step-row-heading {
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-gold-500);
  margin-bottom: var(--space-5);
}
.step-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--container-pad);
  text-align: center;
}
.step-row-item-label {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-navy-900);
  margin-bottom: var(--space-2);
}
.step-row-item-desc {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
}
@media (max-width: 768px) {
  .step-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
}

/* ---------- Bottom CTA ---------- */
.cta-band {
  background: var(--color-bg);
  padding: var(--space-7) 0;
  text-align: center;
}
.cta-band-question {
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.cta {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
@media (max-width: 768px) {
  .cta-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Footer (kept navy from original) ---------- */
.footer {
  background: var(--color-navy-900);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-8) 0;
}
.footer a { color: rgba(255, 255, 255, 0.75); }
.footer a:hover { color: #fff; text-decoration: underline; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
  justify-items: center;
  text-align: center;
}

.footer-logo {
  display: grid;
  place-items: center;
}
.footer-logo-img {
  height: 64px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  display: block;
  background: transparent;
}

.footer-links { display: grid; gap: var(--space-2); }
.footer-social { display: flex; gap: var(--space-4); align-items: center; }
.footer-meta {
  font-size: var(--text-small);
  color: rgba(255, 255, 255, 0.65);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
  z-index: 50;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

/* Centered single card in 2-col grid (used for odd-count grids) */
.feature-card-centered {
  grid-column: 1 / -1;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 640px) {
  .feature-card-centered { max-width: 100%; }
}
