:root {
  --paper: #ffdfad;
  --paper-soft: #ffe8c4;
  --ink: #2b1910;
  --red: #a62b2f;
  --red-dark: #7d1c22;
  --blue: #006d79;
  --line: #b74731;
  --white: #fffaf1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: relative;
  background: linear-gradient(#ffe6bd, #ffd8a0);
  border-top: 4px solid #003f4b;
  border-bottom: 1px solid rgba(125, 28, 34, .35);
  text-align: center;
}

.admin-cog {
  position: absolute;
  right: 12px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .74);
  color: #4b5661;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

.unesco-line {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 18px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.brand {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  max-width: 980px;
  min-height: 96px;
  margin: 0 auto;
  background: linear-gradient(#e9e9e9, #ffffff);
  border: 1px solid rgba(0, 0, 0, .22);
  text-align: left;
}

.brand-figures {
  width: 134px;
  max-height: 126px;
  margin: -34px 0 -10px 10px;
  object-fit: contain;
  align-self: end;
  filter: drop-shadow(0 5px 4px rgba(60, 29, 18, .28));
}

.brand-title {
  grid-column: 2;
  text-align: center;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  color: var(--red);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(30px, 5vw, 50px);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.top-nav {
  display: none;
  justify-content: center;
  gap: 8px;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 18px 16px;
}

.top-nav a,
.side-menu a,
.button {
  border: 1px solid #aeb9c6;
  background: linear-gradient(#fff, #edf1f5);
  color: #4b5661;
  text-decoration: none;
  font-weight: 700;
}

.top-nav a {
  min-width: 120px;
  padding: 8px 16px;
  text-transform: uppercase;
}

.top-nav a[aria-current="page"],
.side-menu a[aria-current="page"] {
  border-color: var(--red);
  color: var(--red-dark);
}

.page-shell,
.gallery-layout {
  display: grid;
  grid-template-columns: minmax(112px, 15%) minmax(0, 85%);
  gap: 24px;
  width: min(980px, calc(100% - 28px));
  margin: 16px auto 36px;
}

.side-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-menu a {
  padding: 3px 8px;
  border-color: #aeb9c6;
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
}

.side-menu .submenu-item {
  margin-left: 10px;
  font-size: 12px;
  text-transform: none;
}

.side-menu .menu-main {
  padding: 5px 8px;
  text-transform: uppercase;
}

.unesco-badge {
  margin-top: 12px;
  color: #8f1114;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.access-counter-box {
  margin-top: 10px;
  padding: 5px 7px;
  border: 1px solid #aeb9c6;
  background: #fffaf1;
  color: #684432;
  text-align: center;
}

.access-counter-box span,
.access-counter-box strong {
  display: block;
}

.access-counter-box span {
  font-size: 11px;
  text-transform: uppercase;
}

.access-counter-box strong {
  margin-top: 2px;
  color: var(--red-dark);
  font-size: 16px;
  line-height: 1.1;
}

.home-content,
.gallery-page,
.text-page {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  text-align: center;
}

.hero h2,
.section-title h2 {
  margin: 0;
  color: var(--red);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

.text-page h2 {
  margin: 0 0 16px;
  color: var(--red);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
}

.eyebrow,
.section-title p {
  margin: 0 0 6px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
}

.hero img {
  width: min(100%, 680px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 8px solid var(--white);
  box-shadow: 0 8px 18px rgba(78, 37, 18, .18);
  justify-self: center;
}

.notice {
  margin: 14px auto 12px;
  color: #b32317;
  font-size: 20px;
  line-height: 1.25;
  text-align: center;
}

.notice p {
  margin: 7px 0;
}

.notice a {
  color: inherit;
  text-decoration: none;
}

.invitation {
  margin: 16px 0 20px;
  padding: 12px 0;
  border-top: 2px solid rgba(90, 120, 130, .48);
  border-bottom: 2px solid rgba(183, 71, 49, .58);
  color: #8f1114;
  text-align: center;
  text-transform: uppercase;
}

.invitation h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.1;
}

.invitation p {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.panel {
  background: rgba(255, 250, 241, .55);
  border-left: 4px solid var(--line);
  padding: 18px;
}

.panel h3,
.photo-section h3 {
  margin: 0 0 8px;
  color: var(--red-dark);
}

.button {
  display: inline-flex;
  margin-top: 8px;
  padding: 8px 14px;
}

.button.secondary {
  background: linear-gradient(#f7f7f7, #dfe5ea);
}

.button.danger {
  border-color: #8f1114;
  background: #9e1f1f;
  color: #fff;
}

.home-posts {
  margin-top: 24px;
}

.home-post {
  padding: 18px 10px 22px;
  border-top: 3px solid rgba(90, 120, 130, .48);
  color: #2f2119;
}

.home-post::after {
  display: block;
  clear: both;
  content: "";
}

.home-post h3 {
  margin: 0 0 12px;
  color: var(--red-dark);
  font-size: 22px;
}

.home-post img {
  float: right;
  width: min(42%, 330px);
  max-height: 260px;
  margin: 0 0 14px 24px;
  object-fit: cover;
}

.post-date {
  margin: 0 0 6px;
  color: #66594f;
  font-weight: 700;
}

.post-author {
  clear: both;
  margin: 16px 0 0;
  text-align: right;
  font-weight: 700;
}

.simple-page {
  width: min(900px, calc(100% - 28px));
  margin: 28px auto 42px;
}

.text-page {
  background: rgba(255, 250, 241, .48);
  border-top: 4px solid var(--line);
  padding: 24px;
}

.text-page .lead {
  font-size: 19px;
}

.section-title {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 4px solid var(--line);
}

.gallery-page .section-title h2 {
  font-size: clamp(26px, 3.4vw, 40px);
}

.photo-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 3px solid rgba(183, 71, 49, .8);
}

.section-title + .photo-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.photo-section-shared {
  width: 50%;
  min-width: 320px;
  margin-right: auto;
}

.shared-photo-cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(78, 37, 18, .22);
  text-decoration: none;
}

.shared-photo-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.shared-photo-cover span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7px 10px;
  background: rgba(143, 17, 20, .86);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.shared-extra-grid {
  margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
}

.photo-section-prohaneni {
  clear: both;
}

.photo-section-head {
  margin-bottom: 12px;
}

.photo-section-head h3 {
  margin-bottom: 0;
}

.photo-section-credit {
  margin: 8px 0 0;
  text-align: right;
  color: var(--red-dark);
  font-weight: 700;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 12px;
}

.photo-grid a {
  display: block;
  background: #fff;
  box-shadow: 0 3px 8px rgba(78, 37, 18, .16);
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, .86);
  z-index: 50;
}

.lightbox.is-open {
  display: grid;
}

.lightbox img {
  max-width: min(92vw, 1180px);
  max-height: 86vh;
  object-fit: contain;
}

.lightbox button {
  position: fixed;
  border: 0;
  background: rgba(255, 255, 255, .9);
  color: #111;
  cursor: pointer;
  font-size: 44px;
  line-height: 1;
}

.lightbox-close {
  top: 18px;
  right: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  width: 52px;
  height: 72px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-counter {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  font-weight: 800;
}

.site-footer {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto 24px;
  padding-top: 14px;
  border-top: 3px solid var(--line);
  color: #684432;
  text-align: center;
  font-weight: 700;
}

.admin-page .text-page {
  border-top-color: var(--red-dark);
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-head h2,
.admin-section h3 {
  margin: 0 0 14px;
  color: var(--red-dark);
}

.admin-message {
  padding: 9px 12px;
  border-left: 4px solid var(--blue);
  background: rgba(255, 255, 255, .68);
  font-weight: 700;
}

.admin-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px solid rgba(183, 71, 49, .45);
}

.admin-tabs,
.admin-year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(183, 71, 49, .35);
}

.admin-tabs a,
.admin-year-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #c8b79f;
  color: var(--ink);
  background: #fffaf1;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.admin-tabs a[aria-current="page"],
.admin-tabs a:hover,
.admin-year-tabs a[aria-current="page"],
.admin-year-tabs a:hover {
  color: #fff;
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.admin-form {
  display: grid;
  gap: 9px;
}

.admin-form label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #c8b79f;
  background: #fffaf1;
  font: inherit;
}

.admin-form-actions,
.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-post-row {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(260px, 1.1fr);
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid rgba(183, 71, 49, .45);
}

.admin-post-summary h4 {
  margin: 0 0 8px;
  color: var(--red-dark);
  font-size: 20px;
}

.admin-post-thumb {
  max-width: 180px;
  max-height: 120px;
  margin: 0 0 10px;
  object-fit: cover;
}

.admin-gallery-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(183, 71, 49, .45);
}

.admin-gallery-current {
  display: grid;
  grid-template-columns: minmax(150px, .55fr) minmax(240px, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.admin-gallery-current h4 {
  margin: 0 0 4px;
  color: var(--red-dark);
  font-size: 17px;
}

.admin-gallery-current p {
  margin: 0;
  font-weight: 700;
}

.admin-cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 72px));
  gap: 8px;
}

.admin-photo-tile {
  position: relative;
  overflow: hidden;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(183, 71, 49, .28);
  background: #fffaf1;
}

.admin-photo-tile > img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.admin-photo-delete {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
}

.delete-photo-button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(143, 31, 29, .92);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.admin-section-title-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, .8fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-section-title-form label {
  display: grid;
  gap: 4px;
  font-weight: 700;
}

.admin-section-title-form input,
.admin-section-title-form select {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #c8b79f;
  background: #fffaf1;
  font: inherit;
}

.delete-photo-button:hover {
  background: var(--red-dark);
}

@media (max-width: 760px) {
  .brand,
  .page-shell,
  .gallery-layout,
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .brand-figures {
    width: 126px;
    margin: 0 auto -10px;
  }

  .brand {
    text-align: center;
  }

  .brand-title {
    grid-column: auto;
  }

  .brand h1 {
    font-size: clamp(27px, 8vw, 42px);
    white-space: normal;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .side-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }

  .side-menu .submenu-item {
    margin-left: 0;
  }

  .admin-post-row {
    grid-template-columns: 1fr;
  }

  .admin-gallery-current,
  .admin-section-title-form {
    grid-template-columns: 1fr;
  }

  .photo-section-shared {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .home-post img {
    float: none;
    width: 100%;
    max-height: none;
    margin: 0 0 14px;
  }
}
