/* =========================================================
   Οι Εντολές του Χριστού · Κάθε Λαός, Κάθε Τόπος
   Black ink on white, no accent colour (same look as obeychrist.com / herhalkheryer.com).
   ========================================================= */

/* ---------- 1. Fonts (self-hosted, SIL OFL, full Greek) ---------- */
@font-face { font-family: "Sofia Sans XC"; src: url("../fonts/SofiaSansXC-450.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Sofia Sans XC"; src: url("../fonts/SofiaSansXC-650.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Didact Gothic"; src: url("../fonts/DidactGothic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* ---------- 2. Design tokens ---------- */
:root {
  color-scheme: light;
  --ink: #212121; --ink-head: #1f1f1f; --paper: #fff; --sidebar-bg: #f7f7f7; --nav-ink: #333;
  --current-bg: #000; --current-ink: #fff;
  --btn-bg: #000; --btn-ink: #fff; --btn-hover: #333;
  --stroke: #111; --frame: #222; --frame-ink: #555; --rule: #e3e3e3; --badge-hover: #f4f4f4;
  --cover-border: #ccc; --cover-shadow: rgba(0,0,0,.12); --menu-shadow: rgba(0,0,0,.15);
  --btn2-bg: #fff; --btn2-ink: #000; --btn2-border: #000; --btn2-hover: #f0f0f0;
  --ink-filter: none; --show-moon: inline-block; --show-sun: none;
  --sidebar-w: 220px; --content-w: 680px;
  --font-head: "Sofia Sans XC", "Arial Narrow", sans-serif;
  --font-body: "Didact Gothic", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #ededed; --ink-head: #f5f5f5; --paper: #121212; --sidebar-bg: #1c1c1c; --nav-ink: #d6d6d6;
    --current-bg: #fff; --current-ink: #000; --btn-bg: #fff; --btn-ink: #000; --btn-hover: #d0d0d0;
    --stroke: #ededed; --frame: #e0e0e0; --frame-ink: #bdbdbd; --rule: #333; --badge-hover: #222;
    --cover-border: #555; --cover-shadow: transparent; --menu-shadow: rgba(0,0,0,.6);
    --btn2-bg: transparent; --btn2-ink: #fff; --btn2-border: #fff; --btn2-hover: #262626;
    --ink-filter: invert(1); --show-moon: none; --show-sun: inline-block;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ededed; --ink-head: #f5f5f5; --paper: #121212; --sidebar-bg: #1c1c1c; --nav-ink: #d6d6d6;
  --current-bg: #fff; --current-ink: #000; --btn-bg: #fff; --btn-ink: #000; --btn-hover: #d0d0d0;
  --stroke: #ededed; --frame: #e0e0e0; --frame-ink: #bdbdbd; --rule: #333; --badge-hover: #222;
  --cover-border: #555; --cover-shadow: transparent; --menu-shadow: rgba(0,0,0,.6);
  --btn2-bg: transparent; --btn2-ink: #fff; --btn2-border: #fff; --btn2-hover: #262626;
    --ink-filter: invert(1); --show-moon: none; --show-sun: inline-block;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.6; }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
img.ink { filter: var(--ink-filter); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink-head); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; }
/* Greek headings in small capitals, like Amatic SC on the originals (lang="el" drops the accents) */
h2, h3 { letter-spacing: .02em; }
/* Small capitals are written out at build time (build.py): capitals stay full size, the rest sit in <span class="s"> (same method as the PDF) */
.s { font-size: .8em; }
h2 { font-size: 2.3rem; margin-top: 1.6em; }
h3 { font-size: 1.5rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--btn-bg); color: var(--btn-ink); padding: .5rem 1rem; z-index: 100; }

/* ---------- 4. Layout: sidebar + content ---------- */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--sidebar-bg);
  overflow-y: auto; padding: 2rem 1.1rem 2rem 1.4rem; font-size: .88rem; z-index: 20; }
.page { margin-left: var(--sidebar-w); padding: 3rem 2rem 2rem; }
.content { max-width: var(--content-w); margin: 0 auto; }
@media (min-width: 861px) {
  body { background: linear-gradient(to right, var(--sidebar-bg) var(--sidebar-w), var(--paper) var(--sidebar-w)); }
}
.brand-row { position: relative; }
.brand { display: block; text-decoration: none; margin-bottom: 1.8rem; }
.brand img { width: 26px; margin: 0 0 1.4rem 4px; }
.brand-title { display: block; font-family: var(--font-head); font-size: 1.75rem; line-height: 1.02; font-weight: 400;
  color: var(--ink-head); text-transform: uppercase; letter-spacing: .02em; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0 0 .35rem; }
.nav a { display: inline-block; padding: .2rem .4rem; text-decoration: none; color: var(--nav-ink); line-height: 1.3; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { background: var(--current-bg); color: var(--current-ink); font-weight: 700; }
.nav .soon-tag { font-size: .78em; opacity: .7; }
.nav-group { display: flex; align-items: center; }
.nav-toggle { background: none; border: 0; padding: .2rem; margin-right: .1rem; cursor: pointer; color: var(--nav-ink); line-height: 1; }
.nav-toggle svg { width: 14px; height: 14px; transition: transform .15s; transform: rotate(-90deg); }
.nav-toggle[aria-expanded="true"] svg { transform: rotate(0deg); }
.nav .sub { padding-left: 1.4rem; margin-top: .35rem; }
.nav .sub[hidden] { display: none; }
.topbar { display: none; }

/* ---------- 5. Components ---------- */
hr.brush { border: 0; height: 16px; margin: 2.4rem auto; max-width: var(--content-w); background-color: var(--stroke);
  -webkit-mask: url("../img/pinelia.svg") center / 100% 100% no-repeat; mask: url("../img/pinelia.svg") center / 100% 100% no-repeat; }
.btn { display: inline-block; background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-bg);
  padding: .5rem 1.2rem .45rem; font-family: var(--font-body); font-size: .85rem; letter-spacing: .06em;
  text-decoration: none; text-align: center; border-radius: 2px; text-transform: uppercase; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); text-decoration: none; }
.btn-block { display: block; width: 100%; }
.btn-soon { background: transparent; color: var(--frame-ink); border: 1px dashed var(--frame-ink); cursor: default; }
.btn-soon:hover { background: transparent; border-color: var(--frame-ink); }

/* ---------- 6. Home page ---------- */
.hero { text-align: center; }
.hero-title { font-family: var(--font-head); color: var(--ink-head); margin: 0; line-height: .95; text-transform: uppercase; text-align: center; }
.hero-title .up   { display: block; font-size: 2.8rem; font-weight: 400; letter-spacing: .06em; }
.hero-title .bar  { display: block; font-size: 5.6rem; font-weight: 700; letter-spacing: .04em; }
.hero-title .down { display: block; font-size: 1.9rem; font-weight: 400; margin-top: .55rem; letter-spacing: .14em; }
.hero-title .down::before { content: ""; display: block; width: 300px; max-width: 100%; height: 9px; margin: 0 auto .55rem;
  background-color: var(--stroke); -webkit-mask: url("../img/pinelia.svg") center / 100% 100% no-repeat; mask: url("../img/pinelia.svg") center / 100% 100% no-repeat; }
.tagline { font-family: var(--font-head); font-weight: 400; letter-spacing: .03em;
  font-size: 1.9rem; line-height: 1.2; text-align: center; margin: 0 auto; max-width: 620px; }
.start { text-align: center; }
.start .booklet { width: 110px; margin: 0 auto 1rem; border: 1px solid var(--cover-border); box-shadow: 3px 3px 0 var(--cover-shadow); }
.start .btn { min-width: 240px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4rem 2rem; margin: 3rem 0 1rem; }
.card { text-align: center; display: flex; flex-direction: column; }
.card h3 { flex: 1; margin: 0 0 .6rem; }
.card h3 a { text-decoration: none; }
.card .page-ref { display: block; font-family: var(--font-body); font-weight: 400; font-size: .8rem; letter-spacing: 0; color: var(--frame-ink); margin-top: .25rem; }
.card-img { display: block; text-decoration: none; }
.cmd-icon { width: 92px; height: 92px; margin: 0 auto .6rem; }
.card-cover { width: 72px; margin: 0 auto .6rem; border: 1px solid var(--cover-border); box-shadow: 3px 3px 0 var(--cover-shadow); }
.cards .card:last-child:nth-child(3n + 1) { grid-column: 2; }
/* Tools grid: flex so a short last row sits in the middle */
.cards.flex { display: flex; flex-wrap: wrap; justify-content: center; }
.cards.flex .card { width: calc((100% - 4rem) / 3); }
.ph { display: flex; align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--frame);
  font-family: var(--font-head); font-weight: 700; color: var(--frame-ink);
  width: 92px; height: 92px; margin: 0 auto .6rem; font-size: 1.3rem; line-height: 1; letter-spacing: .03em; }
.section-title { text-align: center; margin-top: 0; }
.section-intro { text-align: center; max-width: 560px; margin: 0 auto; }
.pdf-card { display: flex; align-items: center; justify-content: center; gap: 2rem; margin: 1rem auto; }
.pdf-card img { width: 150px; border: 1px solid var(--cover-border); box-shadow: 4px 4px 0 var(--cover-shadow); }
.pdf-card h2 { margin: 0 0 .6rem; font-size: 2.4rem; }
.pdf-card .meta { font-size: .85rem; color: var(--frame-ink); margin: .6rem 0 0; }

/* ---------- 7. Footer ---------- */
.site-footer { max-width: var(--content-w); margin: 4rem auto 2rem; text-align: center; }
.site-footer h2 { font-size: 2.1rem; margin-top: 1rem; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; text-align: left; max-width: 540px; margin: 0 auto 2rem; font-size: .92rem; }
.footer-links ul { margin: 0; padding-left: 1.2rem; }
.footer-links li { margin-bottom: .3rem; }
.contact { font-size: .92rem; margin: 0 0 1.6rem; }
.placeholder { background: #fff3b0; color: #000; padding: 0 .25rem; font-family: monospace; }
.badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 112px; height: 112px; border-radius: 50%;
  border: 3px solid var(--stroke); box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px var(--stroke);
  font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; line-height: 1; letter-spacing: .05em;
  color: var(--stroke); text-decoration: none; text-transform: uppercase; }
.badge:hover { background: var(--badge-hover); text-decoration: none; }
.credit { font-size: .78rem; color: var(--frame-ink); margin-top: 1.6rem; }

/* ---------- 8. Theme button ---------- */
.brand-row .theme-btn { position: absolute; top: -6px; right: -4px; }
.theme-btn { flex: none; width: 36px; height: 36px; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: none; color: var(--ink); border: 1px solid transparent; border-radius: 50%; }
.theme-btn:hover { border-color: var(--frame); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .icon-moon { display: var(--show-moon); }
.theme-btn .icon-sun { display: var(--show-sun); }
.topbar-btns { display: flex; align-items: center; gap: .5rem; }
html.no-js .theme-btn { display: none; }

/* ---------- 9. Mobile (≤ 860 px) ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
    background: var(--sidebar-bg); border-bottom: 1px solid var(--rule); padding: .5rem 1rem; }
  .topbar .brand-title { font-size: 1.55rem; }
  .topbar a { text-decoration: none; }
  .topbar .theme-btn { width: 40px; height: 40px; }
  .menu-btn { background: none; border: 1px solid var(--frame); border-radius: 3px; color: var(--ink); width: 44px; height: 40px;
    cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
  .menu-btn svg { width: 22px; height: 22px; }
  .sidebar { top: 57px; width: 100%; max-width: 320px; transform: translateX(-100%); transition: transform .2s, visibility .2s; visibility: hidden; }
  body.menu-open .sidebar { visibility: visible; box-shadow: 2px 0 8px var(--menu-shadow); }
  .sidebar .brand { display: none; }
  .sidebar .brand-row .theme-btn { display: none; }
  body.menu-open .sidebar { transform: none; }
  .page { padding: 1.8rem 1.1rem 1.5rem; margin-left: 0; }
  h2 { font-size: 2rem; }
  .hero-title .up { font-size: 2.1rem; }
  .hero-title .bar { font-size: 3.9rem; }
  .hero-title .down { font-size: 1.35rem; }
  .hero-title .down::before { width: 210px; height: 7px; }
  .tagline { font-size: 1.6rem; }
  .cards { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
  .cards .card:last-child:nth-child(3n + 1) { grid-column: auto; }
  .cards .card:last-child:nth-child(2n + 1) { grid-column: 1 / -1; max-width: 50%; margin: 0 auto; width: 100%; }
  .card h3 { font-size: 1.3rem; }
  .cards.flex { gap: 2rem 1rem; }
  .cards.flex .card { width: calc(50% - .5rem); }
  .cards.flex .card:last-child:nth-child(2n + 1) { max-width: none; margin: 0; width: calc(50% - .5rem); }
  .pdf-card { flex-direction: column; text-align: center; gap: 1rem; }
  .footer-links { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  html.no-js .sidebar { position: static; transform: none; max-width: none; box-shadow: none; }
  html.no-js .menu-btn { display: none; }
}

/* ---------- 10. Lesson, 411 and tool pages (same layout as herhalkheryer.com) ---------- */
h1 { font-size: 3.6rem; text-align: center; }
.lesson-head, .page-head { text-align: center; }
.lesson-head .cmd-icon { margin: 0 auto 1rem; }
.cmd-label { font-family: var(--font-head); font-size: 1.5rem; letter-spacing: .04em; margin: 0; text-transform: uppercase; }
.lesson-head h1 { margin-bottom: 0; }
.lesson-head hr.brush { margin: 1.2rem auto .6rem; }
.back { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; text-decoration: none; }
.page-head .booklet { width: 100px; margin: 0 auto 1.2rem; border: 1px solid var(--cover-border); box-shadow: 3px 3px 0 var(--cover-shadow); }
.page-head .head-img { width: 120px; margin: 0 auto 1.2rem; }
.page-head h1 { margin-bottom: .1rem; }
.page-head .subtitle { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
.lesson ul, .lesson ol { padding-left: 1.4rem; margin: 0; }
.lesson ul { list-style: square; }
.lesson li { margin-bottom: .45rem; }
.lesson li > ul { margin-top: .4rem; }
.lesson ul.spec { list-style: disc; }
.lesson section > h2:first-child, .lesson section > div > h2:first-child { margin-top: 1.2em; }
.with-figure { display: grid; grid-template-columns: 1fr 210px; gap: 1.6rem; align-items: center; }
.with-figure.wide-figure { grid-template-columns: 1fr 270px; }
.with-figure figure { margin: 0; text-align: center; }
.with-figure figure img { width: 180px; margin: 0 auto .6rem; }
.with-figure figure img.diagram { width: 260px; }
.btn-outline { background: var(--btn2-bg); color: var(--btn2-ink); border-color: var(--btn2-border); }
.btn-outline:hover { background: var(--btn2-hover); border-color: var(--btn2-border); }
.btn-small { font-size: .72rem; padding: .35rem .7rem .3rem; }
.figure-note { font-size: .8rem; line-height: 1.45; margin: .6rem 0 0; text-align: left; }
.record-box { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.25; text-align: left; width: max-content; margin: .2rem auto 0; text-transform: uppercase; }
.step { margin-top: 0; }
.step-n { font-family: var(--font-head); font-weight: 700; font-size: 1.8rem; margin-right: .2rem; }
details.more { margin-top: 1.6em; }
details.more summary { cursor: pointer; list-style: none; font-family: var(--font-head); font-weight: 700; font-size: 2.3rem; line-height: 1.1; color: var(--ink-head); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "– "; }
details.more summary small { font-size: 1.3rem; font-weight: 400; }
details.more > ol { margin-top: .8rem; }
.pager { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 2rem auto 1rem; align-items: stretch; }
.pager .btn { display: flex; align-items: center; justify-content: center; }
.pager.pager-2 { grid-template-columns: repeat(2, minmax(0, 280px)); justify-content: center; }
.pdf-line { text-align: center; font-size: .85rem; color: var(--frame-ink); margin: 1.4rem 0 0; }
ol.plan { columns: 3; column-gap: 2rem; margin: 1.6rem 0; }
ol.plan li { break-inside: avoid; margin-bottom: .3rem; }
.cards.cards-2 { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; margin-top: 2.5rem; }
.cards.cards-2 .card:last-child:nth-child(3n + 1) { grid-column: auto; }
.tool-img { width: 100px; height: auto; margin: 0 auto .6rem; }
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 1rem; }
.three-cols h2 { font-size: 2rem; margin: 0 0 .6rem; border-bottom: 2px solid var(--frame); padding-bottom: .3rem; }
.three-cols ol { padding-left: 1.4rem; margin: 0; }
.three-cols ul { list-style: square; padding-left: 1.1rem; margin: .2rem 0 .4rem; }
.three-cols li { margin-bottom: .25rem; }
.card .ph { width: 92px; height: 92px; }
.section-title a { text-decoration: none; }
@media (max-width: 860px) {
  h1 { font-size: 2.8rem; }
  .with-figure, .with-figure.wide-figure { grid-template-columns: 1fr; }
  details.more summary { font-size: 2rem; }
  .pager, .pager.pager-2 { grid-template-columns: 1fr; gap: .7rem; }
  .pager > span { display: none; }
  ol.plan { columns: 2; }
  .three-cols { grid-template-columns: 1fr; }
  .cards.cards-2 { grid-template-columns: 1fr 1fr; }
  .cards.cards-2 .card:last-child:nth-child(2n + 1) { grid-column: auto; max-width: none; }
}

/* ---------- 11. Print (as on the reference: menu, pager and footer hidden; Explore More printed open) ---------- */
@media print {
  .sidebar, .topbar, .pager, .site-footer, .skip, .pdf-line, .back { display: none !important; }
  body { background: #fff; }
  .page { margin: 0; padding: 0; }
  details.more > * { display: block; }
  .with-figure figure { break-inside: avoid; page-break-inside: avoid; }
}
