/* Public website styles — marketing pages */

/* Keyframes must live outside @layer (they're global) */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@layer components {

/* Terminal-inspired code accents */
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.course-code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Hero gradient */
.hero-gradient {
  background-color: #003C60;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(126, 177, 50, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 120, 193, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(237, 140, 12, 0.06) 0%, transparent 40%),
    linear-gradient(135deg, #003C60 0%, #00609A 40%, #0078C1 100%);
}

/* Blinking terminal cursor */
.terminal-cursor {
  display: inline-block;
  width: 0.5em;
  height: 1.1em;
  background: var(--color-secondary);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* Terminal prompt decoration */
.terminal-prompt::before {
  content: '$ ';
  color: var(--color-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* Subtle grid background for sections */
.grid-bg {
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Category pill */
.category-pill {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-primary);
  color: #fff;
}

/* Course card hover lift */
.course-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 60, 96, 0.10);
}

/* Schedule row hover */
.schedule-row {
  transition: background-color 0.15s ease;
}
.schedule-row:hover {
  background-color: rgba(0, 120, 193, 0.03);
}

/* CTA button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-primary:active {
  transform: scale(0.98);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  background: var(--color-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--color-secondary-dark);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: transparent;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
  border: 2px solid var(--color-primary);
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Section divider */
.section-divider {
  width: 3rem;
  height: 3px;
  background: var(--color-secondary);
  border-radius: 2px;
}

/* Stat counter */
.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

/* Outline list with numbering */
.outline-list {
  counter-reset: outline-counter;
}
.outline-item {
  counter-increment: outline-counter;
  position: relative;
  padding-left: 2.5rem;
}
.outline-item::before {
  content: counter(outline-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.125rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-primary);
  opacity: 0.6;
}

/* Form field focus ring override for public pages */
.pub-form input:focus,
.pub-form select:focus,
.pub-form textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 193, 0.12);
  outline: none;
}

/* Fade-in animation */
.animate-fade-up {
  animation: fade-up 0.5s ease-out both;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Accent CTA button — warm glow */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px rgba(237, 140, 12, 0.35);
}
.btn-accent:hover {
  background: #d97a06;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(237, 140, 12, 0.45);
}
.btn-accent:active {
  transform: translateY(0) scale(0.98);
}

/* ── Sidebar smart-collapse ─────────────────────────────────────────
   Four-phase progressive sidebar: full → cards compact → HYL compact → scroll-through.
   JS adds .sidebar-compact (cards) then .sidebar-hyl-compact (HYL) at different
   scroll thresholds, then adjusts sticky `top` for scroll-through when content
   still overflows. ── */

/* Sticky wrapper — section gap tightens in compact */
.course-sidebar-sticky {
  transition: gap 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-compact.course-sidebar-sticky {
  gap: 0.5rem;
}

/* Upcoming Classes section container tightens */
.sidebar-classes-section {
  transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-compact .sidebar-classes-section {
  padding: 0.75rem 1rem;
}
.sidebar-compact .sidebar-classes-section > h3 {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

/* List container — gap collapses between cards */
.sidebar-classes-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: gap 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-compact .sidebar-classes-list {
  gap: 0.125rem;
}

/* Card */
.sidebar-class-card {
  transition:
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.35s ease,
    border-color 0.35s ease,
    border-radius 0.35s ease,
    box-shadow 0.35s ease;
}

/* Date + Register on one row */
.sidebar-class-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-class-date {
  flex: 1;
  min-width: 0;
}
.sidebar-class-actions {
  flex-shrink: 0;
}

/* Inline price next to heading — collapses in compact */
.sidebar-class-collapsible-inline {
  transition: opacity 0.25s ease;
}
.sidebar-compact .sidebar-class-collapsible-inline {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Compact: cards flatten to tight borderless rows */
.sidebar-compact .sidebar-class-card {
  padding: 0.25rem 0;
  background-color: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #e5e7eb;
}
.sidebar-compact .sidebar-class-card:last-child {
  border-bottom: none;
}
.sidebar-compact .sidebar-class-date {
  font-size: 0.75rem;
}
.sidebar-compact .sidebar-class-actions .btn-secondary,
.sidebar-compact .sidebar-class-actions .btn-outline {
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
}

/* Collapsible rows — grid-template-rows trick for smooth height:auto → 0.
   Collapse: opacity fades with height (same duration).
   Expand: opacity lags 0.08s behind height so space opens before content appears. */
.sidebar-class-collapsible {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease 0.08s;
  opacity: 1;
}
.sidebar-compact .sidebar-class-collapsible {
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease;
}
.sidebar-class-collapsible > * {
  overflow: hidden;
  will-change: auto;
}

/* HYL collapsible — separate class so it can be triggered independently */
.sidebar-hyl-collapsible {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease 0.08s;
  opacity: 1;
}
.sidebar-hyl-compact .sidebar-hyl-collapsible {
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease;
}
.sidebar-hyl-collapsible > * {
  overflow: hidden;
  will-change: auto;
}

/* "How You'll Learn" section spacing tightens (triggered by .sidebar-hyl-compact) */
.sidebar-hyl-section {
  transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-hyl-compact .sidebar-hyl-section {
  padding: 0.75rem 1rem;
}
.sidebar-hyl-header {
  transition: margin 0.35s ease;
}
.sidebar-hyl-compact .sidebar-hyl-header {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}
.sidebar-hyl-item {
  transition: margin 0.3s ease, gap 0.3s ease;
}
.sidebar-hyl-compact .sidebar-hyl-item {
  margin-bottom: 0.25rem;
  gap: 0.375rem;
}
.sidebar-hyl-compact .sidebar-hyl-item:last-child {
  margin-bottom: 0;
}
.sidebar-hyl-compact .sidebar-hyl-icon {
  width: 1rem;
  height: 1rem;
}
.sidebar-hyl-compact .sidebar-hyl-label {
  font-size: 0.75rem;
}

/* HYL compact summary — crossfade with full version */
.sidebar-hyl-compact-summary {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.3s ease 0.15s,
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
    transform 0.3s ease 0.15s;
}
.sidebar-hyl-compact .sidebar-hyl-compact-summary {
  opacity: 1;
  max-height: 10rem;
  transform: translateY(0);
}

/* Compact indicator count + price in section header */
.sidebar-compact-count,
.sidebar-compact-price {
  display: none;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-light);
}
.sidebar-compact .sidebar-compact-count,
.sidebar-compact .sidebar-compact-price {
  display: inline;
}

/* "Bring This Course" section tightens */
.sidebar-compact .sidebar-cta-section {
  padding: 0.75rem 1rem;
}
.sidebar-compact .sidebar-cta-section .btn-accent {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* Details chevron rotation */
details[open] .details-chevron {
  transform: rotate(90deg);
}
details summary {
  list-style: none;
}
details summary::-webkit-details-marker {
  display: none;
}

/* ── Retro article (blog archives) ─────────────────────── */

.retro-article {
  overflow: hidden;
}

/* Table of contents strip */
.retro-toc {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f23 100%);
  padding: 1rem 2rem;
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.8125rem;
  border-bottom: 2px solid #33ff33;
}

.retro-toc-label {
  color: #33ff33;
  font-weight: 700;
  margin-right: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.retro-toc a {
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.15s;
}

.retro-toc a:hover {
  color: #33ff33;
}

.retro-toc-sep {
  color: #555;
  margin: 0 0.5rem;
}

/* Article body prose */
.retro-body {
  padding: 2rem 2.5rem 3rem;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1.7rem,
      rgba(0, 0, 0, 0.015) 1.7rem,
      rgba(0, 0, 0, 0.015) 1.75rem
    ),
    linear-gradient(180deg, #fffef9 0%, #fdfcf5 100%);
  color: #2c3e50;
  font-size: 1rem;
  line-height: 1.75;
}

.retro-body h2 {
  color: var(--color-primary-darker, #003C60);
  font-size: 1.375rem;
  font-weight: 800;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8dcc8;
}

.retro-body h2:first-child {
  margin-top: 0;
}

.retro-body h3 {
  color: #3d3d3d;
  font-size: 1.125rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}

.retro-body p {
  margin: 0.75rem 0;
}

.retro-body ul,
.retro-body ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.retro-body li {
  margin: 0.35rem 0;
}

.retro-body a {
  color: var(--color-primary, #0078C1);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.retro-body a:hover {
  border-bottom-color: var(--color-primary, #0078C1);
}

.retro-body code {
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.875em;
  background: #f0ebe0;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: #8b4513;
}

/* Terminal-style code blocks */
.retro-body pre {
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.8125rem;
  line-height: 1.55;
  background: #0c0c0c;
  color: #d4d4d4;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
  position: relative;
}

.retro-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}

/* Terminal prompt (#) in green */
.retro-prompt {
  color: #33ff33;
  font-weight: 700;
}

/* Commands typed by user in bold white */
.retro-cmd {
  color: #fff;
  font-weight: 700;
}

/* OK status output in green */
.retro-ok {
  color: #33ff33;
}

/* Article images */
.retro-body figure {
  margin: 1.25rem 0;
  text-align: center;
}

.retro-body img {
  max-width: 100%;
  height: auto;
  border: 2px solid #d4c9a8;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Article footer */
.retro-footer {
  background: #f5f0e6;
  border-top: 1px solid #e0d8c8;
  padding: 1.5rem 2.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #707070;
}

.retro-footer code {
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.8em;
  background: #ebe5d8;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.retro-footer p {
  margin: 0.25rem 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .retro-toc {
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
  }
  .retro-body {
    padding: 1.5rem 1.25rem 2rem;
  }
  .retro-footer {
    padding: 1.25rem;
  }
}

} /* end @layer components */
