/* ============================================
   CSS Custom Properties (Proměnné)
   ============================================ */

:root {
  --color-bg: hsl(42, 47%, 95%);
  --color-bg-light: hsl(42, 47%, 92%);
  --color-bg-white: hsl(0, 0%, 100%);
  --color-text: hsl(220, 20%, 15%);
  --color-text-muted: hsl(220, 15%, 45%);
  --color-primary: hsl(225, 53%, 38%);
  --color-primary-hover: hsl(225, 53%, 30%);
  --color-accent: hsl(35, 85%, 65%);
  --color-border: hsl(42, 30%, 80%);
  --color-border-light: hsl(42, 30%, 85%);
  --color-code-bg: hsl(42, 35%, 85%);
  --color-code-dark: hsl(220, 25%, 8%);
  --color-code-text: hsl(42, 47%, 95%);
  --color-focus: hsl(270, 70%, 60%);
  --color-gradient-1: hsl(270, 70%, 60%);
  --color-gradient-2: hsl(200, 85%, 55%);
  --color-gradient-3: hsl(35, 85%, 65%);
}

/* ============================================
   CSS Reset a základní styly
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: system-ui;
  font-size: 1.25rem;
  line-height: 1.5;
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Stylování výběru textu */
::selection {
  background-color: var(--color-accent);
  color: var(--color-text);
}

/* Stylování scrollbaru */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(42, 30%, 70%);
}

/* ============================================
   Typografie - Nadpisy
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1em 0 0.5em;
  color: var(--color-text);
}

h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
  margin-top: 0;
}

h1 {
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 700;
}

h3 {
  font-size: 1.875rem;
  line-height: 1.3;
  font-weight: 600;
}

h4 {
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 600;
}

h5 {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 600;
}

h6 {
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 600;
}

/* ============================================
   Odstavce a text
   ============================================ */

p {
  margin-bottom: 1em;
  color: var(--color-text);
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin-bottom: 1em;
  color: var(--color-text);
}

/* ============================================
   Odkazy
   ============================================ */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ============================================
   Seznamy
   ============================================ */

ul,
ol {
  padding-left: 2rem;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  line-height: 1.5;
}

li > ul,
li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* ============================================
   Citace (Blockquote)
   ============================================ */

blockquote {
  margin: 1.5em 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-bg-light);
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote p {
  margin-bottom: 0.75rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-muted);
}

blockquote cite::before {
  content: "— ";
}

/* ============================================
   Kód
   ============================================ */

code {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background-color: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  color: var(--color-text);
}

pre {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  background-color: var(--color-code-dark);
  color: var(--color-code-text);
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5em 0;
  position: relative;
}

pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--color-gradient-1), 
    var(--color-gradient-2), 
    var(--color-gradient-3)
  );
  border-radius: 0.75rem 0.75rem 0 0;
}

pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ============================================
   Tabulky
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.875rem;
}

thead {
  background-color: var(--color-bg-light);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

tbody tr:hover {
  background-color: var(--color-bg-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================
   Obrázky
   ============================================ */

img {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 1.5em auto;
  border-radius: 0.5rem;
  display: block;
}

figure {
  margin: 1.5em 0;
}

figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================
   Horizontální čára
   ============================================ */

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5em 0;
}

/* ============================================
   Zvýraznění textu
   ============================================ */

strong,
b {
  font-weight: 700;
  color: var(--color-text);
}

em,
i {
  font-style: italic;
}

mark {
  background-color: var(--color-accent);
  color: var(--color-text);
  padding: 0.125rem 0.25rem;
  border-radius: 0.125rem;
}

/* ============================================
   Layout - Container
   ============================================ */

.container {
  max-width: min(70ch, 100% - 4rem);
  margin-inline: auto;
}

/* ============================================
   Header
   ============================================ */

header {
  border-bottom: 1px solid hsl(42, 30%, 80% / 0.4);
  background-color: hsl(42, 47%, 95% / 0.8);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 50;
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: min(70ch, 100% - 4rem);
  margin-inline: auto;
}

header nav img {
  margin: 0.5rem;
}

header nav a {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  color: var(--color-text);
}

header nav a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

header nav > div {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

header nav > div a {
  font-size: 1rem;
  font-weight: 500;
  color: hsl(220, 20%, 15% / 0.7);
  position: relative;
  text-decoration: none;
  transition: color 0.3s ease;
}

header nav > div a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: hsl(35, 85%, 55%);
  transition: width 0.3s ease;
}

header nav > div a:hover {
  color: hsl(35, 85%, 55%);
  text-decoration: none;
}

header nav > div a:hover::after {
  width: 100%;
}

@media (max-width: 768px) {
  header nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  header nav > div {
    width: 100%;
    justify-content: flex-start;
  }

  header nav img {
    margin: 0.25rem;
  }
}

/* ============================================
   Footer
   ============================================ */

footer {
  border-top: 1px solid hsl(42, 30%, 80% / 0.4);
  margin-top: 6rem;
  padding: 3rem 1rem;
}

footer > div {
  max-width: min(70ch, 100% - 4rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  footer > div {
    flex-direction: row;
  }
}

footer p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

footer a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

footer a:hover {
  color: hsl(220, 20%, 15%);
  text-decoration: none;
}

footer > div > div {
  display: flex;
  gap: 1.5rem;
}

/* ============================================
   Sekce a články
   ============================================ */

section {
  padding: 1rem 0.5rem;
}

article {
  max-width: min(70ch, 100% - 4rem);
  margin-inline: auto;
  padding: 0rem 0rem;
}

article header {
  position: static;
  border: none;
  background: transparent;
  backdrop-filter: none;
  margin-bottom: 3rem;
}

article header h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  article header h1 {
    font-size: 3rem;
  }
}

article header p {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

article footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(42, 30%, 80% / 0.4);
}

/* ============================================
   Obsah článku (prose)
   ============================================ */

article > div {
  line-height: 1.625;
}

article > div > *:first-child {
  margin-top: 0;
}

article > div > *:last-child {
  margin-bottom: 0;
}



/* ============================================
   Vylepšení pro lepší čitelnost
   ============================================ */


/* Styl pro definiční seznamy */
dl {
  margin: 1.5rem 0;
}

dt {
  font-weight: 600;
  margin-top: 1rem;
  color: var(--color-text);
}

dd {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

/* Styl pro zkratky */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Styl pro malý text */
small {
  font-size: 0.875em;
  color: var(--color-text-muted);
}

/* Styl pro superscript a subscript */
sup,
sub {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* ============================================
   Karty a komponenty
   ============================================ */

.card {
  width: 100%;
  background-color: var(--color-bg-white);
  border: 1px solid hsl(42, 30%, 80% / 0.5);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: all 0.3s ease;
  will-change: transform, box-shadow;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border-color: hsl(225, 53%, 38% / 0.3);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--color-bg-light);
  color: var(--color-text);
  border: 1px solid transparent;
}

.badge-secondary {
  background-color: var(--color-bg-light);
  color: var(--color-text);
}

.badge-muted {
  background-color: transparent;
  color: var(--color-text-muted);
  font-weight: 600;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--color-text);
  text-decoration: none;
}

button:hover,
.btn:hover {
  background-color: var(--color-accent);
  color: var(--color-text);
}

button:active,
.btn:active {
  transform: scale(0.98);
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: hsl(0, 0%, 100%);
  border: none;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: hsl(0, 0%, 100%);
  text-decoration: none;
}

.btn-secondary {
  border: 1px solid var(--color-border-light);
}

.btn-secondary:hover {
  background-color: var(--color-accent);
  color: var(--color-text);
}

.btn-rounded {
  border-radius: 9999px;
}

/* ============================================
   Layout utility třídy
   ============================================ */

.min-h-screen {
  min-height: 100vh;
}

.flex {
  display: flex;
}

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

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

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 0.75rem;
}

.inline-flex {
  display: inline-flex;
}

/* ============================================
   Spacing utility třídy
   ============================================ */

.pt-1 {
  padding-top: 0.25rem;
}

.pt-4 {
  padding-top: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.pt-0 {
  padding-top: 0;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-1\.5 {
  margin-bottom: 1.5em;
}

/* ============================================
   Typografie utility třídy
   ============================================ */

.hero-title {
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.625;
  color: var(--color-text-muted);
  max-width: 42rem;
}

.section-title {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
}

.card-title {
  font-weight: 600;
  letter-spacing: -0.025em;
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-primary {
  color: var(--color-primary);
}

.text-muted {
  color: var(--color-text-muted);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.leading-relaxed {
  line-height: 1.625;
}

.tracking-tight {
  letter-spacing: -0.025em;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

/* ============================================
   Komponenty
   ============================================ */

.card-header {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-body {
  padding: 1rem;
  padding-top: 0;
}

.card-description {
  color: var(--color-text-muted);
  line-height: 1.625;
}

.card-link {
  color: var(--color-primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75em;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-sm-ml {
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
}

/* ============================================
   Responzivní typografie
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.875rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  p {
    font-size: 1rem;
  }
}

/* ============================================
   Tiskové styly
   ============================================ */

@media print {
  body {
    background: white;
    color: black;
  }

  header,
  footer {
    display: none;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  img {
    max-width: 100%;
  }

  pre {
    background: #f5f5f5;
    border: 1px solid #ddd;
  }
}


.photo-float-right {
  width: 256px;
  float: right;
  margin-top: 0;
  margin-left: 20px;
  margin-bottom: 10px;
}

.photo-float-left {
  width: 256px;
  float: left;
  margin-top: 0;
  margin-right: 20px;
  margin-bottom: 10px;
}