/*
 * STEP project custom styles.
 * Loaded after Bootstrap and BS5Docs. Scoped classes keep the base theme intact.
 */

:root {
  --step-accent: #0f5f73;
  --step-accent-hover: #094a5a;
  --step-accent-soft: #e6f2f4;
  --step-border: #b9d3d8;
  --step-focus: #8a5600;
  --step-radius: 0.75rem;
  --step-space: 1.25rem;
  --step-card-shadow: 0 0.25rem 0.75rem rgb(15 95 115 / 12%);
}

[data-bs-theme="dark"] {
  --step-accent: #58c7d7;
  --step-accent-hover: #8bd8e2;
  --step-accent-soft: #123941;
  --step-border: #3d6972;
  --step-focus: #ffd166;
  --step-card-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 28%);
}

/* Clear keyboard focus without changing Bootstrap's base controls. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--step-focus);
  outline-offset: 3px;
}

.step-hero {
  border-color: var(--step-border) !important;
  background: var(--step-accent-soft) !important;
  box-shadow: var(--step-card-shadow);
}

.step-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.step-hero .lead {
  max-width: 44rem;
}

.step-hero .btn-primary,
.step-class-card .btn-primary {
  --bs-btn-bg: var(--step-accent);
  --bs-btn-border-color: var(--step-accent);
  --bs-btn-hover-bg: var(--step-accent-hover);
  --bs-btn-hover-border-color: var(--step-accent-hover);
  --bs-btn-active-bg: var(--step-accent-hover);
  --bs-btn-active-border-color: var(--step-accent-hover);
  --bs-btn-disabled-bg: var(--step-accent);
  --bs-btn-disabled-border-color: var(--step-accent);
}

.step-hero .btn-outline-primary,
.step-contact-callout .btn-outline-primary,
.step-catalog .btn-outline-primary,
.step-class-detail .btn-outline-primary,
.step-featured-classes .btn-outline-primary {
  --bs-btn-color: var(--step-accent);
  --bs-btn-border-color: var(--step-accent);
  --bs-btn-hover-bg: var(--step-accent);
  --bs-btn-hover-border-color: var(--step-accent);
  --bs-btn-active-bg: var(--step-accent-hover);
  --bs-btn-active-border-color: var(--step-accent-hover);
}

.step-quick-link-card,
.step-subject-card,
.step-class-card,
.step-class-details {
  border-color: var(--step-border);
  border-radius: var(--step-radius);
  box-shadow: 0 0.125rem 0.375rem rgb(0 0 0 / 6%);
}

.step-quick-link-card:hover,
.step-quick-link-card:focus-visible,
.step-subject-card:hover {
  box-shadow: var(--step-card-shadow);
}

[data-bs-theme="dark"] .step-hero .btn-primary,
[data-bs-theme="dark"] .step-class-card .btn-primary {
  --bs-btn-color: #102a30;
  --bs-btn-hover-color: #102a30;
  --bs-btn-active-color: #102a30;
}

.step-featured-classes,
.step-subject-listing,
.step-catalog,
.step-class-detail {
  margin-bottom: 2rem;
}

.step-class-card .card-body,
.step-subject-card .card-body {
  padding: var(--step-space);
}

.step-status {
  border: 1px solid currentColor;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.4em 0.65em;
}

.step-status.text-bg-success {
  background-color: #146c43 !important;
  color: #fff !important;
}

.step-status.text-bg-warning,
.step-status.text-bg-info {
  color: #1d2b31 !important;
}

.step-status.text-bg-secondary {
  background-color: #59636c !important;
  color: #fff !important;
}

.step-status.text-bg-danger {
  background-color: #a61b29 !important;
  color: #fff !important;
}

.step-class-details .card-header {
  border-bottom-color: var(--step-border);
  font-weight: 700;
}

.step-class-details dt {
  color: var(--bs-secondary-color);
}

.step-contact-callout,
.step-empty-state {
  border-color: var(--step-border);
  border-left: 0.35rem solid var(--step-accent);
  border-radius: var(--step-radius);
}

.step-empty-state {
  background: var(--step-accent-soft);
}

/* Trusted lesson iframe: the lesson remains a separate uploaded file. */
.step-lesson-embed {
  width: 90%;
  aspect-ratio: 16 / 9;
  margin-right: auto;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid var(--step-border);
  border-radius: var(--step-radius);
  background: var(--bs-body-bg);
}

.step-lesson-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

/* Privacy-enhanced YouTube video fallback for a Class. */
.step-video-embed {
  width: 90%;
  aspect-ratio: 16 / 9;
  margin-right: auto;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid var(--step-border);
  border-radius: var(--step-radius);
  background: var(--bs-body-bg);
}

.step-video-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.step-pdf-embed {
  width: 100%;
  min-height: 42rem;
  overflow: hidden;
  border: 1px solid var(--step-border);
  border-radius: var(--step-radius);
  background: var(--bs-body-bg);
}

.step-pdf-embed iframe {
  display: block;
  width: 100%;
  min-height: 42rem;
  border: 0;
}

.step-lesson-instruction {
  color: var(--bs-secondary-color);
}

.step-resource-list {
  border-color: var(--step-border);
}

.step-resource-list .list-group-item {
  background: var(--bs-body-bg);
  border-color: var(--step-border);
}

/* Google Calendar iframe wrapper; iframe source stays editor-managed. */
.step-calendar-embed {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--step-border);
  border-radius: var(--step-radius);
  background: var(--bs-body-bg);
}

.step-calendar-embed iframe {
  display: block;
  width: 100%;
  min-height: 700px;
  border: 0;
}

@media (max-width: 575.98px) {
  .step-hero {
    padding: 1.5rem !important;
  }

  .step-hero .btn {
    width: 100%;
  }

  .step-class-details dt {
    margin-top: 0.5rem;
  }

}

/* Compact the entire homepage hero panel and its primary content to 90%. */
.step-hero {
  padding: 1.35rem !important;
}

.step-hero .display-6 {
  font-size: 2.25rem;
}

.step-hero .lead {
  font-size: 1.125rem;
}

.step-hero .btn-lg {
  padding: 0.45rem 0.9rem;
  font-size: 1.125rem;
}

@media (min-width: 768px) {
  .step-hero {
    padding: 2.7rem !important;
  }
}

/* Keep sidebar copyright and credits together at the desktop panel bottom. */
@media (min-width: 768px) {
  .menu-area {
    position: sticky;
    top: 56px;
    align-self: flex-start;
    height: calc(100vh - 56px) !important;
    display: flex !important;
    flex-direction: column;
  }

  .step-sidebar-meta {
    margin-top: auto;
    padding-top: 2rem;
  }

  .step-sidebar-meta .bs5docs-footer {
    margin-top: 0 !important;
  }

  .step-sidebar-meta .step-sidebar-credit {
    margin-top: 0.667rem !important;
  }
}

/* Course and Class short descriptions render safe Markdown blocks. */
.step-rich-description > :last-child {
  margin-bottom: 0;
}

/* Separate offering descriptions from their image/details and registration row. */
.step-detail-description {
  margin-bottom: 1.5rem;
}

/* Course/Class cover display size is selected by an Administrator (50–100%). */
.step-offering-cover {
  display: block;
  width: var(--step-cover-scale, 100%);
  max-width: 100%;
  height: auto;
}

/* Custom schedule text uses the same safe Markdown block treatment. */
.step-schedule-markdown {
  margin-bottom: 1rem;
}

/* Bludit site logo at the top of the shared left navigation panel. */
.step-sidebar-logo {
  padding: 1rem 1rem 0.5rem;
  text-align: left;
}

.step-sidebar-logo img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Bring announcement titles closer to the top while retaining message padding. */
.step-home-announcements .alert {
  padding-top: 0.5rem;
}

/* Override the base page h3 top margin inside announcement panels. */
.step-home-announcements .alert-heading {
  margin-top: 0 !important;
}
