/* =========================================================
   Mesih'in Buyrukları – shared stylesheet
   One file for every page. Black ink on white, no accent colour.
   ========================================================= */

/* ---------- 1. Fonts (self-hosted, see /fonts) ---------- */
@font-face {
  font-family: "Amatic SC TR";            /* patched Amatic SC with dotted small-cap i */
  src: url("/fonts/AmaticSCTR-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Amatic SC TR";
  src: url("/fonts/AmaticSCTR-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
/* Josefin Sans: static Regular for normal text (crisper on non-retina screens),
   variable font for semi-bold/bold (500–700). */
@font-face {
  font-family: "Josefin Sans";
  src: url("/fonts/JosefinSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("/fonts/JosefinSans-VF.woff2") format("woff2");
  font-weight: 500 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("/fonts/JosefinSans-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("/fonts/JosefinSans-Italic-VF.woff2") format("woff2");
  font-weight: 500 700; font-style: italic; font-display: swap;
}

/* ---------- 2. Design tokens ---------- */
/* Colours live here. Light theme = default values on :root.
   Dark theme = the same names with dark values, used when
   (a) the device is set to dark and the visitor has not chosen a theme, or
   (b) the visitor pressed the moon/sun button (<html data-theme="dark">).
   <html data-theme="light"> forces the light values even on a dark device. */
:root {
  color-scheme: light;
  --ink: #212121;          /* body text */
  --ink-head: #1f1f1f;     /* headings */
  --paper: #fff;           /* page background */
  --sidebar-bg: #f7f7f7;
  --nav-ink: #333;         /* sidebar links */
  --current-bg: #000;      /* active menu item */
  --current-ink: #fff;
  --btn-bg: #000;          /* primary (black) buttons */
  --btn-ink: #fff;
  --btn-hover: #333;
  --btn2-bg: #fff;         /* secondary (outline) buttons */
  --btn2-ink: #000;
  --btn2-border: #000;
  --btn2-hover: #f0f0f0;
  --underline: currentColor; /* link underlines */
  --stroke: #111;          /* brush dividers, badge */
  --frame: #222;           /* placeholder frames, menu button, column rules */
  --frame-bg: #fff;
  --frame-ink: #555;       /* text inside placeholder frames */
  --frame-ink-2: #444;
  --rule: #e3e3e3;         /* mobile top bar bottom line */
  --badge-hover: #f4f4f4;
  --cover-border: #ccc;    /* PDF cover picture */
  --cover-shadow: rgba(0,0,0,.12);
  --menu-shadow: rgba(0,0,0,.15);
  --ink-filter: none;      /* line drawings (<img class="ink">) */
  --show-moon: inline-block; /* theme button icon */
  --show-sun: none;
  --sidebar-w: 220px;
  --content-w: 680px;
  --font-head: "Amatic SC TR", "Amatic SC", cursive;
  --font-body: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;
}

/* Dark values. The two blocks below are identical on purpose:
   one follows the device setting, the other is the visitor's own choice. */
@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;
    --btn2-bg: #121212; --btn2-ink: #fff; --btn2-border: #fff; --btn2-hover: #2a2a2a;
    --underline: #fff; --stroke: #ededed;
    --frame: #e0e0e0; --frame-bg: #121212; --frame-ink: #bdbdbd; --frame-ink-2: #c8c8c8;
    --rule: #333; --badge-hover: #222; --cover-border: #555; --cover-shadow: transparent; --menu-shadow: rgba(0,0,0,.6);
    --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;
  --btn2-bg: #121212; --btn2-ink: #fff; --btn2-border: #fff; --btn2-hover: #2a2a2a;
  --underline: #fff; --stroke: #ededed;
  --frame: #e0e0e0; --frame-bg: #121212; --frame-ink: #bdbdbd; --frame-ink-2: #c8c8c8;
  --rule: #333; --badge-hover: #222; --cover-border: #555; --cover-shadow: transparent; --menu-shadow: rgba(0,0,0,.6);
  --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%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--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); }   /* black line drawings turn white in dark mode */
strong { font-weight: 700; }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--ink-head);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 .4em;
  letter-spacing: .01em;
}
h1 { font-size: 4rem; text-align: center; }
h2 { font-size: 2.6rem; margin-top: 1.6em; }
h3 { font-size: 1.9rem; }

/* skip link for keyboard users */
.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: .9rem;
  z-index: 20;
}
.page {
  margin-left: var(--sidebar-w);
  padding: 3rem 2rem 2rem;
}
.content { max-width: var(--content-w); margin: 0 auto; }

/* Desktop: paint the grey sidebar column the full height of the page */
@media (min-width: 861px) {
  body { background: linear-gradient(to right, var(--sidebar-bg) var(--sidebar-w), var(--paper) var(--sidebar-w)); }
}

/* Sidebar header */
.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.9rem; line-height: 1.05; font-weight: 400;
  color: var(--ink-head);
}

/* Sidebar menu */
.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-group { display: flex; align-items: center; }
.nav-toggle {
  background: none; border: 0; padding: .2rem; margin-right: .1rem;
  cursor: pointer; color: var(--nav-ink); font: inherit; 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; }

/* Mobile top bar (hidden on desktop) */
.topbar { display: none; }

/* ---------- 5. Components ---------- */

/* Brush-stroke divider: <hr class="brush"> */
hr.brush {
  border: 0; height: 18px; margin: 2.4rem auto;
  max-width: var(--content-w);
  /* the original brush stroke (PNG) is used as a stencil, so it takes the theme colour;
     it keeps its own proportions and sits in the middle of the 18 px strip */
  background-color: var(--stroke);
  -webkit-mask: url("/img/firca.png") center / 100% auto no-repeat;
          mask: url("/img/firca.png") center / 100% auto no-repeat;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--btn-bg); color: var(--btn-ink);
  border: 1px solid var(--btn-bg);
  padding: .55rem 1.2rem .45rem;
  font-family: var(--font-body); font-weight: 600; font-size: .85rem;
  letter-spacing: .03em;
  text-decoration: none; text-align: center;
  border-radius: 2px;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); text-decoration: none; }
.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-block { display: block; width: 100%; }
.btn-small { font-size: .75rem; padding: .3rem .7rem .25rem; font-weight: 400; }

/* Placeholder frame for images that still need a Turkish redraw / are not here yet */
.ph {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 2px solid var(--frame);
  background: var(--frame-bg);
  font-family: var(--font-head); font-weight: 700; color: var(--frame-ink);
  text-decoration: none;
  padding: .5rem;
}
.ph-icon { width: 92px; height: 92px; margin: 0 auto .6rem; font-size: 2.4rem; }
.ph-booklet { width: 110px; height: 140px; margin: 0 auto 1rem; font-size: 3rem; border-radius: 4px; }

/* Responsive 16:9 video embed (3 Daire page).
   Videos that have no Turkish version yet are NOT shown; they sit in the HTML as comments. */
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; display: block; background: #000; }

/* ---------- 6. Home page ---------- */
.hero { text-align: center; margin: 0 auto; }
/* Typeset stand-in for the hand-lettered cross title (redraw brief R1) */
.hero-title { font-family: var(--font-head); color: var(--ink-head); margin: 0; line-height: 1; }
.hero-title .up   { display: block; font-size: 3.4rem; font-weight: 700; }
.hero-title .bar  { display: block; font-size: 6rem;   font-weight: 700; letter-spacing: .03em; }
.hero-title .down {
  display: block; font-size: 1.6rem; font-weight: 700; margin-top: .4rem;
  writing-mode: vertical-rl; white-space: nowrap;
  margin-left: auto; margin-right: auto;
  letter-spacing: .08em;
}
.tagline {
  font-family: var(--font-head); font-weight: 700;
  font-size: 2.1rem; line-height: 1.2; text-align: center;
  margin: 0 auto; max-width: 620px;
}
.start { text-align: center; }
.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 { font-size: 1.75rem; flex: 1; margin: 0 0 .6rem; }
.card h3 a { text-decoration: none; }
.cards .card:last-child:nth-child(3n + 1) { grid-column: 2; }   /* 10th card centred */

.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.6rem; }

/* ---------- 7. Lesson page ---------- */
.lesson-head { text-align: center; }
.lesson-head .cmd-icon { margin-bottom: 1.6rem; }
.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.3rem; text-decoration: none; }

.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 section > h2:first-child { margin-top: 1.4em; }

.with-figure { display: grid; grid-template-columns: 1fr 210px; gap: 1.6rem; align-items: center; }
.with-figure figure { margin: 0; text-align: center; }
.with-figure figure img { width: 180px; margin: 0 auto .6rem; }

/* Daha Derine (İsteğe Bağlı) accordion */
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.6rem; 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.4rem; 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; max-width: 860px;
}
.pager .btn { font-weight: 400; }

/* ---------- 8. Site footer ---------- */
.site-footer { max-width: var(--content-w); margin: 4rem auto 2rem; text-align: center; }
.site-footer h2 { font-size: 2.4rem; margin-top: 1rem; }
.footer-links {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem;
  text-align: left; max-width: 520px; margin: 0 auto 2.4rem;
  font-size: .95rem;
}
.footer-links ul { margin: 0; padding-left: 1.2rem; }
.footer-links li { margin-bottom: .3rem; }

/* Round "HER HALK / HER YER" badge – stand-in for the logo, links to / */
.badge {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 108px; height: 108px; 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.45rem; line-height: .95;
  color: var(--stroke); text-decoration: none;
}
.badge:hover { background: var(--badge-hover); text-decoration: none; }

/* ---------- 9. Mobile (≤ 860 px) ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .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.7rem; }
  .topbar a { text-decoration: none; }
  .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; bottom: 0;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 2px 0 8px var(--menu-shadow);
  }
  .sidebar .brand { display: none; }
  body.menu-open .sidebar { transform: none; }
  .page { margin-left: 0; padding: 1.8rem 1.1rem 1.5rem; }
  h1 { font-size: 3rem; }
  h2 { font-size: 2.2rem; }
  .hero-title .up { font-size: 2.6rem; }
  .hero-title .bar { font-size: 4.2rem; }
  .tagline { font-size: 1.75rem; }
  .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.5rem; }
  .pdf-card { flex-direction: column; text-align: center; gap: 1rem; }
  .with-figure { grid-template-columns: 1fr; }
  details.more summary { font-size: 2.2rem; }
  .pager { grid-template-columns: 1fr; gap: .7rem; }
  .footer-links { grid-template-columns: 1fr; }
}
/* Without JavaScript the mobile menu simply shows under the top bar */
@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. Print ---------- */
@media print {
  .sidebar, .topbar, .pager, .site-footer { display: none; }
  .page { margin: 0; padding: 0; }
  details.more > * { display: block; }
}

/* ---------- 11. Added in Stage 2 ---------- */
/* Two-card grid (bottom of lesson 10) */
.cards.cards-2 { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; margin-top: 2.5rem; }
@media (max-width: 860px) {
  .cards.cards-2 { grid-template-columns: 1fr 1fr; }
}

/* ---------- 12. Added in Stage 3 ---------- */
/* Placeholder frame for drawings that need a Turkish redraw (batch 2 redraw brief R4–R11).
   It lists the Turkish labels the new drawing must carry. Replace with <img> when the art exists. */
.ph-figure {
  border: 2px solid var(--frame); padding: .9rem .8rem;
  display: flex; flex-direction: column; justify-content: center; gap: .35rem;
  min-height: 180px; text-align: center; background: var(--frame-bg);
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; line-height: 1.15; color: var(--frame-ink-2);
}
.ph-figure .ph-main { font-size: 1.5rem; color: var(--ink-head); }
.with-figure.wide-figure { grid-template-columns: 1fr 260px; }
.figure-note { font-size: .8rem; line-height: 1.45; margin: .6rem 0 0; text-align: left; }

/* Page header used by 411 and the tools pages */
.page-head { text-align: center; }
.page-head .booklet { margin-bottom: 1.4rem; }
.page-head .head-img { width: 120px; margin: 0 auto 1.4rem; }
.page-head h1 { margin-bottom: .1rem; }
.page-head .subtitle { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; margin: 0; }
.h1-sub { display: block; font-size: 1.8rem; margin-top: .3rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin: 2rem 0 1rem; }
.btn-row .btn { min-width: 220px; }

.tools .note-em, .italic { font-style: italic; }
p { margin: 0 0 1rem; }

/* Üçte Üç Düzeni: three columns */
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 1rem; }
.three-cols h2 { font-size: 2.1rem; 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; }

/* PDF card used as a grid card on /araclar/ */
.card .card-cover { width: 92px; margin: 0 auto .6rem; border: 1px solid var(--cover-border); }

@media (max-width: 860px) {
  .with-figure.wide-figure { grid-template-columns: 1fr; }
  .three-cols { grid-template-columns: 1fr; }
  .h1-sub { font-size: 1.5rem; }
}

/* Capitals via CSS: the HTML keeps normal Turkish case ("Rehberi İndir"); lang="tr" gives the dotted İ */
.btn-upper { text-transform: uppercase; }
.ph-figure small { font-weight: 400; font-size: .85em; }

/* ---------- 13. Dark mode toggle (moon/sun button) ---------- */
/* Desktop: the button sits in the top-right corner of the sidebar header, beside the cross and title,
   without moving them. */
.brand-row { position: relative; }
.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:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .icon-moon { display: var(--show-moon); }   /* light page: moon = "switch to dark" */
.theme-btn .icon-sun  { display: var(--show-sun); }    /* dark page: sun = "switch to light" */
.topbar-btns { display: flex; align-items: center; gap: .5rem; }
.topbar .theme-btn { width: 40px; height: 40px; }
html.no-js .theme-btn { display: none; }               /* needs JavaScript */

/* ---------- 14. Original drawings ---------- */
/* Hand-drawn pictures from obeychrist.com: black ink on a transparent PNG (class="ink" flips them in dark mode) */
.card-img { display: block; text-decoration: none; }
.cmd-icon { display: block; width: 92px; height: 92px; margin: 0 auto .6rem; }
.booklet { display: block; width: 100px; height: auto; margin: 0 auto 1rem; }
.tool-img { display: block; width: auto; height: 110px; max-width: 100%; margin: 0 auto .6rem; object-fit: contain; }
.with-figure figure img { height: auto; }
.page-head .head-img { height: auto; }

/* Church circle, step 2: the nine icons with their Turkish names */
.kc-icons { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem .4rem; }
.kc-icons > div { margin: 0; text-align: center; }
.with-figure figure .kc-icons img { display: block; width: 64px; height: 64px; margin: 0 auto .2rem; }
.kc-icons span { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; line-height: 1.05; color: var(--ink-head); }
.kc-arrow-note { display: flex; gap: .6rem; align-items: flex-start; }
.with-figure figure .kc-arrow { flex: none; width: 30px; height: auto; margin-top: .15rem; }

/* Church circle, step 4: Turkish record box next to the drawing */
.record-box { display: flex; flex-direction: column; gap: .15rem; margin: .4rem auto 0; width: max-content; max-width: 100%;
  text-align: left; font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; line-height: 1.15; color: var(--ink-head); }
.record-box small { font-family: var(--font-body); font-weight: 400; font-size: .7rem; }

/* 411 diagrams (R4–R8): Turkish versions of the original drawings */
.with-figure figure img.diagram { width: 240px; }
.with-figure.diagram-below { grid-template-columns: 1fr; gap: 1rem; }
.with-figure.diagram-below figure img.diagram { width: 100%; max-width: 520px; }
