:root {
  color-scheme: light;
  --page-bg: #fffdfb;
  --text-color: #231915;
  --muted-color: #665d58;
  --header-bg: #6f0f16;
  --header-bg-hover: #a81e28;
  --header-menu-bg: #8c1d26;
  --header-text: #fbeada;
  --link-color: #6f0f16;
  --link-visited: #5a0c13;
  --link-hover: #a81e28;
  --border-color: #eaded5;
  --border-strong: #d8c8c0;
  --surface: #fff8f0;
  --surface-alt: #fbf7f3;
  --surface-hover: #f4e7df;
  --field-bg: #fffdfb;
  --field-text: #231915;
  --focus-color: #a81e28;
  --swiper-button-bg: rgba(0, 0, 0, 0.25);
  --swiper-button-color: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #151413;
  --text-color: #f1ebe3;
  --muted-color: #b9aca3;
  --header-bg: #4b0b12;
  --header-bg-hover: #7d1720;
  --header-menu-bg: #341d24;
  --header-text: #fff1df;
  --link-color: #f0a18f;
  --link-visited: #d8a2c2;
  --link-hover: #ffc3b4;
  --border-color: #3a332f;
  --border-strong: #534941;
  --surface: #211f1c;
  --surface-alt: #1c1a18;
  --surface-hover: #2c2622;
  --field-bg: #201d1a;
  --field-text: #f1ebe3;
  --focus-color: #f0a18f;
  --swiper-button-bg: rgba(255, 241, 223, 0.28);
  --swiper-button-color: #fff1df;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page-bg: #151413;
    --text-color: #f1ebe3;
    --muted-color: #b9aca3;
    --header-bg: #4b0b12;
    --header-bg-hover: #7d1720;
    --header-menu-bg: #341d24;
    --header-text: #fff1df;
    --link-color: #f0a18f;
    --link-visited: #d8a2c2;
    --link-hover: #ffc3b4;
    --border-color: #3a332f;
    --border-strong: #534941;
    --surface: #211f1c;
    --surface-alt: #1c1a18;
    --surface-hover: #2c2622;
    --field-bg: #201d1a;
    --field-text: #f1ebe3;
    --focus-color: #f0a18f;
    --swiper-button-bg: rgba(255, 241, 223, 0.28);
    --swiper-button-color: #fff1df;
  }
}

.swiper-container, .single-container {
    display: inline-block; /* Zajistí, že šířka odpovídá obsahu */
    position: relative;
    max-width: 37.5rem;
    width: 100%;
    height: auto;
    margin: auto;
    overflow: hidden; /* Zabrání zobrazení mimo Swiper */
}

.swiper-wrapper {
    display: flex;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
}

.swiper-slide svg {
    display: block; /* Zamezí mezerám kolem obrázku */
    /* width: auto; /* Obrázek bude mít svou přirozenou šířku */ */
    height: auto; /* Zachová poměr stran obrázku */
    width: 100%;
}

/* Styl navigačních tlačítek */
.swiper-button-next,
.swiper-button-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: var(--swiper-button-bg);
    color: var(--swiper-button-color);
    padding: 0.3125rem;
    cursor: pointer;
}
.swiper-button-next {
    right: 0.625rem;
}
.swiper-button-prev {
    left: 0.625rem;
}

/* Skryje tlačítka ve výchozím stavu */
.swiper-button-next,
.swiper-button-prev {
    opacity: 0;
    transition: opacity 0.3s ease; /* Plynulý přechod pro zobrazení */
}

/* Zobrazí tlačítka při najetí myší na Swiper kontejner */
.swiper-container:hover .swiper-button-next,
.swiper-container:hover .swiper-button-prev {
    opacity: 1;
}

html {
    font-size: 100%; /* obvykle 16px = 1rem */
}

body {
    font-family: 'C059';
    margin: 0 0 1.25rem 0;
    background: var(--page-bg);
    color: var(--text-color);
}

body, p, li {
    font-size: clamp(1.125rem, 1.2vw, 1.25rem);
    line-height: 1.5;
}

p {
    margin: 8px 0px 8px 0px;
}

p .p-number {
    font-weight: bold;
    margin-top: 8px;
    margin-right: 4px;
}

li {
    line-height: 1.6;
    padding-bottom: 0.3125rem;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem); /* cca 28–36 px */
  line-height: 1.25;
  margin-bottom: 0.6em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem); /* cca 24–30 px */
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem); /* cca 20–24 px */
  line-height: 1.4;
  margin-bottom: 0.5em;
}

h1, h2, h3 {
  font-weight: bold;
}

.subheading {
  font-size: clamp(1.3rem, 2vw, 1.5rem); /* cca 21–24 px */
  font-weight: normal;
  color: var(--muted-color);
  line-height: 1.45;
  margin-top: -0.2em; /* optické přiblížení k h1 */
  margin-bottom: 0.8em;
}

small, footer, .organ-info, .footnotes li {
  font-size: clamp(0.8rem, 0.9vw, 0.95rem); /* cca 13–15 px */
  line-height: 1.4;
}

footer {
  text-align: right;
}

li::marker {
    font-weight: bold;
}

.page-number {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--muted-color);
}

a {
  color: var(--link-color);              /* základní barva – vínová z hlavičky */
}

a:visited {
  color: var(--link-visited);              /* mírně tlumená varianta vínové */
}

a:hover,
a:focus {
  color: var(--link-hover);              /* světlejší červená pro hover efekt */
}

header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 0.8em 1em;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1.2em;
  text-decoration: none;      /* odstraní podtržení */
  color: inherit;             /* zdědí barvu z nadřazeného prvku */
}

.brand img {
  height: 2rem; /* 32px */
  margin-left: 1.25rem; /* 20px */
  margin-right: 0.3125rem; /* 5px */
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1em;
}

.navbar a {
  color: var(--header-text);
  text-decoration: none;
}

.navbar a:hover {
    opacity: 0.85;
}

.nav-links a {
  font-size: 0.95em;
}

.nav-links form {
  display: flex;
  align-items: center;
}

.nav-links input[type="search"] {
  padding: 0.3em;
  width: 9.5rem;
  border: none;
  border-radius: 4px 0 0 4px;
  font-family: inherit;
  background: var(--field-bg);
  color: var(--field-text);
}

.nav-links button {
  padding: 0.3em 0.6em;
  border: none;
  background: var(--header-bg-hover);
  color: var(--header-text);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--header-text), transparent 55%);
  border-radius: 50%;
  background: transparent;
  color: var(--header-text);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus {
  background: color-mix(in srgb, var(--header-text), transparent 88%);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--header-text);
  outline-offset: 3px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 1.4em;
  cursor: pointer;
}

.page-number-input {
    font-size: 2rem;
    width: min(100%, 28rem);
    box-sizing: border-box;
    font-family: 'C059';
}

.home-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.home-search-form input[type="submit"] {
  font-family: 'C059';
  font-size: 1.25rem;
  padding: 0.35rem 0.8rem;
}

.liturgical-day-links {
  margin: 1.4rem 0 1.8rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.liturgical-day-links h2 {
  margin-top: 0;
}

.liturgical-day-links__items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.9rem;
}

.liturgical-day-link {
  border-left: 4px solid var(--link-color);
  padding: 0.2rem 0 0.2rem 0.85rem;
}

.liturgical-day-link--current {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--link-color);
  border-radius: 4px;
  padding: 0.55rem 0.7rem 0.65rem 0.85rem;
}

.liturgical-day-link__label {
  font-size: 0.95rem;
  color: var(--muted-color);
}

.liturgical-day-link__title {
  display: block;
  font-size: clamp(1.15rem, 1.5vw, 1.3rem);
  line-height: 1.35;
  margin: 0.1rem 0;
}

.liturgical-day-link__date,
.liturgical-day-link__rank,
.liturgical-day-link__missing {
  color: var(--muted-color);
  font-size: clamp(0.95rem, 1vw, 1.05rem);
}

.liturgical-day-link__rank {
  font-style: italic;
}

.liturgical-day-link__entries {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.45rem;
}

.liturgical-day-link__entry {
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-color);
}

.liturgical-day-link__entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.liturgical-day-link__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
}

/* Chrome, Safari, Edge */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

.index-section {
  border-bottom: 1px solid var(--border-color);
  padding: 0.2rem 0 0.55rem;
}

.index-section h2 {
  margin: 0.55em 0 0.35em;
}

.index-section-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  font-family: 'C059';
  font-size: inherit;
  font-weight: bold;
  line-height: inherit;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 0.25rem 0;
  cursor: pointer;
}

.index-section-toggle:hover,
.index-section-toggle:focus {
  color: var(--link-color);
}

.index-section-toggle:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 4px;
}

.index-section-toggle__state {
  color: var(--link-color);
  background: var(--surface);
  border: 1px solid var(--link-color);
  border-radius: 4px;
  font-size: 1rem;
  font-weight: normal;
  line-height: 1.2;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.index-section-toggle:hover .index-section-toggle__state,
.index-section-toggle:focus .index-section-toggle__state {
  background: var(--surface-hover);
}

.index-section.is-open h2 {
  color: var(--link-color);
}

@media (max-width: 800px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: var(--header-menu-bg);
    padding: 1em;
    margin-top: 0.5em;
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

.container {
  margin-right: auto;
  margin-left: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width:768px) {
  .container {
    width:750px;
  }
}
@media (min-width:992px) {
  .container {
    width:970px;
  }
}
@media (min-width:1200px) {
  .container {
    width:1170px;
  }
}

@font-face {
    font-family: 'C059';
    src: url('../fonts/c059-roman.woff2') format('woff2');
    font-weight: normal;
}

@font-face {
    font-family: 'C059';
    src: url('../fonts/c059-bold.woff2') format('woff2');
    font-weight: bold;
}

@font-face {
  font-family: 'C059';
  src: url('../fonts/c059-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: normal;
}

em, .stanza-info {
    font-style: italic;
}

.hidden {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}
