:root {
  --c-bg: #f6f1e7;
  --c-surface: #fffdf7;
  --c-ink: #2c2a25;
  --c-ink-soft: #5a5750;
  --c-moss: #4a6b3a;
  --c-moss-dark: #2f4a25;
  --c-bark: #6b4a2b;
  --c-clay: #b97a4b;
  --c-stone: #d8d1c0;
  --c-border: #d6cdb8;
  --c-cream: #f4ead2;

  --pill-bg: rgba(244, 234, 210, 0.78);
  --pill-bg-hover: rgba(255, 251, 240, 0.95);
  --pill-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);

  --surface-translucent: rgba(255, 253, 247, 0.86);
  --surface-translucent-soft: rgba(246, 241, 231, 0.72);

  --shadow-soft: 0 2px 8px rgba(44, 42, 37, 0.08);
  --shadow-med: 0 6px 20px rgba(44, 42, 37, 0.12);

  --radius: 6px;
  --max-content: 1440px;

  --font-body: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-display: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--c-ink);
  background-color: var(--c-bg);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}
.page { flex: 1; } /* pushes the footer to the bottom of the viewport */
/* Fixed page-wide background image. Pseudo-element approach because
   background-attachment: fixed is unreliable on iOS Safari. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/assets/images/taj-2.jpg') center / cover no-repeat;
}

img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

a { color: var(--c-moss-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-clay); }

h1, h2, h3 { font-family: var(--font-display); color: var(--c-moss-dark); line-height: 1.2; }
h1 { font-size: 2.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.6rem; margin: 2rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 1.2rem 0 0.4rem; }

/* ─── Header ─────────────────────────────────────────────── */
/* Always transparent — body bg image shows through. */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 2rem;
  background: transparent;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}
.site-header__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--c-cream);
  text-decoration: none;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

/* Overlay variant: header floats above the hero, leaving the hero free
   to fill the viewport from the top. */
.site-header--overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
}
.has-hero { /* hero pages: hide horizontal scroll from absolute header */
  overflow-x: hidden;
}

/* Nav pills — same component in both header variants */
.site-nav ul {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  background: var(--pill-bg);
  color: var(--c-ink);
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  box-shadow: var(--pill-shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--pill-bg-hover);
  color: var(--c-moss-dark);
  transform: translateY(-1px);
}

/* ─── Hero ───────────────────────────────────────────────── */
/* The hero is transparent; body bg image shows through. A page can still
   set its own bg image via the hero.image frontmatter to override. */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 55vh;
  display: flex;
  align-items: center;
  padding: 6rem 2rem 3rem;
}
.hero::after {
  /* subtle vignette at top for nav legibility */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0));
  pointer-events: none;
}
.hero__overlay {
  position: relative;
  z-index: 1;
  background: rgba(20, 18, 14, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 1.6rem 2.6rem 1.9rem;
  border-radius: 8px;
  max-width: 560px;
  margin-left: 5%;
  color: var(--c-cream);
}
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1;
  color: var(--c-cream);
}
.hero__subtitle {
  margin: 0.6rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: #e8dcc4;
  font-style: italic;
}

/* ─── Page layout (under the hero, or on inner pages) ───── */
.page {
  width: 100%;
  max-width: var(--max-content);
  margin: 2rem 0;
  align-self: center; /* center in body's flex-column without using auto margins */
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  align-items: start;
}
.page__content {
  background: var(--surface-translucent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 2rem 2.2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-med);
}
.page__content > :first-child { margin-top: 0; }
.page__title { margin-top: 0; }

/* When there is a hero, lift the content card so it overlaps slightly */
.has-hero .page {
  margin-top: -3rem;
  position: relative;
  z-index: 1;
}

/* Gallery page: content fills the viewport (no sidebar, no max-width). */
.is-gallery .page {
  max-width: none;
  grid-template-columns: 1fr;
  padding: 0 1.5rem;
}

/* ─── Info sidebar ──────────────────────────────────────── */
.info-sidebar {
  position: sticky;
  top: 1.5rem;
  background: var(--surface-translucent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-med);
}
.info-sidebar__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--c-moss-dark);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 0.5rem;
}
.info-sidebar__list { margin: 0; }
.info-sidebar__list dt {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-ink-soft);
  margin-top: 0.75rem;
}
.info-sidebar__list dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
}
.info-sidebar__cta {
  display: block;
  margin-top: 1.2rem;
  padding: 0.6rem 1rem;
  background: var(--c-clay);
  color: #fff;
  text-align: center;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-display);
}
.info-sidebar__cta:hover { background: var(--c-moss); color: #fff; }

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--c-ink-soft);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer__sep { margin: 0 0.5rem; opacity: 0.6; }

/* ─── Floats for images-by-text ─────────────────────────── */
.float-right { float: right; max-width: 320px; margin: 0 0 1rem 1.5rem; }
.float-left  { float: left;  max-width: 320px; margin: 0 1.5rem 1rem 0; }

/* ─── Cards ──────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--surface-translucent-soft);
  border: 1px solid var(--c-border);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
}
.card h3 { margin-top: 0; }

.cta { margin-top: 2rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  background: var(--c-moss);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
}
.btn:hover { background: var(--c-clay); color: #fff; }

/* ─── Organizers ─────────────────────────────────────────── */
.organizers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
  clear: both;
}
@media (max-width: 720px) {
  .organizers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .organizers { grid-template-columns: 1fr; }
}
.organizer { text-align: center; }
.organizer__photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 0.6rem;
  box-shadow: var(--shadow-soft);
}
.organizer__name { margin: 0.3rem 0 0.1rem; font-size: 1.1rem; }
.organizer__role { margin: 0; color: var(--c-clay); font-style: italic; font-size: 0.95rem; }
.organizer__blurb { margin-top: 0.5rem; color: var(--c-ink-soft); }

/* ─── Stories list ──────────────────────────────────────── */
.story-list { list-style: none; padding: 0; margin: 1rem 0; }
.story-list__item { border-bottom: 1px solid var(--c-border); }
.story-list__item:last-child { border-bottom: 0; }
.story-list__item a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--c-ink);
}
.story-list__item a:hover { background: var(--c-bg); }
.story-list__title { margin: 0; color: var(--c-moss-dark); }
.story-list__date { font-size: 0.85rem; color: var(--c-ink-soft); }
.story-list__summary { margin: 0.3rem 0 0; }

/* ─── Timeline (egy napunk) ──────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.75rem;
  margin: 2rem 0;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  background: var(--c-moss);
  border-radius: 2px;
}
.tl-event {
  position: relative;
  margin-bottom: 1.75rem;
}
.tl-event:last-child { margin-bottom: 0; }
.tl-event__marker {
  position: absolute;
  left: -2.6rem;
  top: 0.6rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--c-clay);
  border: 3px solid var(--c-cream);
  box-shadow: 0 0 0 2px var(--c-moss);
}
.tl-event__card {
  position: relative;
  background: var(--surface-translucent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.85rem 1.15rem 1rem;
  box-shadow: var(--shadow-soft);
}
.tl-event__card::before {
  /* notch border */
  content: "";
  position: absolute;
  left: -0.55rem;
  top: 0.72rem;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0.55rem 0.55rem 0.55rem 0;
  border-color: transparent var(--c-border) transparent transparent;
}
.tl-event__card::after {
  /* notch fill */
  content: "";
  position: absolute;
  left: -0.42rem;
  top: 0.7rem;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0.53rem 0.53rem 0.53rem 0;
  border-color: transparent var(--surface-translucent) transparent transparent;
}
.tl-event__time {
  font-family: var(--font-display);
  color: var(--c-moss-dark);
  font-weight: bold;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}
.tl-event__title {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.15rem;
}
.tl-event__body { font-size: 0.97rem; }
.tl-event__body p { margin: 0.45rem 0; }
.tl-event__body p:first-child { margin-top: 0; }
.tl-event__body p:last-child { margin-bottom: 0; }

/* Image lives at the top of the card (sibling of time/title) and floats
   right, so the time, title, and body all wrap to its left. */
.tl-event__card { display: flow-root; }
.tl-event__img {
  float: right;
  max-width: 42%;
  max-height: 200px;
  object-fit: cover;
  margin: 0 0 0.5rem 1rem;
}

@media (max-width: 520px) {
  .tl-event__img {
    float: none;
    max-width: 100%;
    margin: 0 0 0.7rem;
  }
}

/* ─── Story page ─────────────────────────────────────────── */
.story__meta { color: var(--c-ink-soft); font-style: italic; margin-top: 0; }
.story__back { margin-top: 2.5rem; clear: both; }

/* ─── Gallery ────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.gallery__item {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  border-radius: var(--radius);
  transition: transform 0.15s ease;
}
.gallery__item:hover { transform: scale(1.02); }

/* Any content image becomes a click-to-zoom target via the global lightbox JS */
main img.is-zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 0; }
.lightbox__close {
  position: absolute;
  top: 1rem; right: 1.5rem;
  background: none; border: 0;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 14, 0.45);
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}
.lightbox__nav:hover { background: rgba(20, 18, 14, 0.75); }
.lightbox__nav--prev { left: 1.5rem; }
.lightbox__nav--next { right: 1.5rem; }

@media (max-width: 520px) {
  .lightbox__nav { width: 2.75rem; height: 2.75rem; font-size: 1.8rem; }
  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .info-sidebar { position: static; }
  .page__content { padding: 1.5rem; }
  h1 { font-size: 2rem; }
  .float-left, .float-right {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }
  .hero {
    min-height: 60vh;
    padding: 6rem 1.25rem 3rem;
  }
  .hero__overlay { margin-left: 0; padding: 1.2rem 1.6rem 1.4rem; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
  }
  .site-nav ul { gap: 0.4rem; }
  .site-nav a { padding: 0.4rem 0.85rem; font-size: 0.9rem; }
  .hero { padding-top: 10rem; }
}
