:root {
  --brand-maroon: #7A1734;
  --brand-maroon-700: #5d1128;
  --brand-gold: #C9A36A;
  --brand-gold-700: #a8844d;
  --brand-cream: #F4EADD;
  --brand-beige: #EFE5D1;
  --bg: var(--brand-cream);
  --surface: #fff;
  --text: #231f20;
  --muted: #6b7280;
  --border: #e5d8c2;
  --ring: rgba(201, 163, 106, .55);
  --chip: #f7efe3;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

/* Prevent horizontal overflow on mobile */
html,
body {
  overflow-x: hidden
}

body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text)
}

h1,
h2,
h3,
h4,
strong,
.brand-title {
  font-family: Montserrat, Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--brand-maroon);
  color: #fff;
  border: none;
  padding: .75rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(122, 23, 52, .25)
}

.btn:hover {
  background: var(--brand-maroon-700)
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  color: var(--brand-maroon);
  border: 1px solid var(--brand-maroon);
  padding: .7rem 1rem;
  border-radius: 12px;
  font-weight: 700
}

.btn-outline:hover {
  background: rgba(122, 23, 52, .06)
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border)
}

.brand-strip {
  background: linear-gradient(180deg, rgba(201, 163, 106, .12), rgba(201, 163, 106, 0));
  border-top: 1px solid var(--border)
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px
}

.brand-logos img {
  height: 28px;
  object-fit: contain;
  filter: contrast(1.05)
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--chip);
  border: 1px solid var(--border);
  padding: .35rem .6rem;
  border-radius: 999px;
  font-size: .75rem
}

nav {
  display: flex;
  flex-wrap: nowrap;
  gap: .25rem;
  white-space: nowrap;
}

nav a {
  padding: .4rem .5rem;
  border-radius: 10px;
  font-size: .9rem;
}

nav a.active,
nav a:hover {
  background: rgba(148, 163, 184, .15)
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
  align-items: center;
  padding: 48px 0
}

.hero-brand {
  position: relative;
  isolation: isolate;
  background: radial-gradient(1200px 400px at 20% -10%, rgba(201, 163, 106, .25), transparent 60%)
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, .04)
}

.p-16 {
  padding: 16px
}

.p-24 {
  padding: 24px
}

.grid {
  display: grid;
  gap: 16px
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

.muted {
  color: var(--muted)
}

label {
  font-weight: 600;
  font-size: .9rem
}

input,
select,
textarea {
  width: 100%;
  padding: .7rem .8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text)
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px
}

.s-ok {
  color: var(--ok)
}

.s-warn {
  color: var(--warn)
}

.s-bad {
  color: var(--bad)
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr
  }

  .row {
    grid-template-columns: 1fr
  }

  .grid-3 {
    grid-template-columns: 1fr
  }
}

/* Masthead headline */
.masthead {
  background: var(--brand-cream);
  border-bottom: 1px solid var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #F4EEE5;
  border: 1px solid #e5d8c2;
  color: #1f2937;
  padding: .35rem .6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
}

/* Accordion Component */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  background: linear-gradient(135deg, rgba(201, 163, 106, .12), rgba(201, 163, 106, .04));
  border-bottom: 1px solid transparent;
  transition: background .2s, border-color .2s;
  user-select: none;
}

.accordion-header:hover {
  background: linear-gradient(135deg, rgba(201, 163, 106, .18), rgba(201, 163, 106, .08));
}

.accordion-item.open .accordion-header {
  border-bottom-color: var(--border);
  background: linear-gradient(135deg, rgba(122, 23, 52, .08), rgba(201, 163, 106, .06));
}

.accordion-header .icon {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand-maroon);
  transition: transform .3s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-item.open .accordion-header .icon {
  transform: rotate(45deg);
}

.accordion-content {
  display: none;
  background: var(--surface);
  padding: 0;
}

.accordion-item.open .accordion-content {
  display: block;
  padding: 16px 20px;
  animation: accordionSlide .25s ease-out;
}

@keyframes accordionSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.accordion-content ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.accordion-content li {
  margin-bottom: 12px;
  color: var(--text);
  padding: 10px 14px;
  background: var(--brand-cream);
  border-radius: 8px;
  border-left: 3px solid var(--brand-gold);
}

.accordion-content li:last-child {
  margin-bottom: 0;
}

.accordion-content .periodo {
  display: inline-block;
  background: var(--brand-maroon);
  color: #fff;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: .8rem;
  margin-right: 10px;
  font-weight: 600;
}

/* ===========================
   CARRUSEL DE PRENSA
   =========================== */
.prensa-carrusel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.prensa-carrusel-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
}

.prensa-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}

.prensa-slide:hover {
  background: var(--chip);
}

.prensa-slide-img {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-maroon) 0%, var(--brand-gold) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.prensa-slide-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prensa-slide-placeholder {
  font-size: 4rem;
  opacity: 0.7;
}

.prensa-slide-content {
  padding: 20px;
}

.prensa-slide-fecha {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.prensa-slide-titulo {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.prensa-slide-link {
  display: inline-block;
  color: var(--brand-maroon);
  font-weight: 500;
  font-size: 0.95rem;
}

.prensa-slide:hover .prensa-slide-link {
  text-decoration: underline;
}

/* Botones prev/next */
.prensa-carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-maroon);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
  z-index: 10;
}

.prensa-carrusel-btn:hover {
  background: var(--brand-maroon);
  color: #fff;
}

.prensa-carrusel-prev {
  left: 12px;
}

.prensa-carrusel-next {
  right: 12px;
}

/* Dots indicadores */
.prensa-carrusel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.prensa-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--brand-maroon);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.prensa-dot.active,
.prensa-dot:hover {
  background: var(--brand-maroon);
}

/* Responsive */
@media (max-width: 600px) {
  .prensa-slide-img {
    height: 200px;
  }

  .prensa-carrusel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .prensa-carrusel-prev {
    left: 8px;
  }

  .prensa-carrusel-next {
    right: 8px;
  }
}

/* ===========================
   CARRUSEL DE FACEBOOK EMBEDS
   =========================== */
.fb-carrusel {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
}

.fb-carrusel-container {
  overflow: hidden;
  border-radius: 8px;
}

.fb-carrusel-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
}

.fb-slide {
  min-width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
  box-sizing: border-box;
}

.fb-slide .fb-post {
  max-width: 100%;
}

.fb-slide-fallback {
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1877f2 0%, #3b5998 100%);
  border-radius: 8px;
}

.fb-fallback-link {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  transition: all 0.2s;
}

.fb-fallback-link:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
}

/* Botones prev/next FB */
.fb-carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
  z-index: 10;
}

.fb-carrusel-btn:hover {
  background: #166fe5;
  transform: translateY(-50%) scale(1.1);
}

.fb-carrusel-prev {
  left: -20px;
}

.fb-carrusel-next {
  right: -20px;
}

/* Contador */
.fb-carrusel-counter {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

/* Responsive FB */
@media (max-width: 600px) {
  .fb-carrusel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .fb-carrusel-prev {
    left: -10px;
  }

  .fb-carrusel-next {
    right: -10px;
  }

  .fb-slide {
    padding: 8px;
  }
}

/* Fecha del post */
.fb-post-fecha {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
}

/* Iframe wrapper */
.fb-iframe-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.fb-iframe-wrapper iframe {
  max-width: 100%;
  border-radius: 8px;
}

/* Botón deshabilitado */
.fb-carrusel-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Slide vertical (reels) */
.fb-slide-vertical .fb-iframe-wrapper {
  min-height: 480px;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

/* Hamburger Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 100;
}

.menu-toggle svg {
  width: 28px;
  height: 28px;
  stroke: var(--brand-maroon);
  stroke-width: 2;
}

/* Mobile Navigation Overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

.nav-mobile-overlay.active {
  display: block;
}

/* Mobile Navigation (body level, for proper z-index) */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 70px 20px 30px;
  gap: 0;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  z-index: 100;
  overflow-y: auto;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav a {
  padding: 14px 16px;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
  display: block;
  color: var(--text);
}

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

.mobile-nav .nav-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
}

.mobile-nav .nav-close svg {
  width: 24px;
  height: 24px;
  stroke: var(--brand-maroon);
  stroke-width: 2;
}

/* Desktop navigation */
.desktop-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  white-space: nowrap;
}

.desktop-nav a {
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.desktop-nav a.active,
.desktop-nav a:hover {
  background: rgba(148, 163, 184, 0.15);
}

/* Mobile Styles */
@media (max-width: 768px) {

  /* Show hamburger button */
  .menu-toggle {
    display: block;
  }

  /* Hide desktop navigation on mobile */
  .desktop-nav {
    display: none !important;
  }

  header nav a {
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    display: block;
  }

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

  /* Close button in mobile nav */
  .nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 5;
    width: 40px;
    height: 40px;
  }

  .nav-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--brand-maroon);
    stroke-width: 2;
  }

  /* Compact Header */
  header .container {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  header .container>div:first-child {
    flex: 1;
    min-width: 0;
  }

  header .container strong {
    font-size: 0.85rem;
    line-height: 1.2;
    display: block;
  }

  header .container .muted {
    font-size: 0.7rem !important;
    line-height: 1.2;
  }

  .chip {
    padding: 0.25rem 0.4rem;
    font-size: 0.65rem;
  }

  /* Hero Section */
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  /* Stack buttons vertically */
  .hero-btns,
  .btn-group {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .hero-btns .btn,
  .hero-btns .btn-outline,
  .btn-group .btn,
  .btn-group .btn-outline {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Cards */
  .card {
    padding: 16px !important;
  }

  /* Reduce container padding */
  .container {
    padding: 0 12px;
  }

  main.container {
    padding: 12px;
  }

  /* Footer */
  footer .container {
    flex-direction: column;
    text-align: center;
    gap: 8px !important;
  }

  footer .muted {
    font-size: 0.8rem;
  }

  /* OELV Auth buttons */
  .auth-tabs,
  [data-auth-tab] {
    flex-wrap: wrap;
  }

  .oelv-tab-btn,
  #oelv-tabs-buttons .btn,
  #oelv-tabs-buttons .btn-outline {
    flex: 1 1 100%;
    margin-bottom: 8px;
  }

  /* Forms */
  .form-row {
    flex-direction: column !important;
  }

  .form-row>* {
    width: 100% !important;
  }

  /* Prensa carousel */
  .fb-carrusel-container {
    margin: 0 -12px;
    padding: 0 12px;
  }

  .fb-slide {
    padding: 4px;
  }

  /* Ficha técnica (Perfil) */
  .profile-grid,
  .data-grid {
    grid-template-columns: 1fr !important;
  }

  /* Accordion items */
  .accordion-trigger {
    padding: 12px 14px !important;
    font-size: 0.9rem !important;
  }

  /* Tables responsive */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Accessibility button */
  #a11y-widget {
    bottom: 10px !important;
    right: 10px !important;
  }

  #a11y-widget button {
    padding: 10px 14px !important;
    font-size: 0.8rem !important;
  }
}

/* Extra small screens (under 400px) */
@media (max-width: 400px) {
  header .container strong {
    font-size: 0.75rem;
  }

  header .container .muted {
    font-size: 0.65rem !important;
  }

  .chip {
    display: none;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .btn,
  .btn-outline {
    font-size: 0.85rem;
    padding: 0.65rem 0.8rem;
  }
}