:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-border: rgba(11, 37, 69, 0.1);
  --text: #16223a;
  --text-muted: #5b6478;
  --navy: #0b2545;
  --navy-soft: #13315c;
  --gold: #b8902f;
  --gold-soft: rgba(184, 144, 47, 0.14);
  --radius: 14px;
  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Work Sans", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2c;
  --surface-border: rgba(255, 255, 255, 0.1);
  --text: #f2f0e9;
  --text-muted: #a7afc2;
  --navy: #0b2545;
  --navy-soft: #13315c;
  --gold: #d4af52;
  --gold-soft: rgba(212, 175, 82, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, .brand {
  font-family: var(--font-display);
  font-weight: 600;
}

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

.topbar {
  background: var(--navy);
  color: #f2f0e9;
  font-size: 0.82rem;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 6vw;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.topbar a {
  color: #f2f0e9;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.topbar a:hover { opacity: 1; }

.topbar-city { opacity: 0.75; }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6vw;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-border);
}

.brand {
  font-size: 1.35rem;
  color: var(--navy);
}

:root[data-theme="dark"] .brand { color: var(--text); }

.nav nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav nav a:hover { color: var(--navy); }
:root[data-theme="dark"] .nav nav a:hover { color: var(--gold); }

.nav-cta {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff !important;
}

.theme-toggle {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
}

.menu-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.nav-movil {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 6vw 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--surface-border);
}

.nav-movil[hidden] { display: none; }

.nav-movil a {
  padding: 12px 4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.98rem;
}

.nav-movil a:last-child { border-bottom: none; }

.nav-movil .nav-cta {
  margin-top: 10px;
  text-align: center;
  color: #fff;
}

main { padding: 0 6vw; }

.hero {
  min-height: 76vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-with-bg {
  max-width: none;
  margin: 0 -6vw;
  padding: 60px 6vw;
  background-image: linear-gradient(
      100deg,
      rgba(11, 21, 38, 0.92) 0%,
      rgba(11, 21, 38, 0.78) 45%,
      rgba(11, 21, 38, 0.55) 100%
    ),
    url("img/oficina-legal.png");
  background-size: cover;
  background-position: center;
}

.hero.hero-with-bg .eyebrow { color: var(--gold); }
.hero.hero-with-bg h1,
.hero.hero-with-bg .hero-sub { color: #f2f0e9; }
.hero.hero-with-bg .hero-sub { color: rgba(242, 240, 233, 0.85); }
.hero.hero-with-bg .btn-ghost { border-color: #f2f0e9; color: #f2f0e9; }
.hero.hero-with-bg .hero-tags span {
  background: rgba(242, 240, 233, 0.12);
  border-color: rgba(242, 240, 233, 0.3);
  color: #f2f0e9;
}

@media (max-width: 900px) {
  .hero-with-bg {
    text-align: center;
    align-items: center;
  }
  .hero-actions, .hero-tags { justify-content: center; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.6rem);
  line-height: 1.15;
  margin: 0 0 22px;
  color: var(--navy);
}

:root[data-theme="dark"] .hero h1 { color: var(--text); }

.hero-sub {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 10px;
}

.hero-location {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  padding: 13px 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.96rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover { background: var(--navy-soft); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}

:root[data-theme="dark"] .btn-ghost { border-color: var(--gold); color: var(--gold); }

.btn-ghost:hover { transform: translateY(-2px); }

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-tags span {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--surface-border);
  font-size: 0.83rem;
  color: var(--text);
  font-weight: 500;
}

.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 84px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.section-head { margin-bottom: 42px; max-width: 700px; }

.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.section h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  margin: 0 0 10px;
  color: var(--navy);
}

:root[data-theme="dark"] .section h2 { color: var(--text); }

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-top: 3px solid var(--gold);
  border-radius: 6px;
  padding: 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 30px -18px rgba(11, 37, 69, 0.35);
}

.card-icon { font-size: 1.6rem; margin-bottom: 12px; }

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--navy);
}

:root[data-theme="dark"] .card h3 { color: var(--text); }

.curso-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.curso-card .card-body {
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.area-card { padding: 0; cursor: pointer; }

.area-card summary {
  list-style: none;
  padding: 26px;
  position: relative;
}

.area-card summary::-webkit-details-marker { display: none; }

.area-card summary::after {
  content: "+";
  position: absolute;
  top: 26px;
  right: 22px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  transition: transform 0.2s ease;
}

.area-card[open] summary::after { transform: rotate(45deg); }

.area-card summary .card-icon { margin-bottom: 12px; }
.area-card summary h3 { margin: 0; padding-right: 24px; }

.card-activities {
  list-style: none;
  margin: 0;
  padding: 0 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-activities li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-left: 16px;
  position: relative;
}

.card-activities li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
}

.card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.card-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  margin-top: 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.card-link:hover { transform: translateX(3px); }

.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.avatar-photo {
  width: 230px;
  height: 280px;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px;
  border: 3px solid var(--gold);
  box-shadow: 0 20px 40px -20px rgba(11, 37, 69, 0.4);
  flex-shrink: 0;
  background: var(--surface);
}

.credentials {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.subsection-head {
  margin-top: 56px;
  margin-bottom: 30px;
}

.timeline {
  border-left: 2px solid var(--gold-soft);
  margin-left: 8px;
  display: flex;
  flex-direction: column;
}

.timeline-item {
  position: relative;
  padding: 0 0 32px 30px;
}

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}

.timeline-role {
  font-size: 1.1rem;
  margin: 0 0 4px;
  color: var(--navy);
}

:root[data-theme="dark"] .timeline-role { color: var(--text); }

.timeline-meta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 8px;
}

.timeline-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 640px;
}

.formacion-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 780px;
}

.formacion-list li {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 16px 20px;
  font-size: 0.95rem;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-status {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.news-week {
  margin-top: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gold);
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 18px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.news-item:hover {
  transform: translateX(4px);
  border-color: var(--gold);
}

.news-item-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.98rem;
}

:root[data-theme="dark"] .news-item-title { color: var(--text); }

.news-item-meta {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
}

.news-updated {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-section { padding-bottom: 60px; }

.contact-card {
  background: var(--navy);
  color: #f2f0e9;
  border-radius: 10px;
  padding: 60px 40px;
  text-align: center;
}

.contact-card .tag { color: var(--gold); }
.contact-card h2 { color: #fff; margin: 6px 0 10px; }
.contact-card p { color: rgba(242, 240, 233, 0.75); margin-bottom: 20px; }

.contact-cta { margin-bottom: 32px; }

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

a.contact-item:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

.contact-icon {
  color: var(--gold);
  font-weight: 700;
  font-style: normal;
}

.footer {
  text-align: center;
  padding: 26px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--surface-border);
}

@media (max-width: 760px) {
  .nav nav { display: none; }
  .menu-toggle { display: block; }
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-grid .avatar-photo { margin: 0 auto; }
}

@media (min-width: 761px) {
  .nav-movil { display: none !important; }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(11, 21, 38, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] { display: none; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 12px;
  padding: 36px 30px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}

.modal-iframe {
  width: 100%;
  height: 60vh;
  min-height: 420px;
  border: none;
  border-radius: 6px;
}

.modal-box h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0 0 8px;
  font-size: 1.4rem;
}

:root[data-theme="dark"] .modal-box h3 { color: var(--text); }

.modal-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 20px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gold-soft);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

