/* Basic sizing */
* {
  box-sizing: border-box;
}

/* Page */
body {
  margin: 0;
  padding: 28px 18px;
  background: #f4f7f8;
  color: #24343d;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* One centered reading area */
.lesson {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px;
  background: white;
  border: 1px solid #dce5e8;
  border-radius: 12px;
}

/* Header */
.back-link {
  color: #176775;
  font-size: 14px;
}

.eyebrow {
  margin: 24px 0 4px;
  color: #176775;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

header h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
}

header > p:last-child {
  max-width: 850px;
}

/* Headings and paragraphs */
h2 {
  margin: 24px 0 10px;
  color: #135d69;
  font-size: 19px;
}

h3 {
  margin: 20px 0 8px;
  font-size: 16px;
}

p {
  margin: 8px 0 14px;
}

/* Reference table */
.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: #dceff0;
  color: #173d46;
}

th,
td {
  padding: 13px;
  border: 1px solid #dce5e8;
  text-align: left;
  vertical-align: top;
}

tbody th {
  width: 25%;
  background: #f8fafb;
  font-weight: normal;
}

td {
  width: 37.5%;
}

/* Inline code */
code {
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

th code {
  color: #a22b59;
  overflow-wrap: anywhere;
}

/* Example and questions sit side by side */
.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* Full-document code */
pre {
  margin: 12px 0;
  padding: 18px;
  border: 1px solid #dce5e8;
  border-radius: 7px;
  background: #f3f6fa;
  color: #8c2550;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

/* Rendered output */
.tab-label {
  margin-bottom: 0;
  padding: 8px 12px;
  border: 1px solid #dce5e8;
  background: #eaf0f4;
  font-size: 13px;
}

.output {
  padding: 18px;
  border: 1px solid #dce5e8;
  border-top: 0;
}

.output h1 {
  margin: 0 0 10px;
  font-size: 26px;
}

.output p {
  margin: 0;
}

/* Notes */
.note {
  margin-top: 14px;
  padding: 10px 13px;
  border-left: 3px solid #77aeb2;
  background: #f0f7f7;
  font-size: 13px;
}

/* Hidden answers */
details {
  margin-bottom: 9px;
  border: 1px solid #d6e1e6;
  border-radius: 6px;
}

summary {
  padding: 11px 13px;
  background: #f7f9fb;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}

summary:hover {
  background: #eaf3f4;
}

details[open] summary {
  background: #dceff0;
  border-bottom: 1px solid #d6e1e6;
}

details > p {
  margin: 0;
  padding: 13px;
  font-size: 14px;
}

/* Keyboard focus */
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #237c92;
  outline-offset: 3px;
}

/* Smaller screens */
@media (max-width: 800px) {
  .bottom-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lesson {
    padding: 18px;
  }

  th,
  td {
    padding: 10px;
  }
}

@media (max-width: 550px) {
  table {
    min-width: 620px;
  }

  body {
    padding: 12px;
  }
}

/* ALL TOPICS PAGE */

/* Separate the overview from the topic menu */
.topics-page .overview {
  margin-top: 24px;
  padding-top: 4px;
  padding-bottom: 16px;
  border-top: 1px solid #dce5e8;
  border-bottom: 1px solid #dce5e8;
}

/* Code and output side by side */
.overview-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin: 18px 0;
}

.overview-example h3 {
  margin-top: 0;
}

.overview-example pre {
  margin: 0;
}

.home-output {
  padding: 18px;
  border: 1px solid #dce5e8;
  border-radius: 7px;
  background: #fafcfd;
}

.home-output h1 {
  margin: 0 0 10px;
  font-size: 26px;
}

.home-output p {
  margin: 0;
}

/* HTML, CSS, and JavaScript comparison */
.technology-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.technology-grid > div {
  padding: 16px;
  border: 1px solid #dce5e8;
  border-radius: 8px;
  background: #f7fafb;
}

.technology-grid h3 {
  margin: 0 0 8px;
  color: #135d69;
  font-size: 15px;
}

.technology-grid p {
  margin-bottom: 8px;
  font-size: 14px;
}

.technology-example {
  color: #536875;
  font-style: italic;
}

/* Topic menu */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.topic-card {
  display: block;
  padding: 20px;
  border: 1px solid #dce5e8;
  border-radius: 9px;
  background: #fafcfd;
  color: #24343d;
  text-decoration: none;
}

a.topic-card {
  border-color: #89b6bb;
  background: #f0f8f7;
}

a.topic-card:hover {
  border-color: #176775;
  background: #e4f2f0;
}

.topic-number {
  color: #176775;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

.topic-card h3 {
  margin: 5px 0 8px;
  font-size: 18px;
}

.topic-card p {
  margin: 0 0 14px;
  font-size: 14px;
}

.topic-status {
  color: #627480;
  font-size: 12px;
}

.topic-status.available {
  color: #176775;
  font-weight: bold;
}

/* Questions at the bottom */
.home-questions {
  margin-top: 28px;
  padding-top: 4px;
  border-top: 1px solid #dce5e8;
}

/* Mobile layout */
@media (max-width: 700px) {
  .overview-example,
  .technology-grid,
  .topic-grid {
    grid-template-columns: 1fr;
  }
}
/* Long command names and source links should wrap on narrow screens. */
a,
code {
  overflow-wrap: anywhere;
}
section {
  margin-bottom: 28px;
}
nav[aria-label="Lesson navigation"] {
  margin: 24px 0;
}
.output pre {
  margin: 0;
}

/* Interactive practice uses the companion guides' existing palette. */
label { display: block; font-weight: bold; margin-bottom: 8px; }
textarea { width: 100%; padding: 16px; border: 1px solid #89b6bb; border-radius: 7px; background: #f3f6fa; color: #702447; font: 14px/1.6 Consolas, monospace; resize: vertical; tab-size: 2; }
button { padding: 10px 18px; border: 1px solid #176775; border-radius: 6px; background: #176775; color: white; font: inherit; font-weight: bold; cursor: pointer; }
button:hover { background: #13515e; }
button[data-reset] { background: white; color: #176775; }
button:focus-visible, textarea:focus-visible, iframe:focus-visible { outline: 3px solid #237c92; outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.runner-status { font-size: 13px; color: #435c65; }
iframe { width: 100%; height: 310px; border: 1px solid #dce5e8; border-radius: 7px; background: white; }
.console { min-height: 180px; color: #24343d; }
footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid #dce5e8; font-size: 13px; }
.skip-link { position: absolute; top: -100px; background: white; padding: 10px; }
.skip-link:focus { top: 10px; }
details pre { margin: 12px; }
