/* ==========================================================================
   veljkoloncarevic.in.rs — same visual language as the static site,
   rebuilt fluid-first. Breakpoints: 1100px (grid collapse), 720px (mobile nav).
   ========================================================================== */

:root {
  --navy:        #2b2b90;
  --navy-dark:   #1e1e6e;
  --bar:         #14141c;
  --orange:      #e8590c;
  --orange-lite: #f26522;
  --blue-link:   #1a56db;
  --blue-btn:    #1a56db;
  --ink:         #16181d;
  --muted:       #6b7280;
  --rule:        #c9ccd4;
  --bg:          #ffffff;

  --shell:       1500px;
  --gap:         clamp(1.5rem, 4vw, 3.5rem);
  --pad-x:       clamp(1rem, 3vw, 2.75rem);

  --fs-name:     clamp(1.6rem, 1.1rem + 2.1vw, 2.2rem);
  --fs-section:  clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  --fs-entry:    clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  --fs-body:     clamp(0.85rem, 0.82rem + 0.18vw, 0.94rem);
  --fs-small:    clamp(0.78rem, 0.76rem + 0.12vw, 0.85rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-link); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--navy); padding: .6rem 1rem;
}
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 3px solid var(--orange-lite); outline-offset: 2px; }

/* --------------------------------------------------------------- topbar -- */
.topbar { background: var(--bar); color: #fff; }

.topbar__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: .35rem var(--pad-x);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.25rem;
}

.topbar__toggle {
  display: none;
  background: none; border: 0; color: #fff;
  font-size: 1.1rem; padding: .4rem .5rem; cursor: pointer;
}

.topnav { flex: 1; }

.topnav__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem);
  font-size: var(--fs-small);
}
/* First nav item hugs the left, the rest sit on the right — mirrors the
   original "Home ... Resume Literature" split. */
.topnav__list li:first-child { margin-right: auto; }

.topnav__list a {
  color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .2rem; white-space: nowrap;
}
.topnav__list a:hover,
.topnav__list a[aria-current="page"] { color: var(--orange-lite); }

.btn-pdf {
  background: var(--blue-btn); color: #fff; text-decoration: none;
  border-radius: 999px; padding: .38rem 1rem;
  font-size: var(--fs-small); font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45rem;
}
.btn-pdf:hover { filter: brightness(1.12); }

/* ------------------------------------------------------------------ hero -- */
.hero { background: var(--navy); color: #fff; }

.hero__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--pad-x);
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

.hero__text { flex: 1 1 auto; min-width: 0; }

.hero__name {
  margin: 0;
  font-size: var(--fs-name);
  font-weight: 700;
  letter-spacing: .01em;
}

.hero__headline {
  margin: .15rem 0 1rem;
  color: var(--orange-lite);
  font-size: var(--fs-body);
}

.hero__bio p {
  margin: 0 0 .35rem;
  font-style: italic;
  font-size: var(--fs-small);
  text-align: justify;
  max-width: 78ch;
}

.hero__photo {
  flex: 0 0 auto;
  width: clamp(120px, 14vw, 200px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid var(--orange-lite);
  border-radius: 18px;
}

/* ------------------------------------------------------------ contactbar -- */
.contactbar { background: var(--navy-dark); color: #fff; }

.contactbar__list {
  max-width: var(--shell);
  margin: 0 auto;
  padding: .55rem var(--pad-x);
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem clamp(1rem, 3vw, 2rem);
  font-size: var(--fs-small);
}

.contactbar__list li {
  display: inline-flex; align-items: center; gap: .45rem; min-width: 0;
}
.contactbar__list a { color: #fff; text-decoration: none; word-break: break-word; }
.contactbar__list a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- layout -- */
.layout {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--pad-x) 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--gap);
  align-items: start;
}
.layout__full { grid-column: 1 / -1; }

/* --------------------------------------------------------------- section -- */
.section { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }

.section__title {
  display: inline-block;
  margin: 0 0 1rem;
  padding-bottom: .2rem;
  border-bottom: 2px solid var(--orange);
  color: var(--orange);
  font-size: var(--fs-section);
  font-weight: 700;
}

.section__subtitle { margin: -.6rem 0 1rem; color: var(--muted); }

/* ----------------------------------------------------------- entry cards -- */
.entry {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.4rem;
  break-inside: avoid;
}

.entry__logo {
  flex: 0 0 auto;
  width: clamp(40px, 5vw, 58px);
  height: auto;
  object-fit: contain;
  margin-top: .2rem;
  align-self: flex-start;
}

.entry__body { min-width: 0; }

.entry__title {
  margin: 0;
  font-size: var(--fs-entry);
  font-weight: 700;
  line-height: 1.25;
}

.entry__org {
  margin: .1rem 0 .5rem;
  padding-bottom: .15rem;
  border-bottom: 1px solid var(--rule);
  display: inline-block;
  font-size: var(--fs-body);
}

.entry__subtitle { margin: .1rem 0 .4rem; color: var(--muted); }

.entry__desc {
  margin: 0 0 .5rem;
  font-style: italic;
  color: #4b5563;
  text-align: justify;
  hyphens: auto;
  font-size: var(--fs-small);
}

.entry__date { margin: 0; color: var(--muted); font-style: italic; font-size: var(--fs-small); }

/* ---------------------------------------------------------- publications -- */
.pubgroup { margin-bottom: 1.5rem; }

.pubgroup__head { display: flex; align-items: center; gap: .85rem; margin-bottom: .6rem; }

.pubgroup__logo { width: clamp(38px, 4.5vw, 56px); align-self: flex-start; object-fit: contain; }

.pubgroup__label {
  margin: 0;
  padding-bottom: .15rem;
  border-bottom: 1px solid var(--rule);
  font-size: var(--fs-entry);
  font-weight: 400;
}

.publist { list-style: none; margin: 0; padding: 0 0 0 clamp(0px, 4vw, 4.4rem); }

.pub { margin-bottom: .85rem; }

.pub__title {
  margin: 0;
  font-size: var(--fs-entry);
  font-weight: 700;
  line-height: 1.3;
}
.pub__title i { font-size: .8em; margin-right: .35rem; color: var(--blue-link); }
.pub__title a { color: var(--blue-link); text-decoration: none; }
.pub__title a:hover { text-decoration: underline; }

.pub__meta { margin: .1rem 0 0; color: var(--muted); font-style: italic; font-size: var(--fs-small); }

/* ------------------------------------------------------------------ tags -- */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
/* Same fill as the hero band behind the portrait: navy + white bold text. */
.tag {
  background: var(--navy); color: #fff; font-weight: 700;
  border-radius: 999px; padding: .3rem .8rem; font-size: var(--fs-small);
}

/* ----------------------------------------------------------------- poems -- */
.poem {
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  break-inside: avoid;
}

.poem__title {
  margin: 0;
  color: var(--navy);
  font-size: var(--fs-entry);
  font-weight: 700;
  line-height: 1.3;
}

/* Dedication / epigraph — the item's subtitle field. */
.poem__dedication {
  margin: .1rem 0 .6rem;
  color: var(--muted);
  font-style: italic;
  font-size: var(--fs-small);
}

/* `pre-wrap` is what keeps verse intact: hard line breaks, the blank line
   between stanzas and any leading indentation the poet typed. Deliberately
   not justified, unlike .entry__desc. Jinja autoescape still applies, so poem
   text can never inject markup. */
.poem__body {
  margin: 0 0 .4rem;
  font-size: var(--fs-body);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.poem__meta { margin: 0; color: var(--muted); font-size: var(--fs-small); font-style: italic; }

.poem__link { margin: .3rem 0 0; font-size: var(--fs-small); }

/* ---------------------------------------------------------------- footer -- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem var(--pad-x);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* ============================ responsive ================================= */

/* Tablet / small laptop: one column of content, wider measure. */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .publist { padding-left: 0; }
}

/* Mobile: stacked hero, collapsible nav, no justified text (avoids rivers). */
@media (max-width: 720px) {
  .topbar__toggle { display: inline-flex; }

  .topbar__inner { flex-wrap: wrap; justify-content: space-between; }

  .topnav {
    flex-basis: 100%;
    order: 3;
    display: none;
  }
  .topnav.is-open { display: block; }

  .topnav__list { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: .4rem; }
  .topnav__list li:first-child { margin-right: 0; }
  .topnav__list a { padding: .6rem .25rem; border-top: 1px solid #2a2a35; }

  .hero__inner { flex-direction: column-reverse; align-items: center; text-align: center; }
  .hero__text { width: 100%; }
  .hero__bio p { text-align: left; }
  .hero__photo { width: clamp(110px, 38vw, 160px); }

  .contactbar__list { flex-direction: column; align-items: flex-start; }

  .entry { gap: .75rem; }
  .entry__desc { text-align: left; }
}

@media (max-width: 420px) {
  .entry { flex-direction: column; }
  .entry__logo { width: 44px; }
}

/* -------------------------------------------------------------- printing -- */
@media print {
  .topbar, .footer, .skip-link { display: none !important; }
  .hero, .contactbar, .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .layout { grid-template-columns: repeat(2, 1fr); }
  a { text-decoration: none; color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
