/* CMS Bega — design tokens & components, ported from Paper.design source.
 * Mood: bookish + mineral. Display = PT Serif, UI = SF Pro / system stack. */

:root {
  --bg: #F7F7F7;
  --surface: #FFFFFF;
  --fg: #1B1205;          /* primary text — dark warm brown-black */
  --muted: #8D8D8D;
  --muted-soft: rgba(141, 141, 141, 0.8);   /* breadcrumbs, inactive nav */
  --line: #B4C1C1;        /* 1px dividers, footer logo grid */
  --icon-bg: #E8E8E8;     /* avatar circles, icon tiles, chip arrows */
  --map-yellow: #FDF9D2;
  /* Mint→pale-blue diagonal — matches Paper export 1:1 (oklab interpolation).
   * sRGB fallback for browsers without oklab gradient interpolation. */
  --cta-grad: linear-gradient(263.32deg, #c8e0c8 16%, #b6d2e1 65%);
  --cta-grad-oklab: linear-gradient(in oklab 263.32deg,
                     oklab(86.2% -0.041 0.025) 16.05%,
                     oklab(83% -0.038 -0.059) 65.5%);

  /* Tag dot palette */
  --tag-magenta: #FC00E6;
  --tag-red:     #FA5900;
  --tag-orange:  #FE9B01;
  --tag-yellow:  #FEE700;
  --tag-purple:  #8200FF;
  --tag-green:   #008865;
  --tag-cyan:    #0891B2;

  /* Typography scale */
  --font-display: "PT Serif", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Segoe UI",
             system-ui, "Helvetica Neue", Arial, sans-serif;

  /* Spacing scale */
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap: 16px;
  --gap-md: 24px;
  --gap-lg: 40px;
  --gap-xl: 64px;
  --page-pad: 40px;
  --content-max: 1432px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
ul { padding: 0; margin: 0; list-style: none; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-inline: var(--page-pad);
  padding-block: var(--page-pad);
}

/* ============================================================
   Page header (overridden per page; default nav for non-event pages)
   ============================================================ */
.nav {
  display: flex;
  gap: var(--gap-lg);
  padding: var(--page-pad);
  align-items: center;
}
.nav__brand { font-family: var(--font-display); font-size: 24px; }
.nav__spacer { flex: 1; }
.nav a { color: var(--fg); }
.nav a:hover { color: var(--fg); }

/* ============================================================
   Event page (and similar)
   ============================================================ */

.event {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xl);
}

/* ----- Header row: TC logo · breadcrumb / page-type label · menu pill ----- */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  align-self: stretch;
}
.page-header__brand {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-header__brand svg { display: block; }

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.breadcrumbs a, .breadcrumbs span.crumb { color: var(--muted-soft); }
.breadcrumbs span.crumb-sep { color: var(--muted-soft); }
.breadcrumbs strong { color: var(--fg); font-weight: 600; }

.page-type {
  flex: 1;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-align: center;
}

.menu-pill {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 590;
  min-width: 0;
  width: 25%;
  max-width: 360px;
  flex-shrink: 0;
}
.menu-pill__active { color: var(--fg); }
.menu-pill__inactive {
  color: var(--muted-soft);
  flex: 1;
}
.menu-pill__caret {
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--muted-soft);
  border-bottom: 1.5px solid var(--muted-soft);
  transform: rotate(45deg);
  display: inline-block;
  flex-shrink: 0;
}
.menu-pill__caret--up {
  transform: rotate(-135deg);
  border-color: var(--fg);
}
.menu-pill {
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.menu-pill--open {
  outline: 2px solid var(--fg);
  outline-offset: -2px;
}

/* ============================================================
   Menu dropdown panel — Paper "menu-open" component
   ============================================================ */
.menu-panel {
  position: absolute;
  top: calc(var(--page-pad) + 60px);
  right: var(--page-pad);
  width: 25%;
  max-width: 360px;
  min-width: 280px;
  background: var(--surface);
  border-radius: var(--radius);
  outline: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 12px 32px -8px rgba(27, 18, 5, 0.12);
}
.menu-panel[hidden] { display: none; }

.menu-panel__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
}
.menu-panel__brand-text {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 18px;
  line-height: 24px;
  color: var(--fg);
  flex: 1;
}

.menu-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.menu-panel__item {
  padding: 8px 0;
}
.menu-panel__link {
  display: block;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}
.menu-panel__link:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }

.menu-panel__sublist {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.menu-panel__sublist li { padding: 6px 0; }
.menu-panel__sublink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  padding-left: 24px;
}
.menu-panel__sublink:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.menu-panel__bullet {
  color: var(--muted);
  font-weight: 400;
}

/* ----- Hero: image card (40%) + title block (right) ----- */
.event__hero {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  gap: var(--gap-xl);
  align-items: start;
}
.poster-card { display: flex; flex-direction: column; gap: var(--gap-xs); }
.poster-card__img {
  width: 100%;
  aspect-ratio: 573 / 400;
  border-radius: var(--radius);
  background: var(--icon-bg) center/cover no-repeat;
}
.poster-card__caption {
  font-size: 14px;
  line-height: 18px;
  color: var(--muted);
  text-align: center;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  padding-block: var(--gap);
}
.event-type-pill {
  display: flex;
  align-items: center;
  gap: var(--gap);
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: var(--fg);
}
.event-type-pill__icon {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.event-type-pill__rhombus {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--fg);
  left: 50%;
  top: 50%;
  rotate: 45deg;
  transform-origin: 0 0;
  translate: calc(-50% + 10px) calc(-50% - 4.142px);
}
.event-type-pill__leaf {
  position: absolute;
  left: 5px;
  top: 10.062px;
  width: 18px;
  height: auto;
}
.event__title {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 80px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}
.event__subtitle {
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: var(--fg);
  margin: 0;
}

/* ----- Body row: left info card / tags / resources + right body / map ----- */
.event__body-row {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  gap: var(--gap-xl);
  align-items: start;
}
.event__left { display: flex; flex-direction: column; gap: var(--gap-lg); }
.event__right { display: flex; flex-direction: column; gap: var(--gap-lg); padding-block: var(--gap); }

/* Info card */
.info-card {
  background: var(--surface);
  padding: var(--gap-md);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  border-radius: 4px;
}
.info-row {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding-block: var(--gap-xs);
  border-top: 1px solid var(--line);
  font-size: 21px;
  line-height: 26px;
}
.info-row:first-child { border-top: none; padding-top: 0; }
.info-row__icon {
  width: 40px; height: 40px;
  background: var(--icon-bg);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-row__icon svg { width: 20px; height: 20px; color: var(--fg); }
.info-row__primary { color: var(--fg); }
.info-row__secondary { color: var(--muted); margin-left: auto; }

.cta-button {
  background: var(--cta-grad);
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  font-family: inherit;
  font-size: 21px;
  line-height: 26px;
  font-weight: 590;
  color: var(--fg);
  text-align: center;
  cursor: pointer;
  display: block;
  width: 100%;
  margin-top: var(--gap-xs);
  text-decoration: none;
}
@supports (background: linear-gradient(in oklab, red, blue)) {
  .cta-button { background: var(--cta-grad-oklab); }
}
.cta-button:hover { text-decoration: none; opacity: 0.92; }
.cta-button--ghost {
  background: var(--icon-bg);
  color: var(--fg);
}

.eyebrow {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: var(--gap);
}

.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: var(--gap-xs);
}
.person {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.person__avatar {
  width: 44px; height: 44px;
  background: var(--icon-bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.person__name {
  font-size: 21px;
  line-height: 26px;
  font-weight: 600;
  color: var(--fg);
}
.person__role {
  font-size: 16px;
  line-height: 20px;
  color: var(--muted);
}

/* Tag pills */
.tag-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm);
  padding: 0 var(--gap-md);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  font-size: 16px;
  line-height: 20px;
  color: var(--fg);
}
.tag__dot {
  width: 10px; height: 16px;
  border-radius: 40px;
  background: var(--muted);
  flex-shrink: 0;
}
.tag--magenta .tag__dot { background: var(--tag-magenta); }
.tag--red     .tag__dot { background: var(--tag-red); }
.tag--orange  .tag__dot { background: var(--tag-orange); }
.tag--yellow  .tag__dot { background: var(--tag-yellow); }
.tag--purple  .tag__dot { background: var(--tag-purple); }
.tag--green   .tag__dot { background: var(--tag-green); }
.tag--cyan    .tag__dot { background: var(--tag-cyan); }

.tag--small { font-size: 14px; line-height: 18px; }

/* Accordion (Resurse utile) */
.accordion {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 21px;
  line-height: 26px;
  font-weight: 600;
  color: var(--fg);
}
.accordion__icon {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}
.accordion__icon::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  display: inline-block;
}

/* Body paragraphs (right column) */
.prose {
  font-size: 21px;
  line-height: 26px;
  color: var(--fg);
}
.prose p { margin: 0 0 var(--gap-md); }
.prose p:last-child { margin-bottom: 0; }

/* Embedded map */
.map-block {
  width: 100%;
  height: 320px;
  border-radius: var(--radius);
  background: #1f3a44;
  overflow: hidden;
  position: relative;
}
.map-block__inner { width: 100%; height: 100%; }

/* ----- Gallery (full-bleed, white surface) ----- */
.gallery {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--surface);
  padding: var(--gap-lg) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
}
.gallery__img {
  width: 756px;
  max-width: calc(100vw - 2 * var(--page-pad));
  aspect-ratio: 756 / 440;
  border-radius: var(--radius);
  background: var(--icon-bg) center/cover no-repeat;
}
.gallery__bar {
  width: 756px;
  max-width: calc(100vw - 2 * var(--page-pad));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.gallery__caption { font-size: 14px; line-height: 18px; color: var(--muted); }
.gallery__nav { display: flex; align-items: center; gap: var(--gap); }
.chip {
  background: var(--icon-bg);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 16px;
  color: var(--fg);
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.chip--disabled { color: var(--muted-soft); cursor: not-allowed; }

/* ----- Articole section ----- */
.related {
  display: grid;
  grid-template-columns: 20% repeat(3, 1fr);
  gap: var(--gap);
  padding-block: var(--gap-md);
}
.related__heading {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.related__heading h2 {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--fg);
}
.related__nav { display: flex; gap: var(--gap-xs); }
.article-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 8px 16px;
}
.article-card__title {
  font-size: 21px;
  line-height: 26px;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}
.article-card__meta {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  padding-block: var(--gap-xs);
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 20px;
  color: var(--fg);
}
.article-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}

/* ============================================================
   Article page (single-column, 50% centered)
   ============================================================ */
.article { display: flex; flex-direction: column; gap: var(--gap-xl); align-items: center; }
.article__centered {
  width: 50%;
  max-width: 716px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.article__hero { gap: 32px; }
.article__hero-meta {
  display: flex;
  align-items: center;
  gap: var(--gap);
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.article__hero-tags {
  display: flex;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.article__date {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  font-size: 16px;
  line-height: 20px;
  color: var(--fg);
}
.article__date svg { color: var(--fg); }
.article__lead {
  font-size: 21px;
  line-height: 26px;
  color: var(--fg);
  margin: 0;
}
.article__h2 {
  font-family: var(--font-ui);
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--fg);
  margin: 0;
}
.article__pull-quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
}
.article__pull-quote-text {
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin: 0;
}
.article__pull-quote-author {
  font-size: 16px;
  line-height: 20px;
  color: var(--muted);
  text-align: center;
}
.article__related-card {
  background: var(--surface);
  padding: var(--gap-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-xl);
  width: 60%;
  max-width: 860px;
}

/* Event preview (small card on article page) */
.event-preview { padding: 8px; display: flex; flex-direction: column; gap: var(--gap); position: relative; }
.event-preview__img {
  width: 100%;
  aspect-ratio: 374/200;
  border-radius: 4px;
  background: var(--icon-bg) center/cover no-repeat;
}
.event-preview__title {
  font-size: 21px;
  line-height: 26px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}
.event-preview__row {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  font-size: 16px;
  line-height: 20px;
  color: var(--fg);
}
.event-preview__row .info-row__secondary { color: var(--muted); }
.event-preview__person {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.event-preview__person .person__avatar { width: 36px; height: 36px; font-size: 13px; }
.event-preview__chip-corner {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 18px;
  color: var(--fg);
}

/* Collab panel — Au colaborat / Solul fertil */
.collab-panel { padding: 8px; display: flex; flex-direction: column; gap: var(--gap-md); }
.collab-panel__heading {
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}
.collab-panel__avatars { display: flex; gap: var(--gap-xs); flex-wrap: wrap; }
.collab-panel__avatars .person__avatar { width: 34px; height: 34px; font-size: 13px; }
.collab-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.collab-panel__list li {
  font-size: 16px;
  line-height: 26px;
  color: var(--fg);
}

/* ----- Site logos footer ----- */
.site-footer {
  display: grid;
  grid-template-columns: 20% 1fr;
  padding-top: 32px;
  gap: 0;
}
.site-footer__col { display: flex; flex-direction: column; gap: var(--gap-md); }
.site-footer__col h3 {
  font-size: 21px;
  line-height: 26px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}
.logo-grid {
  display: grid;
  grid-auto-rows: 160px;
}
.logo-grid--single { grid-template-columns: 286px; }
.logo-grid--six { grid-template-columns: repeat(6, 1fr); }
.logo-cell {
  outline: 1px solid var(--line);
  outline-offset: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: transparent;
}
.logo-cell img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
}
.logo-cell--brand {
  align-items: flex-end; justify-content: flex-start;
  flex-direction: column; gap: var(--gap-sm);
  padding: var(--gap);
}
.logo-cell__socials { display: flex; gap: var(--gap-sm); align-items: center; }
.logo-cell__socials a {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg);
}
.logo-cell__copy { font-size: 14px; line-height: 18px; color: var(--muted); }

/* ----- Generic fallbacks for other pages still on old skeleton ----- */
.box { border: 1px solid var(--line); padding: var(--gap-md); background: var(--surface); }
.section + .section { margin-top: var(--gap-lg); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: block; margin-bottom: var(--gap-xs); }
.btn { display: inline-block; background: var(--cta-grad); color: var(--fg); padding: 10px 16px; border: none; cursor: pointer; border-radius: var(--radius); font-weight: 600; }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.title-xl { font-family: var(--font-display); font-size: 72px; line-height: 80px; font-weight: 400; letter-spacing: -0.01em; }
.title-l  { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.02em; }
.title-m  { font-size: 21px; line-height: 26px; font-weight: 600; }
.grid     { display: grid; gap: var(--gap); }
.cols-4   { grid-template-columns: repeat(4, 1fr); }
.cols-3   { grid-template-columns: repeat(3, 1fr); }
.cols-2   { grid-template-columns: 1fr 1fr; }
.aspect-square { aspect-ratio: 1; }
.aspect-wide   { aspect-ratio: 16/9; }
.flex { display: flex; gap: var(--gap); }
.flex--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
table.lib { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lib th, table.lib td { border: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: top; }
.partner-logo { max-height: 60px; max-width: 100%; object-fit: contain; }
.gallery-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; }

@media (max-width: 900px) {
  .event__hero, .event__body-row { grid-template-columns: 1fr; }
  .event__title { font-size: 48px; line-height: 56px; }
  .breadcrumbs, .page-type { font-size: 20px; line-height: 26px; }
  .related { grid-template-columns: 1fr; }
  .logo-grid--six { grid-template-columns: repeat(2, 1fr); }
  .menu-pill { min-width: 0; }
}
