/* Learn.css - shared styles for Learn track tutorial pages */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.4rem;
  background-color: var(--light);
  color: var(--dark);
}

/* ---- header ---- */
header {
  background-color: var(--header-bg);
  color: var(--header-clr);
  padding: 1.25em 2em;
}
header h1 { font-size: 1.6rem; font-weight: bold; }
header t-b  { display: block; font-size: 0.9rem; margin-top: 0.25em; opacity: 0.85; }

/* ---- layout ---- */
main {
  margin: 0;
  padding: 2rem 2rem 4rem;
}

/* ---- sections ---- */
section { margin-top: 2.5em; }

h2 {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--header-bg);
  border-bottom: 2px solid var(--header-bg);
  padding-bottom: 0.2em;
  margin-bottom: 0.9em;
}

t-b { display: block; max-width: 50rem; margin-bottom: 0.85em; }

ul {
  margin: 0.5em 0 0.85em 1.5em;
}
ul li { margin-bottom: 0.3em; }

/* ---- inline code ---- */
code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background-color: rgba(26, 92, 138, 0.12);
  color: inherit;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ---- code blocks ---- */
pre {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  padding: 1em 1.25em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.75em 0 1em;
  line-height: 1.5;
  width: max-content;
  min-width: 15rem;
}
pre code { font-size: inherit; padding: 0; background: transparent; border-radius: 0; }

/* ---- output block ---- */
.output {
  border-left: 4px solid var(--header-bg);
}
.output::before {
  content: "output";
  display: block;
  font-size: 0.75em;
  opacity: 0.5;
  margin-bottom: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- exercise / note boxes ---- */
.box {
  background-color: var(--header-bg);
  color: var(--header-clr);
  padding: 0.9em 1.2em;
  border-radius: 4px;
  margin: 1em 0;
  width: max-content;
  min-width: 15rem;
  max-width: 50rem;
}
.box strong {
  display: block;
  color: var(--header-clr);
  margin-bottom: 0.4em;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.box t-b, .box ul { margin-bottom: 0; color: var(--header-clr); }
.box ul { margin-top: 0.4em; }

/* ---- mistakes ---- */
.mistake { margin-bottom: 1.25em; }
.mistake h3 {
  font-size: 1rem;
  color: var(--header-bg);
  margin-bottom: 0.3em;
}

/* ---- key terms table ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75em;
  font-size: 0.93rem;
}
thead tr {
  background-color: var(--header-bg);
  color: var(--header-clr);
}
thead th {
  text-align: left;
  padding: 0.55em 0.85em;
  font-weight: bold;
}
tbody tr:nth-child(odd)  { background-color: var(--light); color: var(--dark); }
tbody tr:nth-child(even) { background-color: #b8d4e6;      color: var(--dark); }
tbody td { padding: 0.5em 0.85em; }
tbody td:first-child { font-family: Consolas, monospace; font-size: 0.88em; }

/* ---- top button group (Site | Sections | Pages) ---- */
#top-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  z-index: 100;
}
#sections-wrap,
#pages-wrap { position: relative; }

#site-btn,
#sections-btn,
#pages-btn {
  display: inline-block;
  background-color: var(--header-bg);
  color: var(--header-clr);
  border: 1px solid var(--header-clr);
  padding: 0.4em 0.9em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-decoration: none;
  line-height: normal;
  white-space: nowrap;
}

#sections-dropdown,
#pages-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  background-color: var(--header-bg);
  border-radius: 4px;
  width: max-content;
  min-width: 14rem;
  z-index: 100;
  padding: 0.4em 0;
  border: 2px solid var(--light);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}
#sections-dropdown a,
#pages-dropdown a {
  display: block;
  color: var(--header-clr);
  text-decoration: none;
  padding: 0.15em 0.9em;
  font-size: 0.9rem;
}
#sections-dropdown a:hover,
#pages-dropdown a:hover { background-color: rgba(255,255,255,0.15); }
#sections-dropdown.open,
#pages-dropdown.open { display: block; }

/* ---- language nav bar (Learn_intro only) ---- */
#lang-bar {
  background-color: var(--header-bg);
  margin-top: 2px;
  padding: 0.4em 5rem;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.2);
}
#lang-links {
  float: left;
  display: flex;
  gap: 0.25em;
}
#lang-nav {
  float: right;
  display: flex;
  gap: 1rem;
}
#lang-bar a {
  color: var(--header-clr);
  text-decoration: none;
  padding: 0.25em 0.9em;
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: bold;
}
#lang-bar a:hover { background-color: rgba(255,255,255,0.15); }
#lang-bar a.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- no-equivalent-topic popup ---- */
#no-equiv-popup {
  display: none;
  position: fixed;
  background-color: var(--header-bg);
  color: var(--header-clr);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 0.3em 0.75em;
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
#no-equiv-popup.visible { display: block; }

/* ---- footer ---- */
footer {
  background-color: var(--header-bg);
  color: var(--header-clr);
  text-align: center;
  padding: 0.9em;
  font-size: 0.85rem;
  margin-top: 3em;
}
footer a { color: var(--header-clr); }
