/* === Base / Fonts === */
@import url('https://fonts.googleapis.com/css?family=Inter+Tight');

:root{
  --page-max: 1700px;       /* site width on large screens */
  --page-pad: 8px;          /* side padding inside container */
  --card-bg: #f6faff;
  --code-bg: #f0f4fa;
  --ink: #222;
  --brand: #1565c0;
  --panel-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: 'Inter Tight', sans-serif;
  background: #f5f5f5;
  color: var(--ink);
  margin: 5px;     /* needs units */
  padding: 5px;    /* needs units */
}

/* === Page container (centers EVERYTHING) === */
.content {
  max-width: var(--page-max);
  width: min(var(--page-max), 95vw);
  margin: 0 auto;
  padding-inline: var(--page-pad);
}

/* === Headings === */
h1, h2{
  /* background: #f0f4fa; */
  color: var(--ink);
  border-radius: 12px;
  padding: 18px 28px;
  margin: 32px 0 24px 0;   /* no auto centering; .content handles that */
  box-shadow: var(--panel-shadow);
  border: 2px solid #dbe6ee;
  /* text-align: center; */
  font-weight: 700;
  letter-spacing: 1px;
  max-width: none;          /* align with .content width */
}
h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { 
  font-size: 1.5em; 
  color: var(--ink);
  font-weight: 600;
  padding: 0px 28px;
  /* margin: 32px 0 24px 0; */
}

h4 { 
  font-size: 22px; 
  /* background: #f0f4fa; */
  color: var(--ink);
  padding: 0px 28px;
  margin: 32px 0 24px 0;
}

/* === General paragraph styling (for standalone paragraphs) === */
p {
  max-width: 1200px;
  margin: 18px auto;
  padding: 14px 22px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  font-size: 1.08em;
  line-height: 1.7;
  color: #2a2a2a;
}

/* === Links === */
a { color: #0077cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* back button */
.back-btn {
  position: absolute;
  top: 24px;
  left: 32px;
  background: #e3f2fd;
  color: var(--brand);
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(51,102,204,0.08);
  text-decoration: none;
  transition: background 0.2s;
  z-index: 10;
}
.back-btn:hover { background: #bbdefb; color: #0d47a1; }

/* === Cards / Buttons (unchanged) === */
.card-links {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 48px 0;
}
.card-btn {
  display: block;
  background: #e3f2fd;
  color: var(--brand);
  font-size: 1.4em;
  font-weight: 700;
  padding: 36px 64px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(51,102,204,0.10);
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.card-btn:hover {
  background: #bbdefb;
  box-shadow: 0 6px 24px rgba(51,102,204,0.16);
  color: #0d47a1;
}

/* === Image Row (unchanged) === */
.img-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* <-- centers each wrapped line */
  gap: 32px;
  width: 100%;
  margin: 24px 0;
}
.img-row2{
  display: flex;
  gap: 20px;
  width: 75%;
  height: 75%;
  margin: 24px 0;
}
.img-col {
  flex: 0 1 320px;   /* basis 320px, can shrink if needed */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.img-col img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.img-desc { margin-top: 8px; font-size: 0.95em; color: #444; text-align: center; }

/* === Table (unchanged) === */
table {
  width: 90%;
  max-width: 900px;
  margin: 32px auto 24px auto;
  border-collapse: collapse;
  background: #f0f4fa;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--panel-shadow);
  font-size: 1.05em;
}
thead { background: #e3f2fd; }
th, td { padding: 14px 18px; text-align: center; border-bottom: 1px solid #dbe6ee; }
th { color: var(--brand); font-weight: 700; letter-spacing: 1px; }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--card-bg); }

/* =========================================================
   EXPLAIN + CODE “mini-stacks” in two columns
   ========================================================= */
.section-grid {
  width: 100%;                                      /* fill .content */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 equal columns */
  gap: 24px;
  align-items: stretch;                              /* equal heights */
  margin: 24px 0;
}

.section {
  display: flex;
  flex-direction: column;  /* explanation above code */
  gap: 16px;
  height: 100%;
}

.section .explain,
.section .code {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 16px 20px;
}

/* prevent global <p> styling from adding inner margins/backgrounds */
.section .explain p {
  margin: 0;
  max-width: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Prism block inside the code card */
.section .code pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0;                /* no extra outer margin */
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 1280px) {
  .img-col { flex-basis: 300px; } /* helps fit 3 across comfortably */
}
@media (max-width: 1000px) {
  .img-col { flex-basis: 320px; } /* likely 2 across */
}
@media (max-width: 700px) {
  .img-col { flex-basis: 100%; }  /* 1 across */
}
