/* ========================================
   CSS RESET & NORMALIZE
   ======================================== */

/* Reset všech elementů */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: inherit;
  background-color: inherit;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.9rem; }


/* Lists */
ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

/* Forms */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: 1px solid currentColor;
  background-color: transparent;
  padding: 0.5em;
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--link, #0066cc);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  overflow: auto;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid currentColor;
  margin: 1em 0;
}

/* Code */
code,
pre {
  font-family: monospace;
  font-size: 1em;
}

pre {
  overflow: auto;
  padding: 1em;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

th,
td {
  text-align: left;
  vertical-align: baseline;
  padding: 0;
}

/* ======================================== */

/* ========================================
   FOCUS STATES (ACCESSIBILITY)
   ======================================== */

/* Globální focus style */
:focus-visible {
  outline: 2px solid var(--link, #0c69c8);
  outline-offset: 2px;
}

/* Linky */
a:focus-visible {
  outline: 2px solid var(--link, #0c69c8);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Tlačítka */
button:focus-visible {
  outline: 2px solid var(--link, #0c69c8);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible:not(:active) {
  background-color: rgba(12, 105, 200, 0.1);
}

/* Formulářové prvky */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--link, #0c69c8);
  outline-offset: 2px;
  border-color: var(--link, #0c69c8);
}

/* Checkboxy a radio */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--link, #0c69c8);
  outline-offset: 4px;
}

/* ======================================== */

:root {
  /* ========== SPACING SYSTEM ========== */
  /* Baseline spacing scale - všechno vychází z 4px */
  --space-xs: 4px;      /* Micro spacing */
  --space-sm: 8px;      /* Small spacing */
  --space-md: 12px;     /* Medium spacing */
  --space-lg: 16px;     /* Large spacing */
  --space-xl: 20px;     /* X-large spacing */
  --space-2xl: 24px;    /* 2X-large spacing */
  --space-3xl: 28px;    /* 3X-large spacing */
  --space-4xl: 32px;    /* 4X-large spacing */
  --space-5xl: 40px;    /* 5X-large spacing */
  --space-6xl: 48px;    /* 6X-large spacing */
  
  /* Layout specific */
  --gap: 18px;
  --topbar-height: 56px;
  --body-top-padding: 90px;
  --page-max-width: 1200px;
  --page-padding: 1.5rem;
  
  /* ========== COLORS ========== */
  /* Colors - Base */
  --bg: linear-gradient(180deg, #f7f9fb 0%, #eef2f7 100%);
  --card: #ffffff;
  --border: #dbe1ea;
  --link: #0c69c8;
  --text: #1f2a3d;
  --muted: #5a6a7a;
  
  /* Colors - Dark/Overlay */
  --dark: #111;
  --dark-text: #fff;
  
  /* Colors - Semi-transparent */
  --overlay-light: rgba(0, 0, 0, 0.05);
  --overlay-soft: rgba(0, 0, 0, 0.06);
  --overlay-medium: rgba(0, 0, 0, 0.08);
  --overlay-dark: rgba(0, 0, 0, 0.8);
  --link-hover: rgba(12, 105, 200, 0.1);
  
  /* Shadows */
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.08);
}

body {
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: var(--body-top-padding) 0 0;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 var(--space-2xl);
  padding: var(--space-md) 0 0;
}

h1 {
  margin: 0;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 var(--space-md);
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: var(--space-lg);
}

.hero {
  position: relative;
}

.top-bar {
  background: var(--dark);
  color: var(--dark-text);
  padding: var(--space-sm) var(--space-2xl);
  border-radius: 0;
  margin: 0 0 var(--space-2xl);
  box-shadow: var(--shadow-md);
  width: 100vw;
  height: var(--topbar-height);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

.top-bar-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.page {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding) 2rem;
}

.top-nav {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.top-nav a {
  color: var(--dark-text);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--dark-text);
  text-decoration: none;
}

.nav-toggle-input {
  display: none;
}

.nav-toggle-label {
  display: none;
}

.nav-toggle-btn {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border-radius: 10px;
  cursor: pointer;
  background-color: transparent;
  border: 0;
  color: var(--dark-text);
  font-size: 26px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.nav-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.nav-toggle-icon {
  display: inline-block;
  transform: translateY(-1px);
}

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

a:hover {
  text-decoration: underline;
  color: #0051b3;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3xl);
  align-items: start;
}

.tagline {
  margin-top: var(--space-xs);
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.section-block {
  padding-bottom: 0;
  border-bottom: none;
}

.section-block h2 {
  margin: 0 0 var(--space-md);
  padding: 0 0 var(--space-sm);
  border-bottom: 2px solid var(--link);
}

.post-figure {
  margin: 0 0 var(--space-sm);
}

.post-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin: var(--space-xs) 0 var(--space-sm);
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-md);
}

.recent-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.recent-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.brewery-thumb {
  width: 130px;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 4px 0;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.brewery-post {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.collection {
  column-count: 3;
  column-gap: 12px;
}

.collection img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  break-inside: avoid;
  margin-bottom: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 1rem;
}

.search-box input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input[type="search"]:focus {
  outline: none;
  border-color: #0c69c8;
  box-shadow: 0 0 0 3px rgba(12, 105, 200, 0.15);
}

.search-icon {
  font-size: 1.1rem;
}

.about-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
}

.about-photo img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.detail-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 1rem auto;
  max-width: 900px;
}

.detail-photos img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.back-link {
  margin: 0 0 1rem;
  display: inline-block;
}

.brewery-hero {
  max-width: 900px;
  margin: 0 auto 16px;
}

.brewery-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px var(--overlay-dark);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
}

.lightbox-close {
  top: 12px;
  right: 12px;
  transform: none;
}

.lightbox-prev { left: -50px; }
.lightbox-next { right: -50px; }

@media (max-width: 768px) {
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection { column-count: 2; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; gap: var(--space-xl); }
  .collection { column-count: 1; }

  .top-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 14px;
    background: var(--dark);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    font-size: 1rem;
    z-index: 1000;
  }
  .top-nav a { padding: 10px 12px; }

  .nav-toggle-btn {
    display: inline-block;
  }

  .top-nav.is-open {
    display: flex;
  }
}

@media (max-width: 600px) {
  body { padding: calc(var(--topbar-height) + 18px) 0 0; }
  .page { padding: 0 1rem 1.5rem; }
  .card { padding: var(--space-md); }

  .brewery-post { grid-template-columns: 1fr; }
  .brewery-thumb { width: 100%; max-width: 220px; }
}

/* Map legend */
.map-legend {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  padding: 8px 10px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.4;
}

.map-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

.map-legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.map-legend .dot-red { background: #e53e3e; }
.map-legend .dot-blue { background: #3b82f6; }

.map-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.95rem;
}
