:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-card: #121935;
  --text: #f2f5ff;
  --muted: #aeb8d8;
  --accent: #8c9eff;
  --accent-2: #00e0b8;
  --border: #25305a;
  --max-width: 960px;
  --radius: 14px;
  /* Keep identical in freepik-playbook/styles.css (hero column width). */
  --hero-intro-columns: 1fr minmax(240px, 42%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #18224a 0%, var(--bg) 45%);
  color: var(--text);
  line-height: 1.5;
}

.hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(130deg, rgba(140, 158, 255, 0.2), rgba(0, 224, 184, 0.08));
}

.hero__content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.hero-nav {
  margin: 0 0 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.hero-nav__sep {
  color: var(--muted);
  user-select: none;
}

.home-link {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.home-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  margin-bottom: 0.6rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.hero-intro {
  display: grid;
  grid-template-columns: var(--hero-intro-columns);
  gap: 1.35rem 1.75rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.hero-intro__text {
  min-width: 0;
}

.hero-intro__text .subtitle {
  max-width: none;
  margin: 0.7rem 0 0;
}

.hero-intro__visual {
  margin: 0;
  min-width: 0;
}

.hero-intro__visual-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1735;
  display: block;
  line-height: 0;
}

.hero-intro__visual-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* Dos columnas: mismo offset que freepik-playbook — la foto no queda pegada arriba al título. */
@media (min-width: 861px) {
  .hero-intro__visual {
    margin-top: clamp(1.5rem, 3.8vw, 2.85rem);
  }
}

.subtitle {
  color: var(--muted);
  margin: 0.7rem 0 1.4rem;
  max-width: 70ch;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-start;
}

.controls__course-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.course-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 220px;
}

/* Igual que freepik-playbook: idioma a la derecha de la fila de controles (junto a la búsqueda). */
.hub-language-bar--in-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  text-align: right;
  margin-left: auto;
  flex-shrink: 0;
}

.hub-language-bar__caption {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-language-bar__flags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-flag-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14, 21, 48, 0.85);
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.hub-flag-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hub-flag-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.hub-flag-btn--active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(0, 224, 184, 0.35);
}

.hub-flag {
  display: block;
  width: 36px;
  height: 24px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Misma idea que freepik-playbook: búsqueda en ancho acotado, junto al selector de curso. */
.search-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(220px, 100%);
  flex: 0 1 auto;
  width: min(22rem, 100%);
  max-width: min(22rem, 100%);
}

.search-field .search {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.search-field .search input[type="search"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .controls__course-column {
    width: 100%;
  }

  .hub-language-bar--in-controls {
    margin-left: 0;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
  }

  .hub-language-bar--in-controls .hub-language-bar__caption {
    width: 100%;
    text-align: right;
  }

  .search-field {
    width: 100%;
    max-width: 100%;
  }
}

select,
input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  background: #0e1530;
  color: var(--text);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
  scroll-behavior: smooth;
}

.container--with-sidebar {
  max-width: min(1180px, 100%);
  /* Fixed-width left column reads as a vertical strip (rectangle). */
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: stretch;
  column-gap: 1.1rem;
}

.container--with-sidebar.layout-sidebar-collapsed {
  grid-template-columns: 3.35rem minmax(0, 1fr);
}

.course-sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  width: 100%;
  max-width: 280px;
  min-width: 0;
  min-height: calc(100vh - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
  padding: 0.45rem;
  box-sizing: border-box;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 25, 53, 0.98) 0%, rgba(11, 16, 32, 0.94) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    4px 0 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.course-sidebar .course-shell {
  position: static;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0.75rem 0.72rem 0.85rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(37, 48, 90, 0.85);
  background: rgba(15, 23, 53, 0.65);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.course-sidebar .course-drawer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.course-sidebar .course-drawer__panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.layout-sidebar-collapsed .course-sidebar {
  min-height: auto;
  max-height: none;
  align-self: start;
  max-width: 3.35rem;
  padding: 0.35rem 0.25rem;
}

.layout-sidebar-collapsed .course-sidebar .course-shell {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0.45rem 0.35rem 0.55rem;
}

.course-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

@media (max-width: 820px) {
  .container--with-sidebar {
    grid-template-columns: 1fr;
    max-width: var(--max-width);
  }

  .container--with-sidebar.layout-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: relative;
    top: auto;
    max-width: none;
    width: 100%;
    min-height: auto;
    max-height: none;
    align-self: stretch;
  }

  .layout-sidebar-collapsed .course-sidebar {
    max-width: none;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.22rem;
}

.course-shell {
  backdrop-filter: blur(6px);
}

.course-drawer {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.course-drawer__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.course-shell.course-drawer h2.course-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.course-drawer__toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1735;
  color: var(--text);
  cursor: pointer;
}

.course-drawer__toggle:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.course-drawer__toggle:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.course-drawer__chevron {
  display: block;
  transition: transform 0.22s ease;
  /* Down-chevron rotated: expanded sidebar = arrow left (collapse); collapsed = arrow right (open). */
  transform: rotate(90deg);
}

.course-drawer--collapsed .course-drawer__chevron {
  transform: rotate(-90deg);
}

.layout-sidebar-collapsed .course-drawer__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout-sidebar-collapsed .course-drawer__bar {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
}

.course-drawer__panel {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.course-drawer__panel[hidden] {
  display: none !important;
}

.course-drawer--collapsed {
  padding-bottom: 0.65rem;
}

.course-drawer--collapsed .course-drawer__bar {
  margin-bottom: 0;
}

.course-drawer__lead {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.course-roadmap {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.course-roadmap--stack {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  grid-template-columns: unset;
}

.course-roadmap--stack .module-card {
  padding: 0.52rem 0.62rem;
}

.course-roadmap__group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 0.45rem 0.55rem;
  background: rgba(11, 16, 32, 0.42);
}

.course-roadmap__group-title {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.4rem 0.35rem 0.25rem;
  user-select: none;
}

.course-roadmap__group-title::-webkit-details-marker {
  display: none;
}

.course-roadmap__group[open] .course-roadmap__group-title {
  color: var(--accent-2);
}

.course-roadmap__group--advanced[open] .course-roadmap__group-title {
  color: var(--accent);
}

.course-roadmap__group--addons[open] .course-roadmap__group-title {
  color: #ffd166;
}

.course-roadmap--stack .course-roadmap__group + .course-roadmap__group {
  margin-top: 0.45rem;
}

.course-roadmap__group-inner {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.module-card {
  border: 1px solid var(--border);
  background: #0f1735;
  color: var(--text);
  border-radius: 12px;
  padding: 0.65rem 0.72rem;
  text-align: left;
  cursor: pointer;
}

.module-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 0.18rem;
}

.module-card:hover,
.module-card.active {
  border-color: var(--accent);
  color: var(--accent-2);
}

.module-card.completed {
  border-color: #2bb8a2;
}

.lesson-controls {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.68rem;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.lesson-controls--stack {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.55rem;
  align-items: stretch;
}

.lesson-controls--stack .lesson-nav-btn {
  width: 100%;
}

.lesson-controls--stack .lesson-progress {
  grid-column: 1 / -1;
}

.lesson-nav-btn {
  border: 1px solid var(--border);
  background: #0f1735;
  color: var(--text);
  border-radius: 10px;
  padding: 0.56rem 0.8rem;
  cursor: pointer;
}

.lesson-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lesson-progress p {
  margin: 0 0 0.35rem;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #1b264f;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.lesson-card {
  display: none;
}

.lesson-card.active {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.grid article,
.stack article {
  padding: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.48);
}

.grid article h3,
.stack article h3 {
  margin-top: 0;
}

.card article details {
  margin-top: 0.55rem;
  padding-top: 0.48rem;
  border-top: 1px dashed #2c3a6e;
}

.card article summary {
  color: var(--accent-2);
  font-size: 0.94rem;
}

.timeline {
  display: grid;
  gap: 0.75rem;
}

.timeline article {
  border-left: 2px solid var(--accent);
  padding: 0.35rem 0 0.35rem 0.8rem;
}

.video-link {
  color: var(--accent-2);
  text-decoration: none;
}

.video-link:hover {
  text-decoration: underline;
}

summary {
  cursor: pointer;
  color: var(--accent);
}

.video-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
}

.video-frame iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
}

.visual-with-list {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1.1fr 1fr;
}

.visual-with-list img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1735;
}

.visual-carousel {
  min-width: 0;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1735;
}

.carousel-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

.carousel-figure {
  margin: 0;
  min-width: 0;
}

.carousel-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-height: 320px;
  padding: 0.5rem;
}

.carousel-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.carousel-figcap {
  margin: 0;
  padding: 0.55rem 0.65rem 0.65rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 53, 0.65);
}

.carousel-chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.carousel-btn {
  flex: 0 0 auto;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.carousel-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-2);
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.carousel-status {
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 3.25rem;
  text-align: center;
}

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

.feature-image {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
  background: #0f1735;
}

.lead-capcut-ui {
  margin: 0 0 0.85rem;
}

.lead-capcut-ui .feature-image {
  margin-bottom: 0;
}

.ui-lead-caption {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.42;
  margin: 0.42rem 0 0;
  padding: 0 0.1rem;
}

.card-ui-capcut {
  margin: 0 0 0.75rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1735;
}

.card-ui-capcut img {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.card-learn-link {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
}

.moment-card__thumb-link {
  display: block;
  width: 100%;
  margin-bottom: 0.45rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

.moment-card__thumb-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.moment-card__thumb-link:hover img {
  border-color: var(--accent);
  opacity: 0.96;
}

.moment-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.45rem;
}

.moment-card__thumb-link img {
  margin-bottom: 0;
  display: block;
}

.jump-link {
  display: inline-block;
  text-decoration: none;
  color: var(--accent-2);
  margin-top: 0.42rem;
}

.jump-link:hover {
  text-decoration: underline;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
}

li + li {
  margin-top: 0.46rem;
}

.hidden {
  display: none !important;
}

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

  .visual-with-list {
    grid-template-columns: 1fr;
  }

  .video-frame iframe {
    min-height: 260px;
  }

  .lesson-controls {
    grid-template-columns: 1fr;
  }
}
