/* Asociația Elemdiar — site styles
   Palette comes from the logo (mint mountains, black ink) and the
   navy/teal used in the project infopacks. */

:root {
  --mint: #a8dcd9;
  --mint-soft: #e3f4f2;
  --teal: #1f7f78;
  --teal-dark: #155e59;
  --navy: #12324a;
  --ink: #142230;
  --muted: #536371;
  --paper: #fbfaf6;
  --card: #ffffff;
  --line: #e2e6e4;
  --sun: #f4b942;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(18, 50, 74, .06), 0 8px 24px rgba(18, 50, 74, .08);
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);

  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 246, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 44px; width: auto; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15.5px;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--mint-soft); color: var(--navy); }
.nav a[aria-current="page"] { color: var(--teal); }

.nav-drop { position: relative; }
.nav-drop > button {
  font: inherit; font-weight: 500; font-size: 15.5px; color: var(--ink);
  background: none; border: 0; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-drop > button:hover { background: var(--mint-soft); }
.nav-drop > button::after {
  content: ""; width: 7px; height: 7px; margin-top: -3px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s;
}
.nav-drop[data-open] > button::after { transform: rotate(-135deg); margin-top: 3px; }
.nav-drop ul {
  list-style: none; margin: 0; padding: 8px;
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  display: none;
}
.nav-drop[data-open] ul { display: block; }
.nav-drop ul a { display: block; border-radius: 10px; padding: 10px 12px; }
.nav-drop ul small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }

.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: 8px;
}
.lang a {
  font-size: 13px; font-weight: 600; padding: 4px 10px; letter-spacing: .04em;
  color: var(--muted);
}
.lang a[aria-current="true"] { background: var(--navy); color: #fff; }

.menu-btn {
  display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--navy);
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
  transition: transform .2s;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -7px; }
.menu-btn span::after { top: 7px; }
.site-header[data-menu-open] .menu-btn span { background: transparent; }
.site-header[data-menu-open] .menu-btn span::before { transform: translateY(7px) rotate(45deg); }
.site-header[data-menu-open] .menu-btn span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 20px;
    display: none;
  }
  .site-header[data-menu-open] .nav { display: flex; }
  .nav a, .nav-drop > button { padding: 12px; font-size: 17px; width: 100%; justify-content: space-between; }
  .nav-drop ul { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; display: block; background: none; }
  .nav-drop > button { display: none; }
  .lang { align-self: flex-start; margin: 10px 0 0; }
}

/* ---------- Buttons & chips ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--sun); color: var(--navy); }
.btn-primary:hover { background: #f7c860; color: var(--navy); }
.btn-ghost { border-color: currentColor; color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: #0b2235; color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: 6px 14px; font-size: 14.5px; font-weight: 500;
  backdrop-filter: blur(6px);
}

.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 12px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative; color: #fff; isolation: isolate;
  min-height: min(86vh, 760px); display: flex; align-items: flex-end;
  padding: 120px 0 64px;
}
.hero > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,30,45,.15) 0%, rgba(10,30,45,.35) 45%, rgba(10,30,45,.85) 100%);
}
.hero h1 { color: #fff; max-width: 15ch; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 56ch; opacity: .95; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-sm { min-height: min(64vh, 560px); }
.hero-sm h1 { max-width: 18ch; }

.crumbs { font-size: 14px; margin-bottom: 14px; opacity: .9; }
.crumbs a { color: #fff; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--mint-soft); }
.section-navy { background: var(--navy); color: #dfeaf0; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-navy .section-head p { color: #b9ccd8; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.split { display: grid; gap: clamp(32px, 6vw, 72px); grid-template-columns: 1.1fr .9fr; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Stats ---------- */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-top: -48px; position: relative; z-index: 2;
}
.stat { padding: 26px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-family: var(--font-head); font-size: 2.4rem; line-height: 1; color: var(--navy); }
.stat span { color: var(--muted); font-size: 15px; }
@media (max-width: 620px) {
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
}

/* ---------- Cards ---------- */

.card {
  background: var(--card); border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow); border: 1px solid rgba(18,50,74,.04);
}
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--mint);
  display: grid; place-items: center; margin-bottom: 18px; color: var(--navy);
}
.card .icon svg { width: 26px; height: 26px; }
.card p { color: var(--muted); }
.card .more { font-weight: 600; text-decoration: none; }
.card .more::after { content: " →"; }

.project-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(18,50,74,.06), 0 18px 40px rgba(18,50,74,.14); color: inherit; }
.project-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--mint); }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.project-card .tag {
  align-self: flex-start; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal-dark); background: var(--mint-soft); border-radius: 999px; padding: 4px 10px; margin-bottom: 14px;
}
.project-card h3 { font-size: 1.45rem; }
.project-card p { color: var(--muted); font-size: 15.5px; flex: 1; }
.project-card .meta { font-size: 14px; color: var(--navy); font-weight: 500; display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---------- Quote ---------- */

.quote { font-family: var(--font-head); font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.3; color: #fff; margin: 0; }
.quote::before { content: "“"; display: block; font-size: 4rem; line-height: .6; color: var(--sun); }
.quote-by { margin-top: 20px; color: var(--mint); font-weight: 600; }

/* ---------- Facts / project info ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.fact { background: var(--card); border-radius: var(--radius-sm); padding: 20px 22px; border: 1px solid var(--line); }
.fact dt { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.fact dd { margin: 4px 0 0; font-family: var(--font-head); font-size: 1.25rem; color: var(--navy); font-weight: 600; line-height: 1.3; }

.countries { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.country {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.country img { width: 44px; height: 30px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.country b { display: block; color: var(--navy); }
.country span { font-size: 14px; color: var(--muted); }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312324a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.phases { display: grid; gap: 18px; counter-reset: phase; }
.phase { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: start; }
.phase::before {
  counter-increment: phase; content: counter(phase);
  width: 56px; height: 56px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-family: var(--font-head); font-size: 1.5rem; font-weight: 700;
}
.phase h3 { margin-bottom: 4px; }
.phase h3 small { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--teal); margin-left: 8px; }
.phase p { color: var(--muted); margin: 0; }

/* ---------- Tabs (in-page section nav) ---------- */

.subnav {
  position: sticky; top: 72px; z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav a {
  display: block; padding: 14px 14px; white-space: nowrap; text-decoration: none; color: var(--muted);
  font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent;
}
.subnav a:hover, .subnav a[aria-current="true"] { color: var(--navy); border-color: var(--sun); }

/* ---------- Gallery & lightbox ---------- */

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-tall { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.gallery button {
  all: unset; cursor: zoom-in; display: block; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--mint-soft); position: relative;
}
.gallery button:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .35s; }
.gallery-tall img { aspect-ratio: 1414 / 2000; }
.gallery button:hover img { transform: scale(1.04); }
.gallery .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; font-size: 13.5px; font-weight: 500;
  color: #fff; background: linear-gradient(transparent, rgba(10,30,45,.8));
}

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
}
.lightbox::backdrop { background: rgba(8, 20, 30, .92); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 64px; }
.lightbox img { max-height: calc(100vh - 140px); max-width: 100%; object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #e6eef2; margin-top: 14px; text-align: center; min-height: 1.5em; }
.lightbox button {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%; font-size: 26px; line-height: 1; display: grid; place-items: center;
}
.lightbox button:hover { background: rgba(255,255,255,.24); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 620px) {
  .lightbox figure { padding: 64px 12px 80px; }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 16px; transform: none; }
}

/* ---------- Testimonials ---------- */

.testimonials { columns: 3 300px; column-gap: 20px; }
.testimonial {
  break-inside: avoid; margin: 0 0 20px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.testimonial img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 30%; }
.testimonial blockquote { margin: 0; padding: 20px 22px 4px; font-size: 16px; }
.testimonial figcaption { padding: 0 22px 20px; font-weight: 600; color: var(--navy); font-size: 15px; }
.testimonial figcaption span { color: var(--muted); font-weight: 400; }

/* ---------- Media ---------- */

.video { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video iframe, .map iframe { width: 100%; height: 100%; border: 0; display: block; }
.map { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--mint-soft); }

.download {
  display: flex; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; text-decoration: none; color: inherit;
  transition: border-color .2s, transform .2s;
}
.download:hover { border-color: var(--teal); transform: translateY(-2px); color: inherit; }
.download .doc {
  flex: none; width: 48px; height: 60px; border-radius: 6px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .05em;
}
.download b { display: block; color: var(--navy); font-size: 1.05rem; }
.download span { color: var(--muted); font-size: 14px; }

/* ---------- CTA ---------- */

.cta {
  background: var(--navy) url("../img/brand/pattern.jpg") center / cover; background-blend-mode: soft-light;
  border-radius: calc(var(--radius) + 6px); color: #fff; padding: clamp(36px, 6vw, 64px);
  display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr; align-items: center;
}
.cta h2 { color: #fff; }
.cta p { color: #d3e2ea; margin: 0; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } .cta .actions { justify-content: flex-start; } }

/* ---------- Footer ---------- */

.site-footer { background: #0d2536; color: #b7c7d2; padding: 64px 0 32px; font-size: 15px; }
.site-footer a { color: #e3eef4; text-decoration: none; }
.site-footer a:hover { color: var(--mint); text-decoration: underline; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { background: #fff; border-radius: 14px; padding: 10px 14px; display: inline-block; margin-bottom: 18px; }
.footer-logo img { height: 46px; width: auto; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eu {
  margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
}
.eu .badges { display: flex; gap: 12px; flex-wrap: wrap; }
.eu .badges img { height: 44px; width: auto; background: #fff; border-radius: 8px; padding: 6px 10px; }
.eu p { flex: 1 1 380px; margin: 0; font-size: 13px; line-height: 1.55; color: #8ea3b1; }
.copyright { margin-top: 28px; font-size: 13px; color: #7f95a4; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Utilities ---------- */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 32px; }
.mt-3 { margin-top: 56px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Hero without a photo: navy with the doodle pattern */
.hero-pattern { background: var(--navy) url("../img/brand/pattern.jpg") center / cover; background-blend-mode: soft-light; }
.hero-pattern::before { background: linear-gradient(180deg, rgba(10,30,45,.1), rgba(10,30,45,.55)); }

.prose h3 { margin-top: 1.6em; }
.prose h3:first-child { margin-top: 0; }
.activity-groups { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 40px; }
.activity-groups .card { padding: 24px 26px; }
.activity-groups ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15.5px; }
.activity-groups li { margin-bottom: 4px; }
.banner-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
