/*
 * Cloud Club shared story styles
 *
 * The five Cloud Club sections previously kept near-identical copies of
 * story.css. This file is the single source of truth. Section-specific
 * differences are selected from the existing note-index href prefixes so
 * generated pages do not need section-specific stylesheet files.
 */

.note-page {
  padding: 132px 0 72px;
}

.note-wrap {
  max-width: 820px;
  min-width: 0;
}

.note-back {
  display: inline-flex;
  margin-bottom: 22px;
  color: #94a3b8;
  font-size: 14px;
}

.note-back:hover {
  color: white;
}

.note-kicker {
  margin: 18px 0 8px;
  color: #94a3b8;
  font-size: 15px;
}

.note-page h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 12px 0 28px;
}

.note-meta {
  margin: -12px 0 28px;
  color: #94a3b8;
  font-size: 15px;
}

.note-meta p {
  margin: 0 0 6px;
}

.note-index {
  width: 100%;
  margin: 0 0 36px;
  border-collapse: collapse;
}

.note-index th,
.note-index td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 16px;
  vertical-align: top;
}

.note-index th {
  color: #94a3b8;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.note-index a {
  display: block;
  color: #e2e8f0;
  text-decoration: none;
}

.note-index a:hover {
  color: white;
}

.note-index a:hover .muted {
  color: #cbd5e1;
}

.note-index .note-num {
  color: #94a3b8;
  font-weight: 600;
  margin-right: 0.45em;
}

.note-index tr.current a {
  color: white;
}

.note-index tr.current .note-num {
  color: #7dd3fc;
}

.note-body p,
.note-body li {
  color: #e2e8f0;
  font-size: 16px;
  line-height: 1.75;
}

.note-body p {
  margin: 0 0 12px;
}

.note-body p strong {
  color: #f8fafc;
  font-weight: 650;
}

.note-body h2 {
  margin: 28px 0 14px;
  font-size: clamp(20px, 2.4vw, 28px);
  color: #f8fafc;
}

.note-body {
  min-width: 0;
  max-width: 100%;
}

.note-body pre {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 14px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: #0b1a2e;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
}

.note-body pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

.note-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.note-body :not(pre) > code {
  padding: 1px 5px;
  background: #0b1a2e;
  border-radius: 4px;
}

.note-body table {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
}

.note-body th,
.note-body td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.note-table-scroll {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 0 18px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  background: #061018;
}

.note-table-scroll table {
  width: max-content;
  min-width: 100%;
  margin: 0;
}

.note-table-scroll th,
.note-table-scroll td {
  padding: 10px 12px;
  white-space: nowrap;
  color: #ffffff;
}

.note-table-scroll th.num,
.note-table-scroll td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.note-table-scroll.note-table-text table {
  width: 100%;
}

.note-table-scroll.note-table-text th,
.note-table-scroll.note-table-text td {
  white-space: normal;
}

.note-table-scroll.note-table-text td:first-child {
  white-space: nowrap;
}

.note-body .recap-head {
  margin: 22px 0 8px;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 650;
}

.note-body ul {
  margin: 0 0 18px;
  padding-left: 20px;
}

.note-body li {
  margin: 6px 0;
}

.note-body hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Articles, AWS Exam, and Community share the richer note body treatment. */
:where(
  .note-page:has(.note-index a[href^="aws_kiro_"]),
  .note-page:has(.note-index a[href^="agentcore-"]),
  .note-page:has(.note-index a[href^="aws-exam-practice-"]),
  .note-page:has(.note-index a[href^="tagalog_practice_room_"]),
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body h3 {
  margin: 22px 0 10px;
  font-size: clamp(18px, 2vw, 22px);
  color: #f8fafc;
}

:where(
  .note-page:has(.note-index a[href^="aws_kiro_"]),
  .note-page:has(.note-index a[href^="agentcore-"]),
  .note-page:has(.note-index a[href^="aws-exam-practice-"]),
  .note-page:has(.note-index a[href^="tagalog_practice_room_"]),
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body h4 {
  margin: 18px 0 8px;
  font-size: 16px;
  color: #f8fafc;
}

:where(
  .note-page:has(.note-index a[href^="aws_kiro_"]),
  .note-page:has(.note-index a[href^="agentcore-"]),
  .note-page:has(.note-index a[href^="aws-exam-practice-"]),
  .note-page:has(.note-index a[href^="tagalog_practice_room_"]),
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body blockquote {
  margin: 0 0 18px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid #7dd3fc;
  color: #cbd5e1;
}

:where(
  .note-page:has(.note-index a[href^="aws_kiro_"]),
  .note-page:has(.note-index a[href^="agentcore-"]),
  .note-page:has(.note-index a[href^="aws-exam-practice-"]),
  .note-page:has(.note-index a[href^="tagalog_practice_room_"]),
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body ol {
  margin: 0 0 18px;
  padding-left: 20px;
}

:where(
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body th,
:where(
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body td {
  padding: 8px 10px;
  font-size: 14px;
  color: #ffffff;
}

:where(
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body th {
  color: #ffffff;
  font-weight: 600;
}

:where(
  .note-page:has(.note-index a[href^="aws_exam_"]),
  .note-page:has(.note-index a[href^="aws-community-day-"])
) .note-body img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  margin: 14px 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #061018;
}

/* Articles use a denser, nowrap table layout. */
:where(
  .note-page:has(.note-index a[href^="aws_kiro_"]),
  .note-page:has(.note-index a[href^="agentcore-"]),
  .note-page:has(.note-index a[href^="aws-exam-practice-"]),
  .note-page:has(.note-index a[href^="tagalog_practice_room_"])
) .note-body table {
  margin: 0;
  font-size: 16px;
  white-space: nowrap;
}

:where(
  .note-page:has(.note-index a[href^="aws_kiro_"]),
  .note-page:has(.note-index a[href^="agentcore-"]),
  .note-page:has(.note-index a[href^="aws-exam-practice-"]),
  .note-page:has(.note-index a[href^="tagalog_practice_room_"])
) .note-body .note-table-scroll table {
  max-width: none;
}

/* AWS Recap and Amarathon use ordinary responsive tables. */
:where(
  .note-page:has(.note-index a[href^="aws_reinvent_recap_"]),
  .note-page:has(.note-index a[href^="cmd_hk_recap_"]),
  .note-page:has(.note-index a[href^="fsi_recap_"]),
  .note-page:has(.note-index a[href^="gov_data_"]),
  .note-page:has(.note-index a[href^="summit_dev_lounge_"]),
  .note-page:has(.note-index a[href^="amarathon_"])
) .note-body table {
  font-size: 14px;
}

/* Amarathon keeps its highlighted quotation treatment. */
.note-page:has(.note-index a[href^="amarathon_"]) .note-body blockquote {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid rgba(251, 191, 36, .2);
  background: rgba(251, 191, 36, .05);
  color: #cbd5e1;
}

.note-page:has(.note-index a[href^="amarathon_"]) .note-body blockquote p:last-child {
  margin-bottom: 0;
}

@media (max-width: 800px) {
  .note-page {
    padding: 110px 0 56px;
  }

  .note-wrap {
    overflow-x: hidden;
  }

  .note-index th,
  .note-index td {
    padding: 10px 0;
    font-size: 16px;
  }

  .note-index th {
    font-size: 16px;
    letter-spacing: .04em;
  }

  .note-body pre {
    padding: 12px;
    font-size: 12px;
  }

  .note-table-scroll {
    display: block;
  }

  :where(
    .note-page:has(.note-index a[href^="aws_reinvent_recap_"]),
    .note-page:has(.note-index a[href^="cmd_hk_recap_"]),
    .note-page:has(.note-index a[href^="fsi_recap_"]),
    .note-page:has(.note-index a[href^="gov_data_"]),
    .note-page:has(.note-index a[href^="summit_dev_lounge_"]),
    .note-page:has(.note-index a[href^="amarathon_"])
  ) .note-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
