/* ZAKLADNI NASTAVENI: barvy a sirku stranky muzete upravit zde. */
:root {
  color-scheme: light;
  --blue: #0878c9;
  --red: #e5222b;
  --green: #58bb3c;
  --ink: #143f70;
  --page-width: 1320px;
  --site-header-height: 152px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.page-width {
  width: min(var(--page-width), calc(100% - 64px));
  margin-inline: auto;
}

/* HORNI LISTA */
.site-header {
  width: 100%;
  padding-inline: max(32px, calc((100% - var(--page-width)) / 2));
  padding-bottom: 16px;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 70px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
}

.brand {
  padding-top: 36px;
  padding-left: 36px;
  display: block;
  flex: none;
  width: auto;
  line-height: 0;
}

.brand img {
  width: 100%;
  height: 100px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.mobile-nav {
  display: none;
  position: relative;
  flex: none;
}

.desktop-nav {
  display: flex;
  margin-left: auto;
}

.mobile-nav summary {
  display: none;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
}

.main-nav a {
  min-height: 44px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e5ef;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a[aria-current="page"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

/* UVOD: text vlevo, ctvercovy obrazek vpravo. */
.hero {
  min-height: 570px;
  padding-block: 36px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(36px, 6vw, 80px);
}

.hero-copy {
  max-width: 520px;
}

.hero h1,
.applicant-intro h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(38px, 4.2vw, 58px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero-location {
  margin: 8px 0 28px;
  color: var(--blue);
  font-size: clamp(16px, 1.7vw, 21px);
  font-weight: 700;
}

.availability-card {
  margin-top: 28px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--green);
  border-radius: 20px;
}

.button {
  min-height: 66px;
  padding: 16px 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  border-radius: 999px;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.availability-card__count {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45em;
}

.availability-card__icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.button-arrow {
  position: relative;
  width: 0.8em;
  height: 0.7em;
  flex: none;
}

.button-arrow::before {
  position: absolute;
  top: 50%;
  right: 0.08em;
  left: 0;
  height: 0.09em;
  transform: translateY(-50%);
  background: currentColor;
  content: "";
}

.button-arrow::after {
  position: absolute;
  top: 50%;
  right: 0.08em;
  width: 0.42em;
  height: 0.42em;
  transform: translateY(-50%) rotate(45deg);
  border-top: 0.09em solid currentColor;
  border-right: 0.09em solid currentColor;
  content: "";
}

.button:hover {
  transform: translateY(-2px);
}

.button--green {
  background: var(--green);
  color: #fff;
  min-height: 44px;
  padding: 10px 15px;
  font-size: 15px;
}

.button--green:hover {
  background: #43952e; 
}

.hero-image {
  width: min(100%, 540px);
  aspect-ratio: 1;
  justify-self: end;
  overflow: hidden;
  border-radius: 30px;
}

.hero-photo {
  width: 100%;
  height: 100%;
  display: block;
  /* contain ponecha cely obrazek viditelny, i kdyz neni ctvercovy. */
  object-fit: contain;
}

/* PROGRAM: ctvercove dlazdice se podle sirky stranky preskupuji. */
.programme {
  padding-block: 20px 72px;
  text-align: center;
}

.programme h2 {
  margin: 0 0 32px;
  color: var(--blue);
  font-size: clamp(30px, 3.6vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.programme-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, 170px);
  justify-content: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.programme-card {
  width: 170px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 20px;
}

.programme-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* NOVINKY */
.news {
  padding-block: 20px 72px;
}

.news h2 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.2;
}

.news-intro {
  margin: 8px 0 28px;
  font-size: 18px;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.news-card {
  aspect-ratio: 1;
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--blue);
  border-radius: 12px;
}

.news-card__meta,
.news-dialog__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.news-tag {
  padding: 4px 9px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.news-tag--type {
  border-color: var(--green);
  color: var(--ink);
}

.news-card h3 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.news-card > p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.news-card__link {
  margin-top: auto;
  padding: 8px 0 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.news-card__link:hover {
  color: var(--ink);
}

.news-status {
  margin: 0;
}

.news-status[hidden] {
  display: none;
}

.news-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: min(80vh, 760px);
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--blue);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.news-dialog::backdrop {
  background: rgb(20 63 112 / 55%);
}

.news-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.news-dialog__close {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--blue);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.news-dialog h2 {
  margin: 18px 0;
  color: var(--red);
  font-size: clamp(25px, 5vw, 36px);
  line-height: 1.2;
}

.news-dialog__content > :first-child {
  margin-top: 0;
}

.news-dialog__content > :last-child {
  margin-bottom: 0;
}

.news-dialog__content a {
  color: var(--blue);
}

/* PATICKA */
.site-footer {
  min-height: 88px;
  padding: 20px max(32px, calc((100% - var(--page-width)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #eaf0f3;
  color: var(--ink);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* TABLET */
@media (max-width: 1050px) {
  :root {
    --site-header-height: 164px;
  }

  .site-header {
    height: auto;
    flex-wrap: nowrap;
    align-items: flex-end;
    padding-block: 14px;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero {
    min-height: 0;
    gap: 32px;
  }

  .programme-list {
    grid-template-columns: repeat(auto-fit, 170px);
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
    margin-left: auto;
  }

  .mobile-nav > summary {
    display: block;
    min-height: 52px;
    padding-top: 12px;
    padding-right: 24px;
    padding-bottom: 12px;
    padding-left: 24px;
    border: 1px solid var(--blue);
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
  }

  .mobile-nav > summary:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 4px;
  }

  .mobile-nav > summary:hover {
    background: var(--ink);
    border-color: var(--ink);
  }

  .mobile-nav > .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    min-width: 200px;
    padding: 8px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    border: 1px solid #d8e5ef;
    border-radius: 12px;
    background: #fff;
  }

  .mobile-nav[open] > .main-nav {
    display: flex;
  }
}

/* MOBIL */
@media (max-width: 700px) {
  .page-width {
    width: min(100% - 36px, 540px);
  }

  .site-header {
    padding-inline: 18px;
    gap: 12px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .main-nav a {
    display: block;
    margin-left: auto;
  }

  .hero {
    padding-block: 26px 42px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 48px);
  }

  .hero-location {
    margin-bottom: 20px;
    font-size: 18px;
  }

  .button {
    min-height: 60px;
    padding-inline: 24px;
  }

  .availability-card {
    padding: 16px;
  }

  .availability-card .button {
    width: 100%;
  }

  .hero-image {
    width: 100%;
    justify-self: stretch;
    border-radius: 22px;
  }

  .programme {
    padding-block: 12px 46px;
  }

  .news {
    padding-block: 12px 46px;
  }

  .programme h2 {
    margin-bottom: 22px;
    font-size: clamp(18px, 7vw, 24px);
  }

  .news h2 {
    font-size: 28px;
  }

  .news-list {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .news-card {
    width: min(100%, 420px);
    padding: 20px;
  }

  .news-card h3 {
    font-size: 20px;
  }

  .news-dialog {
    padding: 20px;
  }

  .programme-list {
    gap: 12px;
  }

  .site-footer {
    min-height: 70px;
    padding: 16px 18px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
