:root {
  --navy: #0b2239;
  --navy-2: #102f4f;
  --gold: #f1b94a;
  --cream: #f7f5ef;
  --white: #ffffff;
  --text: #1e2a35;
  --muted: #66727e;
  --line: #e4e8ec;
  --shadow: 0 18px 50px rgba(11,34,57,.12);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

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

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  font-weight: 800;
  letter-spacing: .04em;
}

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

.brand span {
  display: block;
  font-size: .8rem;
  color: var(--muted);
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: .95rem;
  font-weight: 600;
}

nav a:hover { color: var(--gold); }

.menu-btn {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(241,185,74,.25), transparent 30%),
    linear-gradient(135deg, #0b2239 0%, #143f66 100%);
  color: white;
  padding: 96px 0 90px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 60px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 5.2rem);
  line-height: 1.02;
  margin: 0 0 24px;
  max-width: 780px;
}

.hero p {
  max-width: 680px;
  font-size: 1.15rem;
  color: rgba(255,255,255,.82);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 750;
}

.btn.primary {
  background: var(--gold);
  color: var(--navy);
}

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

.hero-card {
  background: white;
  color: var(--text);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-card-label {
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--navy);
}

.quick-link {
  display: block;
  padding: 17px 4px;
  border-bottom: 1px solid var(--line);
}

.quick-link:last-child { border-bottom: 0; }

.quick-link span {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .08em;
}

.quick-link strong {
  display: block;
  margin-top: 2px;
  font-size: 1.03rem;
}

.disabled {
  opacity: .65;
  cursor: default;
}

.section {
  padding: 90px 0;
}

.section.alt {
  background: var(--cream);
}

.section.dark {
  background: var(--navy);
  color: white;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 42px;
}

.section-heading h2,
.split h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--navy);
}

.section-heading p,
.split p {
  color: var(--muted);
  font-size: 1.05rem;
}

.section-heading.light h2,
.section-heading.light p {
  color: white;
}

.section-heading.light p {
  color: rgba(255,255,255,.7);
}

.cards {
  display: grid;
  gap: 22px;
}

.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }

.ministry-card,
.resource-card,
.system-card,
.calendar-preview {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(11,34,57,.05);
}

.ministry-card {
  position: relative;
  overflow: hidden;
}

.ministry-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
}

.adventurers::before { background: #7a4bb7; }
.pathfinders::before { background: #cf3a3a; }
.masterguides::before { background: #d7a129; }

.icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--cream);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 24px;
}

.ministry-card h3,
.resource-card h3,
.system-card h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.ministry-card p,
.resource-card p,
.system-card p {
  color: var(--muted);
}

.ministry-card a,
.text-link,
.system-card a {
  font-weight: 750;
  color: var(--navy);
}

.split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 60px;
  align-items: center;
}

.calendar-preview {
  padding: 12px 28px;
}

.event {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.event:last-child { border-bottom: 0; }

.date-box {
  width: 68px;
  min-width: 68px;
  height: 68px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
}

.date-box strong {
  font-size: .7rem;
  letter-spacing: .08em;
}

.date-box span {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.event p {
  margin: 4px 0 0;
  font-size: .92rem;
}

.resource-card span {
  display: inline-block;
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 18px;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.system-card {
  background: #123654;
  border-color: rgba(255,255,255,.08);
}

.system-card h3,
.system-card a {
  color: white;
}

.system-card p {
  color: rgba(255,255,255,.68);
}

.status {
  display: inline-block;
  font-size: .75rem;
  font-weight: 850;
  padding: 6px 10px;
  border-radius: 999px;
  background: #d9f7e3;
  color: #1e6e3c;
  margin-bottom: 18px;
}

.status.future {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
}

footer {
  background: #071827;
  color: white;
  padding: 34px 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
}

footer p {
  margin: 4px 0 0;
  color: rgba(255,255,255,.62);
}

@media (max-width: 900px) {
  .hero-grid,
  .split,
  .cards.three,
  .cards.four,
  .systems-grid {
    grid-template-columns: 1fr;
  }

  nav {
    display: none;
    position: absolute;
    top: 78px;
    right: 20px;
    left: 20px;
    flex-direction: column;
    align-items: stretch;
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
  }

  nav.open { display: flex; }

  .menu-btn { display: block; }

  .hero {
    padding-top: 72px;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Refinamiento visual desktop */
.container {
  width: min(1320px, calc(100% - 64px));
}

.hero {
  padding: 105px 0 100px;
}

.hero-grid {
  grid-template-columns: 1.15fr .85fr;
  gap: 90px;
}

.hero h1 {
  max-width: 820px;
}

.hero-card {
  max-width: 470px;
  width: 100%;
  justify-self: end;
}

.section {
  padding: 105px 0;
}

.cards.three {
  gap: 28px;
}

.ministry-card {
  min-height: 285px;
}

.ministry-card,
.resource-card,
.system-card {
  transition: transform .2s ease, box-shadow .2s ease;
}

.ministry-card:hover,
.resource-card:hover,
.system-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 45px rgba(11,34,57,.12);
}

nav a {
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -8px;
  height: 2px;
  background: var(--gold);
  transition: right .2s ease;
}

nav a:hover::after {
  right: 0;
}

@media (max-width: 1100px) {
  .container {
    width: min(100% - 40px, 1180px);
  }

  .hero-grid {
    gap: 45px;
  }
}

/* Logos oficiales */
.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
}

.ministry-logo {
  height: 115px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.ministry-logo img {
  width: auto;
  height: 105px;
  max-width: 150px;
  object-fit: contain;
}

.adventurers .ministry-logo img {
  height: 112px;
}

.pathfinders .ministry-logo img {
  height: 105px;
}

.masterguides .ministry-logo img {
  height: 108px;
}

/* Identidad institucional */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 470px;
  justify-self: end;
}

.institution-card {
  background: white;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
}

.institution-card img {
  width: 100%;
  max-width: 255px;
  height: auto;
  display: block;
}

.hero-side .hero-card {
  max-width: none;
  width: 100%;
}

.calendar-empty {
  text-align: center;
  padding: 48px 38px;
}

.calendar-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.calendar-empty h3 {
  color: var(--navy);
  font-size: 1.4rem;
  margin: 0 0 10px;
}

.calendar-empty p {
  max-width: 520px;
  margin: 0 auto 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-brand img {
  width: 170px;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .92;
}

@media (max-width: 900px) {
  .hero-side {
    max-width: none;
  }

  .institution-card img {
    max-width: 220px;
  }

  .footer-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-brand img {
    width: 150px;
  }
}

/* Bienvenida institucional */
.welcome-section {
  background: #ffffff;
  padding-top: 80px;
  padding-bottom: 30px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 60px;
  align-items: center;
}

.welcome-grid h2 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.welcome-grid p {
  color: var(--muted);
  font-size: 1.04rem;
  max-width: 760px;
}

.welcome-note {
  background: var(--cream);
  border-left: 5px solid var(--gold);
  border-radius: 18px;
  padding: 28px;
}

.welcome-note strong {
  display: block;
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.welcome-note p {
  margin: 0;
}

@media (max-width: 900px) {
  .welcome-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.calendar-title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--line);
}

.calendar-title .calendar-icon {
  font-size: 2rem;
  margin: 0;
}

.calendar-title h3 {
  margin: 0;
  color: var(--navy);
}

.calendar-title p {
  margin: 2px 0 0;
  font-size: .9rem;
}

.calendar-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 0 8px;
}

.calendar-links a {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--cream);
  font-size: .82rem;
  font-weight: 750;
  color: var(--navy);
}

/* ===== AJUSTE FINAL DE ANCHO Y COMPOSICIÓN ===== */

main section > .container,
.section-inner,
.home-section-inner {
  width: min(88%, 1380px);
  margin-left: auto;
  margin-right: auto;
}

/* Avisos */
.notice-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 28px;
}

.notice-card {
  min-height: 180px;
  padding: 38px 40px;
}

/* Próximos eventos */
.events-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.event-card {
  min-height: 135px;
  padding: 26px 28px;
}

/* Títulos de las secciones */
.home-section h2,
.section-title {
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.home-section {
  padding-top: 80px;
  padding-bottom: 80px;
}

/* Navegación un poco más refinada */
.site-header nav a {
  position: relative;
  transition: opacity .2s ease;
}

.site-header nav a:hover {
  opacity: .65;
}

/* Adaptación para pantallas más pequeñas */
@media (max-width: 900px) {
  main section > .container,
  .section-inner,
  .home-section-inner {
    width: min(92%, 720px);
  }

  .notice-grid,
  .events-grid {
    grid-template-columns: 1fr;
  }

  .notice-card {
    min-height: auto;
  }
}

/* ===== PULIDO VISUAL HOME ===== */

/* Menos espacio vacío después del banner */
.home-section {
  padding-top: 58px !important;
  padding-bottom: 62px !important;
}

/* Avisos más proporcionados */
.notice-grid {
  margin-top: 30px;
  gap: 26px;
  align-items: stretch;
}

.notice-card {
  min-height: 145px !important;
  padding: 30px 34px !important;
  border-radius: 18px;
}

.notice-card h3 {
  font-size: 1.28rem;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.notice-card p {
  font-size: 1rem;
  line-height: 1.55;
}

/* Títulos principales */
.home-section h2 {
  font-size: clamp(2rem, 2.6vw, 2.75rem);
  letter-spacing: -0.045em;
  margin-bottom: 10px;
}

/* Etiquetas doradas */
.home-section .eyebrow,
.section-kicker {
  letter-spacing: .15em;
  font-weight: 800;
}

/* Tarjetas de eventos más elegantes */
.events-grid {
  margin-top: 28px;
}

.event-card {
  border-radius: 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(13, 48, 76, .12);
}

/* Mejor separación entre grandes bloques */
.home-section + .home-section {
  border-top: 1px solid rgba(12, 47, 75, .05);
}

/* ===== ACCESOS RÁPIDOS ===== */

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 34px;
}

.home-shortcut {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: #ffffff;
  border: 1px solid rgba(11, 34, 57, .08);
  border-radius: 16px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(7, 55, 90, .06);
  transition: transform .18s ease, box-shadow .18s ease;
}

.home-shortcut:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(7, 55, 90, .11);
}

.shortcut-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef5f8;
  font-size: 22px;
}

.home-shortcut strong {
  display: block;
  color: #07375a;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  margin-bottom: 3px;
}

.home-shortcut span {
  display: block;
  color: #6b7c8c;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 1050px) {
  .home-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .home-shortcuts {
    grid-template-columns: 1fr;
  }
}
