/* Společně pro Rakovník — základní styl */

:root {
  --blue: #1b4d91;
  --blue-dark: #123564;
  --blue-muted: #55729a;
  --red: #e2231a;
  --yellow: #f9b233;
  --green: #6cb33f;
  --gray: #f4f6f9;
  --border: #e0e4ea;
  --text: #222;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
summary {
  font: inherit;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 5%;
  border-bottom: 1px solid #e6e9ee;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.logo img {
  height: 52px;
  width: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.logo span {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blue);
  letter-spacing: 0.02em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

nav a {
  display: inline-block;
  font-weight: 600;
  color: var(--blue-dark);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

nav a:hover,
nav a.active {
  border-bottom-color: var(--red);
}

/* Hero */

.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 5%;
  background: linear-gradient(180deg, var(--gray) 0%, #fff 100%);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--blue-dark);
  max-width: 18ch;
  margin: 0 auto;
  font-weight: 800;
}

.hero .accent,
.heading-accent {
  display: block;
  width: 64px;
  height: 5px;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green), var(--blue));
  border-radius: 3px;
}

.hero .accent {
  margin: 1.5rem auto 0;
}

.hero-tool-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--blue-dark);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(18, 53, 100, 0.45);
  text-underline-offset: 0.22em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.hero-tool-link:hover,
.hero-tool-link:focus-visible {
  color: var(--blue);
  text-decoration-color: currentColor;
}

/* Subpage */

.page {
  padding: 4rem 5%;
  max-width: 800px;
  margin: 0 auto;
  min-height: 50vh;
}

.page h1,
.candidates-heading h1,
.topics-heading h1 {
  color: var(--blue-dark);
  font-size: 2rem;
  margin: 0 0 1rem;
}

.page h2 {
  color: var(--blue);
  font-size: 1.3rem;
  margin: 2rem 0 1rem;
}

.page p {
  margin: 0 0 1.1rem;
}

.page p.placeholder {
  color: #888;
  font-style: italic;
  padding: 0.75rem 1rem;
  background: var(--gray);
  border-radius: 6px;
  display: inline-block;
}

.info-list {
  margin: 0 0 1.5rem;
}

.info-list dt {
  font-weight: 700;
  color: var(--blue-dark);
  margin-top: 0.5rem;
}

.info-list dd {
  margin: 0.15rem 0 0;
}

.page h3 {
  color: var(--blue-dark);
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
}

.page ul,
.page ol {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
}

.page li {
  margin-bottom: 0.6rem;
}

.page blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 3px solid var(--blue);
  color: #555;
  font-style: italic;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  color: var(--blue);
}

.doc-link:hover {
  border-color: var(--blue);
}

/* Candidates and topics */

.candidates-page,
.topics-page {
  width: min(1100px, 90%);
  margin: 0 auto;
  padding: 4rem 0;
  min-height: 50vh;
}

.candidates-heading,
.topics-heading {
  margin-bottom: 2.5rem;
}

.heading-accent {
  margin-top: 1rem;
}

.candidate,
.topic {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.candidate + .candidate,
.topic + .topic {
  margin-top: 5rem;
  padding-top: 5rem;
  border-top: 1px solid var(--border);
}

.candidate-gallery {
  min-width: 0;
}

.candidate-photo-frame {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 10px;
  background: var(--gray);
  touch-action: pan-y;
}

.candidate-photo-frame img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topic-photo-frame {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--gray);
}

.topic-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.candidate-gallery.is-ready .gallery-controls {
  display: flex;
}

.gallery-controls button,
.candidate-details summary {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  color: var(--blue-dark);
  background: #fff;
  cursor: pointer;
}

.gallery-controls button:hover,
.gallery-controls button:focus-visible,
.candidate-details summary:hover,
.candidate-details summary:focus-visible {
  border-color: var(--blue);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.gallery-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cfd5de;
}

.gallery-dot.active {
  background: var(--blue-muted);
}

.candidate-copy h2,
.topic-copy h2 {
  color: var(--blue-dark);
  font-size: 1.65rem;
  margin: 0 0 1.25rem;
}

.candidate-copy p,
.topic-copy p {
  margin: 0 0 1.1rem;
}

.candidate-number {
  color: var(--blue-muted);
  font-weight: 700;
  margin-bottom: 0.2rem !important;
}

.candidate-details summary {
  display: inline-block;
  color: var(--blue);
  font-weight: 600;
  list-style: none;
  user-select: none;
}

.candidate-details summary::-webkit-details-marker {
  display: none;
}

.details-close {
  display: none;
}

.candidate-details[open] .details-open {
  display: none;
}

.candidate-details[open] .details-close {
  display: inline;
}

.candidate-details-content {
  margin-top: 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer */

.site-footer {
  padding: 1.5rem 5%;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  border-top: 1px solid #e6e9ee;
}

/* Responsive */

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  nav {
    width: 100%;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(0.45rem, 2.8vw, 1.5rem);
  }

  .candidate,
  .topic {
    grid-template-columns: 1fr;
  }

  .candidate + .candidate,
  .topic + .topic {
    margin-top: 4rem;
    padding-top: 4rem;
  }

}

@media (max-width: 420px) {
  .logo span {
    font-size: 0.95rem;
  }

  nav a {
    font-size: 0.86rem;
  }

  .page,
  .candidates-page,
  .topics-page {
    padding-top: 2.5rem;
  }

  .gallery-controls button {
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Program */
.program-page {
  width: min(1100px, 90%);
  margin: 0 auto;
  padding: 2.5rem 0;
}
.program-poster {
  display: block;
  cursor: zoom-in;
}
.program-poster:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 6px;
}
.program-poster img {
  display: block;
  width: 100%;
  height: auto;
}
@media (min-width: 721px) and (max-width: 1000px) {
  .site-header {
    flex-direction: column;
    gap: 0.75rem;
  }
}