/* Jeskyně a draci – téma pro Datenstrom Yellow (mytago.cz/jad)
   Použití: v hlavičce stránky „Theme: jad“.
   Soubory: system/themes/jad.css + jad.png, fonty jad-*.woff2 do media/themes/.
   Kontrast (WCAG 2.2) vůči pozadí #110c09: text 15,1:1, vedlejší 8,4:1, zlatá 9,5:1,
   rudý text 6,3:1, text na rudém tlačítku 5,9:1, rudá výplň vůči pozadí 3,1:1. */

/* ---------- Fonty (OFL, Google Fonts, jen latin + latin-ext) ---------- */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url('jad-cormorant-garamond-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url('jad-cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 600; font-display: swap;
  src: url('jad-cormorant-garamond-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 600; font-display: swap;
  src: url('jad-cormorant-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('jad-alegreya-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('jad-alegreya-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('jad-alegreya-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('jad-alegreya-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('jad-alegreya-sans-sc-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('jad-alegreya-sans-sc-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('jad-alegreya-sans-sc-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans SC'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('jad-alegreya-sans-sc-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokeny ---------- */
:root {
  color-scheme: dark;
  --bg:         #110c09;  /* uhel */
  --surface:    #1c1410;  /* tmavá kůže */
  --surface-2:  #261a14;
  --text:       #ece2cc;  /* pergamen */
  --muted:      #b9a98d;  /* vybledlý inkoust */
  --gold:       #dcae4f;
  --gold-hi:    #f2cf7a;
  --crimson:    #b8262a;  /* rudá pravidel – výplň tlačítka */
  --crimson-hi: #a01f23;
  --blood:      #8e1b1e;  /* jen dekor */
  --red-text:   #ec6a5c;
  --rule:       #6b5236;  /* bronzová linka */
  --line:       #2f231b;
  --on-crimson: #fff8ec;

  --f-head:  'Cormorant Garamond', Garamond, Georgia, serif;
  --f-body:  'Alegreya', Georgia, 'Times New Roman', serif;
  --f-label: 'Alegreya Sans SC', 'Alegreya', system-ui, sans-serif;
  --measure: 42rem;
}

/* ---------- Základ ---------- */
html, body, div, form, pre, span, tr, th, td, img { margin: 0; padding: 0; border: 0; vertical-align: baseline; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.65 var(--f-body);
  hyphens: auto; -webkit-hyphens: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--blood); color: var(--on-crimson); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

a { color: var(--gold); text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--gold-hi); text-decoration-color: currentColor; }

h1, h2, h3, h4, h5, h6 { color: var(--gold); font-family: var(--f-head); font-weight: 700; hyphens: none; -webkit-hyphens: none; text-wrap: balance; }
strong, b { font-weight: 700; }

/* ---------- Kostra Yellow ---------- */
.page {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}

/* Hlavička */
.header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: 1.25rem 0 .9rem;
  border-bottom: 1px solid var(--rule);
}
/* Mytago jen jako text ve stylu menu, bez znaku */
.header .sitename h1 { margin: 0; font: 700 1.05rem/1.2 var(--f-label); letter-spacing: .06em; }
.header .sitename h1 a { display: inline-block; padding: .4rem 0; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.header .sitename h1 a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.sitename-logo, .sitename-banner { display: none; }

.navigation ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.navigation a {
  display: inline-block; padding: .4rem 0;
  font: 700 1.05rem/1.2 var(--f-label); letter-spacing: .06em;
  color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.navigation a:hover, .navigation a.active { color: var(--gold); border-bottom-color: var(--gold); }

.header-links {
  flex-basis: 100%;
  padding-top: .6rem; border-top: 1px solid var(--line);
  font: 500 .95rem/1.6 var(--f-label); letter-spacing: .04em;
  color: var(--rule);
}
.header-links a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.header-links a:hover { color: var(--gold); text-decoration: underline; }
.header-links a[href$="jeskyne-a-draci"], .header-links a[href$="/jad"] { color: var(--gold); }

/* Obsah */
.content { padding: 2.5rem 0 4rem; }
.main { max-width: var(--measure); margin: 0 auto; }
.main p { margin: 0 0 1rem; }
.main ul, .main ol { margin: 0 0 1.25rem; padding-left: 1.3rem; }
.main li { margin-bottom: .45rem; }
.main ul > li::marker { content: "◆  "; color: var(--crimson); font-size: .7em; }
.main em { color: var(--muted); }

.main h1 {
  font-size: clamp(2.6rem, 7vw, 4.1rem); line-height: 1.02;
  margin: 0 0 .6rem; letter-spacing: .005em;
}
/* Hlavní nadpis stránky nahradí logo JaD; text zůstává pro vyhledávače a čtečky */
.main h1:first-of-type {
  width: min(100%, 22rem); aspect-ratio: 2400 / 597;
  margin: .25rem 0 1.5rem;
  background: url(jad-logo.png) left center / contain no-repeat;
  color: transparent; font-size: 1px; line-height: 0; overflow: hidden;
}
.main h2 {
  font-size: clamp(1.75rem, 4.2vw, 2.3rem); line-height: 1.1;
  margin: 3.25rem 0 1rem; padding-top: .9rem;
  border-top: 3px double var(--blood);
  clear: both;
}
.main h3 {
  font: 700 1.05rem/1.3 var(--f-label); letter-spacing: .08em;
  color: var(--red-text); margin: 2rem 0 .5rem;
}

/* Úvodní odstavec s iniciálou */
.main h1 + p { font-size: 1.2rem; }
/* Iniciála přes dva řádky. Box floatu je nižší než dva řádky (3,6 × 0,8 = 2,88em < 3,3em),
   takže nožička J přesahuje jen vizuálně a třetí řádek začíná zase u kraje. */
.main h1 + p::first-letter {
  float: left;
  font-family: var(--f-head); font-weight: 700;
  font-size: 3.6em; line-height: .8;
  margin: .06em .1em 0 0;
  color: var(--crimson);
}

/* Heslo na začátku odstavce, jako v příručce */
.main p > strong:first-child {
  font-family: var(--f-head); font-size: 1.15em; color: var(--gold);
}
.main li > strong:first-child { color: var(--text); }

/* Obálka */
.main img { max-width: 100%; height: auto; box-sizing: border-box; }
.main img.right {
  float: right; width: min(42%, 15rem);
  margin: .4rem 0 1rem 1.75rem;
  border: 1px solid var(--rule);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--blood), 0 18px 40px -12px #000;
}
.main img.left { float: left; margin: 0 1.5rem 1rem 0; }

/* Tlačítka – Yellow vkládá <p><center><a class="button"> */
.main center {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem;
  margin: 1.75rem 0 2rem; clear: both;
}
.main a.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  padding: .55rem 1.2rem; box-sizing: border-box;
  font: 700 1rem/1.2 var(--f-label); letter-spacing: .06em;
  color: var(--gold); background: transparent;
  border: 1px solid var(--gold); border-radius: 2px;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.main a.button:hover { background: var(--surface-2); color: var(--gold-hi); }
.main a.button:first-child,
.main a.button.primary { background: var(--crimson); border-color: var(--crimson); color: var(--on-crimson); }
.main a.button:first-child:hover,
.main a.button.primary:hover { background: var(--crimson-hi); border-color: var(--crimson-hi); color: var(--on-crimson); }

/* Boxy – Yellow notice: „! text“ až „!!!!!! text“ */
.main .notice1, .main .notice2, .main .notice3,
.main .notice4, .main .notice5, .main .notice6 {
  margin: 1.75rem 0; padding: 1.1rem 1.25rem 1.2rem;
  background: var(--surface);
  border-top: 4px solid var(--crimson);
  border-bottom: 1px solid var(--rule);
  font-size: 1.02rem;
}
.main .notice2 { border-top-color: var(--gold); }
.main [class^="notice"] > :last-child { margin-bottom: 0; }

/* Citát */
.main blockquote {
  margin: 2.5rem 0; padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
  font: italic 600 1.45rem/1.4 var(--f-head); text-align: center;
}
.main blockquote p { margin: 0; }

/* Tabulky */
.main table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 1rem; }
.main th {
  text-align: left; padding: .55rem .75rem;
  font: 700 .9rem/1.3 var(--f-label); letter-spacing: .07em;
  color: var(--gold); background: var(--surface-2); border-bottom: 2px solid var(--blood);
}
.main td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.main tr:nth-child(even) td { background: var(--surface); }

.main hr { height: 0; border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; clear: both; }
.main code { font-size: .95em; background: var(--surface-2); padding: .1rem .35rem; border-radius: 2px; }

/* Patička */
.footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 2.5rem;
  font: 500 1rem/1.5 var(--f-label); letter-spacing: .04em;
  color: var(--rule); text-align: center;
}
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--gold); text-decoration: underline; }

/* Rozšíření Backtotop */
a#backtotop {
  background: var(--surface-2); color: var(--gold);
  border: 1px solid var(--rule); border-radius: 2px;
  font: 700 .95rem/1 var(--f-label); letter-spacing: .05em;
  padding: .6rem .9rem; bottom: max(20px, env(safe-area-inset-bottom, 0px)); right: max(20px, env(safe-area-inset-right, 0px));
}
a#backtotop:hover { color: var(--gold-hi); border-color: var(--gold); }

/* Vyhledávací stránka a formuláře, kdyby téma použila jiná stránka */
input, select, textarea, button { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--rule); border-radius: 2px; padding: .45rem .6rem; }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .header { justify-content: flex-start; }
  .main img.right { float: none; display: block; width: min(70%, 15rem); margin: 0 auto 1.75rem; }
  .main center { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
