@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* Navbar: más blanca sobre el hero oscuro (solo en esta página) */
.navbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.16);
}

/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --color-bg: #f8fafc;
  --color-surface: rgba(255, 255, 255, 0.8);
  --color-surface-card: rgba(255, 255, 255, 0.75);
  --color-border: rgba(226, 232, 240, 0.8);
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  
  --color-indigo: #6366f1;
  --color-indigo-bg: #e0e7ff;
  --color-emerald: #10b981;
  --color-emerald-bg: #d1fae5;
  --color-amber: #f59e0b;
  --color-amber-bg: #fef3c7;
  --color-blue: #3b82f6;
  --color-blue-bg: #dbeafe;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(31, 38, 135, 0.08), 0 8px 10px -6px rgba(31, 38, 135, 0.08);
  
  --font-family-sans: 'Inter', sans-serif;
  --font-family-title: 'Montserrat', sans-serif;
}

body.dark-mode {
  --color-bg: #0b0f19;
  --color-surface: rgba(17, 24, 39, 0.85);
  --color-surface-card: rgba(30, 41, 59, 0.6);
  --color-border: rgba(51, 65, 85, 0.6);
  --color-text-main: #f8fafc;
  --color-text-muted: #94a3b8;
  
  --color-indigo-bg: rgba(99, 102, 241, 0.15);
  --color-emerald-bg: rgba(16, 185, 129, 0.15);
  --color-amber-bg: rgba(245, 158, 11, 0.15);
  --color-blue-bg: rgba(59, 130, 246, 0.15);
  
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   RESET & LAYOUT BASE
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* Decorative Blur background shapes */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  transition: opacity 0.5s ease;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--color-indigo);
  top: -150px;
  left: -100px;
}

.shape-2 {
  width: 450px;
  height: 450px;
  background: var(--color-emerald);
  bottom: -100px;
  right: -50px;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   TOP BAR / HEADER CONTROLS
   ========================================================================== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: var(--color-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: 10;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
}

.brand .logo img {
  height: 40px;
  object-fit: contain;
  display: block;
}

.spacer {
  flex-grow: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-indigo);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-indigo);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-btn-link:hover {
  background: var(--color-indigo);
  color: #ffffff;
}

.btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn:hover {
  background-color: var(--color-indigo);
  border-color: var(--color-indigo);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   MAIN CONTENT & INTRO
   ========================================================================== */
.main-content {
  flex-grow: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  z-index: 1;
}

.intro-section {
  text-align: left;
  max-width: 700px;
  margin: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-indigo);
  background: var(--color-indigo-bg);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 1rem;
}

.main-title {
  font-family: var(--font-family-title);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--color-text-main);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   TIERS AND GRID OF CARDS
   ========================================================================== */
.authorities-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
}

.tier {
  display: flex;
  justify-content: center;
  width: 100%;
}

.tier-2 {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

/* Base Card styles */
.authority-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.authority-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

body.dark-mode .authority-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.02));
}

.authority-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.authority-card[data-color="indigo"]:hover { border-color: rgba(99, 102, 241, 0.4); }
.authority-card[data-color="emerald"]:hover { border-color: rgba(16, 185, 129, 0.4); }
.authority-card[data-color="amber"]:hover { border-color: rgba(245, 158, 11, 0.4); }
.authority-card[data-color="blue"]:hover { border-color: rgba(59, 130, 246, 0.4); }

/* Card Glow Effect (specular) */
.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.15), transparent 75%);
  z-index: 1;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.authority-card:hover .card-glow,
.identity-card:hover .card-glow {
  opacity: 1;
}

body.dark-mode .card-glow {
  background: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.07), transparent 75%);
}

/* Avatar container (Edge-to-edge layout) */
.avatar-container {
  width: 100%;
  height: 385px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
  border-radius: 23px 23px 0 0;
}

.auth-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  position: relative;
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 23px 23px 0 0;
}

/* Custom alignment to achieve perfect horizontal symmetry for the Vocales */
.authority-card[data-id="vocal_sala_1"] .auth-img {
  object-position: center 0%;
}

.authority-card[data-id="vocal_sala_2"] .auth-img {
  object-position: center 52%;
}

.authority-card:hover .auth-img {
  transform: scale(1.04);
}

/* Initials Fallback style */
.avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 3rem;
  color: #ffffff;
  z-index: 1;
  text-transform: uppercase;
  border-radius: 23px 23px 0 0;
}

.avatar-indigo { background: linear-gradient(135deg, var(--color-indigo), #4f46e5); }
.avatar-emerald { background: linear-gradient(135deg, var(--color-emerald), #059669); }
.avatar-amber { background: linear-gradient(135deg, var(--color-amber), #d97706); }
.avatar-blue { background: linear-gradient(135deg, var(--color-blue), #2563eb); }

/* Card content */
.auth-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  gap: 0.5rem;
  padding: 2rem 2.25rem 2.25rem;
  position: relative;
  z-index: 3;
  background: transparent;
}

.auth-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.25rem;
}

.color-indigo { color: var(--color-indigo); background: var(--color-indigo-bg); }
.color-emerald { color: var(--color-emerald); background: var(--color-emerald-bg); }
.color-amber { color: var(--color-amber); background: var(--color-amber-bg); }
.color-blue { color: var(--color-blue); background: var(--color-blue-bg); }

.auth-name {
  font-family: var(--font-family-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.25;
}

.auth-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.auth-short-bio {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Action button */
.view-profile-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: auto;
  align-self: flex-start;
  margin-top: 0.75rem;
}

.authority-card:hover .view-profile-btn {
  background: var(--color-indigo);
  border-color: var(--color-indigo);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  transform: translateY(-3px);
}

/* Botón respeta el color de la tarjeta */
.authority-card[data-color="emerald"]:hover .view-profile-btn {
  background: var(--color-emerald);
  border-color: var(--color-emerald);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.authority-card[data-color="amber"]:hover .view-profile-btn {
  background: var(--color-amber);
  border-color: var(--color-amber);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.authority-card[data-color="blue"]:hover .view-profile-btn {
  background: var(--color-blue);
  border-color: var(--color-blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ==========================================================================
   FEATURED CARD (TIER 1 - PRESIDENCIA)
   ========================================================================== */
.authority-card.featured {
  max-width: 950px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 3fr;
}

.authority-card.featured .avatar-container {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border-radius: 23px 0 0 23px;
}

.authority-card.featured .auth-img,
.authority-card.featured .avatar-fallback {
  border-radius: 23px 0 0 23px;
}

.authority-card.featured .auth-content {
  padding: 3rem;
  align-items: flex-start;
  text-align: left;
  justify-content: center;
  gap: 0.65rem;
  height: 100%;
}

.authority-card.featured .auth-name {
  font-size: 1.85rem;
  line-height: 1.2;
}

.authority-card.featured .auth-role {
  font-size: 1rem;
}

.authority-card.featured .view-profile-btn {
  width: auto;
  padding: 0.75rem 2rem;
  margin-top: 1rem;
}

/* ==========================================================================
   TIERS & CARD SIZES ALIGNMENT
   ========================================================================== */
.tier-2 .authority-card,
.tier-3 .authority-card {
  max-width: 420px;
  margin: 0 auto;
}

/* ==========================================================================
   OFF-CANVAS BIOGRAPHY DRAWER
   ========================================================================== */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(460px, 95vw);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-left: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: -20px 0 60px -10px rgba(0, 0, 0, 0.18), inset -1px 0 0 rgba(255, 255, 255, 0.5);
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

body.dark-mode .drawer {
  background: rgba(10, 16, 35, 0.82);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: -20px 0 60px -10px rgba(0, 0, 0, 0.55), inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 2.5rem 2rem;
  color: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-head.indigo { background: linear-gradient(135deg, var(--color-indigo), #4f46e5); }
.drawer-head.emerald { background: linear-gradient(135deg, var(--color-emerald), #059669); }
.drawer-head.amber { background: linear-gradient(135deg, var(--color-amber), #d97706); }
.drawer-head.blue { background: linear-gradient(135deg, var(--color-blue), #2563eb); }

.d-initials {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
  overflow: hidden;
}

.d-initials img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-head h2 {
  font-family: var(--font-family-title);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}

.drawer-head p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.drawer-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.drawer-body {
  padding: 2.5rem 2rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.drawer-body h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
}

.d-bio {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-main);
  text-align: justify;
}

.d-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  font-size: 0.875rem;
  display: flex;
  gap: 0.5rem;
}

.contact-label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.contact-value {
  color: var(--color-text-main);
  font-weight: 500;
}

.contact-value a {
  color: var(--color-indigo);
  text-decoration: none;
}

.contact-value a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sequential card fade-ins */
.tier-1 { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; opacity: 0; }
.tier-2 { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; opacity: 0; }
.tier-3 { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards; opacity: 0; }

/* ==========================================================================
   IDENTITY SECTION (MISIÓN, VISIÓN, VALORES)
   ========================================================================== */
.identity-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  opacity: 0;
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

.identity-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Borde luminoso */
.identity-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

body.dark-mode .identity-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.02));
}

/* Glow de fondo por color */
.identity-card[data-color="indigo"] { --active-color: var(--color-indigo); }
.identity-card[data-color="emerald"] { --active-color: var(--color-emerald); }
.identity-card[data-color="amber"] { --active-color: var(--color-amber); }

.identity-card::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--active-color) 0%, transparent 70%);
  opacity: 0.1;
  filter: blur(30px);
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1;
}

body.dark-mode .identity-card::after { opacity: 0.18; }

.identity-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.identity-card[data-color="indigo"]:hover { border-color: rgba(99, 102, 241, 0.4); }
.identity-card[data-color="emerald"]:hover { border-color: rgba(16, 185, 129, 0.4); }
.identity-card[data-color="amber"]:hover { border-color: rgba(245, 158, 11, 0.4); }

.identity-card:hover .card-glow { opacity: 1; }

.identity-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 3;
}

.identity-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--color-border);
}

.identity-card[data-color="indigo"] .identity-icon-wrapper {
  background: var(--color-indigo-bg);
  color: var(--color-indigo);
}
.identity-card[data-color="emerald"] .identity-icon-wrapper {
  background: var(--color-emerald-bg);
  color: var(--color-emerald);
}
.identity-card[data-color="amber"] .identity-icon-wrapper {
  background: var(--color-amber-bg);
  color: var(--color-amber);
}

.identity-card:hover .identity-icon-wrapper { transform: scale(1.12) rotate(5deg); }
.identity-card[data-color="indigo"]:hover .identity-icon-wrapper { background: var(--color-indigo); color: #fff; border-color: var(--color-indigo); }
.identity-card[data-color="emerald"]:hover .identity-icon-wrapper { background: var(--color-emerald); color: #fff; border-color: var(--color-emerald); }
.identity-card[data-color="amber"]:hover .identity-icon-wrapper { background: var(--color-amber); color: #fff; border-color: var(--color-amber); }

.identity-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.identity-title {
  font-family: var(--font-family-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.5px;
}

.identity-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  z-index: 3;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */
@media (max-width: 992px) {
  .authority-card.featured {
    grid-template-columns: 1fr;
  }
  
  .authority-card.featured .avatar-container {
    border-radius: 23px 23px 0 0;
    height: 300px;
    min-height: auto;
  }
  
  .authority-card.featured .auth-img,
  .authority-card.featured .avatar-fallback {
    border-radius: 23px 23px 0 0;
  }
  
  .authority-card.featured .auth-content {
    padding: 2.25rem;
  }

  .identity-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 2rem 1rem;
    gap: 2.5rem;
  }

  .identity-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .identity-card {
    padding: 1.5rem;
    gap: 1rem;
  }

  .identity-title { font-size: 1.15rem; }
  .identity-desc { font-size: 0.85rem; }
  
  .main-title {
    font-size: 2.25rem;
  }
  
  .tier-2 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .header-bar {
    padding: 1rem;
  }
  
  .nav-btn-link {
    display: none; /* Hide on mobile to save space */
  }
}

/* Integración WP: el hero auto-hero ya incluye el offset del navbar fijo */
.auto-page .main-content { padding-top: 2rem; }
@media (max-width: 768px) { .auto-page .main-content { padding-top: 1.5rem; } }

/* ════════════════════════════════════════════════════════════════
   HERO ── auto-page
   ════════════════════════════════════════════════════════════════ */
.auto-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0B2545 0%, #13365f 55%, #00549A 100%);
  color: #fff;
  padding: 128px 2rem 64px;
  min-height: 400px;
  display: flex;
  align-items: center;
}

.auto-hero-dots {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px, 64px 64px, 64px 64px;
  opacity: 0.4;
  pointer-events: none;
}

/* Motivo en marca de agua para Institucional (Columnas / Cúpulas de arquitectura gubernamental) */
.auto-hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='columns-pattern' width='120' height='120' patternUnits='userSpaceOnUse'%3E%3Cpath d='M20 120 V30 L60 10 L100 30 V120' fill='none' stroke='%23bae6fd' stroke-width='1' stroke-dasharray='4 4'/%3E%3Cpath d='M35 120 V45 M60 120 V30 M85 120 V45' fill='none' stroke='%23ffffff' stroke-width='0.8'/%3E%3Crect x='15' y='110' width='90' height='10' fill='none' stroke='%2338bdf8' stroke-width='0.8'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23columns-pattern)'/%3E%3C/svg%3E");
}

.auto-hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.auto-hero-orb-1 { width: 480px; height: 480px; background: rgba(99, 102, 241, 0.22); top: -160px; right: -120px; }
.auto-hero-orb-2 { width: 360px; height: 360px; background: rgba(16, 185, 129, 0.18); bottom: -140px; left: -80px; }

.auto-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 992px) {
  .auto-hero-inner { grid-template-columns: 1fr; max-width: 1200px; }
}
@media (max-width: 768px) {
  .auto-hero { padding: 96px 1.25rem 48px; min-height: auto; }
  .auto-hero-badge { display: none; }
}

.auto-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1rem;
  font-weight: 500;
}
.auto-breadcrumb a { color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: color 0.2s; }
.auto-breadcrumb a:hover { color: #fff; }

.auto-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #bae6fd;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.32rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.9rem;
}
.auto-eyebrow svg { width: 14px; height: 14px; }

.auto-hero h1 {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 0.85rem;
}
.auto-hero-lead {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  max-width: 620px;
}

.auto-hero-badge {
  position: relative;
  background: #fff;
  border-radius: 28px;
  padding: 1.5rem;
  text-align: center;
  max-width: 250px;
  margin: 0 auto;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  animation: autoFloat 6s ease-in-out infinite;
}

.auto-hero-badge.glass-badge {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  max-width: 270px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: none;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.auto-hero-badge.glass-badge:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

.auto-hero-badge-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auto-hero-badge-icon svg { width: 28px; height: 28px; stroke: #38bdf8; }

.auto-hero-badge.glass-badge h3 { color: #ffffff; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.auto-hero-badge.glass-badge p { color: rgba(255, 255, 255, 0.72); font-size: 0.78rem; font-family: inherit; margin-top: 0; }

@keyframes autoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.auto-hero-badge-inner {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 0.9rem;
}
.auto-hero-badge img { width: 118px; height: auto; margin: 0 auto; display: block; }
.auto-hero-badge h3 { font-family: var(--font-family-title); color: #0B2545; font-size: 0.85rem; font-weight: 800; }
.auto-hero-badge p { color: #94a3b8; font-size: 0.68rem; font-family: monospace; margin-top: 0.3rem; }

/* ════════════════════════════════════════════════════════════════
   SUBNAV STICKY
   ════════════════════════════════════════════════════════════════ */
.auto-subnav {
  position: sticky;
  top: 110px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.auto-subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.auto-subnav-inner::-webkit-scrollbar { display: none; }
.auto-subnav-link {
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.auto-subnav-link:hover { color: var(--color-indigo); border-color: rgba(99, 102, 241, 0.3); background: var(--color-indigo-bg); }
.auto-subnav-link.active { color: var(--color-indigo); background: var(--color-indigo-bg); border-color: var(--color-indigo); }
@media (max-width: 768px) {
  .auto-subnav { top: 64px; }
}

/* ════════════════════════════════════════════════════════════════
   KICKER DE SECCIÓN
   ════════════════════════════════════════════════════════════════ */
.auto-kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-indigo);
  margin-bottom: 0.6rem;
}
.auto-kicker .bar { width: 32px; height: 2px; border-radius: 2px; background: currentColor; }

/* ════════════════════════════════════════════════════════════════
   OVERLAY DEL DRAWER
   ════════════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.drawer-overlay.active { opacity: 1; visibility: visible; }

/* Botón cerrar drawer: ajuste con SVG */
.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.drawer-close:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.12) rotate(90deg); }
.drawer-close svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════
   CUADRÍCULA PREMIUM v2 — Tarjetas expandibles con overlay
   ═══════════════════════════════════════════════════════════ */

.authorities-grid-v2 {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  width: 100%;
}

/* ── Presidencia: tarjeta horizontal destacada ──────────── */
.aut-featured-v2 {
  display: flex;
  flex-direction: row;
  max-width: 100%;
}

.aut-featured-v2 .avatar-container {
  width: 42%;
  min-width: 260px;
  max-width: 420px;
  flex-shrink: 0;
  height: auto;
  min-height: 420px;
  border-radius: 23px 0 0 23px;
}

.aut-featured-v2 .auth-img,
.aut-featured-v2 .avatar-fallback {
  border-radius: 23px 0 0 23px;
}

.aut-featured-v2 .auth-content {
  flex: 1;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  justify-content: center;
}

.aut-featured-v2 .auth-name { font-size: 1.9rem; line-height: 1.15; }
.aut-featured-v2 .auth-role { font-size: 1rem; }

.aut-featured-v2 .view-profile-btn {
  width: auto;
  padding: 0.75rem 2rem;
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* ── Grilla de miembros (3 columnas) ────────────────────── */
.aut-members-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.aut-member-card {
  display: flex;
  flex-direction: column;
}

.aut-member-card .avatar-container {
  height: 310px;
}

/* ── Velo de gradiente sobre la foto ────────────────────── */
.aut-photo-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 28%, rgba(5, 15, 40, 0.88) 100%);
  z-index: 3;
  pointer-events: none;
}

/* ── Caption superpuesto: badge + nombre + rol ──────────── */
.aut-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.5rem 1.35rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
}

.aut-caption-name {
  font-family: var(--font-family-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin: 0;
}

.aut-caption-role {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

/* Badge glassmorphic sobre fondo oscuro */
.aut-photo-caption .auth-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Área expandible (grid-template-rows trick) ─────────── */
.aut-expand-track {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.authority-card:hover .aut-expand-track {
  grid-template-rows: 1fr;
}

.aut-expand-min {
  overflow: hidden;
  min-height: 0;
}

.aut-expand-content {
  padding: 1.25rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

/* CSS var de acento por color de tarjeta */
.authority-card[data-color="indigo"]  { --aut-color: var(--color-indigo); }
.authority-card[data-color="emerald"] { --aut-color: var(--color-emerald); }
.authority-card[data-color="amber"]   { --aut-color: var(--color-amber); }
.authority-card[data-color="blue"]    { --aut-color: var(--color-blue); }

/* Botón del expand activo con color institucional */
.authority-card:hover .aut-expand-content .view-profile-btn {
  background: var(--aut-color, var(--color-indigo));
  border-color: var(--aut-color, var(--color-indigo));
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transform: none;
}

.authority-card:hover .aut-expand-content .view-profile-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .aut-members-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .aut-featured-v2 { flex-direction: column; }
  .aut-featured-v2 .avatar-container {
    width: 100%;
    max-width: 100%;
    height: 300px;
    min-height: auto;
    border-radius: 23px 23px 0 0;
  }
  .aut-featured-v2 .auth-img,
  .aut-featured-v2 .avatar-fallback { border-radius: 23px 23px 0 0; }
  .aut-featured-v2 .auth-content { padding: 2rem 2.25rem 2.25rem; }
  .aut-featured-v2 .auth-name { font-size: 1.55rem; }
}

@media (max-width: 640px) {
  .aut-members-grid { grid-template-columns: 1fr; }
  /* En móvil: siempre expandido para accesibilidad táctil */
  .aut-expand-track { grid-template-rows: 1fr; }
}
