/* ================================================================
   Krasoňov — Heritage Edition
   Aesthetic: Refined Bohemian Gazette
   Fonts:  DM Serif Display (headings) + Crimson Text (body)
           + Cinzel (nav / labels)
   Colors: #0f2744 deep navy  ·  #CFDDEB sky  ·  #7a9e6a sage
           #cc0033 red  ·  #f5f2ec parchment
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── Custom properties ─────────────────────────────────────────── */
:root {
  --navy:        #0f2744;
  --navy-mid:    #1e4678;
  --navy-soft:   #2a5a8a;
  --sky:         #CFDDEB;
  --parchment:   #f5f2ec;
  --parchment-d: #e8e2d6;
  --sage:        #7a9e6a;
  --sage-soft:   rgba(122,158,106,0.18);
  --red:         #cc0033;
  --ink:         #18243a;
  --ink-soft:    #3a4d65;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Page background ───────────────────────────────────────────── */
body {
  background-color: var(--sky);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(30,70,120,0.025) 2px,
      rgba(30,70,120,0.025) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 4px,
      rgba(30,70,120,0.015) 4px,
      rgba(30,70,120,0.016) 5px
    );
  color: var(--ink);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.82;
  min-height: 100vh;
}

/* ── Page wrapper ──────────────────────────────────────────────── */
.page-wrap {
  max-width: 900px;
  margin: 28px auto;
  box-shadow:
    0  2px  8px  rgba(15,39,68,0.10),
    0  8px  32px rgba(15,39,68,0.16);
  border-radius: 2px;
  overflow: hidden;
  animation: pageRise 0.5s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes pageRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header banner ─────────────────────────────────────────────── */
.header {
  background-color: var(--navy);
  border-bottom: 2px solid rgba(122,158,106,0.45);
  line-height: 0;
  overflow: hidden;
}

.header img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Two-column layout ─────────────────────────────────────────── */
#allfix {
  display: flex;
  flex-direction: row;
  min-height: 420px;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
#allfix .leftmenu {
  flex: 0 0 170px;
  background-color: var(--navy);
  padding: 0;
  border-right: 1px solid rgba(255,255,255,0.06);
}

/* village name above nav */
#allfix .leftmenu::before {
  content: 'KRASOŇOV';
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 600;
  color: rgba(200,220,245,0.5);
  letter-spacing: 0.22em;
  text-align: center;
  padding: 16px 12px 13px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}

/* nav links */
#allfix .leftmenu a.button {
  display: block;
  width: 100%;
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.035em;
  color: rgba(200,220,245,0.75);
  background: transparent;
  text-decoration: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 7px 14px 7px 18px;
  transition: color 0.2s, background 0.2s, border-left-color 0.2s, padding-left 0.2s;
}

#allfix .leftmenu a.button:hover {
  color: #fff;
  background: rgba(122,158,106,0.14);
  border-left-color: var(--sage);
  padding-left: 22px;
}

/* override bare <a> inside nav */
#allfix .leftmenu a {
  background: transparent;
}

/* hide presentational <br> tags in nabidka.html */
#allfix .leftmenu br {
  display: none;
}

/* ── Main content area ─────────────────────────────────────────── */
#allfix .mainarea {
  flex: 1 1 0;
  min-width: 0;
  background-color: var(--parchment);
  color: var(--ink);
  padding: 28px 34px 38px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(170,200,235,0.5);
  font-family: 'Cinzel', serif;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  padding: 11px 20px;
  text-align: right;
}

.footer a {
  color: rgba(170,200,235,0.6);
  background: transparent;
  border-bottom: none;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #fff;
  background: transparent;
}

/* ── Typography ────────────────────────────────────────────────── */
H1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 29px;
  font-weight: 400;
  font-style: italic;
  color: var(--red);
  text-align: center;
  line-height: 1.22;
  margin: 0.15em 0 0.9em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(204,0,51,0.12);
  letter-spacing: -0.01em;
}

h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25em;
  font-weight: 400;
  color: var(--navy-mid);
  margin: 1.5em 0 0.25em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--parchment-d);
}

h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.07em;
  font-weight: 400;
  font-style: italic;
  color: var(--navy-soft);
  margin: 1.1em 0 0.15em;
}

p {
  margin: 0 0 0.4em;
  text-indent: 1.6em;
}

h1 + p, h2 + p, h3 + p {
  text-indent: 0;
}

/* ── Content links ─────────────────────────────────────────────── */
a {
  color: var(--navy-mid);
  background: transparent;
  text-decoration: none;
  border-bottom: 1px solid rgba(30,70,120,0.28);
  transition: color 0.18s, border-color 0.18s;
}

a:hover {
  color: var(--red);
  background: transparent;
  border-bottom-color: rgba(204,0,51,0.4);
}

a.button, a.cistej {
  border-bottom: none;
  text-decoration: none;
  color: inherit;
  background: transparent;
}

a.cistej:hover {
  color: inherit;
  background: transparent;
  border-bottom: none;
}

/* ── Images ────────────────────────────────────────────────────── */
img {
  border: 0;
  max-width: 100%;
  height: auto;
  display: block;
}

p img, td img, .mainarea p img {
  display: inline;
}

/* ── Media blocks (text + image side by side) ──────────────────── */
.media-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 2em;
}

.media-text {
  flex: 1 1 0;
  min-width: 0;
}

.media-text p {
  text-indent: 0;
}

.media-img {
  flex: 0 0 200px;
}

.media-img img {
  width: 100%;
  height: auto;
}

.media-imgs {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-imgs img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 480px) {
  .media-block {
    flex-direction: column;
  }
  .media-img, .media-imgs {
    flex: none;
    width: 100%;
  }
}

/* ── Horizontal rules ──────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--parchment-d);
  margin: 0.55em auto;
  width: 82%;
}

/* ── Tables ────────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  width: auto;
  margin: 0.8em 0;
}

td, th {
  padding: 5px 14px 5px 5px;
  vertical-align: top;
}

th {
  font-family: 'Cinzel', serif;
  font-size: 0.78em;
  letter-spacing: 0.06em;
  color: var(--navy-mid);
  border-bottom: 2px solid var(--parchment-d);
}

table tr:nth-child(even) td {
  background-color: rgba(30,70,120,0.04);
}

table td:first-child {
  font-variant-numeric: tabular-nums;
}

/* ── Lightbox ──────────────────────────────────────────────────── */
#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#lb-overlay.lb-active {
  display: flex;
  opacity: 1;
}

#lb-box {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  cursor: default;
}

#lb-img {
  display: block;
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  box-shadow: 0 12px 56px rgba(0,0,0,0.55);
  border-radius: 2px;
}

#lb-close {
  position: absolute;
  top: -13px;
  right: -13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--navy);
  color: rgba(200,220,245,0.9);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: background 0.15s;
}

#lb-close:hover {
  background: var(--red);
  color: #fff;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 660px) {
  .page-wrap {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #allfix {
    flex-direction: column;
  }

  #allfix .leftmenu {
    flex: none;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px;
    padding: 6px 8px 8px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  #allfix .leftmenu::before {
    width: 100%;
    padding: 4px 8px 6px;
    text-align: left;
    border-bottom: none;
    margin-bottom: 4px;
  }

  #allfix .leftmenu a.button {
    width: auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 5px 10px;
    font-size: 10px;
  }

  #allfix .leftmenu a.button:hover {
    padding-left: 10px;
    border-left-color: transparent;
    border-bottom-color: var(--sage);
  }

  #allfix .leftmenu br {
    display: none;
  }

  #allfix .mainarea {
    padding: 18px 18px 28px;
  }

  H1 { font-size: 24px; }
}
