/* Public pages only. This stylesheet is not loaded by the admin renderer. */
.public-page {
  --masthead-height: 240px;
}

.site-masthead {
  height: var(--masthead-height);
  border-bottom: 1px solid #edf0f4;
  background: var(--paper);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 48px);
  height: 100%;
  margin-inline: auto;
  gap: 32px;
}

.masthead-mascot {
  flex: 0 0 auto;
  width: 260px;
  height: 208px;
  object-fit: contain;
}

.masthead-wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.masthead-wordmark a {
  text-decoration: none;
}

.site-shell {
  --sidebar-width: 240px;
  --space-small: 16px;
  --space-medium: 24px;
  --space-large: 40px;
  --space-section: clamp(56px, 6vw, 88px);
  min-height: calc(100svh - var(--masthead-height) - 24px);
  margin-top: 24px;
}

.site-shell :is(h1, h2, h3, h4, p, a, button, summary, strong) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.site-shell :is(h1, h2, h3) {
  text-wrap: balance;
  line-height: 1.4;
}

.site-shell p {
  text-wrap: pretty;
}

.site-shell h1 {
  font-size: clamp(32px, 3.6vw, 48px);
  letter-spacing: -0.035em;
}

.site-shell h2 {
  font-size: clamp(24px, 2.6vw, 32px);
}

.site-main {
  --content-width: 960px;
  min-height: 0;
}

.site-main :is(.section-hero, .content-band, .post-page, .cta-band, .home-introduction) {
  width: min(var(--content-width), calc(100% - 96px));
  margin-inline: auto;
}

.site-main .section-hero {
  min-height: 0;
  padding: 0 0 48px;
  gap: 20px;
}

.site-main .section-hero .lead {
  max-width: 640px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.85;
}

.site-main .content-band {
  padding-block: 48px var(--space-section);
}

.breadcrumb {
  width: fit-content;
  margin-bottom: 12px;
  padding-block: 8px;
  color: var(--muted);
  font-size: 14px;
  text-underline-offset: 5px;
}

.ui-icon {
  flex: 0 0 auto;
  vertical-align: middle;
}

.site-shell .button {
  gap: 12px;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 15px;
  box-shadow: none;
}

.site-shell .button:hover {
  transform: none;
}

.text-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  gap: 12px;
  align-items: center;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  text-underline-offset: 6px;
}

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

.public-page :focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.sidebar-inner {
  position: relative;
  min-height: 0;
  gap: 16px;
  padding: 0 24px 24px;
}

.site-sidebar {
  top: 24px;
  align-self: start;
  height: fit-content;
  max-height: calc(100svh - 48px);
  scrollbar-width: none;
  background: var(--paper);
  border-right-color: #edf0f4;
}

.site-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-close {
  display: none;
}

.site-sidebar .sidebar-community {
  margin-top: 24px;
}

.site-shell .sidebar-section-label {
  margin: 0 12px 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.site-shell .sidebar-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.site-shell .sidebar-link.active {
  font-weight: 700;
}

.sidebar-product {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.sidebar-product:hover {
  border-color: var(--blue-line);
  color: var(--blue-dark);
}

.site-main .study-topics {
  padding-top: 0;
}

.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 28px 0;
  text-decoration: none;
}

.topic-row:last-child {
  border-bottom: 1px solid var(--line);
}

.topic-row h3 {
  font-size: 20px;
}

.topic-row > .ui-icon {
  color: var(--blue-dark);
}

.topic-row:hover h3 {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-main .post-page {
  max-width: 760px;
  padding-block: 0 var(--space-section);
}

.site-main .post-hero h1 {
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.45;
}

.site-main .post-hero .lead {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
}

.site-main .post-content {
  font-size: 17px;
  line-height: 1.95;
}

.site-main .post-content img {
  height: auto;
  box-shadow: none;
}

.site-main .post-card-meta {
  flex-wrap: wrap;
}

.site-main .post-card h3 {
  font-size: 22px;
}

.site-main .text-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.site-main .article-layout {
  gap: 40px;
}

.site-main .section-outline-row {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
}

.site-main .section-outline-toggle,
.site-main .section-outline-toggle-spacer {
  width: 44px;
  min-height: 48px;
}

.site-main .section-outline-item {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding-block: 16px;
  background: transparent;
}

.site-main .section-outline-item strong {
  font-size: 16px;
  line-height: 1.75;
}

.site-main a.section-outline-item:hover {
  background: var(--blue-soft);
}

.site-main .pagination-button {
  width: 44px;
  height: 44px;
}

/* Content is readable even if animation scripts fail or a long article never intersects. */
.site-shell .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (max-width: 1200px) {
  .site-main .article-layout {
    grid-template-columns: 1fr;
  }

  .site-main .article-layout > aside {
    position: static;
  }
}

@media (max-width: 760px) {
  .public-page {
    --masthead-height: 200px;
  }

  .masthead-inner {
    width: calc(100% - 40px);
    gap: 12px;
    padding-top: 36px;
  }

  .masthead-mascot {
    width: clamp(84px, 26vw, 108px);
    height: auto;
  }

  .masthead-wordmark {
    font-size: clamp(18px, 5.6vw, 24px);
  }

  .js-ready .site-sidebar {
    top: 0;
    max-height: none;
    visibility: hidden;
    box-shadow: none;
  }

  .sidebar-inner {
    min-height: 100%;
    padding: 60px 18px 24px;
  }

  .js-ready body[data-sidebar-open="true"] .site-sidebar {
    visibility: visible;
    box-shadow: 12px 0 32px rgba(19, 35, 60, 0.1);
  }

  .site-main :is(.section-hero, .content-band, .post-page, .cta-band, .home-introduction) {
    width: calc(100% - 40px);
  }

  .js-ready .site-main {
    padding-top: 0;
  }

  .site-main .section-hero {
    padding-top: 0;
    padding-bottom: 36px;
  }

  .site-main .section-hero .lead {
    font-size: 17px;
  }

  .site-main .content-band {
    padding-top: 36px;
  }

  .sidebar-close {
    position: absolute;
    top: 14px;
    right: 12px;
    display: grid;
    place-items: center;
    align-self: flex-end;
    width: 44px;
    height: 44px;
    margin: 0;
    border: 0;
    border-radius: 9px;
    background: var(--paper);
    cursor: pointer;
  }

  .js-ready .sidebar-toggle {
    min-height: 44px;
    padding: 10px 14px;
    box-shadow: none;
  }

  .site-main .section-outline-item {
    padding-inline: 4px;
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .site-main .section-outline-item-parent {
    grid-template-columns: 1fr;
  }

  .site-main .section-outline-row {
    padding-left: calc(var(--depth, 0) * 8px);
  }
}
