/* ==========================================================================
   NEB Chapters platform — styles
   Design language: sharp European institutional editorial.
   Squared geometry, hairline rules, whitespace instead of boxes.
   Full-bleed hero & map. Space Grotesk display, Instrument Sans UI.
   ========================================================================== */

:root {
  /* palette */
  --cream: #fffdf6;
  --paper: #fffefa;
  --beige: #faf7ed;
  --ink: #0c310a;
  --ink-soft: #45543a;
  --muted: #6d7a5e;
  --olive: #57772e;
  --olive-deep: #3d4d20;
  --sage: #d5e798;
  --sage-soft: #f0f6dd;
  --hairline: #dcd9c8;
  --hairline-strong: #b8b4a0;
  --rust: #c2651a;
  --danger: #a03c2a;
  --danger-soft: #fbeae4;

  /* type */
  --font-display: "Space Grotesk", "Instrument Sans", -apple-system, sans-serif;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* shape: deliberately square */
  --radius: 0;
  --radius-sm: 0;
  --shadow: none;
  --shadow-lift: 0 18px 40px -18px rgba(12, 49, 10, .35);

  /* rhythm — generous, padding-driven */
  --gutter: clamp(1.25rem, 4vw + .5rem, 3.5rem);
  --section-gap: clamp(2.2rem, 5vw, 4rem);
  --pad-block: clamp(1.6rem, 3vw, 2.6rem);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--olive); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--olive-deep); }
img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.08; margin: .2em 0 .5em; }
h1, .chapter-name, .card h3, .site-logo {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
}
.muted { color: var(--muted); }
.rich { max-width: 66ch; }

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

::selection { background: var(--sage); color: var(--ink); }

/* --------------------------------------------------------------------------
   Header — thin rule below, lots of air
   -------------------------------------------------------------------------- */
.site-header {
  display: flex; align-items: center; gap: 1rem 1.6rem; flex-wrap: wrap;
  padding: 1.1rem var(--gutter);
  background: #687B40;
  border-bottom: none;
  position: sticky; top: 0; z-index: 1000;
}
.site-header .site-logo, .site-header .site-nav a { color: #fff; }
.site-header .site-logo:hover { color: #f2f5e9; }
.site-header .nav-user { color: rgba(255, 255, 255, .78); }
.site-logo {
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: .6rem;
}
.site-logo:hover { color: var(--olive-deep); text-decoration: none; }

.site-nav {
  display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap;
  margin-left: auto;
  font-size: .92rem;
}
.site-nav a {
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color .16s ease, color .16s ease;
}
.site-nav a:hover { border-bottom-color: var(--olive); color: var(--olive-deep); }
.nav-chapters { display: inline-flex; gap: 1.1rem; flex-wrap: wrap; }
.nav-user { color: var(--muted); font-size: .85rem; }
.nav-user a { font-size: .85rem; }

/* Plenary notifications: header button + subscription bell */
.site-header .site-nav .plenary-btn {
  font-size: .85rem; font-weight: 600;
  padding: .5rem 1.3rem;
  background: #fff;
  color: #687B40;
  border: 1px solid #fff;
  border-bottom: 1px solid #fff;
}
.site-header .site-nav .plenary-btn:hover {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .85);
}
.plenary-toggle { display: inline-flex; margin: 0; }
.plenary-bell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: rgba(255, 255, 255, .85);
  cursor: pointer;
}
.plenary-bell:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.plenary-bell.is-on { background: rgba(255, 255, 255, .92); color: #687B40; border-color: transparent; }
.plenary-note mark { background: #f3e9a8; padding: .05rem .3rem; }

.site-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto 5rem;
  padding: var(--section-gap) var(--gutter) 0;
  flex: 1 0 auto;
}

/* Chapter pages break out: no side padding, hero & map run edge to edge */
.is-chapter .site-main {
  max-width: none;
  padding: 0 0 0;
  margin-bottom: 0;
}

/* Network home breaks out too: its chapters map is the hero */
.is-home .site-main {
  max-width: none;
  padding: 0 0 0;
  margin-bottom: 0;
}

.site-footer {
  flex-shrink: 0;
  color: rgba(255, 253, 246, .82);
  background: #687B40;
  font-size: .88rem;
  margin-top: 0;
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 2.6rem 1.2rem calc(2.8rem + env(safe-area-inset-bottom)); position: relative; }
.footer-grid { display: grid; gap: 2.2rem; grid-template-columns: 1fr 1fr; }
.footer-col-img { display: block; margin-bottom: 1rem; }
.footer-col-left .footer-col-img { width: 206px; height: 100px; object-fit: contain; }
.footer-col-right .footer-col-img { width: 183px; height: 100px; object-fit: contain; opacity: .9; }
.footer-part { line-height: 1.6; }
.footer-part a { color: #fff; text-decoration: underline; }
.footer-part a:hover { color: #f2f5e9; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 253, 246, .28); }
.footer-links a, .lang-switcher a { color: #fff; text-decoration: underline; }
.footer-links a:hover, .lang-switcher a:hover { color: #f2f5e9; }
.lang-switcher { margin: 1.2rem 0 0; }
.lang-switcher .lang-current { font-weight: 700; }
.footer-edit { position: absolute; top: 1rem; right: 1.2rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* Image crop modal (Cropper.js) */
.crop-modal {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(12, 49, 10, .55);
  display: none; align-items: center; justify-content: center;
  padding: 1.2rem;
}
.crop-modal.open { display: flex; }
.crop-dialog {
  background: #fffdf6; border-radius: var(--radius, 12px);
  padding: 1rem; width: 100%; max-width: min(760px, 96vw);
  box-shadow: 0 12px 40px rgba(12, 49, 10, .35);
}
.crop-stage { max-height: 62vh; }
.crop-stage img { display: block; max-width: 100%; max-height: 62vh; }
.crop-actions { display: flex; gap: .45rem; margin-top: .9rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.crop-hint { margin-right: auto; color: var(--muted); font-size: .82rem; }

/* EU cookie notice */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.6rem; flex-wrap: wrap;
  background: #fffdf6; border-top: 1px solid var(--hairline);
  box-shadow: 0 -2px 14px rgba(12, 49, 10, .16);
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
}
.cookie-banner[hidden] { display: none; }
.cookie-text { margin: 0; max-width: 62ch; font-size: .9rem; }
.cookie-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cookie-more { font-size: .88rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.inline-form { display: inline; }
.row-actions { white-space: nowrap; }
.row-actions .inline-form { margin-left: .6rem; }

/* --------------------------------------------------------------------------
   Flash messages — squared, left keyline only
   -------------------------------------------------------------------------- */
.flash {
  padding: .85rem 1.2rem;
  margin: 0 0 1.2rem;
  background: var(--beige);
  border-left: 3px solid var(--hairline-strong);
  font-size: .95rem;
}
.flash-ok { background: var(--sage-soft); border-left-color: var(--olive); color: var(--olive-deep); }
.flash-warn { background: #fdf2dd; border-left-color: #d8a94e; color: #6d4c12; }
.flash-error { background: var(--danger-soft); border-left-color: var(--danger); color: var(--danger); }

/* --------------------------------------------------------------------------
   Sections — divided by hairlines and padding, not boxes
   -------------------------------------------------------------------------- */
.card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.section {
  margin: 0;
  padding: var(--pad-block) 0;
  border-top: 1px solid var(--hairline);
}
.section:first-child { border-top: none; }

.section-head {
  display: flex; align-items: baseline; gap: .8rem;
  margin-bottom: 1.1rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--olive);
}
.section-head .btn-edit { margin-left: auto; }
.section-more { margin: 1.4rem 0 0; font-weight: 500; }
.section-more a { text-decoration: none; border-bottom: 1px solid var(--sage); }
.section-more a:hover { border-bottom-color: var(--olive); }

/* --------------------------------------------------------------------------
   Chapter page — asymmetric editorial composition
   -------------------------------------------------------------------------- */
.layout-chapter { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 5vw, 4.5rem); }

#sec-hero {
  grid-column: 1 / -1;
  position: relative;
  padding: 0;
  border-top: none;
  margin-bottom: calc(-1 * clamp(4.4rem, 9vw, 7.2rem));
}
#sec-hero .section-head {
  position: absolute; top: 1.2rem; right: var(--gutter); z-index: 500; margin: 0;
}
#sec-hero .section-head h2 { display: none; }
#sec-hero .btn-edit {
  background: var(--cream);
  border: 1px solid var(--ink);
}
#sec-hero .hero { border-radius: 0; }

/* Inner sections re-indent on the full-bleed chapter page */
.layout-chapter > .section:not(#sec-hero):not(#sec-map) {
  margin-left: var(--gutter);
  margin-right: var(--gutter);
}
/* Contacts, directions and description run the full content measure,
   like members and projects — contacts stacked above directions. */
.layout-chapter > #sec-contacts,
.layout-chapter > #sec-directions,
.layout-chapter > #sec-description { grid-column: 1 / -1; }
@media (min-width: 1400px) {
  .layout-chapter > .section:not(#sec-hero):not(#sec-map) {
    margin-left: max(var(--gutter), calc((100% - 1160px) / 2));
    margin-right: max(var(--gutter), calc((100% - 1160px) / 2));
  }
}

#sec-name {
  grid-column: 1 / -1;
  position: relative; z-index: 2;
  padding: 0;
  border-top: none;
}
#sec-name .section-head { margin-bottom: 0; }
#sec-name .section-head h2 { display: none; }
.chapter-name {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.03em;
  margin: 0;
  color: var(--cream);
  /* readability over the hero: soft shadow, the image carries a bottom gradient */
  text-shadow: 0 1px 14px rgba(12, 49, 10, .45);
  display: inline;
}
/* subtle darkening from the bottom of the hero image so the title reads */
#sec-hero .hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(12, 49, 10, .55), rgba(12, 49, 10, 0));
  pointer-events: none;
}
/* Edit button of the name section sits over the hero too */
#sec-name .btn-edit {
  position: absolute; right: 0; top: 0;
  background: var(--cream);
  border: 1px solid var(--ink);
}

/* Home page: the chapters map is the hero — full-bleed, tall */
.layout-home > #sec-map {
  padding: 0;
  border-top: none;
}
.layout-home > #sec-map .section-head {
  position: absolute; top: 1.2rem; right: var(--gutter); z-index: 500; margin: 0;
}
.layout-home > #sec-map .section-head h2 { display: none; }
.layout-home > #sec-map { position: relative; }
.layout-home > #sec-map .btn-edit { background: var(--cream); border: 1px solid var(--ink); }
.layout-home > #sec-map .map { height: clamp(320px, 46vw, 620px) !important; }
.layout-home > .section:not(#sec-map) {
  margin-left: var(--gutter);
  margin-right: var(--gutter);
}
@media (min-width: 1400px) {
  .layout-home > .section:not(#sec-map) {
    margin-left: max(var(--gutter), calc((100% - 1160px) / 2));
    margin-right: max(var(--gutter), calc((100% - 1160px) / 2));
  }
}

#sec-description .rich {
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* Map goes full-bleed and tall — the stage of the page */
#sec-map {
  grid-column: 1 / -1;
  padding: 0;
}
#sec-map .section-head { display: none; }
#sec-map .map { border: none; height: clamp(320px, 46vw, 520px) !important; }

#sec-members, #sec-projects, #sec-news, #sec-calendar { grid-column: 1 / -1; }

address { font-style: normal; }

/* Contacts — open list, ruled rows */
.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li {
  padding: .85rem 0;
  border-top: 1px solid var(--hairline);
  font-size: .98rem;
}
.contacts li:first-child { border-top: none; padding-top: 0; }

/* --------------------------------------------------------------------------
   Buttons — sharp rectangles, confident fills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  padding: .55rem 1.3rem;
  font: inherit; font-family: var(--font-sans);
  font-size: .92rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.btn-primary:hover { background: var(--olive-deep); border-color: var(--olive-deep); color: var(--cream); }

.btn-edit {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  padding: .3rem .8rem;
  min-height: 32px;
  color: var(--olive);
  border: 1px solid var(--hairline-strong);
  background: transparent;
}
.btn-edit:hover { border-color: var(--olive); background: var(--olive); color: var(--cream); }

.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: var(--cream); }

.btn-link {
  border: none; background: none; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
  min-height: 44px;
}
.btn-link:hover { color: var(--olive-deep); background: none; }

.btn-mini { font-size: .74rem; font-weight: 600; padding: .2rem .55rem; min-height: 30px; }

/* Add buttons (editors only) */
.add-card {
  display: grid; place-items: center;
  min-height: 150px;
  cursor: pointer;
  border: 1px dashed var(--hairline-strong);
  background: transparent;
  color: var(--olive);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  transition: background-color .16s ease, border-color .16s ease;
}
.add-card:hover { border-color: var(--olive); border-style: solid; background: var(--sage-soft); }

/* --------------------------------------------------------------------------
   Hero slideshow — full-bleed, tall, square
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  background: var(--olive-deep);
}
.hero::-webkit-scrollbar { display: none; }
.hero > img {
  width: 100%; flex: 0 0 100%; scroll-snap-align: center;
  object-fit: cover;
  height: clamp(300px, 52vw, 620px);
}
.hero-placeholder {
  min-height: 260px; display: grid; place-items: center; color: var(--muted);
  border: 1px dashed var(--hairline-strong);
  background: var(--beige);
  font-family: var(--font-display); font-size: 1.15rem;
}

/* --------------------------------------------------------------------------
   Carousels
   -------------------------------------------------------------------------- */
.carousel { position: relative; }
.carousel-track {
  display: flex; gap: clamp(1.2rem, 2.5vw, 2rem); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: .2rem .1rem 1rem; scrollbar-width: thin;
  scrollbar-color: var(--hairline-strong) transparent;
}
.carousel .card { flex: 0 0 300px; scroll-snap-align: start; display: flex; flex-direction: column; }
.carousel-nav {
  position: absolute; top: 42%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.carousel-nav:hover { background: var(--ink); color: var(--cream); }
.carousel-nav.prev { left: -1px; }
.carousel-nav.next { right: -1px; }

/* --------------------------------------------------------------------------
   Content cards — ruled, padding-driven, no boxes
   -------------------------------------------------------------------------- */
.carousel .card, .grid .card {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}
.card-cover {
  display: block; overflow: hidden;
  margin: 0 0 1rem;
  aspect-ratio: 16/9;
  background: var(--sage-soft);
  position: relative;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.card-cover:hover img { transform: scale(1.04); }
.cover-placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  color: var(--olive);
  background:
    linear-gradient(135deg, rgba(213, 231, 152, .5), transparent 55%),
    var(--sage-soft);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: .02em;
  font-size: 1.15rem;
}

.card h3 { font-size: 1.25rem; margin: .1rem 0 .4rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--olive-deep); text-decoration: underline; text-decoration-color: var(--sage); text-decoration-thickness: 3px; }

.card-meta { color: var(--muted); font-size: .86rem; margin: .15rem 0; }
.card-dates { margin-top: -.1rem; }
.card-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 2px; }
.card-meta a:hover { color: var(--olive-deep); }
.field-hint { font-size: .8rem; color: var(--muted); margin: -.3rem 0 .9rem; max-width: 60ch; }
.card-excerpt { margin: .4rem 0; font-size: .95rem; color: var(--ink-soft); flex: 1 0 auto; }
.card-money {
  font-size: .85rem; color: var(--olive-deep); font-weight: 600;
  border-top: 1px solid var(--hairline);
  padding-top: .6rem; margin: .8rem 0 0;
}
.card-more { font-size: .88rem; font-weight: 600; }
.card .btn-edit { align-self: flex-start; margin-top: .9rem; }

.badge {
  display: inline-block;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .6rem;
}
.badge-event { background: var(--sage); color: var(--ink); }
.card-cover .badge-event {
  position: absolute; top: 0; left: 0; margin: 0;
  background: var(--cream);
  color: var(--olive-deep);
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}

/* Member cards */
.member-logo {
  width: 64px; height: 64px; object-fit: contain;
  border: 1px solid var(--hairline);
  background: var(--paper); padding: 6px;
  margin-bottom: .9rem;
}
.member-monogram {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: var(--olive-deep);
  color: var(--sage);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.8rem;
  margin-bottom: .9rem;
}
.member-contact { margin: .25rem 0; font-size: .9rem; word-break: break-word; }
.member-address { color: var(--muted); font-size: .88rem; margin: .25rem 0; }
.map-warn { color: var(--danger); font-size: .82rem; margin: .3rem 0 0; font-weight: 600; }

.chapter-card h3 { font-size: 1.45rem; }

/* --------------------------------------------------------------------------
   Grids
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: clamp(1.4rem, 3vw, 2.4rem); grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.grid .add-card { border-top: 1px dashed var(--hairline-strong); }

/* --------------------------------------------------------------------------
   Inline edit forms — sage wash panel, squared
   -------------------------------------------------------------------------- */
.edit-box {
  border-top: 3px solid var(--olive);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--sage-soft);
}
.edit-actions { margin: 1rem 0 0; }

label { display: block; font-weight: 600; font-size: .86rem; letter-spacing: .02em; color: var(--ink-soft); }
label input, label textarea, label select { display: block; margin-top: .35rem; }

input[type=text], input[type=email], input[type=url], input[type=password],
input[type=number], input[type=date], textarea, select {
  width: 100%; max-width: 580px;
  padding: .65rem .85rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  font: inherit; font-size: .95rem;
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--olive);
  box-shadow: inset 0 0 0 1px var(--olive);
}
input[type=file] { font-size: .9rem; color: var(--ink-soft); }
input[type=file]::file-selector-button {
  font: inherit; font-size: .84rem; font-weight: 600;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  padding: .42rem .95rem; margin-right: .8rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--ink); color: var(--cream); }

.form-row { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.form-row label { flex: 1 1 200px; }
label.inline { display: inline-flex; gap: .45rem; align-items: center; font-weight: 400; }
label.inline input { width: auto; min-height: 0; }
.form-logo-preview { max-width: 90px; display: inline-block; vertical-align: middle; border: 1px solid var(--hairline); }

.contact-row { display: flex; gap: .7rem; margin-bottom: .6rem; flex-wrap: wrap; }
.contact-row input[type=text] { flex: 2 1 200px; }
.contact-row input[type=email] { flex: 3 1 240px; }

/* --------------------------------------------------------------------------
   Image manager
   -------------------------------------------------------------------------- */
.img-manager { display: flex; gap: 1rem; flex-wrap: wrap; margin: .7rem 0; }
.img-item { margin: 0; width: 140px; }
.img-item img {
  width: 140px; height: 96px; object-fit: cover;
  border: 1px solid var(--hairline);
}
.img-item figcaption { display: flex; gap: .4rem; margin-top: .45rem; justify-content: center; }
.img-item { position: relative; }
.img-pending img { outline: 2px dashed var(--olive); outline-offset: -2px; }
.img-pending-badge {
  position: absolute; top: 6px; left: 6px; z-index: 1;
  background: var(--olive); color: #fff;
  font-size: .72rem; padding: 2px 8px; border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Map & calendar — central stage, squared
   -------------------------------------------------------------------------- */
.map {
  border: none;
  z-index: 1;
  overflow: hidden;
}
.site-main:not(.layout-chapter) .map { border-top: 2px solid var(--ink); }
.map .leaflet-tile { filter: sepia(.18) saturate(.82) brightness(1.02); }
.leaflet-popup-content-wrapper {
  border-radius: 0;
  font-family: var(--font-sans);
  color: var(--ink);
}
.leaflet-popup-content a { color: var(--olive); font-weight: 600; }
.leaflet-bar a { border-radius: 0 !important; }

.calendar {
  background: var(--paper);
  padding: clamp(1rem, 2.5vw, 1.8rem) 0 0;
  border-top: 2px solid var(--ink);
}
.event-upcoming { margin-top: 1.4rem; }
.event-upcoming .section-head { margin-bottom: .5rem; }
.event-upcoming td.event-date {
  white-space: nowrap;
  width: 1%;
  padding-right: 1.6rem;
  color: var(--muted);
  font-size: .85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.event-upcoming td a { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--sage); }
.event-upcoming td a:hover { color: var(--olive-deep); }
.calendar.fc.fc {
  --fc-border-color: var(--hairline);
  --fc-button-bg-color: var(--olive);
  --fc-button-border-color: var(--olive);
  --fc-button-hover-bg-color: var(--olive-deep);
  --fc-button-hover-border-color: var(--olive-deep);
  --fc-button-active-bg-color: var(--olive-deep);
  --fc-button-active-border-color: var(--olive-deep);
  --fc-today-bg-color: var(--sage-soft);
  --fc-event-bg-color: var(--olive);
  --fc-event-border-color: var(--olive);
  --fc-page-bg-color: transparent;
  font-family: var(--font-sans);
}
.calendar.fc .fc-toolbar-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
  font-size: 1.5rem;
  color: var(--ink);
}
.calendar.fc .fc-button {
  border-radius: 0;
  font-weight: 600; font-size: .84rem;
  padding: .4rem 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.calendar.fc .fc-col-header-cell-cushion,
.calendar.fc .fc-daygrid-day-number {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .88rem;
}
.calendar.fc .fc-col-header-cell-cushion { font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--olive); }
.calendar.fc .fc-daygrid-event { border-radius: 0; font-size: .8rem; }
.calendar.fc .fc-daygrid-dot-event .fc-event-title,
.calendar.fc .fc-daygrid-event .fc-event-title { color: var(--cream); }
.calendar.fc .fc-daygrid-dot-event:hover,
.calendar.fc .fc-daygrid-event:hover { background: var(--olive-deep); }
.calendar.fc a:hover { color: var(--cream); }
.calendar.fc .fc-daygrid-day-number:hover { color: var(--olive-deep); }

/* --------------------------------------------------------------------------
   Detail pages
   -------------------------------------------------------------------------- */
/* Detail pages & listings: header stays close to the top of the page */
.back-link { margin: 0 0 .5rem; }
.back-link + h1, .back-link + .hero { margin-top: 0; }
body:not(.is-chapter):not(.is-home) .site-main { padding-top: clamp(1.2rem, 2.5vw, 2rem); }
.detail { max-width: 800px; }
.detail h1 { font-size: clamp(2rem, 4vw, 3rem); margin-top: .1em; }
.detail-logo { max-width: 140px; margin-bottom: 1rem; }
.detail address { color: var(--muted); margin: .4rem 0 1.2rem; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-box {
  max-width: 440px;
  margin: clamp(3rem, 10vh, 6rem) auto;
  border-top: 3px solid var(--olive);
  padding-top: 1.6rem;
}
.login-box h1 { font-size: 2.2rem; }
.login-alt { margin-top: 1.2rem; font-size: .95rem; }

/* --------------------------------------------------------------------------
   Like & share (public detail pages)
   -------------------------------------------------------------------------- */
.action-bar { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.4rem; }
.btn-like { display: inline-flex; align-items: center; gap: .4rem; }
.btn-like svg path { fill: none; stroke: var(--olive-deep); stroke-width: 1.4; }
.btn-like.liked svg path { fill: var(--olive); stroke: var(--olive); }
.btn-like.liked { border-color: var(--olive); color: var(--olive-deep); }
.share-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.share-label { color: var(--muted); font-size: .9rem; margin-right: .1rem; }
.share-btn {
  font-size: .82rem; line-height: 1; padding: .38rem .7rem;
  border: 1px solid var(--hairline); border-radius: 999px;
  background: #fff; color: var(--ink-soft); cursor: pointer; text-decoration: none;
}
.share-btn:hover { border-color: var(--olive); color: var(--olive-deep); }

/* --------------------------------------------------------------------------
   Address autocomplete
   -------------------------------------------------------------------------- */
.address-field { position: relative; max-width: 580px; margin-top: .35rem; }
.address-field input[type=text] { max-width: none; }
.address-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1200;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow-lift);
  max-height: 260px; overflow: auto;
  margin-top: 0;
}
.address-suggest-item {
  display: block; width: 100%; text-align: left;
  border: none; background: none;
  padding: .65rem .85rem;
  font: inherit; font-size: .9rem; color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--hairline);
  min-height: 44px;
}
.address-suggest-item:last-child { border-bottom: none; }
.address-suggest-item:hover, .address-suggest-item.active { background: var(--sage-soft); color: var(--olive-deep); }
.address-suggest-empty { padding: .65rem .85rem; color: var(--muted); font-size: .9rem; }

/* --------------------------------------------------------------------------
   Tables (users admin)
   -------------------------------------------------------------------------- */
.table {
  width: 100%; border-collapse: collapse;
  background: transparent;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
}
.table th, .table td { text-align: left; padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--hairline); }
.table tr:last-child td { border-bottom: none; }
.table th {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--olive);
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .hero, .carousel-track { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .layout-chapter { grid-template-columns: 1fr; }
  #sec-contacts, #sec-directions { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .carousel .card { flex-basis: 80vw; }
  .carousel-nav { display: none; } /* swipe is the mobile pattern */
  .site-nav { gap: .9rem; font-size: .88rem; }
  .nav-user { width: 100%; }
  .section-head h2::after { content: none; }
  .card-cover:hover img { transform: none; }
  .hero > img { height: clamp(240px, 62vw, 340px); }
  .chapter-name { font-size: clamp(1.7rem, 8.5vw, 2.3rem); }
  /* shallower overlap so the title stays on the image on small screens */
  #sec-hero { margin-bottom: calc(-1 * clamp(2.6rem, 12vw, 3.6rem)); }
}

/* Network brand: logo + full name */
.site-logo { display: inline-flex; align-items: center; gap: .6rem; }
.site-logo-img { width: 40px; height: 40px; object-fit: contain; display: block; }
.site-logo-text { font-weight: 600; letter-spacing: .01em; }
