/* ============================================
   DE PLATFORM - Gate Detail Pages
   Coursera/edX Style Course Landing & Content
============================================ */

/* ==========================================
   GATE HERO
========================================== */
.gate-hero {
  padding-top: calc(var(--nav-height) + var(--space-2xl));
  padding-bottom: var(--space-3xl);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.gate-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 500px;
  height: 100%;
  background: radial-gradient(ellipse at 80% 50%, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}

.gate-hero__inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-3xl);
  align-items: start;
  position: relative;
  z-index: 1;
}

.gate-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.gate-hero__breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.gate-hero__breadcrumb a:hover {
  color: var(--accent);
}

.gate-hero__breadcrumb .sep {
  color: var(--text-subtle);
}

.gate-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.gate-hero__badge--free {
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.gate-hero__badge--paid {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.gate-hero__gate-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.gate-hero__title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.gate-hero__description {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  max-width: 640px;
}

.gate-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.gate-hero__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

.gate-hero__meta-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.gate-hero__meta-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.gate-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.gate-hero__tag {
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================
   GATE SIDEBAR (Sticky CTA Card)
========================================== */
.gate-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-lg));
}

.gate-sidebar__card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card-hover);
}

.gate-sidebar__preview {
  height: 200px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gate-sidebar__preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M20 20h20v20H20V20zM0 0h20v20H0V0z'/%3E%3C/g%3E%3C/svg%3E");
}

.gate-sidebar__gate-number {
  font-size: 80px;
  font-weight: 800;
  color: var(--text-subtle);
  opacity: 0.3;
  position: relative;
  z-index: 1;
}

.gate-sidebar__body {
  padding: var(--space-xl);
}

.gate-sidebar__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.gate-sidebar__price-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.gate-sidebar__price-note {
  font-size: 14px;
  color: var(--text-muted);
}

.gate-sidebar__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.gate-sidebar__cta .btn {
  width: 100%;
  justify-content: center;
}

.gate-sidebar__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.gate-sidebar__feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.gate-sidebar__feature-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gate-sidebar__feature-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 1.5;
}

/* ==========================================
   GATE CONTENT SECTIONS
========================================== */
.gate-body {
  padding: var(--space-3xl) 0;
}

.gate-body__inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-3xl);
  align-items: start;
}

.gate-body__main {
  min-width: 0;
}

/* What You'll Learn */
.gate-learn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.gate-learn__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.gate-learn__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.gate-learn__item {
  display: flex;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gate-learn__check {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
}

/* Prerequisites */
.gate-prereqs {
  margin-bottom: var(--space-2xl);
}

.gate-prereqs__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.gate-prereqs__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.gate-prereqs__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

.gate-prereqs__item .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================
   CURRICULUM ACCORDION
========================================== */
.gate-curriculum {
  margin-bottom: var(--space-2xl);
}

.gate-curriculum__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.gate-curriculum__title {
  font-size: 20px;
  font-weight: 700;
}

.gate-curriculum__summary {
  font-size: 13px;
  color: var(--text-muted);
}

.gate-module {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.gate-module:hover {
  border-color: var(--border-highlight);
}

.gate-module__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-lg);
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  gap: var(--space-md);
}

.gate-module__toggle:hover {
  background: var(--bg-card-hover);
}

.gate-module__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.gate-module__number {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gate-module.is-open .gate-module__number {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.gate-module__info {
  flex: 1;
  min-width: 0;
}

.gate-module__name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.gate-module__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.gate-module__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.gate-module__lock {
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
}

.gate-module__lock svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.gate-module__chevron {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.gate-module__chevron svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.gate-module.is-open .gate-module__chevron {
  transform: rotate(180deg);
}

.gate-module__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.gate-module.is-open .gate-module__content {
  max-height: 1000px;
}

.gate-module__lessons {
  padding: 0 var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.gate-lesson {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
}

.gate-lesson:last-child {
  border-bottom: none;
}

.gate-lesson__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.gate-lesson__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.gate-lesson__icon--video svg { stroke: var(--info); }
.gate-lesson__icon--reading svg { stroke: var(--accent); }
.gate-lesson__icon--quiz svg { stroke: var(--success); }
.gate-lesson__icon--exercise svg { stroke: #a855f7; }

.gate-lesson__name {
  flex: 1;
  min-width: 0;
}

.gate-lesson__duration {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gate-lesson__lock-icon {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.gate-lesson__lock-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* ==========================================
   INSTRUCTOR SECTION
========================================== */
.gate-instructor {
  margin-bottom: var(--space-2xl);
}

.gate-instructor__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.gate-instructor__card {
  display: flex;
  gap: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.gate-instructor__avatar {
  width: 72px;
  height: 72px;
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.gate-instructor__info {
  flex: 1;
}

.gate-instructor__name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.gate-instructor__role {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.gate-instructor__bio {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   GATE DESCRIPTION (Long text)
========================================== */
.gate-description {
  margin-bottom: var(--space-2xl);
}

.gate-description__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.gate-description__text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.gate-description__text p {
  margin-bottom: var(--space-md);
}

/* ==========================================
   PAYWALL OVERLAY
========================================== */
.gate-paywall {
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  margin: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.gate-paywall::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.gate-paywall__icon {
  width: 64px;
  height: 64px;
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.gate-paywall__icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.gate-paywall__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.gate-paywall__text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.gate-paywall__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.gate-paywall__price-value {
  font-size: 44px;
  font-weight: 700;
  color: var(--text-primary);
}

.gate-paywall__price-note {
  font-size: 14px;
  color: var(--text-muted);
}

.gate-paywall__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.gate-paywall__actions .btn {
  min-width: 280px;
}

.gate-paywall__bundle {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-muted);
}

.gate-paywall__bundle a {
  color: var(--accent);
  font-weight: 600;
}

.gate-paywall__bundle a:hover {
  text-decoration: underline;
}

/* ==========================================
   MOBILE SIDEBAR CTA (Bottom bar)
========================================== */
.gate-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-nav-scroll);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: var(--space-md) var(--space-lg);
  z-index: 100;
}

.gate-mobile-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.gate-mobile-cta__price {
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}

.gate-mobile-cta .btn {
  flex: 1;
  max-width: 240px;
  justify-content: center;
}

/* ==========================================
   GATE CONTENT PAGE (Learning View)
========================================== */
.gate-content-page {
  padding-top: var(--nav-height);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.gate-content__layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - var(--nav-height));
}

/* Content Sidebar */
.gate-content__sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
}

.gate-content__sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.gate-content__sidebar-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.gate-content__sidebar-gate {
  font-size: 12px;
  color: var(--text-muted);
}

.gate-content__progress {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.gate-content__progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.gate-content__progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.gate-content__progress-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* Sidebar module list */
.gate-content__modules {
  padding: var(--space-sm) 0;
}

.gate-content__module-group {
  border-bottom: 1px solid var(--border-color);
}

.gate-content__module-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  gap: var(--space-sm);
}

.gate-content__module-toggle:hover {
  background: var(--bg-tertiary);
}

.gate-content__module-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}

.gate-content__module-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.gate-content__module-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.gate-content__module-group.is-open .gate-content__module-chevron {
  transform: rotate(180deg);
}

.gate-content__lesson-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.gate-content__module-group.is-open .gate-content__lesson-list {
  max-height: 500px;
}

.gate-content__lesson-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg) var(--space-sm) calc(var(--space-lg) + var(--space-md));
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.gate-content__lesson-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.gate-content__lesson-item.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.gate-content__lesson-item.is-completed {
  color: var(--success);
}

.gate-content__lesson-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-highlight);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-content__lesson-item.is-completed .gate-content__lesson-check {
  background: var(--success);
  border-color: var(--success);
}

.gate-content__lesson-item.is-completed .gate-content__lesson-check::after {
  content: '';
  width: 8px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Content Main Area */
.gate-content__main {
  padding: var(--space-2xl) var(--space-3xl);
  max-width: 800px;
}

.gate-content__lesson-header {
  margin-bottom: var(--space-2xl);
}

.gate-content__lesson-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.gate-content__lesson-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.gate-content__lesson-duration {
  font-size: 13px;
  color: var(--text-muted);
}

.gate-content__lesson-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.gate-content__lesson-body h2 {
  font-size: 22px;
  margin: var(--space-2xl) 0 var(--space-md);
}

.gate-content__lesson-body h3 {
  font-size: 18px;
  margin: var(--space-xl) 0 var(--space-md);
}

.gate-content__lesson-body p {
  margin-bottom: var(--space-md);
}

.gate-content__lesson-body ul,
.gate-content__lesson-body ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.gate-content__lesson-body li {
  margin-bottom: var(--space-sm);
  list-style: disc;
  color: var(--text-secondary);
}

.gate-content__lesson-body ol li {
  list-style: decimal;
}

.gate-content__lesson-body blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-md) var(--space-lg);
  background: var(--accent-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-md);
  font-style: italic;
  color: var(--text-secondary);
}

.gate-content__lesson-body .info-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.gate-content__lesson-body .info-box h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--accent);
}

/* Lesson Navigation */
.gate-content__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
  gap: var(--space-md);
}

.gate-content__nav-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.gate-content__nav-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.gate-content__nav-btn--complete {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
  font-weight: 600;
}

.gate-content__nav-btn--complete:hover {
  background: var(--accent-hover);
}

/* Mobile sidebar toggle */
.gate-content__sidebar-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-size: 20px;
}

/* ==========================================
   RELATED GATES
========================================== */
.gate-related {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border-color);
}

.gate-related__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-xl);
}

.gate-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* ==========================================
   RESPONSIVE - Mobile
========================================== */
@media (max-width: 768px) {
  .gate-hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .gate-sidebar {
    position: relative;
    top: 0;
  }

  .gate-body__inner {
    grid-template-columns: 1fr;
  }

  .gate-body__sidebar-placeholder {
    display: none;
  }

  .gate-learn__grid {
    grid-template-columns: 1fr;
  }

  .gate-mobile-cta {
    display: block;
  }

  .gate-related__grid {
    grid-template-columns: 1fr;
  }

  /* Content page mobile */
  .gate-content__layout {
    grid-template-columns: 1fr;
  }

  .gate-content__sidebar {
    position: fixed;
    top: var(--nav-height);
    left: -100%;
    width: 85%;
    max-width: 320px;
    z-index: 500;
    transition: left 0.3s ease;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-dropdown);
  }

  .gate-content__sidebar.is-open {
    left: 0;
  }

  .gate-content__sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gate-content__main {
    padding: var(--space-lg);
  }

  .gate-content__lesson-title {
    font-size: 22px;
  }

  .gate-content__nav {
    flex-direction: column;
  }

  .gate-content__nav-btn {
    width: 100%;
    justify-content: center;
  }

  .gate-instructor__card {
    flex-direction: column;
    text-align: center;
  }

  .gate-instructor__avatar {
    margin: 0 auto;
  }

  .gate-paywall__actions .btn {
    min-width: auto;
    width: 100%;
  }

  /* Add bottom padding for sticky CTA */
  .gate-body {
    padding-bottom: 100px;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .gate-hero__inner {
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
  }

  .gate-body__inner {
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
  }

  .gate-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gate-content__layout {
    grid-template-columns: 260px 1fr;
  }

  .gate-content__main {
    padding: var(--space-xl);
  }
}

/* Large screens */
@media (min-width: 1440px) {
  .gate-hero__inner {
    grid-template-columns: 1fr 400px;
  }

  .gate-body__inner {
    grid-template-columns: 1fr 400px;
  }
}

/* Sidebar overlay backdrop for mobile */
.gate-content__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 499;
}

.gate-content__overlay.is-visible {
  display: block;
}
