/* ternYpe website — shared styles
   Brand colors below are picked straight from the real ternYpe logo
   (img/logo.png: red / green / blue dots above the "Y"), per the client's
   2026-10-18 meeting feedback asking for a more colorful site built from
   the logo's own palette.
   2026-10-19: livelier pass inspired by youthforum.org's energy (warm
   cream instead of cold white, much bigger soft-rounded corners, playful
   tinted sections, bouncier hover motion) — same ternYpe palette throughout,
   not Youth Forum's own blue/orange. */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #fdf7ea;       /* warmer cream, livelier than plain white */
  --color-surface: #ffffff;
  --color-text: #1c1c1c;
  --color-text-muted: #5a5a5a;
  --color-primary: #1c4e9c;   /* blue — from logo */
  --color-primary-dark: #123564;
  --color-primary-tint: #eaf1fb;
  --color-secondary: #2e8b57; /* green — from logo */
  --color-secondary-tint: #e7f3ec;
  --color-accent: #d1361f;    /* red — from logo */
  --color-accent-dark: #a82912;
  --color-accent-tint: #fbe9e5;
  --color-border: #e9dfc8;
  --radius: 22px;
  --radius-sm: 12px;
  --radius-lg: 32px;
  --max-width: 1180px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Poppins", var(--font-body);
  --shadow-sm: 0 1px 3px rgba(20,33,58,.06);
  --shadow-md: 0 8px 24px rgba(20,33,58,.10);
  --shadow-lg: 0 16px 40px rgba(20,33,58,.16);
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  color: var(--color-text);
}
h1 { font-size: clamp(2.1rem, 4.2vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-weight: 700; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
}
.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%; /* playful dot instead of a flat bar */
  background: var(--color-accent);
  display: inline-block;
}

/* Header / nav */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
/* Thin brand-color bar — red/green/blue from the logo — per meeting
   feedback to make the site feel more colorful throughout. */
header.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent) 0 33.33%, var(--color-secondary) 33.33% 66.66%, var(--color-primary) 66.66% 100%);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.logo { display: flex; align-items: center; font-family: var(--font-heading); font-weight: 800; font-size: 1.3rem; color: var(--color-text); }
.logo img { height: 60px; width: auto; } /* bigger logo per meeting feedback (was 40px) */
.logo span { color: var(--color-accent); }
nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
nav.main-nav a {
  color: var(--color-text);
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
nav.main-nav a:hover { background: rgba(28,78,156,.08); color: var(--color-primary); text-decoration: none; }
nav.main-nav a[aria-current="page"] { background: var(--color-primary); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--color-text);
}

@media (max-width: 780px) {
  nav.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  nav.main-nav.open { display: block; animation: slideDown .18s var(--ease); }
  nav.main-nav.open ul { flex-direction: column; gap: 2px; padding: 12px; }
  nav.main-nav a { display: block; }
  .nav-toggle { display: inline-block; }
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* Hero */
.hero {
  position: relative;
  min-height: 66vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: linear-gradient(180deg, rgba(10,20,40,.25) 0%, rgba(10,20,40,.55) 55%, rgba(10,20,40,.85) 100%),
              var(--color-primary-dark) center/cover no-repeat;
  overflow: hidden;
}
.hero.has-image { background-image: linear-gradient(180deg, rgba(10,20,40,.15) 0%, rgba(10,20,40,.45) 55%, rgba(10,20,40,.85) 100%), var(--hero-img); background-position: center; background-size: cover; }
/* Playful confetti-dot texture + two brand-colored decorative rings,
   inspired by youthforum.org's graphic/illustrated (not just photo) hero
   treatment — same ternYpe palette, just more movement. */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,.35) 2px, transparent 2.5px),
    radial-gradient(rgba(255,255,255,.2) 2px, transparent 2.5px);
  background-size: 54px 54px, 86px 86px;
  background-position: 0 0, 27px 43px;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18);
  pointer-events: none;
}
.hero .ring-accent {
  position: absolute;
  left: -50px; bottom: -70px;
  width: 170px; height: 170px;
  border-radius: 50%;
  border: 10px solid var(--color-secondary);
  opacity: .5;
  pointer-events: none;
}
.hero-inner { position: relative; padding: 64px 24px 56px; max-width: var(--max-width); margin: 0 auto; }
.hero h1 { color: #fff; margin-bottom: .35em; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.hero p { max-width: 58ch; font-size: 1.15rem; color: rgba(255,255,255,.92); }
.hero .eyebrow { color: #ffd9d0; }
.hero .eyebrow::before { background: #ffd9d0; }

/* Sections */
section { padding: 64px 0; }
/* Soft brand-color wash instead of plain white — livelier page rhythm
   without needing a different class per section. */
section.alt { background: var(--color-primary-tint); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 30px; }
.section-head h2 { margin-bottom: 0; }
.section-head > a { font-weight: 700; white-space: nowrap; }

/* Cards / grids */
.grid { display: grid; gap: 24px; }
/* minmax(min(Npx, 100%), 1fr) instead of a bare minmax(Npx, 1fr): on very
   narrow phones (≈320px wide) a bare px floor can force a track wider than
   the screen and cause horizontal scrolling — min(Npx, 100%) caps the floor
   at the container's own width so it always fits, with identical behavior
   on every normal-sized screen. */
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); } /* 2-up: members, open calls — per meeting feedback */
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); } /* 3-4 across: homepage/project cards — per meeting feedback */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #d5cfc0; }
/* Tiny alternating tilt on hover for a bouncier, less rigid feel. */
.grid .card:nth-child(odd):hover { transform: translateY(-5px) rotate(-.6deg); }
.grid .card:nth-child(even):hover { transform: translateY(-5px) rotate(.6deg); }
.card img { aspect-ratio: 16/10; object-fit: cover; transition: transform .3s var(--ease); }
.card:hover img { transform: scale(1.03); }
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.card-body h3 { font-size: 1.08rem; margin: 0; }
.card-body h3 a { color: var(--color-text); }
.card-body h3 a:hover { color: var(--color-primary); text-decoration: none; }

.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(28,78,156,.1);
  color: var(--color-primary);
  width: fit-content;
}
.tag.status-open { background: rgba(46,139,87,.12); color: var(--color-secondary); }
.tag.status-closed { background: rgba(0,0,0,.06); color: var(--color-text-muted); }
/* Priority/category tag variants cycling the three brand colors — "more
   colorful" per meeting feedback instead of every tag being the same blue. */
.tag.tag-red { background: rgba(209,54,31,.1); color: var(--color-accent); }
.tag.tag-green { background: rgba(46,139,87,.12); color: var(--color-secondary); }
.tag.tag-blue { background: rgba(28,78,156,.1); color: var(--color-primary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: background .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--color-accent-dark); color: #fff; text-decoration: none; transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(1); }
.btn.outline { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); box-shadow: none; padding: 9px 20px; }
.btn.outline:hover { background: var(--color-primary); color: #fff; }

.member-logos { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.member-logos a { display: block; border-radius: var(--radius-sm); transition: transform .15s var(--ease); }
.member-logos a:hover { transform: translateY(-3px) scale(1.06); }
.member-logos img { height: 56px; width: auto; filter: grayscale(35%); opacity: .85; transition: filter .15s var(--ease), opacity .15s var(--ease); }
.member-logos img:hover { filter: grayscale(0%); opacity: 1; }

/* Compact horizontal member/call row — "shorter lines, two next to each
   other" per meeting feedback. Used on membership.html and calls.html.
   Logos are wordmarks, not faces, so they sit in a square tile (object-fit:
   contain + padding) rather than being circle-cropped. */
.row-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px; }
.row-card img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: contain; object-position: center; flex-shrink: 0; background: var(--color-bg); padding: 6px; border: 1px solid var(--color-border); }
.row-card .card-body { padding: 0; gap: 4px; }
.row-card h3 { font-size: 1rem; }
/* Make each member's website link read as a small clear button, not a
   plain underlined text link lost under the description paragraph. */
.link-pill {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  padding: 6px 14px; margin-top: 2px; border-radius: 999px;
  background: var(--color-primary-tint); color: var(--color-primary) !important;
  font-weight: 700; font-size: .85rem;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.link-pill:hover { background: var(--color-primary); color: #fff !important; text-decoration: none; transform: translateX(2px); }

/* People avatar card — rounded photos per meeting feedback (board &
   working-group/team members). */
.avatar-card { text-align: center; padding: 26px 18px; align-items: center; }
.avatar-card img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; box-shadow: var(--shadow-sm); }
.avatar-card h3 { font-size: 1rem; margin-bottom: 2px; }
.avatar-card .tag { margin: 0 auto 8px; }
.avatar-card p { font-size: .9rem; }
.avatar-card.small img { width: 72px; height: 72px; margin-bottom: 10px; }

/* Compact hover-reveal card for homepage/project listings — "3-4 projects
   horizontally, hover to show more details" per meeting feedback. */
.hover-card { position: relative; }
.hover-card img { aspect-ratio: 4/3; }
.hover-card .card-body { padding: 14px 16px; gap: 5px; }
.hover-card .card-body h3 { font-size: .98rem; }
.hover-card .hover-reveal {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  padding: 16px; background: linear-gradient(180deg, rgba(18,53,100,0) 35%, rgba(18,53,100,.94) 100%);
  opacity: 0; transition: opacity .2s var(--ease);
}
.hover-card:hover .hover-reveal { opacity: 1; }
.hover-card .hover-reveal p { color: #fff; font-size: .85rem; margin: 0; }

.empty-state {
  color: var(--color-text-muted);
  font-style: normal;
  padding: 28px 20px;
  text-align: center;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  background: rgba(0,0,0,.015);
  grid-column: 1 / -1;
}

/* Footer */
footer.site-footer {
  background: #14213a;
  color: #cfd6e4;
  padding: 48px 0 24px;
  margin-top: 48px;
  position: relative;
}
/* Bookend the page with the same brand-color bar as the header. */
footer.site-footer::before {
  content: "";
  display: block;
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0 33.33%, var(--color-accent) 33.33% 66.66%, var(--color-secondary) 66.66% 100%);
}
footer.site-footer h4 { color: #fff; }
footer.site-footer a { color: #b9c3da; }
footer.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); margin-bottom: 28px; }
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.footer-grid p { margin: 0 0 8px; }
.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2);
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.social-links a:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; font-size: .85rem; color: #8d97ac; }

/* Europe member map — real interactive map (per meeting feedback asking
   for something similar to what European national youth councils use),
   replacing the earlier country-tile placeholder. Base map: "Blank map of
   Europe (cropped)" by Maix / Tintazul, CC BY-SA 3.0, via Wikimedia
   Commons — every country is its own SVG group, found/colored by its
   ISO 3166-1 alpha-3 code (see js/main.js highlightMemberCountries()). */
.europe-map-wrap { max-width: 720px; margin: 0 auto; position: relative; }
/* Pan/zoom viewport — drag to move, scroll/pinch to zoom, like a real map.
   See js/main.js makeMapPannable(). */
.europe-map-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  /* Soft "sea" wash behind the landmasses instead of a flat white panel. */
  background: radial-gradient(ellipse at 50% 40%, #eaf3f8 0%, #dfeaf2 60%, #d3e3ee 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
  touch-action: none; /* we handle drag/pinch ourselves */
  cursor: grab;
}
.europe-map-viewport.dragging { cursor: grabbing; }
.europe-map { width: 100%; height: auto; display: block; transform-origin: 0 0; will-change: transform; }
.europe-map .country { transition: fill .15s var(--ease), filter .15s var(--ease); }
.europe-map .country:hover { filter: brightness(.93); } /* every country responds to hover now */
.europe-map .member-country { cursor: pointer; }
.europe-map .member-country:hover, .europe-map .member-country:focus-visible { filter: brightness(1.2) saturate(1.15); }
.map-controls { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.map-controls button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--color-border); background: var(--color-surface);
  font-size: 1.15rem; font-weight: 700; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-sm); color: var(--color-text);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.map-controls button:hover { transform: scale(1.08); box-shadow: var(--shadow-md); }
.map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 12px; font-size: .82rem; color: var(--color-text-muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.map-credit { text-align: center; font-size: .72rem; color: var(--color-text-muted); margin-top: 8px; }
.map-credit a { color: inherit; }

/* Lightbox — click any photo in a gallery to view it full-size, with
   keyboard/arrow navigation between the other photos in that gallery.
   See js/main.js initLightbox(). */
.lightbox-gallery img { cursor: zoom-in; transition: transform .2s var(--ease), filter .2s var(--ease); }
.lightbox-gallery img:hover { transform: scale(1.03); filter: brightness(1.05); }
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,14,24,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 90vw; max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: block;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.3rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.25); transform: scale(1.06); }
.lightbox-close { top: env(safe-area-inset-top, 20px); right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-counter {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-size: .82rem; font-weight: 600;
  background: rgba(255,255,255,.1); padding: 4px 12px; border-radius: 999px;
}
@media (max-width: 600px) {
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* Inline visual editor — lets a logged-in admin edit the real public page
   directly. See js/inline-editor.js. */
#inline-editor-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: env(safe-area-inset-bottom, 16px);
  z-index: 900;
  display: flex; align-items: center; gap: 10px;
  background: #14213a; color: #fff;
  padding: 10px 16px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
}
#inline-editor-bar .btn { padding: 8px 18px; font-size: .85rem; }
#inline-edit-status { font-size: .8rem; color: #cfd6e4; max-width: 240px; }
body.inline-editing [data-field]:not([data-render="items"]) {
  outline: 2px dashed var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
  transition: background .15s var(--ease);
}
body.inline-editing [data-field]:not([data-render="items"]):focus {
  outline-color: var(--color-accent);
  background: var(--color-primary-tint);
}
.inline-items-editor {
  display: block; width: 100%; margin-top: 10px;
  padding: 12px; font: inherit; font-size: .9rem;
  border: 2px dashed var(--color-accent); border-radius: var(--radius-sm);
  background: var(--color-accent-tint);
}

/* Utility */
.mt-0 { margin-top: 0; }
.text-muted { color: var(--color-text-muted); }
.text-justify { text-align: justify; text-justify: inter-word; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }
