/* =======================================
   Modern UMU Theme (Global)
   - Accessible, responsive, and clean
   - Shared across all pages
======================================= */

:root {
  /* Brand */
  --umu-red: #80140d;
  --umu-red-light: #b3212d;
  --umu-bg: #f6f4f2;
  --text-dark: #17141f;
  --text-gray: #4b5563;
  --surface: #ffffff;
  --surface-soft: #fff7f6;
  --border: #e7e2e1;

  /* Layout */
  --container-width: 1180px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;
  --nav-height: 74px;

  /* Shadows */
  --shadow-sm: 0 6px 18px rgba(13, 10, 20, 0.08);
  --shadow-md: 0 18px 40px rgba(13, 10, 20, 0.12);
  --shadow-hover: 0 18px 44px rgba(128, 20, 13, 0.18);
  --shadow-float: 0 24px 60px rgba(128, 20, 13, 0.18);
  --shadow-book: 0 24px 48px rgba(15, 14, 25, 0.18);
  --shadow-video: 0 16px 32px rgba(15, 14, 25, 0.14);

  /* Typography */
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Fraunces", "Times New Roman", serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Transitions */
  --t-fast: 0.15s;
  --t-base: 0.28s;
  --t-slow: 0.45s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --umu-bg: #0f1115;
    --text-dark: #f4f4f6;
    --text-gray: #c7ccd6;
    --surface: #171a22;
    --surface-soft: #11141b;
    --border: #2a2f3a;
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.55);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-dark);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff4f1 0, transparent 60%),
    radial-gradient(900px 500px at 90% 0%, #fff0ee 0, transparent 55%),
    var(--umu-bg);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  body {
    background: var(--umu-bg);
  }
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}

a:hover {
  color: var(--umu-red);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(179, 33, 45, 0.32);
  border-radius: 10px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
  color: var(--text-gray);
  max-width: 75ch;
}

main {
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}

section {
  margin-top: var(--space-7);
}

section:first-of-type {
  margin-top: var(--space-5);
}

.section {
  margin-top: var(--space-7);
}

.subtitle {
  color: var(--text-gray);
  font-size: 1rem;
}

.container {
  width: min(92vw, var(--container-width));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------------------------------------
   Header + Navigation (Injected)
--------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -40px;
  background: var(--umu-red);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 2000;
}

.skip-link:focus {
  top: 16px;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--nav-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--umu-red), var(--umu-red-light));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-dark);
}

.logo-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-gray);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-link {
  font-weight: 600;
  color: var(--text-dark);
  position: relative;
  padding: 6px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--umu-red);
  transition: width var(--t-base);
}

.nav-link:hover::after,
.nav-link.is-active::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-dark);
}

.nav-contact:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.nav-toggle-icon {
  display: grid;
  gap: 5px;
}

.nav-toggle-icon span {
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  display: block;
  border-radius: 999px;
  transition: transform var(--t-base), opacity var(--t-base);
}

body.nav-open .nav-toggle-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100vh;
  width: min(360px, 80vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: right var(--t-base);
  z-index: 1500;
  padding: var(--space-7) var(--space-5);
  overflow-y: auto;
}

.nav-drawer-inner {
  display: grid;
  gap: var(--space-4);
}

.nav-drawer .nav-link {
  font-size: 1.05rem;
}

.nav-drawer .nav-contact {
  justify-content: center;
  width: 100%;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 9, 16, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  z-index: 1400;
}

body.nav-open .nav-drawer {
  right: 0;
}

body.nav-open .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

/* Secondary nav pills (in-page) */
.nav-menu {
  margin-top: var(--space-5);
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.nav-pills {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text-dark);
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
}

.nav-pill.active {
  background: var(--surface-soft);
  border-color: rgba(128, 20, 13, 0.3);
  color: var(--umu-red);
}

.nav-pill .num {
  font-size: 0.8rem;
  color: var(--text-gray);
}

/* ---------------------------------------
   Buttons + Pills + Badges
--------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--umu-red);
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base), background var(--t-base);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: var(--umu-red-light);
  color: #fff;
}

.btn-primary {
  background: var(--umu-red);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-soft);
}

.btn-outline,
.btn-secondary-outline {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.btn-outline:hover,
.btn-secondary-outline:hover {
  border-color: var(--umu-red);
  color: var(--umu-red);
}

.btn-reset {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.badge,
.card-badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-dark);
}

.badge.highlight {
  background: rgba(128, 20, 13, 0.08);
  border-color: rgba(128, 20, 13, 0.3);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.role-badges,
.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------------------------------------
   Forms + Filters
--------------------------------------- */

input,
select {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text-dark);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.filter-field {
  display: grid;
  gap: 6px;
  min-width: 200px;
  flex: 1 1 220px;
}

.filter-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.filter-field input,
.filter-field select {
  width: 100%;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
}

.results-meta {
  margin-top: var(--space-3);
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* ---------------------------------------
   Hero + Section Headers
--------------------------------------- */

.hero,
.book-hero,
.intro-banner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-7);
  align-items: center;
}

.hero {
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.page-hero {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(128, 20, 13, 0.08), rgba(255, 255, 255, 0.9));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.page-hero h1 {
  margin-bottom: var(--space-3);
}

.hero-actions,
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-gray);
}

.academic-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.aneca-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.affil-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.affil-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.feature-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.feature-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.feature-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.feature-action {
  display: flex;
  align-items: center;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.hero-image img,
.intro-image img,
.book-cover-wrapper img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-book);
}

.image-frame {
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.section-title,
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-title p {
  margin: 0;
}

.section-header i {
  color: var(--umu-red);
}

.grid-section > h2,
.grid-section > h3 {
  margin-bottom: var(--space-4);
}

/* ---------------------------------------
   Grids + Cards
--------------------------------------- */

.cards-grid,
.courses-grid,
.projects-grid,
.talleres-grid,
.features-grid,
.publicaciones-grid,
.software-grid,
.modules-grid,
.books-grid,
.conferencias-grid,
.gallery-grid {
  display: grid;
  gap: var(--space-5);
}

.cards-grid,
.courses-grid,
.projects-grid,
.talleres-grid,
.features-grid,
.publicaciones-grid,
.software-grid,
.modules-grid,
.books-grid,
.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.publicaciones-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.conferencias-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.features-grid .feature-card {
  text-align: center;
}

.info-card,
.course-card,
.project-card,
.taller-card,
.feature-card,
.feature-item,
.publicacion-card,
.software-card,
.module-card,
.book-card,
.gallery-card,
.blog-card,
.conferencia-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.info-card:hover,
.course-card:hover,
.project-card:hover,
.taller-card:hover,
.feature-card:hover,
.feature-item:hover,
.publicacion-card:hover,
.software-card:hover,
.module-card:hover,
.book-card:hover,
.gallery-card:hover,
.conferencia-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.info-card p,
.feature-card p,
.feature-item p,
.project-card p,
.taller-card p,
.software-card p,
.module-card p,
.blog-card p {
  color: var(--text-gray);
}

.blog-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.module-icon,
.repo-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--umu-red);
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.info-card .meta {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--umu-red);
  font-weight: 700;
}

.pub-card {
  border-left: 4px solid var(--umu-red);
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
}

.pub-title {
  margin: 0;
}

.pub-authors {
  font-weight: 600;
  color: var(--text-dark);
}

.pub-outlet {
  color: var(--text-gray);
  font-style: italic;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.pub-tag--year {
  background: rgba(128, 20, 13, 0.08);
  border-color: rgba(128, 20, 13, 0.25);
  color: var(--umu-red);
}

.pub-tag--quartile {
  background: rgba(17, 122, 70, 0.08);
  border-color: rgba(17, 122, 70, 0.35);
  color: #117a46;
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pub-link,
.pub-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
}

.pub-link:hover,
.pub-copy:hover {
  border-color: var(--umu-red);
  color: var(--umu-red);
}

.pub-link.is-disabled,
.pub-copy:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.feature-item {
  text-align: center;
}

.feature-icon,
.icon {
  font-size: 1.7rem;
  color: var(--umu-red);
  margin-bottom: var(--space-2);
}

.project-card {
  border-left: 4px solid var(--umu-red);
}

.project-code {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(128, 20, 13, 0.1);
  color: var(--umu-red);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: var(--space-3);
}

.pi-block {
  background: var(--surface-soft);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-3);
  border: 1px solid var(--border);
}

.meta,
.meta-label,
.meta-row,
.degree-info,
.details {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: var(--space-2);
  margin-top: var(--space-2);
}

/* ---------------------------------------
   Publications + Books
--------------------------------------- */

.books-showcase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.books-header {
  margin-bottom: var(--space-5);
}

.book-card {
  text-align: center;
}

.book-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.book-cover-wrapper img {
  max-width: 280px;
  margin-inline: auto;
}

.book-badges,
.book-badge,
.book-badge-year {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.book-subtitle {
  font-size: 1.05rem;
  color: var(--text-gray);
}

.edition-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(128, 20, 13, 0.1);
  color: var(--umu-red);
  font-weight: 700;
  font-size: 0.85rem;
}

.book-promo {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.book-cover img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-book);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.checklist li {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.repo-section {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* ---------------------------------------
   Gallery + Lightbox
--------------------------------------- */

.gallery-card {
  padding: 0;
  overflow: hidden;
}

.gallery-section {
  margin-top: var(--space-7);
}

.gallery-desc {
  margin-bottom: var(--space-4);
  color: var(--text-gray);
}

.gallery-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.img-wrapper {
  position: relative;
  overflow: hidden;
}

.img-wrapper img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform var(--t-base);
}

.gallery-card:hover .img-wrapper img {
  transform: scale(1.04);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--t-base);
  color: #fff;
  font-size: 1.2rem;
}

.gallery-card:hover .overlay {
  opacity: 1;
}

.card-info {
  padding: var(--space-4);
}

.photo-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  z-index: 2000;
}

.photo-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: min(90vw, 860px);
  width: 100%;
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.modal-img-container img {
  width: 100%;
  border-radius: var(--radius);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: var(--surface);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.4rem;
}

/* ---------------------------------------
   Video + Iframe
--------------------------------------- */

.iframe-container,
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-video);
  background: #000;
}

.iframe-container iframe,
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------------------------------------
   Dialog (TOC)
--------------------------------------- */

dialog {
  border: 0;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: min(90vw, 640px);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.toc-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

/* ---------------------------------------
   FAQ
--------------------------------------- */

.faq-container details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  background: var(--surface);
}

.faq-container summary {
  font-weight: 700;
  cursor: pointer;
}

/* ---------------------------------------
   Footer
--------------------------------------- */

footer {
  margin-top: var(--space-8);
  padding: var(--space-7) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.social-links {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-4);
}

.social-links a {
  font-size: 1.4rem;
  color: var(--text-dark);
  opacity: 0.7;
}

.social-links a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* Google Translate widget */
#google_translate_container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 900;
}

#google_translate_element {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
}

/* ---------------------------------------
   Utilities
--------------------------------------- */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero,
  .book-hero,
  .intro-banner {
    grid-template-columns: 1fr;
  }

  .book-promo {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .hero,
  .page-hero,
  .books-showcase,
  .book-promo,
  .repo-section {
    padding: var(--space-5);
  }

  .nav-shell {
    gap: var(--space-2);
  }

  .logo-text {
    font-size: 1.05rem;
  }
}
