/* ============================================================
   Хаджи Ненчо Палавеев — Копривщица
   styles.css  (BG POC)
   All assets live in the same folder as index.html
   ============================================================ */

:root {
  --green-900: #123527;
  --green-800: #1a4a35;
  --green-700: #226047;
  --green-100: #e8f0ea;
  --gold-600: #a9822f;
  --gold-500: #c39a3f;
  --gold-100: #f8f1e0;
  --burgundy-700: #7a2436;
  --burgundy-100: #f7e9ec;
  --ink-900: #1b1d1c;
  --ink-700: #3b423e;
  --ink-500: #6b736e;
  --line: #e4e2dc;
  --white: #ffffff;
  --parchment: #faf8f4;

  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1200px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
  --sec-y: clamp(3.5rem, 7vw, 6.5rem);
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 53, 39, .06), 0 6px 18px rgba(18, 53, 39, .06);
  --shadow-md: 0 10px 30px rgba(18, 53, 39, .12);
  --header-h: 78px;
}

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

/* ------------------------------------------------------------
   LANGUAGE SWITCH (BG / EN)
   Both languages are present in index.html; only the active
   one is displayed. Controlled by <html data-lang="bg|en">.
   ------------------------------------------------------------ */
html[data-lang="bg"] .i18n-en,
html[data-lang="en"] .i18n-bg { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green-700); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: .002em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--green-900); color: #fff; padding: .7rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }

/* ------------------------------ HEADER ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--green-900);
  border-bottom: 3px solid var(--gold-600);
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }

.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand-mark { color: var(--gold-500); display: flex; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-family: var(--serif); font-size: 1.16rem; font-weight: 600; letter-spacing: .01em; }
.brand-sub { font-size: .655rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .62); margin-top: .18rem; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul { display: flex; align-items: center; gap: 1.05rem; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.site-nav ul a {
  color: rgba(255, 255, 255, .86); text-decoration: none;
  font-size: .765rem; font-weight: 600; letter-spacing: .085em; text-transform: uppercase;
  padding: .35rem 0; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .18s ease, border-color .18s ease;
}
.site-nav ul a:hover { color: #fff; border-bottom-color: var(--gold-500); }

.header-tools { display: flex; align-items: center; gap: .85rem; flex-shrink: 0; }
.lang-switch { display: flex; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; overflow: hidden; }
.lang {
  font: inherit; font-size: .7rem; font-weight: 700; letter-spacing: .08em; white-space: nowrap;
  padding: .3rem .62rem; border: 0; background: transparent; color: rgba(255, 255, 255, .72); cursor: pointer;
}
.lang:hover { color: #fff; }
.lang.active { background: var(--gold-500); color: #1b1d1c; }
.lang.active:hover { color: #1b1d1c; }
.lang[disabled] { opacity: .45; cursor: not-allowed; }

.logo-link img { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); object-fit: cover; }

.menu-toggle { display: none; }

/* ------------------------------ BUTTONS ------------------------------ */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  font-size: .86rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .92rem 1.7rem; border-radius: 999px; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.btn-primary { background: var(--green-800); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-900); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--green-800); color: var(--green-800); background: transparent; }
.btn-outline:hover { background: var(--green-800); color: #fff; }

/* ------------------------------ SECTION SHELL ------------------------------ */
.section { padding: var(--sec-y) 0; }
.section-tinted { background: var(--parchment); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.eyebrow {
  margin: 0 0 .6rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold-600);
}
.eyebrow-light { color: var(--gold-500); }

.section-head { max-width: 780px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.95rem, 4vw, 2.9rem); }
.section-head h2::after {
  content: ""; display: block; width: 68px; height: 3px;
  background: var(--gold-500); margin-top: 1rem; border-radius: 2px;
}
.section-intro { color: var(--ink-500); margin: 1.1rem 0 0; font-size: 1.02rem; }

.sub-head { font-size: 1.5rem; margin-bottom: .8rem; color: var(--green-900); }

.prose p { margin: 0 0 1.15rem; color: var(--ink-700); }
.prose p:last-child { margin-bottom: 0; }
.prose-invert p { color: rgba(255, 255, 255, .9); }

/* ------------------------------ HERO ------------------------------ */
.hero {
  padding: clamp(2.75rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 5.5rem);
  background:
    radial-gradient(900px 480px at 88% -12%, rgba(195, 154, 63, .16), transparent 70%),
    linear-gradient(180deg, #fffefb 0%, var(--white) 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }

.hero-copy h1 {
  font-size: clamp(2.6rem, 6vw, 4.35rem);
  color: var(--green-900);
  margin: 0 0 .8rem;
}
.hero-lead {
  font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-style: italic;
  color: var(--burgundy-700); margin: 0 0 1.4rem;
}
.hero-text { color: var(--ink-700); margin: 0 0 1.6rem; max-width: 44ch; }
.hero-quote {
  margin: 0 0 1.9rem; padding: .9rem 0 .9rem 1.35rem;
  border-left: 4px solid var(--gold-500);
  font-family: var(--serif); font-size: clamp(1.2rem, 2.3vw, 1.55rem); color: var(--green-800);
}

.hero-media { margin: 0; position: relative; }
.hero-media img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 4.6; object-fit: cover; object-position: center top;
}
.hero-media::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px;
  border: 2px solid var(--gold-500); border-radius: var(--radius); z-index: -1;
}
.hero-media figcaption {
  margin-top: .95rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-500); text-align: center;
}

/* ------------------------------ 3 CARDS ------------------------------ */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.35rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.card {
  padding: 1.6rem 1.55rem; border-radius: var(--radius);
  border: 1px solid var(--line); border-top: 4px solid var(--gold-500);
  background: var(--white); box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { font-size: 1.3rem; margin-bottom: .65rem; }
.card p { margin: 0; color: var(--ink-700); font-size: .965rem; }

.card-green { background: var(--green-100); border-top-color: var(--green-700); border-color: #d3e3d8; }
.card-green h3 { color: var(--green-900); }
.card-burgundy { background: var(--burgundy-100); border-top-color: var(--burgundy-700); border-color: #eed4da; }
.card-burgundy h3 { color: var(--burgundy-700); }
.card-gold { background: var(--gold-100); border-top-color: var(--gold-600); border-color: #ecdcbd; }
.card-gold h3 { color: #6f5417; }

/* ------------------------------ BIO ------------------------------ */
.bio-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.bio-layout > *, .journey-grid > *, .legacy-grid > * { min-width: 0; }

.framed { margin: 0; }
.framed img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); object-fit: cover;
}
.framed-green img { border: 4px solid var(--green-700); }

.timeline { list-style: none; margin: 1.8rem 0 0; padding: 0 0 0 1.15rem; border-left: 2px solid var(--gold-500); }
.timeline li { position: relative; padding: 0 0 1.1rem .35rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -1.55rem; top: .52rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--white); border: 2.5px solid var(--gold-600);
}
.timeline .year { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--green-800); line-height: 1.2; }
.timeline .event { display: block; font-size: .9rem; color: var(--ink-500); line-height: 1.5; }

/* ------------------------------ JOURNEY ------------------------------ */
.journey-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.infographic { margin: 0; transition: transform .2s ease, box-shadow .2s ease; border-radius: var(--radius); }
.infographic img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid #cfd9e4; background: #fff;
  box-shadow: var(--shadow-md); padding: .6rem;
  transition: box-shadow .2s ease;
}
.infographic:hover { transform: translateY(-4px); }
.infographic:hover img { box-shadow: 0 16px 38px rgba(18, 53, 39, .22); }
.infographic figcaption { margin-top: .85rem; font-size: .855rem; color: var(--ink-500); text-align: center; }

/* ------------------------------ PHILANTHROPY (feature) ------------------------------ */
.section-feature {
  background:
    radial-gradient(1000px 520px at 12% 0%, rgba(195, 154, 63, .2), transparent 65%),
    linear-gradient(165deg, var(--green-900) 0%, #0d2a1e 100%);
  color: #fff;
}
.section-feature .section-head h2 { color: #fff; }
.section-feature .section-head h2::after { background: var(--gold-500); }

.phil-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 4vw, 3.25rem); align-items: start; }
.phil-grid > * { min-width: 0; }

/* Donation circles sit on a white panel, per the structure brief */
.donations {
  list-style: none; margin: 0;
  padding: clamp(1.4rem, 2.6vw, 2.1rem) clamp(1.1rem, 2.2vw, 1.9rem);
  background: var(--white); border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.85rem 1.4rem;
}
.donations li:last-child { grid-column: 2; }
.donations figure { margin: 0; text-align: center; }
.donations img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 50%; background: #fff; padding: 5px;
  border: 2px solid var(--gold-500);
  box-shadow: 0 6px 16px rgba(18, 53, 39, .18);
  transition: transform .22s ease, box-shadow .22s ease;
}
.donations figure:hover img { transform: translateY(-5px) scale(1.02); box-shadow: 0 12px 26px rgba(18, 53, 39, .28); }
.donations figcaption {
  margin-top: .75rem; font-size: .815rem; line-height: 1.45;
  color: var(--ink-700); font-weight: 500;
}

.edu-donation {
  margin: clamp(2.5rem, 5vw, 4rem) auto 0; max-width: 1000px; text-align: center;
  background: #fff; padding: clamp(.8rem, 1.6vw, 1.15rem); border-radius: var(--radius);
  border: 3px solid var(--gold-500); box-shadow: 0 18px 45px rgba(0, 0, 0, .3);
}
.edu-donation img { width: 100%; border-radius: 8px; }
.edu-donation figcaption {
  margin-top: 1rem; padding: 0 .6rem .35rem;
  font-family: var(--serif); font-size: clamp(1rem, 1.9vw, 1.22rem);
  color: var(--green-900); line-height: 1.5;
}

/* ------------------------------ LEGACY ------------------------------ */
.legacy-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.legacy-media img { aspect-ratio: 3 / 4.4; object-fit: cover; object-position: center; }
.quote-frame {
  margin: 1.9rem 0 0; padding: 1.5rem 1.7rem;
  background: var(--gold-100); border: 1px solid #ecdcbd; border-left: 5px solid var(--gold-600);
  border-radius: 10px;
  font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--green-900); line-height: 1.45;
}

/* ------------------------------ GALLERY ------------------------------ */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem 1.5rem; }
.gallery-item { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-item figcaption { padding: .95rem 1.1rem 1.15rem; font-size: .875rem; line-height: 1.5; color: var(--ink-700); }
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }

.audio-band {
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.6rem 1.8rem; border-radius: var(--radius);
  background: var(--green-100); border: 1px solid #d3e3d8; border-left: 5px solid var(--green-700);
}
.audio-band h3 { font-size: 1.35rem; color: var(--green-900); margin-bottom: .25rem; }
.audio-band p { margin: 0; color: var(--ink-500); font-size: .93rem; }

/* ------------------------------ LINKS ------------------------------ */
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.link-card {
  padding: 1.75rem 1.65rem; border-radius: var(--radius);
  border: 1px solid var(--line); border-top: 4px solid var(--gold-500);
  display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.link-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.link-card h3 { font-size: 1.3rem; margin-bottom: .7rem; }
.link-card p { color: var(--ink-700); font-size: .95rem; margin: 0 0 1.35rem; }
.link-arrow {
  margin-top: auto; font-weight: 600; font-size: .92rem; text-decoration: none;
  color: var(--green-800); border-bottom: 2px solid transparent; align-self: flex-start;
}
.link-arrow:hover { border-bottom-color: var(--gold-500); }
.logo-inline { display: flex; align-items: center; gap: .7rem; }
.logo-inline img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--burgundy-700); object-fit: cover; }

/* ------------------------------ FOOTER ------------------------------ */
.site-footer { background: var(--green-900); color: rgba(255, 255, 255, .8); border-top: 3px solid var(--gold-600); padding: 2.25rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer p { margin: 0; font-size: .9rem; }
.site-footer strong { font-family: var(--serif); font-size: 1.05rem; color: #fff; font-weight: 600; }
.footer-links { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.footer-links a { color: var(--gold-500); text-decoration: none; font-size: .875rem; }
.footer-links a:hover { text-decoration: underline; }

/* ------------------------------ LIGHTBOX ------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10, 22, 17, .93);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.25rem; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 94vw); max-height: 78vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lightbox p { color: #fff; max-width: 70ch; text-align: center; margin: 1.1rem 0 0; font-size: .95rem; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.35rem;
  background: transparent; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer;
}

/* ------------------------------ REVEAL ------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .site-nav ul { gap: .85rem; }
  .site-nav ul a { font-size: .705rem; letter-spacing: .06em; }
  .brand-copy strong { font-size: 1.05rem; }
}

@media (max-width: 940px) {
  :root { --header-h: 68px; }

  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 8px;
    background: transparent; border: 1px solid rgba(255, 255, 255, .34); border-radius: 8px; cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .22s ease, opacity .22s ease; }
  .menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .header-inner { flex-wrap: wrap; }
  .site-nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0;
    border-top: 1px solid rgba(255, 255, 255, .16); padding: .5rem 0 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav ul a {
    display: block; padding: .85rem .2rem; font-size: .84rem; letter-spacing: .08em;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .site-nav ul a:hover { border-bottom-color: var(--gold-500); }
  .header-tools { justify-content: space-between; padding-top: 1rem; }

  .hero-grid,
  .bio-layout,
  .journey-grid,
  .phil-grid,
  .legacy-grid { grid-template-columns: 1fr; }

  .hero-media { order: -1; max-width: 460px; }
  .hero-media::before { inset: 12px -12px -12px 12px; }
  .hero-text { max-width: none; }

  .legacy-media { max-width: 400px; }
  .legacy-media img { aspect-ratio: 3 / 4; }

  .cards-3 { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .links-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .brand-sub { display: none; }
  .cards-3 { grid-template-columns: 1fr; }
  .donations { grid-template-columns: 1fr 1fr; gap: 1.5rem 1.1rem; }
  .donations li:last-child { grid-column: auto; }
  .gallery-grid { grid-template-columns: 1fr; }
  .audio-band { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .hero-media::before { display: none; }
  .btn { width: 100%; text-align: center; }
  .audio-band .btn { width: auto; }
}

@media (max-width: 380px) {
  .donations { grid-template-columns: 1fr; }
  .donations li:last-child { grid-column: auto; }
}

/* ------------------------------ PRINT ------------------------------ */
@media print {
  .site-header, .menu-toggle, .lightbox, .audio-band .btn { display: none !important; }
  body { font-size: 12pt; }
  .section-feature { background: #fff; color: #000; }
  .prose-invert p, .donations figcaption { color: #000; }
  .reveal { opacity: 1; transform: none; }
}
