
:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #1f2421;
  --muted: #6b6b6b;
  --accent: #7a3b2e;
  --accent-soft: #c98a78;
  --border: #e3ddd2;
  --shadow: 0 6px 24px rgba(20, 20, 20, 0.06);
  --radius: 10px;
  font-family: "Segoe UI", "Cantarell", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 243, 238, 0.95);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
header.site .inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 1px; font-size: 18px;
  color: var(--ink); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.brand .dot { color: var(--accent); }

/* Dropdown menu */
.menu {
  position: relative;
}
.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink);
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.menu-toggle:hover { background: #fff; border-color: var(--accent-soft); }
.menu-toggle .caret {
  display: inline-block; transition: transform 0.18s ease;
  font-size: 12px; color: var(--accent);
}
.menu.open .menu-toggle .caret { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 320px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 14px 40px rgba(20,20,20,0.14);
  padding: 8px 0;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.menu.open .menu-panel {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a {
  display: block; padding: 10px 18px;
  color: var(--ink); font-size: 14px;
  border-left: 3px solid transparent;
}
.menu-panel a:hover {
  background: #f6f3ee; text-decoration: none;
  border-left-color: var(--accent-soft);
}
.menu-panel a.active {
  background: #f6f3ee; color: var(--accent); font-weight: 600;
  border-left-color: var(--accent);
}
.menu-panel .divider {
  height: 1px; background: var(--border); margin: 6px 0;
}

/* Landing hero image (full bleed, edge-to-edge) */
.hero-image {
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-image img {
  display: block;
  width: 100%;
  height: auto;
}
/* When inside <main>, escape the centred container so the image
   spans the full viewport width. */
main > .hero-image.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.hero {
  max-width: 1180px; margin: 0 auto; padding: 40px 20px 20px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 0 0 12px; letter-spacing: 2px;
}
.hero .lede { font-size: 18px; color: var(--muted); max-width: 760px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }
main > .hero-image:first-child { margin-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column; min-height: 160px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(20,20,20,0.10); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .cta { margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--accent); }

.section-header {
  position: relative;
  padding: 8px 0 22px;
  margin-bottom: 30px;
}
.section-header::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  background: var(--accent);
  margin-top: 18px;
}
.section-header .eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(122, 59, 46, 0.08);
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 14px;
}
.section-header h1 {
  margin: 0 0 8px;
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.section-header p { margin: 0; color: var(--muted); font-size: 16px; max-width: 70ch; }

.item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Article-flavoured items (docx content) */
.item.article {
  padding: 36px clamp(22px, 4vw, 56px) 32px;
}
.article-head {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.article-head h2 {
  margin: 0;
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
  position: relative;
  padding-left: 18px;
}
.article-head h2::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 4px; border-radius: 2px;
  background: var(--accent);
}
.article-subtitle {
  margin: 8px 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
.article-body {
  max-width: 68ch;
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  color: #2a2f2c;
}
.article-body p { margin: 0 0 1.05em; text-align: justify; hyphens: auto; }
.article-body p:last-child { margin-bottom: 0; }

/* First paragraph after the title — drop cap + lead style. */
.article-body > p:first-of-type {
  font-size: 18px;
}
.article-body > p:first-of-type::first-letter {
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
  float: left;
  font-size: 3.4em;
  line-height: 0.95;
  font-weight: 700;
  color: var(--accent);
  padding: 4px 10px 0 0;
  margin-top: 2px;
}

/* In-article section headings (was ALL CAPS in the docx). */
.article-body h3.ar-heading {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 13px;
  color: var(--accent);
  margin: 2.2em 0 0.6em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent-soft);
  font-weight: 700;
}
.article-body h4.ar-subhead {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  color: var(--muted);
  margin: 1.6em 0 0.4em;
  font-weight: 700;
}
.article-body h4.ar-profile {
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
  font-size: 19px;
  color: var(--ink);
  margin: 1.4em 0 0.2em;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  font-weight: 700;
}
.article-body p.ar-caption {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin: 0.4em auto 1.6em;
  max-width: 56ch;
}
.article-body strong { color: var(--ink); }
.article-body em { color: #3a3a3a; }

.byline {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

/* Fallback for non-article items still using h2/h3/h4. */
.item h2 { margin: 0 0 12px; font-size: 22px; color: var(--accent); }
.item h3 { margin-top: 18px; font-size: 18px; }
.item h4 { margin-top: 14px; font-size: 16px; color: var(--muted); }
.item ul { padding-left: 22px; }

/* Ad-hoc inline lists detected from the source docx (lines that were
   written as separate short paragraphs ending in commas). */
.article-body ul.ar-list {
  list-style: none;
  margin: 0.4em 0 1.4em;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 24px;
}
.article-body ul.ar-list li {
  position: relative;
  padding: 7px 4px 7px 22px;
  border-bottom: 1px dashed var(--border);
  text-align: left;
  hyphens: none;
}
.article-body ul.ar-list li:last-child { border-bottom: 0; }
.article-body ul.ar-list li::before {
  content: "▸";
  position: absolute;
  left: 2px; top: 6px;
  color: var(--accent);
  font-size: 13px;
}

/* Figures: images embedded inline where "Слика N: ..." placeholders were. */
.article-body .ar-figure {
  margin: 1.8em auto;
  text-align: center;
  max-width: 100%;
}
.article-body .ar-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(20, 20, 20, 0.08);
  background: #fff;
}
.article-body .ar-figure figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}
.article-body .ar-figure-missing {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 1.4em 0;
}
.article-body .ar-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 1.8em 0;
}
.article-body .ar-gallery .ar-figure {
  margin: 0;
}

.group {
  border-left: 4px solid var(--accent-soft);
  padding-left: 18px; margin-bottom: 32px;
}
.group > h2.group-title {
  margin: 4px 0 16px; font-size: 24px;
}

/* Section-page TOC: sticky horizontal pill bar that lets users jump
   between subsections within a long section page (e.g. ЈАВНИ ПРОСТОРИ). */
.section-toc {
  position: sticky;
  top: 60px;
  z-index: 20;
  margin: 0 -16px 28px;
  padding: 10px 16px;
  background: rgba(246, 243, 238, 0.96);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
}
.section-toc .toc-inner {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
}
.toc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  flex: 0 0 auto;
}
.toc-pill:hover {
  background: #f3ede4;
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}
.toc-pill .toc-num {
  display: inline-flex;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}
.toc-pill .toc-text {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-pill.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.toc-pill.is-active .toc-num {
  background: #fff;
  color: var(--accent);
}

.page-section {
  scroll-margin-top: 96px;
  margin-bottom: 36px;
}
.page-section.group {
  margin-bottom: 36px;
}

.pdf-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: start;
  padding: 18px;
}
.pdf-thumb {
  display: block; overflow: hidden; border-radius: 8px;
  border: 1px solid var(--border); background: #fafafa;
  aspect-ratio: 3 / 4;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pdf-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20,20,20,0.10);
}
.pdf-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.pdf-thumb.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; letter-spacing: 2px;
}
.pdf-body { padding-top: 4px; }
.pdf-body h2 { margin: 0 0 6px; color: var(--accent); font-size: 20px; }
.pdf-meta { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.pdf-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500; line-height: 1.2;
  text-decoration: none; transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: #5e2c22; }
.btn-ghost {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .pdf-item {
    grid-template-columns: 1fr;
  }
  .pdf-thumb {
    max-width: 280px;
    aspect-ratio: 4 / 3;
  }
}

footer.site {
  display: none;
}

@media (max-width: 720px) {
  header.site .inner { padding: 12px 14px; }
  .brand { font-size: 16px; }
  .brand img { height: 28px; }
  .menu-panel { min-width: 260px; right: -8px; }
  .hero h1 { letter-spacing: 1px; }
}

/* Hero title band — just the handwritten "Билећа između камена и воде"
   cropped from the original mockup, sitting like a sub-header above
   the map carousel. */
.hero-title-band {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 18px 0 10px;
  text-align: center;
}
.hero-title-band img {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 1100px;
  height: auto;
}
main > .hero-title-band.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Map carousel for the home page */
.hero-carousel {
  position: relative;
  background: #f3f1ec;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
}
main > .hero-carousel.full-bleed {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
.hero-carousel .slides {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  height: clamp(320px, 60vw, 720px);
}
.hero-carousel .slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 700ms ease;
  pointer-events: none;
}
.hero-carousel .slide.active {
  opacity: 1;
  pointer-events: auto;
}
.hero-carousel .slide img {
  max-width: 96%;
  max-height: 96%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
  background: #fff;
}
.hero-carousel .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 20, 0.55);
  color: #fff;
  border: 0;
  width: 46px;
  height: 64px;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  border-radius: 4px;
  transition: background 0.2s;
}
.hero-carousel .nav:hover { background: rgba(20, 20, 20, 0.85); }
.hero-carousel .nav.prev { left: 16px; }
.hero-carousel .nav.next { right: 16px; }
.hero-carousel .dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 9px;
  z-index: 2;
}
.hero-carousel .dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(40, 40, 40, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.hero-carousel .dots .dot:hover { background: rgba(40, 40, 40, 0.6); }
.hero-carousel .dots .dot.active {
  background: #1a1a1a;
  transform: scale(1.2);
}
@media (max-width: 600px) {
  .hero-carousel .nav { width: 36px; height: 50px; font-size: 22px; }
  .hero-carousel .dots { bottom: 10px; }
  .hero-title-band { padding: 12px 14px 6px; }
}
