@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ==========================================================================
   CUSTOM PROPERTIES
   ========================================================================== */
:root {
  --g950: #061910;
  --g900: #0a2e1a;
  --g800: #0f3d22;
  --g700: #155c30;
  --g600: #1e7a3e;
  --g500: #27a050;
  --g400: #3ec468;
  --g300: #7ddfaa;
  --g200: #b8f0ce;
  --g100: #e6faf0;
  --g50:  #f4faf6;
  --accent:       #f0c040;
  --accent-light: #fdf3cc;
  --white: #ffffff;
  --text-dark: #0d1f14;
  --text-mid:  #3a5c47;
  --text-soft: #6b8f78;
  --shadow-sm: 0 2px 10px rgba(10,46,26,0.07);
  --shadow:    0 4px 32px rgba(10,46,26,0.12);
  --shadow-lg: 0 8px 48px rgba(10,46,26,0.18);
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --transition: .2s ease;
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  background: var(--g50);
  overflow-x: hidden;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* Accessibility – focus-visible outlines */
:focus-visible {
  outline: 2px solid var(--g500);
  outline-offset: 2px;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  background: var(--g950);
  color: var(--g300);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  padding: 6px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar a { color: var(--g300); text-decoration: none; transition: color var(--transition); }
.topbar a:hover { color: var(--accent); }
.topbar-left  { display: flex; gap: 22px; align-items: center; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.topbar-right a {
  font-size: 0.8rem;
  padding: 2px 8px;
  border: 1px solid rgba(125,223,170,0.2);
  border-radius: 4px;
  transition: border-color var(--transition), color var(--transition);
}
.topbar-right a:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
header {
  background: var(--white);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center;
  padding: 0 48px;
  height: 74px;
  gap: 20px;
}
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--g700), var(--g500));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; color: var(--white); font-weight: 900;
  letter-spacing: -1px;
  box-shadow: 0 3px 12px rgba(21,92,48,0.35);
}
.logo-text strong { display: block; font-size: 0.97rem; font-weight: 700; color: var(--g900); }
.logo-text span   { font-size: 0.7rem; color: var(--text-soft); font-weight: 400; }

nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
nav a {
  color: var(--text-mid); text-decoration: none;
  font-size: 0.8rem; font-weight: 500;
  padding: 6px 13px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap;
}
nav a:hover { background: var(--g100); color: var(--g700); }
nav a.active { background: var(--g100); color: var(--g700); font-weight: 700; }
.nav-cta {
  background: var(--g600) !important;
  color: var(--white) !important;
  border-radius: var(--radius-sm) !important;
  margin-left: 10px;
  padding: 8px 18px !important;
}
.nav-cta:hover { background: var(--g700) !important; }

.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px;
  flex-direction: column; gap: 5px;
  margin-left: auto;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--g700); border-radius: 2px; transition: transform .2s; }
.mobile-nav {
  display: none; position: fixed;
  top: 74px; left: 0; right: 0; bottom: 0;
  background: var(--white); z-index: 99;
  padding: 20px; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 13px 16px; color: var(--text-mid);
  text-decoration: none; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.95rem;
}
.mobile-nav a:hover, .mobile-nav a.active { background: var(--g100); color: var(--g700); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative; background: var(--g800);
  min-height: 520px; display: flex; align-items: center;
  overflow: hidden; padding: 64px 48px; gap: 40px; flex-wrap: wrap;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 72% 50%, rgba(62,196,104,0.17) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at 15% 80%, rgba(10,20,14,0.7) 0%, transparent 70%);
  pointer-events: none;
}
.hero-pattern {
  position: absolute; inset: 0; opacity: 0.04;
  background-image: repeating-linear-gradient(45deg, var(--g300) 0, var(--g300) 1px, transparent 0, transparent 50%);
  background-size: 28px 28px;
}
.hero-content { position: relative; max-width: 580px; flex: 1; animation: fadeUp .7s ease both; }
.hero-tag {
  display: inline-block;
  background: rgba(240,192,64,0.16); border: 1px solid rgba(240,192,64,0.38);
  color: var(--accent); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 4px 13px; border-radius: 20px; margin-bottom: 18px;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.4rem); color: var(--white); line-height: 1.1; margin-bottom: 18px;
}
.hero h1 em { color: var(--g300); font-style: normal; }
.hero p { color: rgba(255,255,255,0.67); font-size: 1.03rem; line-height: 1.7; margin-bottom: 32px; }
.hero-buttons { display: flex; gap: 13px; flex-wrap: wrap; }
.hero-stats { position: relative; display: flex; gap: 18px; flex-wrap: wrap; align-self: flex-end; animation: fadeUp .8s ease .2s both; }
.stat-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.11);
  border-radius: var(--radius); padding: 20px 26px; text-align: center; backdrop-filter: blur(6px);
}
.stat-card strong { display: block; font-size: 2rem; color: var(--g300); font-family: 'Playfair Display', serif; }
.stat-card span { font-size: 0.72rem; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; }

/* Hero image – responsive replacement for fixed-dimension class */
.hero-image {
  width: clamp(200px, 25vw, 320px);
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}

/* ==========================================================================
   PAGE HERO (INNER PAGES)
   ========================================================================== */
.page-hero {
  background: var(--g800);
  padding: 64px 48px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 120% at 80% 50%, rgba(62,196,104,0.15) 0%, transparent 65%),
    radial-gradient(ellipse 60% 80% at 10% 100%, rgba(10,30,18,0.6) 0%, transparent 70%);
}
.page-hero-pattern {
  position: absolute; inset: 0; opacity: 0.04;
  background-image: repeating-linear-gradient(45deg, var(--g300) 0, var(--g300) 1px, transparent 0, transparent 50%);
  background-size: 28px 28px;
}
.page-hero-content { position: relative; max-width: 700px; }
.page-hero-label {
  display: inline-block;
  background: rgba(240,192,64,0.15);
  border: 1px solid rgba(240,192,64,0.35);
  color: var(--accent);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 20px;
  margin-bottom: 14px;
}
.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--white); line-height: 1.1;
  margin-bottom: 14px;
}
.page-hero h1 em { color: var(--g300); font-style: normal; }
.page-hero p {
  color: rgba(255,255,255,0.65);
  font-size: 1rem; line-height: 1.7; max-width: 520px;
}
.breadcrumb {
  margin-top: 20px;
  display: flex; gap: 6px; align-items: center;
  font-size: 0.75rem; color: rgba(255,255,255,0.35);
}
.breadcrumb a { color: var(--g300); text-decoration: none; }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb span { color: rgba(255,255,255,0.2); }

/* ==========================================================================
   SECTIONS / LAYOUT
   ========================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
section { padding: 80px 48px; }
section.tight { padding: 56px 48px; }

.section-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--g500);
  margin-bottom: 8px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--g900); line-height: 1.15;
  margin-bottom: 14px;
}
.section-sub {
  color: var(--text-mid); font-size: 0.97rem; line-height: 1.7; max-width: 540px;
}
.section-header {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 48px;
  flex-wrap: wrap; gap: 20px;
}
.section-header-text { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  font-weight: 600; cursor: pointer; border: none;
  padding: 11px 26px; border-radius: var(--radius-sm);
  text-decoration: none; transition: background var(--transition), transform .15s, box-shadow var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--g600); color: var(--white); }
.btn-primary:hover { background: var(--g700); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(21,92,48,0.3); }
.btn-secondary { background: var(--g100); color: var(--g700); }
.btn-secondary:hover { background: var(--g200); }
.btn-outline { background: transparent; color: var(--g700); border: 1.5px solid var(--g300); }
.btn-outline:hover { background: var(--g100); }
.btn-ghost { background: transparent; color: var(--text-mid); border: 1.5px solid var(--g200); }
.btn-ghost:hover { border-color: var(--g400); color: var(--g700); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 0.95rem; }
.btn-danger { background: #eb5757; color: var(--white); }
.btn-danger:hover { background: #d94444; }

/* Especialidad cards */
.especialidad-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px;
}
.espec-card {
  background: var(--white); border: 1px solid var(--g200);
  border-radius: var(--radius); padding: 28px 26px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.espec-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.espec-icon { font-size: 2.2rem; margin-bottom: 12px; }
.espec-card h3 { font-size: 0.97rem; font-weight: 700; color: var(--g900); margin-bottom: 8px; }
.espec-card p  { font-size: 0.85rem; color: var(--text-mid); line-height: 1.65; }

/* Quick-access cards row */
.cards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

/* Contact grid */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; }
.contact-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--g100); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.contact-item h4 { font-size: 0.85rem; font-weight: 700; color: var(--g900); margin-bottom: 4px; }
.contact-item p  { font-size: 0.83rem; color: var(--text-mid); line-height: 1.6; }

/* Stat row (institutional) */
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 28px; }
.stat-box {
  flex: 1; min-width: 120px;
  background: var(--g100); border: 1px solid var(--g200);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-box strong { display: block; font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--g700); }
.stat-box span   { font-size: 0.73rem; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.06em; }

/* Two-column layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }
.content-block p { font-size: 0.93rem; color: var(--text-mid); line-height: 1.78; margin-bottom: 16px; }
.content-block p:last-child { margin-bottom: 0; }

/* Highlight box */
.highlight-box {
  background: linear-gradient(135deg, var(--g700), var(--g600));
  border-radius: var(--radius-lg); padding: 36px;
  color: var(--white);
}
.highlight-box h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin-bottom: 14px; }
.highlight-box p  { color: rgba(255,255,255,0.75); font-size: 0.9rem; line-height: 1.75; margin-bottom: 12px; }
.highlight-box ul { list-style: none; padding: 0; }
.highlight-box li { padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.88rem; color: rgba(255,255,255,0.8); display: flex; gap: 8px; align-items: flex-start; }
.highlight-box li:last-child { border-bottom: none; }
.highlight-box li::before { content: '✓'; color: var(--g300); font-weight: 700; flex-shrink: 0; }

/* Title link (utility) */
.title-link {
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
}
.title-link:hover {
  color: #2e7d32;
}

/* ==========================================================================
   NEWS GRID
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.news-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-card-img {
  height: 185px;
  background: linear-gradient(135deg, var(--g200), var(--g100));
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.news-card-img .ph-emoji { font-size: 3.5rem; }
.news-card-tag {
  position: absolute; top: 12px; left: 12px;
  background: var(--g700); color: var(--white);
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 3px 10px; border-radius: 20px;
}
.news-card-body { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; }
.news-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.news-date { font-size: 0.74rem; color: var(--text-soft); }
.news-author {
  font-size: 0.72rem; color: var(--g600); font-weight: 600;
  background: var(--g100); padding: 2px 8px; border-radius: 10px;
}
.news-card h3 { font-size: 1.02rem; color: var(--g900); font-weight: 700; margin-bottom: 8px; line-height: 1.35; }
.news-card p { font-size: 0.86rem; color: var(--text-mid); line-height: 1.65; flex: 1; }
.news-card-footer {
  padding: 13px 24px;
  border-top: 1px solid var(--g100);
  display: flex; justify-content: flex-end;
}
.news-link { font-size: 0.8rem; color: var(--g600); font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.news-link:hover { color: var(--g800); }

/* Featured news card */
.news-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.news-card.featured .news-card-img { height: auto; min-height: 250px; border-radius: 0; }

/* Empty state */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--text-mid);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-chip {
  padding: 6px 16px; border-radius: 20px;
  border: 1.5px solid var(--g200);
  background: var(--white); color: var(--text-mid);
  font-size: 0.78rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.filter-chip:hover, .filter-chip.active {
  border-color: var(--g500); background: var(--g100); color: var(--g700);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-wrapper {
  max-width: 780px; margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  box-shadow: var(--shadow);
  border: 1px solid var(--g200);
}
.form-wrapper h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem; color: var(--g900); margin-bottom: 6px;
}
.form-subtitle { color: var(--text-mid); margin-bottom: 32px; font-size: 0.9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.75rem; font-weight: 700; color: var(--g800); text-transform: uppercase; letter-spacing: 0.06em; }
.form-group input,
.form-group textarea,
.form-group select {
  border: 1.5px solid var(--g200);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  color: var(--text-dark); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(39,160,80,0.12);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-actions { margin-top: 32px; display: flex; gap: 14px; justify-content: flex-end; }

/* Ensure standalone selects also get the correct font */
select { font-family: 'DM Sans', sans-serif; }

/* ==========================================================================
   INFO CARDS
   ========================================================================== */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.info-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 28px 22px;
  text-align: center; text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  display: block;
}
.info-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); }
.info-card-icon { font-size: 2.2rem; margin-bottom: 12px; }
.info-card h3 { font-size: 0.93rem; color: var(--white); font-weight: 600; margin-bottom: 6px; }
.info-card p  { font-size: 0.75rem; color: rgba(255,255,255,0.42); line-height: 1.55; }

.info-card.light {
  background: var(--white);
  border: 1px solid var(--g200);
}
.info-card.light:hover { background: var(--g50); }
.info-card.light h3 { color: var(--g900); }
.info-card.light p  { color: var(--text-mid); }

/* ==========================================================================
   ACCORDION
   ========================================================================== */
.accordion { border: 1px solid var(--g200); border-radius: var(--radius); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--g200); }
.accordion-item:last-child { border-bottom: none; }
.accordion-trigger {
  width: 100%; background: var(--white); border: none;
  padding: 18px 24px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; text-align: left;
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  font-weight: 600; color: var(--g900);
  transition: background var(--transition);
}
.accordion-trigger:hover { background: var(--g50); }
.accordion-trigger.open { background: var(--g50); color: var(--g700); }
.accordion-icon { font-size: 1rem; color: var(--g500); transition: transform .25s; flex-shrink: 0; }
.accordion-trigger.open .accordion-icon { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, padding .35s;
  background: var(--g50);
  padding: 0 24px;
  font-size: 0.9rem; color: var(--text-mid); line-height: 1.75;
}
.accordion-body.open { max-height: 600px; padding: 18px 24px; }

/* ==========================================================================
   TABLE
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--g200); }
table { width: 100%; border-collapse: collapse; background: var(--white); }
thead tr { background: var(--g800); }
thead th { padding: 14px 20px; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--g300); }
tbody tr { border-bottom: 1px solid var(--g100); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--g50); }
tbody td { padding: 13px 20px; font-size: 0.87rem; color: var(--text-dark); }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-green  { background: var(--g100); color: var(--g700); }
.badge-gold   { background: var(--accent-light); color: #8a6800; }
.badge-soft   { background: #f0f4ff; color: #4060b0; }

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--g400), var(--g200));
  border-radius: 2px;
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--g600);
  border: 3px solid var(--g50);
  box-shadow: 0 0 0 2px var(--g400);
}
.timeline-date { font-size: 0.72rem; font-weight: 700; color: var(--g500); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.timeline-title { font-size: 0.97rem; font-weight: 700; color: var(--g900); margin-bottom: 4px; }
.timeline-desc { font-size: 0.86rem; color: var(--text-mid); line-height: 1.65; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.52);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity .25s; padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-lg); padding: 42px;
  max-width: 600px; width: 100%;
  transform: translateY(16px); transition: transform .25s;
  position: relative; max-height: 88vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 18px;
  background: var(--g100); border: none; cursor: pointer;
  font-size: 1.1rem; border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mid); transition: background var(--transition);
}
.modal-close:hover { background: var(--g200); }
.modal-tag {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--g600); background: var(--g100);
  display: inline-block; padding: 3px 10px; border-radius: 20px; margin-bottom: 12px;
}
.modal h2 { font-family: 'Playfair Display', serif; font-size: 1.65rem; color: var(--g900); margin-bottom: 8px; }
.modal-meta { font-size: 0.8rem; color: var(--text-mid); margin-bottom: 18px; }
.modal-img {
  width: 100%; height: 200px;
  background: linear-gradient(135deg, var(--g200), var(--g100));
  border-radius: var(--radius); margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center; font-size: 3.5rem;
  overflow: hidden;
}
.modal-body { font-size: 0.92rem; color: var(--text-mid); line-height: 1.78; }

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast {
  position: fixed; bottom: 30px; right: 30px; z-index: 1000;
  background: var(--g700); color: var(--white);
  padding: 14px 22px; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 500;
  box-shadow: 0 6px 24px rgba(10,46,26,0.28);
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error {
  background: #eb5757 !important;
  box-shadow: 0 6px 24px rgba(235, 87, 87, 0.3) !important;
}

/* ==========================================================================
   SCROLL-TO-TOP BUTTON
   ========================================================================== */
#scrollTop,
.scroll-top-btn {
  position: fixed; bottom: 30px; left: 30px; z-index: 200;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--g600); color: var(--white); border: none;
  cursor: pointer; font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(10,46,26,0.25);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s, transform .3s, background var(--transition);
  pointer-events: none;
}
#scrollTop.visible,
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
#scrollTop:hover,
.scroll-top-btn:hover { background: var(--g700); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  background: var(--g950);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 56px 48px 28px;
  color: rgba(255,255,255,0.4);
  font-size: 0.82rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 44px; margin-bottom: 44px;
}
.footer-brand .logo-text strong { color: var(--g300); }
.footer-brand .logo-text span   { color: rgba(255,255,255,0.3); }
.footer-desc { margin-top: 14px; line-height: 1.7; color: rgba(255,255,255,0.38); }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
  width: 33px; height: 33px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); text-decoration: none; font-size: 0.8rem;
  transition: background var(--transition), color var(--transition);
}
.footer-social a:hover { background: var(--g700); color: var(--white); }
.footer-col h4 {
  color: var(--g300); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 16px;
}
.footer-col a {
  display: block; color: rgba(255,255,255,0.4); text-decoration: none;
  margin-bottom: 9px; transition: color var(--transition); font-size: 0.83rem;
}
.footer-col a:hover { color: var(--g300); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login-section {
  min-height: calc(100vh - 74px - 33px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  background: var(--g900);
  overflow: hidden;
}
.login-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(62, 196, 104, 0.15) 0%, transparent 75%);
  pointer-events: none;
}

.login-container {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
  animation: loginFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}
.login-header .logo-icon {
  margin: 0 auto 16px;
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
}
.login-header h2 {
  font-family: 'Playfair Display', serif;
  color: var(--g900);
  font-size: 1.8rem;
  margin-bottom: 6px;
}
.login-header p {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.form-group-login {
  position: relative;
  margin-bottom: 22px;
}
.form-group-login label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color var(--transition);
}
.form-group-login input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--g200);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--g50);
  transition: all var(--transition);
}
.form-group-login input:focus {
  outline: none;
  border-color: var(--g500);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--g100);
}
.form-group-login input:focus + label {
  color: var(--g600);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-mid);
  margin-bottom: 26px;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.remember-me input {
  caret-color: var(--g500);
  cursor: pointer;
}
.forgot-password {
  color: var(--g600);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.forgot-password:hover {
  color: var(--g800);
  text-decoration: underline;
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--g600);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(30,122,62,0.2);
}
.btn-login:hover {
  background: var(--g700);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21,92,48,0.3);
}
.btn-login:active {
  transform: translateY(1px);
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--g100);
  font-size: 0.85rem;
  color: var(--text-mid);
}
.login-footer a {
  color: var(--g600);
  text-decoration: none;
  font-weight: 600;
}
.login-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   INSTITUTIONAL PAGE
   ========================================================================== */
.inst-section { padding: 72px 48px; }
.inst-section:nth-child(even) { background: var(--g50); }
.inst-section:nth-child(odd)  { background: var(--white); }

.inst-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; max-width: 1200px; margin: 0 auto; padding: 0 48px; }

.inst-nav {
  position: sticky; top: 90px; align-self: start;
  background: var(--white); border: 1px solid var(--g200);
  border-radius: var(--radius); overflow: hidden;
}
.inst-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; color: var(--text-mid); text-decoration: none;
  font-size: 0.84rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.inst-nav a:hover { background: var(--g50); color: var(--g700); }
.inst-nav a.active { border-left-color: var(--g500); background: var(--g50); color: var(--g700); font-weight: 700; }
.inst-nav-label { padding: 12px 18px 6px; font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-soft); }

/* Materias grid */
.materias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.materia-card {
  background: var(--white); border: 1px solid var(--g200);
  border-radius: var(--radius); padding: 22px 22px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.materia-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.materia-year { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--g500); margin-bottom: 6px; }
.materia-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--g900); margin-bottom: 4px; }
.materia-card p  { font-size: 0.8rem; color: var(--text-mid); line-height: 1.55; }

/* Subject list (renamed from .MIBOMBO) */
.subject-list { list-style-type: none; padding: 0; margin: 0; }
.subject-list li { font-size: 0.85rem; padding: 4px 0; border-bottom: 1px solid var(--g50); color: var(--text-mid); }
.subject-list li:last-child { border-bottom: none; }

/* Autoridades grid */
.autoridades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.autoridad-card {
  position: relative;
  background: var(--white); border: 1px solid var(--g200);
  border-radius: var(--radius); padding: 26px 22px; text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.autoridad-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.autoridad-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--g600), var(--g400));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--white); margin: 0 auto 12px;
}
.autoridad-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--g900); margin-bottom: 4px; }
.autoridad-card .cargo { font-size: 0.75rem; color: var(--g600); font-weight: 600; background: var(--g100); padding: 3px 10px; border-radius: 20px; display: inline-block; }

/* Calendar grid */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.cal-month {
  background: var(--white); border: 1px solid var(--g200);
  border-radius: var(--radius); overflow: hidden;
}
.cal-month-header {
  background: var(--g800); color: var(--white);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
}
.cal-month-header h4 { font-size: 0.9rem; font-weight: 700; color: var(--g300); }
.cal-month-header span { font-size: 0.72rem; color: rgba(255,255,255,0.4); }
.cal-event {
  position: relative;
  padding: 13px 20px; border-bottom: 1px solid var(--g100);
  display: flex; gap: 14px; align-items: flex-start;
  font-size: 0.85rem;
}
.cal-event:last-child { border-bottom: none; }
.cal-day {
  min-width: 36px; height: 36px;
  background: var(--g100); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.88rem; color: var(--g700); flex-shrink: 0;
}
.cal-day.important { background: var(--g700); color: var(--white); }
.cal-event-info strong { display: block; color: var(--g900); font-weight: 600; font-size: 0.86rem; margin-bottom: 2px; }
.cal-event-info span  { color: var(--text-soft); font-size: 0.76rem; }

/* ==========================================================================
   ADMIN CONTROLS
   ========================================================================== */
.admin-badge {
  background: var(--accent);
  color: var(--g950);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}
.edit-btn-inline {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--white);
  border: 1px solid var(--g200);
  color: var(--g700);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  z-index: 10;
  text-decoration: none;
  font-size: 0.85rem;
}
.edit-btn-inline:hover {
  background: var(--g600);
  color: var(--white);
  border-color: var(--g600);
  transform: scale(1.1);
}
.edit-btn-inline.delete {
  right: 48px;
  color: #eb5757;
  border-color: #ffd8d8;
}
.edit-btn-inline.delete:hover {
  background: #eb5757;
  color: var(--white);
  border-color: #eb5757;
}
.card-admin-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 20;
}
.admin-section-header {
  border-bottom: 2px dashed var(--g200);
  padding-bottom: 16px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-section-header h3 {
  font-family: 'Playfair Display', serif;
  color: var(--g900);
}

/* ==========================================================================
   LOGS
   ========================================================================== */
.logs-section {
  padding: 60px 48px;
  background: var(--white);
  min-height: 70vh;
}
.log-action-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-crear    { background: #e6faf0; color: #1e7a3e; }
.badge-editar   { background: #fdf3cc; color: #8a6800; }
.badge-eliminar { background: #ffebeb; color: #eb5757; }
.badge-sesion   { background: #edf2f7; color: #4a5568; }

/* ==========================================================================
   SKELETON / LOADING STATE
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--g100) 25%, var(--g50) 50%, var(--g100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.anim-delay-1 { transition-delay: .1s !important; }
.anim-delay-2 { transition-delay: .2s !important; }
.anim-delay-3 { transition-delay: .3s !important; }

/* ==========================================================================
   MEDIA QUERIES
   ========================================================================== */

/* ---------- Tablet (≤ 1024px) ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .news-card.featured { grid-column: auto; grid-template-columns: 1fr; }

  /* Cards-row: 2 columns on tablet */
  .cards-row { grid-template-columns: repeat(2, 1fr); }

  /* Autoridades: 2 columns on tablet */
  .autoridades-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Small tablet / large mobile (≤ 900px) ---------- */
@media (max-width: 900px) {
  header  { padding: 0 20px; }
  nav     { display: none; }
  .hamburger { display: flex; }
  section { padding: 56px 20px; }
  section.tight { padding: 40px 20px; }
  .page-hero { padding: 48px 20px; }
  .topbar { padding: 6px 20px; }
  .form-wrapper { padding: 28px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  footer  { padding: 44px 20px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  /* Institutional sections */
  .inst-section { padding: 48px 20px; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .inst-layout { grid-template-columns: 1fr; padding: 0 20px; }

  /* Hide sidebar navigation on mobile – content already goes single-column */
  .inst-nav { display: none; }

  /* Logs */
  .logs-section { padding: 40px 20px; }

  /* Hero stacks vertically */
  .hero {
    flex-direction: column;
    padding: 48px 20px;
    min-height: auto;
    text-align: center;
  }
  .hero-content { max-width: 100%; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; align-self: center; }
  .hero-image { width: clamp(180px, 50vw, 280px); margin: 0 auto; }

  /* Admin section header stacks on mobile */
  .admin-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Logs section header wraps */
  .logs-section .admin-section-header {
    flex-wrap: wrap;
  }
}

/* ---------- Mobile (≤ 600px) ---------- */
@media (max-width: 600px) {
  .section-header { flex-direction: column; align-items: flex-start; }
  .page-hero h1 { font-size: 1.9rem; }

  /* Topbar: hide left, center right */
  .topbar-left { display: none; }
  .topbar { justify-content: center; }

  /* Contact grid: 1 column */
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Cards-row: 1 column on mobile */
  .cards-row { grid-template-columns: 1fr; }

  /* Calendar grid: 1 column */
  .cal-grid { grid-template-columns: 1fr; }

  /* Stat row: stack vertically */
  .stat-row { flex-direction: column; }
  .stat-box { min-width: 0; }

  /* Login container: tighter padding on very small screens */
  .login-container { padding: 28px 20px; }
  .login-header h2 { font-size: 1.5rem; }

  /* News card admin controls – relative flow instead of absolute overlap */
  .card-admin-controls {
    position: relative;
    top: auto;
    right: auto;
    justify-content: flex-end;
    padding: 8px 12px 0;
  }

  /* Table: smaller text on mobile for logs */
  .logs-section table { font-size: 0.78rem; }
  .logs-section thead th { padding: 10px 12px; font-size: 0.68rem; }
  .logs-section tbody td { padding: 10px 12px; font-size: 0.78rem; }
}

/* ---------- Small mobile (≤ 420px) ---------- */
@media (max-width: 420px) {
  /* Autoridades: 1 column on small mobile */
  .autoridades-grid { grid-template-columns: 1fr; }

  /* Hero stats: full width cards */
  .stat-card { flex: 1 1 100%; }
}  /* ==========================================================================
   SECCIÓN: GALERÍA DE LA ESCUELA (DOS BLOQUES ROTATIVOS)
   ========================================================================== */
.school-action {
  padding: 80px 24px;
  background-color: var(--g50);
}

.action-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.school-action .section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--g800);
  margin-bottom: 12px;
}

.school-action .section-subtitle {
  color: var(--text-mid);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 48px auto;
  line-height: 1.6;
}

/* Distribución en 2 columnas en PC */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 40px;
}

/* Modificación para pantallas chicas (celulares) para que no se rompa */
@media (max-width: 600px) {
  .action-grid {
    grid-template-columns: 1fr;
  }
}

.action-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(10, 46, 26, 0.12);
}

.action-card-img {
  position: relative;
  width: 100%;
  height: 320px; /* Un poco más alto para resaltar mejor los detalles de las aulas */
  overflow: hidden;
  background-color: #e6faf0;
}

.action-card-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out; /* Transición suave desvanecida */
  z-index: 1;
}

.action-card-img img.active {
  opacity: 1;
  z-index: 2;
}

.action-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-card-content h3 {
  font-family: 'DM Sans', sans-serif;
  color: var(--g900);
  font-size: 1.4rem;
  margin: 0;
  font-weight: 600;
}

.action-card-content p {
  color: var(--text-mid);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0;
}
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 50px; /* Ajusta según el tamaño de tu imagen */
    width: auto;
    object-fit: contain;
}