/* Fjalëkryq site: the app's paper and ink in one reading column. Fraunces for
   headlines, Libre Franklin for reading, and crossword squares wherever a
   number or a choice sits: section numbers, the header's language and theme
   squares, the home page's grid words. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
/* Libre Franklin, subset to Latin with ë and ç (fonts/OFL-LibreFranklin.txt). */
@font-face { font-family: "Libre Franklin"; src: url("/fonts/LibreFranklin-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/LibreFranklin-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/LibreFranklin-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("/fonts/LibreFranklin-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Light by default. site.js puts data-theme on <html> before the first paint,
   from the toggle's saved choice or else the system setting. */
:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --sunk: #EFECE6;
  --line: #E6E1D8;
  --line-strong: #D5CFC4;
  --rule: #1B1A18;
  --block: #1B1A18;
  --ink: #1B1A18;
  --ink-2: #67625A;
  --ink-3: #8F897F;
  --on-ink: #FFFFFF;
  --accent: #E9A93B;
  --cursor: #F3C24F;
  --word: #FCEFCB;
  --missing: #FBE8E5;
  --missing-text: #A8352A;
  --full: #3D63A8;
  --mini: #7752BD;
  --paskeme: #E2B013;
  --sudoku: #3A8659;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111110;
  --surface: #1A1918;
  --sunk: #232220;
  --line: #2A2825;
  --line-strong: #3A3733;
  --rule: #5E5953;
  --block: #050505;
  --ink: #F3F0EA;
  --ink-2: #A8A299;
  --ink-3: #77726A;
  --on-ink: #111110;
  --accent: #F0B54E;
  --cursor: #F0B54E;
  --word: #33280F;
  --missing: #331A16;
  --missing-text: #F28A7E;
  --full: #86A7E6;
  --mini: #AE90E6;
  --paskeme: #FCE497;
  --sudoku: #71BF8D;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-block: 28px 72px; }
.wrap {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ─── Header ───────────────────────────────────────────────────────────── */

.top { position: relative; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; padding-block: 14px; }
.brand { margin-right: auto; display: inline-flex; align-items: center; gap: 10px; font: 600 21px/1 var(--display); text-decoration: none; }
.brand img { border-radius: 0px; }

.menu { display: flex; align-items: center; gap: 28px; }
.menu-nav { display: flex; gap: 22px; }
.menu-nav a { font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.menu-nav a:hover, .menu-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

/* A square of the grid. Joined squares share their borders. */
.sq {
  appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border-radius: 0;
  position: relative;
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1.5px solid var(--rule);
  background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--body); letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.squares { display: flex; }
/* Each line drawn once, so neighbours never round a pixel apart. */
.squares .sq + .sq { border-left-width: 0; }
.sq:hover { background: var(--word); }
.sq:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 1; }
.sq svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Language squares: the flag where a clue number would sit, the code as the
   square's letters. This page's language is the selected square. */
.lang { padding-top: 0px; }
.lang[aria-current], .lang[aria-current]:hover { background: var(--cursor); color: #1B1A18; cursor: default; }
.flag {
  position: absolute; top: 4px; left: 4px;
  width: 17px; height: 12px;
  background: currentColor;
  -webkit-mask: var(--flag) center / contain no-repeat;
  mask: var(--flag) center / contain no-repeat;
  opacity: 0.75;
}
.flag-al { --flag: url("/flags/al.svg"); }
.flag-en { --flag: url("/flags/en.svg"); }

.theme .sun { display: none; }
[data-theme="dark"] .theme .sun { display: block; }
[data-theme="dark"] .theme .moon { display: none; }
/* Without the script there is no theme to switch, and no menu to open. */
html:not(.js) .theme { display: none; }
.burger { display: none; }
.chev { display: none; }

@media (max-width: 680px) {
  .top-row { flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .menu { width: 100%; justify-content: space-between; }

  /* A plain icon button that turns into a close mark. */
  .js .burger {
    appearance: none; -webkit-appearance: none; margin: 0; padding: 0;
    width: 42px; height: 42px; border: 0; border-radius: 0px;
    display: grid; place-items: center;
    background: transparent; color: var(--ink); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .burger:hover, .open .burger { background: var(--sunk); }
  .burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .burger svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .burger path { transition: transform 200ms ease, opacity 150ms ease; transform-origin: 12px 12px; }
  .open .burger .l1 { transform: rotate(45deg) translateY(5px); }
  .open .burger .l2 { opacity: 0; }
  .open .burger .l3 { transform: rotate(-45deg) translateY(-5px); }

  /* The menu: a card under the header with the links, then the squares. */
  .js .menu {
    display: none;
    position: absolute; top: calc(100% + 8px);
    left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    flex-direction: column; align-items: stretch; gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: 0px;
    padding: 6px 16px 16px;
    box-shadow: 0 24px 48px -20px rgba(27, 26, 24, 0.28);
  }
  .js[data-theme="dark"] .menu { box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.7); }
  .js .open .menu { display: flex; }
  .menu-nav { flex-direction: column; gap: 0; }
  .menu-nav a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 2px; border-bottom: 1px solid var(--line);
    font-size: 17px; font-weight: 600; color: var(--ink);
  }
  .menu-nav a:hover, .menu-nav a[aria-current="page"] { text-decoration: none; }
  .menu-nav .chev { display: block; width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}
@media (max-width: 680px) and (prefers-reduced-motion: no-preference) {
  .js .open .menu { animation: drop 200ms cubic-bezier(.2, .7, .2, 1); }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ─── Footer ───────────────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 22px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover, .foot a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.foot p { margin: 0; }

/* ─── Documents ────────────────────────────────────────────────────────── */

h1 {
  font: 600 clamp(32px, 7vw, 44px)/1.08 var(--display);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  text-wrap: balance;
}
.meta { margin: 0 0 6px; color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.lede { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }

.doc { counter-reset: sec; }
.doc h2 {
  counter-increment: sec;
  display: flex; align-items: center; gap: 12px;
  font: 600 22px/1.25 var(--display);
  margin: 44px 0 12px;
  text-wrap: balance;
}
/* The section number as a crossword cell: a square with its clue number in the corner. */
.doc h2::before {
  content: counter(sec);
  flex: none;
  width: 30px; height: 30px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink-2);
  font: 600 10px/1 var(--body);
  padding: 3px 0 0 4px;
  font-variant-numeric: tabular-nums;
}
.doc h3 { font-size: 16px; font-weight: 700; margin: 26px 0 6px; }
.doc p, .doc li { max-width: 66ch; text-wrap: pretty; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.doc li::marker { color: var(--ink-3); }
strong { font-weight: 700; }

/* Numbered steps, each in its own cell */
.steps { list-style: none; padding-left: 0 !important; counter-reset: step; gap: 10px !important; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; }
.steps li::before {
  content: counter(step);
  width: 26px; height: 26px;
  background: var(--ink); color: var(--on-ink);
  font: 600 12px/26px var(--body); text-align: center;
  margin-top: 1px;
}

/* The privacy summary */
.table { overflow-x: auto; margin: 28px 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; width: 40%; }

.callout { background: var(--word); border-radius: 4px; padding: 14px 16px; margin: 20px 0; max-width: 66ch; }
.callout p:last-child { margin-bottom: 0; }

mark.missing {
  background: var(--missing); color: var(--missing-text);
  font: 600 0.82em/1.2 var(--mono); padding: 1px 5px; border-radius: 4px;
  white-space: nowrap;
}

.notfound { padding-block: 40px; display: grid; gap: 12px; }

@media (max-width: 520px) {
  main { padding-block: 20px 56px; }
  .doc h2 { font-size: 20px; margin-top: 36px; }
}
