@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=Special+Elite&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a{
  color: inherit;
  }

a:visited{
  color: inherit;
}

.back{
  position: absolute;
  top: 0;
  left: 0;
  padding: 20px;
  font-weight: 700;
}

.divka-arrow a{
    padding: 20px;
  display: inline-block;
}

.divka-arrow {
  display: flex;
  justify-content: center;
  gap: 2em;
}

body {
  font-family: 'EB Garamond', 'Latin Modern Roman', Georgia, serif;
  font-size: clamp(10pt, 2vw, 12pt);
  line-height: 1.5;
  background: #fff;
  color: #111;
}

.page {
  max-width: 297mm;
  min-height: 167mm;

  margin: 0 auto;
  display: flex;
  align-items: flex-start;
}

.page.a4 {
  max-width: 297mm;
  min-height: 210mm;
  padding: 2cm;
}

.page.a5 {
  max-width: 210mm;
  min-height: 148mm;
  padding: 1cm;
}

.page.narrow-pad {
   padding: 1.5cm;
  padding-bottom: 3cm;
}

/* vertical centering helper */
.page.vcenter {
  min-height: inherit;
  flex-direction: column;
  justify-content: center;
}

/* figure / image */
.figure-left {
  flex-shrink: 0;
  margin-right: 1.2em;
  margin-bottom: 0.4em;
}

.figure-right {
  flex-shrink: 0;
  margin-left: 1.2em;
  margin-bottom: 0.4em;
}

.figure-left img,
.figure-right img {
  display: block;
  max-width: 100%;
}

/* centered figure */
.figure-center {
  text-align: center;
  margin: 0.8em 0;
}

.figure-center img {
  max-width: 70%;
}

.figure-caption {
  font-size: 0.8em;
  color: #444;
  margin-top: 0.2em;
}

/* content block */
.content {
  flex: 1;
  min-width: 0;
}

/* title */
.title {
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 0.3em;
}

/* legend / character list */
.legend {
  margin-bottom: 1em;
  line-height: 1.4;
  margin-right: 50px;
}

/* main narrative text */
.main-text {
  margin-bottom: 0.8em;
  text-align: justify;
  hyphens: auto;
}

/* tab spacer */
.tab {
  display: inline-block;
  width: 5mm;
}

/* bold character labels */
.ch {
  font-weight: 600;
}

/* licence plate style */
.spz {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  padding: 0 3px;
}

/* footnote / small italic block */
.footnote-block {
  font-size: 0.85em;
  font-style: italic;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3em;
  margin-top: 0.5em;
}

.footnote-col {
  line-height: 1.55;
}

/* table */
.data-table {
  border-collapse: collapse;
  font-size: 0.85em;
  margin: 0.8em 0;
  width: 100%;
}

.data-table th,
.data-table td {
  border: 1px solid #999;
  padding: 0.25em 0.6em;
  vertical-align: top;
}

.data-table th {
  text-align: center;
}

.data-table td:first-child {
  text-align: right;
}

.table-note {
  font-size: 0.8em;
  font-style: italic;
  margin-top: 0.3em;
  line-height: 1.4;
}

.type_font{
  font-family: 'Special Elite', serif;
  font-size: 18px;
}


/* inline images (semaphore, gear icons etc.) */
.inline-img {
  height: 3em;
  vertical-align: middle;
  display: inline-block;
  margin: 0 0.2em;
}

/* gradient text for divka.html */
.grad {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

/* sticky menu */

.sticky-menu {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  z-index: 100;
}

.sticky-menu p {
  margin: 0;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: white;
}

.menu-buttons {
  display: flex;
  gap: 0.3em;
  flex-wrap: wrap;
  justify-content: center;
}

.sticky-menu a {
  padding: 0.4em 0.8em;
  background: #fff;
  border: 1px solid #111;
  text-decoration: none;
  color: #111;
  font-size: 0.85em;
  transition: all 0.2s;
  white-space: nowrap;
}

.sticky-menu a:hover {
  background: #111;
  color: #fff;
}

.sticky-menu a.active {
  background: #111;
  color: #fff;
}

/* ---- responsive ---- */
@media (max-width: 540px) {
  .page {
    flex-direction: column;
    padding: 1rem;
  }

  .figure-left,
  .figure-right {
    margin: 0 0 1em 0;
    align-self: center;
  }

  .figure-left img,
  .figure-right img{
  width: 60vw;
  height: auto!important;
  margin-right: auto;
  }

  .tram-flex{
    flex-direction: column;
  }

  .figure-right {
    order: -1;
  }

  .footnote-block {
    grid-template-columns: 1fr;
    gap: 1em 0;
  }

  .data-table {
    font-size: 0.75em;
  }

  .back{
  position: absolute;
  top: 0;
  left: 0;
  padding: 20px;
}
  .sticky-menu {
    bottom: 1rem;
  }
  
  .sticky-menu p {
    font-size: 0.75em;
  }
  
  .sticky-menu a {
    font-size: 0.7em;
    padding: 0.3em 0.5em;
  }
}
