/* ───────────────────────────────────────────────────────────────────────────
   Tizenhét szótag – stíluslap
   Mobilra tervezve: egy írás pontosan egy képernyő. Washi papír, sumi tus,
   és egyetlen vörös szín: a pecsété.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --washi:        #e8e2d5;
  --washi-lap:    #f4f0e7;
  --sumi:         #1c1917;
  --sumi-halvany: #5d574e;
  --aizome:       #2c4a63;
  --shu:          #b03a29;
  --vonal:        rgba(28, 25, 23, .16);
  --vonal-halk:   rgba(28, 25, 23, .08);
  --oszlop:       40rem;
  --margo:        1.35rem;   /* az oldalsó levegő – innen állítható mindenhol */
}

@media (prefers-color-scheme: dark) {
  :root {
    --washi:        #14120f;
    --washi-lap:    #1d1a16;
    --sumi:         #e7e0d2;
    --sumi-halvany: #a49b8b;
    --aizome:       #8fb3cd;
    --shu:          #d56a55;
    --vonal:        rgba(231, 224, 210, .18);
    --vonal-halk:   rgba(231, 224, 210, .09);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--washi);
  color: var(--sumi);
  font-family: Spectral, "Iowan Old Style", Georgia, serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  background-image:
    radial-gradient(circle at 18% 8%,  rgba(255,255,255,.45), transparent 45%),
    radial-gradient(circle at 84% 88%, rgba(0,0,0,.035),      transparent 42%);
  background-attachment: fixed;
}

a { color: var(--aizome); text-underline-offset: .2em; }
a:hover { color: var(--shu); }
img, svg { max-width: 100%; }

:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; border-radius: 2px; }

.rejtve { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.burok { width: 100%; max-width: var(--oszlop); margin-inline: auto; padding-inline: var(--margo); }

/* ── A váz ────────────────────────────────────────────────────────────────── */

.torzs { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.fo { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Az olvasónézet pont egy képernyő: nincs végtelen görgetés. */
.torzs--olvaso { height: 100vh; height: 100dvh; overflow: hidden; }

/* ── Fejléc: kis kép a cím mellett ────────────────────────────────────────── */

.fejlec {
  flex: none;
  display: flex; align-items: center; gap: .75rem;
  width: 100%; max-width: var(--oszlop); margin-inline: auto;
  padding: .55rem var(--margo);
  border-bottom: 1px solid var(--vonal-halk);
}
.fejlec .jel { flex: none; width: 2.5rem; line-height: 0; }
.fejlec .cim {
  margin: 0; font-size: 1.05rem; font-weight: 200; letter-spacing: .16em; line-height: 1.2;
}
.fejlec .alcim {
  margin: .1rem 0 0; font-size: .66rem; letter-spacing: .04em; line-height: 1.35;
  color: var(--sumi-halvany); font-style: italic;
}

/* ── Illusztrációk ────────────────────────────────────────────────────────── */

.rajz { display: block; color: var(--sumi); line-height: 0; }
.rajz svg { display: block; width: 100%; height: auto; overflow: visible; }
.rajz img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rajz--kep img { mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .rajz--kep img { mix-blend-mode: normal; opacity: .85; } }

.rajz .tus { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.rajz .tolt { fill: currentColor; stroke: none; }
.rajz .szirom { fill: var(--shu); opacity: .78; }
.rajz .szirom .bibe { fill: var(--washi-lap); opacity: .9; }
.rajz .szirom-tolt { fill: var(--shu); }
.rajz .szirom-vonal { fill: none; stroke: var(--shu); stroke-width: 2.4; stroke-linecap: round; }
.rajz .pecsetfolt { fill: var(--shu); opacity: .16; }

/* az ecsetvonás lefut, mintha most festenék */
.rajz .tus path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: huzas 1.4s ease forwards; }
.rajz .tus path:nth-child(2) { animation-delay: .1s; }
.rajz .tus path:nth-child(3) { animation-delay: .2s; }
.rajz .tus path:nth-child(n+4) { animation-delay: .3s; }
.rajz .szirom, .rajz .tolt, .rajz .szirom-tolt, .rajz .szirom-vonal, .rajz .pecsetfolt,
.rajz--kep img { animation: elohalvanyul .8s .35s ease both; }
@keyframes huzas { to { stroke-dashoffset: 0; } }
@keyframes elohalvanyul { from { opacity: 0; } }

/* Az írások lapján egy kép van: az, amelyik a szöveg mellett áll.
   A fejlécben ilyenkor nem ismételjük meg. (A számok / könyv / hogyan
   oldalakon viszont ott marad – töröld a torzs--olvaso részt, ha
   mindenhonnan el akarod tüntetni.) */
.fejlec .jelkep { opacity: .85; }
.torzs--olvaso .fejlec .jel { display: none; }

/* ── Egy írás lapja ───────────────────────────────────────────────────────── */

.szinpad { flex: 1; min-height: 0; display: flex; overflow: hidden; max-width: 100%; }

.lap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  width: 100%; max-width: var(--oszlop); margin-inline: auto;
  padding: .85rem var(--margo) 0;
  position: relative;
}

.lap-fej { flex: none; display: flex; align-items: center; gap: .7rem; }
.lap-fej .cim { margin: 0; font-size: 1.15rem; font-weight: 400; line-height: 1.3; }
.lap-fej .meta {
  margin: .1rem 0 0; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sumi-halvany);
}

.pecset {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem;
  border: 1.5px solid var(--shu); border-radius: 3px;
  color: var(--shu);
  font-family: "Noto Serif JP", serif; font-size: .85rem; line-height: 1;
  writing-mode: vertical-rl; letter-spacing: -.05em;
  transform: rotate(-3deg);
}

.lap-torzs {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;     /* vízszintes csík soha */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: .9rem 0 .5rem;
  scrollbar-width: thin;
}
.lap-torzs:focus { outline: none; }

.illu--nagy {
  width: min(52%, 190px);
  max-height: 26vh;
  margin: 0 auto 1.1rem;
  opacity: .95;
}
.illu--nagy svg, .illu--nagy img { max-height: 26vh; }

.illu--kicsi {
  float: right; shape-outside: circle(50%);
  width: 5.25rem; max-width: 38%; height: 5.25rem;
  margin: .1rem -.2rem .5rem .85rem;
  opacity: .6;
}

.szoveg p { margin: 0 0 .95rem; white-space: pre-line; overflow-wrap: break-word; }
.szoveg p:last-child { margin-bottom: 0; }

.lap--haiku .lap-torzs { display: flex; flex-direction: column; justify-content: center; }
.lap--haiku .szoveg {
  font-size: clamp(1.25rem, 5.6vw, 1.6rem); font-weight: 200; line-height: 2.05; text-align: center;
}
.lap--eletkep .szoveg { font-size: 1.05rem; line-height: 1.85; }
.lap--hangulat .szoveg, .lap--novella .szoveg { font-size: 1rem; line-height: 1.75; hyphens: auto; }

/* halvány jelzés, hogy lejjebb még van szöveg */
.lap--gorgetheto .lap-torzs { mask-image: linear-gradient(to bottom, #000 82%, transparent 100%); }

/* ── Értékelés és lapozás ─────────────────────────────────────────────────── */

.lap-lab { flex: none; border-top: 1px solid var(--vonal-halk); padding-top: .5rem; }

.ertekeles { display: flex; align-items: center; gap: .4rem; margin: 0; }

.gomb {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .38rem .7rem;
  border: 1px solid var(--vonal); border-radius: 999px;
  background: transparent; color: var(--sumi-halvany);
  font: inherit; font-size: .85rem; line-height: 1;
  cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.gomb:hover { border-color: var(--shu); color: var(--shu); }
.gomb[aria-pressed="true"] { border-color: var(--shu); color: var(--shu); background: rgba(176,58,41,.07); }
.gomb .szam { font-variant-numeric: tabular-nums; }
.gomb svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.megoszt { margin-left: auto; }
.megoszt svg { fill: currentColor; stroke: none; }
.megoszt:hover { border-color: var(--aizome); color: var(--aizome); }

.visszajelzes {
  font-size: .7rem; font-style: italic; color: var(--sumi-halvany);
  margin-left: .4rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.visszajelzes:empty { display: none; }

.lapozo {
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem 0 .55rem;
}
.nyil {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--sumi); border-radius: 50%;
  background: var(--sumi); color: var(--washi);
  text-decoration: none; font-size: 1.1rem; line-height: 1;
  transition: background .2s, border-color .2s, transform .15s;
}
.nyil:hover, .nyil:focus-visible { background: var(--shu); border-color: var(--shu); color: var(--washi-lap); }
.nyil:active { transform: scale(.94); }
.nyil--halott {
  background: transparent; border-color: var(--vonal); color: var(--sumi-halvany); opacity: .3;
}
.allapot { font-size: .7rem; letter-spacing: .14em; color: var(--sumi-halvany); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .suhints { display: none; } }

/* lapozás közbeni finom mozgás */
.lap.jon-balrol { animation: beszan-bal .28s ease both; }
.lap.jon-jobbrol { animation: beszan-jobb .28s ease both; }
@keyframes beszan-bal  { from { opacity: 0; transform: translateX(-4%); } }
@keyframes beszan-jobb { from { opacity: 0; transform: translateX(4%); } }

/* ── Alsó sáv: apró számok, könyv, e-mail ─────────────────────────────────── */

.also {
  flex: none;
  width: 100%; max-width: var(--oszlop); margin-inline: auto;
  padding: .55rem var(--margo) calc(.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--vonal-halk);
  text-align: center;
}
.statsor {
  margin: 0 0 .3rem;
  font-size: .66rem; letter-spacing: .05em; line-height: 1.5;
  color: var(--sumi-halvany);
}
.statsor a { color: inherit; }
.konyvsor { margin: 0 0 .45rem; font-size: .76rem; line-height: 1.45; }
.patreon {
  display: inline-block; margin-left: .25rem;
  padding: .14rem .55rem;
  background: var(--shu); color: var(--washi-lap);
  border-radius: 2px; text-decoration: none; font-size: .72rem; letter-spacing: .04em;
  white-space: nowrap;
}
.patreon:hover { background: var(--sumi); color: var(--washi-lap); }

.ertesito { display: flex; gap: .35rem; }
.ertesito input[type="email"] {
  flex: 1; min-width: 0;
  padding: .45rem .6rem;
  border: 1px solid var(--vonal); border-radius: 2px;
  background: var(--washi-lap); color: var(--sumi);
  font: inherit; font-size: 1rem;   /* 16px: így nem nagyít rá az iPhone */
}
.ertesito input::placeholder { color: var(--sumi-halvany); opacity: .75; font-size: .8rem; }
.ertesito button {
  flex: none; width: 2.6rem;
  border: 1px solid var(--sumi); border-radius: 2px;
  background: var(--sumi); color: var(--washi-lap);
  font: inherit; font-size: .95rem; cursor: pointer;
}
.ertesito button:hover { background: var(--shu); border-color: var(--shu); }
.csapda { position: absolute; left: -9999px; }

.uzenet { margin: .35rem 0 0; font-size: .72rem; }
.uzenet.ok   { color: var(--aizome); }
.uzenet.hiba { color: var(--shu); }

.ures { padding-block: 3rem; text-align: center; }

/* ── Görgethető aloldalak (számok, könyv, hogyan készült) ─────────────────── */

.torzs--lapozhato .fo { display: block; }

/* Csak függőleges padding: az oldalsó margót a .burok adja, és nem
   írhatja felül egy rövidítés. */
.szakasz { padding-block: 1.75rem; border-top: 1px solid var(--vonal-halk); }
.szakasz:first-child { border-top: 0; }
.szakasz > h2 {
  margin: 0 0 1rem; font-size: .78rem; font-weight: 400;
  letter-spacing: .2em; text-transform: uppercase; color: var(--sumi-halvany);
}
.szakasz h3 { font-weight: 400; font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.hasab p { margin: 0 0 1rem; font-size: .97rem; }
.hasab ul { padding-left: 1.1rem; margin: 0 0 1rem; font-size: .95rem; }
.hasab li { margin-bottom: .4rem; }
.hasab blockquote {
  margin: 1.25rem 0; padding: .5rem 0 .5rem 1.1rem;
  border-left: 2px solid var(--vonal); color: var(--sumi-halvany); font-style: italic; font-size: .95rem;
}
.hasab .brief {
  background: var(--washi-lap); border: 1px solid var(--vonal-halk); border-radius: 2px;
  padding: 1.1rem 1.1rem; font-size: .92rem;
}
.hasab .brief p:last-child { margin-bottom: 0; }

.szamok {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--vonal-halk); border: 1px solid var(--vonal-halk); border-radius: 2px; overflow: hidden;
}
.szamok div { background: var(--washi-lap); padding: .9rem .5rem; text-align: center; }
.szamok .ertek { display: block; font-size: 1.6rem; font-weight: 200; line-height: 1.2; font-variant-numeric: tabular-nums; }
.szamok .cimke { display: block; margin-top: .2rem; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sumi-halvany); }
@media (min-width: 34rem) { .szamok { grid-template-columns: repeat(4, 1fr); } }

.sav { height: 6px; border-radius: 999px; background: var(--vonal); overflow: hidden; }
.sav span { display: block; height: 100%; background: var(--shu); }
.merleg { margin-top: 1.1rem; }
.merleg .alatta { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .75rem; color: var(--sumi-halvany); }

.kiemelt {
  margin-top: 1.25rem; padding: .9rem 1rem;
  border-left: 2px solid var(--shu); background: var(--washi-lap); font-size: .9rem;
}

.muvek-lista { list-style: none; padding: 0; margin: 0; }
.muvek-lista li { padding: .7rem 0; border-bottom: 1px solid var(--vonal-halk); }
.muvek-lista .sorfej { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; }
.muvek-lista .pontok { font-size: .8rem; color: var(--sumi-halvany); white-space: nowrap; font-variant-numeric: tabular-nums; }
.muvek-lista .also-sor { display: flex; gap: .7rem; align-items: center; margin-top: .35rem; }
.muvek-lista .sav { flex: 1; height: 4px; }
.muvek-lista .mufaj { font-size: .68rem; letter-spacing: .08em; color: var(--sumi-halvany); }

.fogomb {
  display: inline-block; margin-top: 1rem; padding: .7rem 1.4rem;
  background: var(--shu); color: var(--washi-lap);
  border-radius: 2px; text-decoration: none; font-size: .92rem; letter-spacing: .05em;
}
.fogomb:hover { background: var(--sumi); color: var(--washi-lap); }

.zarosor { padding: 1.5rem 0 2rem; border-top: 1px solid var(--vonal-halk); text-align: center; font-size: .75rem; color: var(--sumi-halvany); }

/* ── Nagyobb képernyőn kicsit levegősebb ──────────────────────────────────── */

@media (min-width: 40rem) {
  :root { --margo: 1.75rem; }
  .fejlec { padding: .8rem var(--margo); }
  .fejlec .cim { font-size: 1.25rem; }
  .fejlec .jel { width: 3rem; }
  .lap { padding-top: 1.25rem; }
  .lap-fej .cim { font-size: 1.35rem; }
  .illu--nagy { width: min(40%, 210px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rajz .tus path { stroke-dashoffset: 0; }
}

/* ha nincs hova lapozni, a lap finoman megrezzen */
.lap.rezzen { animation: rezzenes .3s ease; }
@keyframes rezzenes { 25% { transform: translateX(-6px); } 60% { transform: translateX(4px); } }
