/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f4f4f4;
  --surface:   #ffffff;
  --border:    #d8d8d8;
  --text:      #111111;
  --text-muted:#888888;
  --accent:    #222222;
  --accent-lt: #555555;
  --visited:   #3a7d44;
  --planned:   #999999;
  --radius:    8px;
  --shadow:    0 2px 8px rgba(0,0,0,0.10);
}

body {
  font-family: 'Georgia', serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ─── Header & Nav ─────────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

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

header h1 {
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: uppercase;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.2s;
}

nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover { border-color: var(--accent-lt); color: var(--accent); }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Main content ─────────────────────────────────────────── */
main { flex: 1; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-content > h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--accent);
}

/* ─── Timeline ─────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 1.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.timeline-item h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timeline-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.timeline-authors {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.authors-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.authors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.authors-list li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.88rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.author-name {
  font-weight: bold;
  color: var(--text);
  white-space: nowrap;
}

.author-works {
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Museums ──────────────────────────────────────────────── */
.museum-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.museum-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#museum-map {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  height: 300px;
}

#museum-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.museum-filter {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

#museum-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.museum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.museum-card:hover { border-color: var(--accent-lt); box-shadow: var(--shadow); }
.museum-card.open { border-color: var(--accent); }

.museum-accordion-body {
  display: none;
}

@media (max-width: 768px) {
  .museum-accordion-body {
    display: block;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }
  .museum-accordion-body:empty { display: none; }
  #museum-detail { display: none; }
  #museum-map { display: none; }
  .museum-main { display: none; }

  .accordion-map {
    height: 200px;
    margin-top: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
  }
}

.museum-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.visited { background: var(--visited); }
.status-dot.planned { background: var(--planned); }

.museum-card h4 {
  font-size: 0.95rem;
  color: var(--text);
}

.museum-card .museum-city {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Museum detail panel */
.museum-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.museum-detail.hidden { display: none; }

.museum-detail h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.museum-detail .detail-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.museum-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.museum-photos img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
  display: block;
}

.museum-photos img:hover { opacity: 0.8; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 88vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  z-index: 1010;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  background: rgba(0,0,0,0.3);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  opacity: 0.8;
  transition: opacity 0.2s;
  z-index: 1010;
}

.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; }

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0.7;
  z-index: 1010;
}

.maps-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
}

.maps-link:hover { text-decoration: underline; }

.museum-comment {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--accent-lt);
  padding-left: 1rem;
  font-style: italic;
}

.close-detail {
  float: right;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

/* ─── Films ────────────────────────────────────────────────── */
.films-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.film-filter-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.film-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.film-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.films-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.films-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 780px;
}

.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow);
}

.film-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.film-card h4 {
  font-size: 1rem;
  color: var(--text);
}

.film-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.film-dot.watched { background: var(--visited); }
.film-dot.planned { background: var(--text-muted); }

.film-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.film-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.stars-wrap {
  position: relative;
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
}

.stars-empty {
  color: #e0e0e0;
  letter-spacing: 2px;
}

.stars-full {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f5a623;
  letter-spacing: 2px;
}

.film-rating-num {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.1rem;
}

.film-imdb {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.3rem;
}

.film-imdb:hover { border-color: var(--accent); color: var(--accent); }

.film-comment {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--text);
  font-style: italic;
  border-left: 3px solid var(--border);
  padding-left: 0.75rem;
}

.films-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Footer ───────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover { color: var(--accent); }

.footer-insta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  main { padding: 1rem; }

  .museum-layout {
    grid-template-columns: 1fr;
  }

  #museum-sidebar { order: -1; }
  #museum-map { height: 220px; }

  .building-grid {
    grid-template-columns: 1fr;
  }

  .films-grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  header {
    padding: 0.75rem 1rem;
  }

  header h1 {
    font-size: 1.2rem;
  }

  .header-top {
    margin-bottom: 0;
  }

  .burger {
    display: flex;
  }

  nav {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.75rem;
  }

  nav.open {
    display: flex;
  }

  .tab-btn {
    text-align: left;
  }
}
