/* baribg.org – нов дизайн 30.11.2026. Цветове от логото на БАРИ. */
:root {
  --green: #58c792;
  --green-dark: #2f9e69;
  --sea: #5c9f98;
  --teal: #3a6c73;
  --teal-dark: #23474d;
  --navy: #2c5887;
  --sun: #ffc600;
  --ink: #1e2d31;
  --muted: #5d6e72;
  --line: #e3ebe9;
  --bg-soft: #f3f8f6;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 50, 55, .10);
  --font: 'Manrope', 'Segoe UI', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
  /* Chrome слага българските (ръкописни) форми на д, в, т при lang="bg" – държим стандартните */
  font-feature-settings: "locl" 0;
}
img { max-width: 100%; height: auto; }
a { color: var(--navy); }
a:hover { color: var(--teal); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--sun); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s, border-color .2s;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(20, 50, 55, .10); border-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.brand { display: block; flex: 0 0 auto; line-height: 0; }
.brand img { width: 190px; height: auto; }

.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a {
  display: block; padding: 10px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15.5px;
  transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--teal); }
.main-nav a.is-active { background: var(--teal); color: var(--white); }
.lang-switch a {
  display: inline-block; padding: 7px 14px; border: 2px solid var(--green); border-radius: 999px;
  color: var(--green-dark); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-decoration: none;
}
.lang-switch a:hover { background: var(--green); color: var(--white); }

.nav-toggle {
  display: none; align-items: center; gap: 10px;
  background: var(--teal); color: var(--white); border: 0; border-radius: 999px;
  padding: 10px 16px; font: 700 15px var(--font); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s, background .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: 16px;
  text-decoration: none; transition: transform .15s, background .15s, color .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 8px 20px rgba(255, 198, 0, .35); }
.btn-sun:hover { color: var(--ink); background: #ffd43a; }
.btn-ghost { border: 2px solid rgba(255, 255, 255, .85); color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--teal-dark); }
.link-arrow { font-weight: 700; color: var(--teal); text-decoration: none; }
.link-arrow::after { content: ' \2192'; transition: margin .15s; }
.link-arrow:hover::after { margin-left: 4px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: var(--white); background: var(--teal-dark); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(25, 58, 64, .92) 0%, rgba(35, 71, 77, .78) 45%, rgba(35, 71, 77, .35) 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  padding-top: 96px; padding-bottom: 96px; min-height: 560px;
}
.hero-kicker {
  display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px;
  background: rgba(88, 199, 146, .22); color: #c9f2dd; font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.hero-title, .hero-title p { font-size: clamp(30px, 4.2vw, 52px); font-weight: 800; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
.hero-title span { font: inherit !important; color: inherit !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.hero-news { display: grid; gap: 16px; }
.hero-news-label { margin: 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--sun); }
.hero-card {
  background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
}
.hero-card time { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.hero-card h2 { font-size: 18px; margin-bottom: 8px; }
.hero-card h2 a { color: var(--ink); text-decoration: none; }
.hero-card h2 a:hover { color: var(--teal); }
.hero-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 96px 0; scroll-margin-top: 90px; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.kicker { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--green-dark); }
.section-title { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; color: var(--teal-dark); letter-spacing: -.01em; }

/* текстът от админа носи стари вградени шрифтове/размери/цветове – изравняваме ги */
.prose { font-size: 17px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.prose span, .prose font, .prose p, .prose li, .prose td, .prose div { font-family: inherit !important; font-size: inherit !important; line-height: inherit !important; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 30px; margin-bottom: .55em; text-align: left !important; }
.prose ul li::before {
  content: ''; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 4px rgba(88, 199, 146, .2);
}
.prose ol { padding-left: 1.3em; }
.prose strong, .prose b { color: var(--teal-dark); }
.prose img { border-radius: 12px; height: auto !important; }
.prose table { max-width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose iframe { max-width: 100%; }
.prose a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

/* about */
.section-about { background: var(--white); }
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: 64px; align-items: start; }
.about-side { position: sticky; top: 110px; }
.about-photo { margin: 24px 0 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); line-height: 0; }
.about-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.about-card {
  margin-top: -40px; margin-left: 20px; margin-right: 20px; position: relative;
  background: var(--teal); color: var(--white); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow);
}
.about-card strong { display: block; font-size: 16px; line-height: 1.35; margin-bottom: 6px; }
.about-card span { display: block; font-size: 14px; line-height: 1.5; color: #d6ecea; }
.about-text { padding-top: 8px; }
.about-text > p:first-child { font-size: 20px; line-height: 1.6; color: var(--teal-dark); }

/* projects */
.section-projects { background: var(--bg-soft); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 28px; }
.project-card {
  display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.project-logo { display: flex; align-items: center; justify-content: center; height: 190px; padding: 24px; background: #fff; border-bottom: 1px solid var(--line); }
.project-logo img { max-height: 140px; width: auto; object-fit: contain; }
.project-body { padding: 26px 28px 30px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 21px; color: var(--teal-dark); }
.project-text { font-size: 16px; }
.project-text.is-collapsed { max-height: 260px; overflow: hidden; position: relative; }
.project-text.is-collapsed::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.btn-more {
  align-self: flex-start; margin-top: 14px; padding: 10px 20px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--teal); background: transparent; color: var(--teal); font: 700 15px var(--font);
}
.btn-more:hover { background: var(--teal); color: var(--white); }
.btn-more[hidden] { display: none; }

/* news */
.section-news { background: var(--white); }
.news-grid { display: grid; grid-template-columns: 400px 1fr; gap: 40px; align-items: start; }
.news-list { display: grid; gap: 16px; transition: opacity .2s; }
.news-item {
  padding: 20px 22px; border-radius: 14px; background: var(--bg-soft); border: 2px solid transparent;
  transition: border-color .15s, background .15s, transform .15s;
}
.news-item:hover { transform: translateX(3px); }
.news-item.is-active { background: var(--white); border-color: var(--green); box-shadow: var(--shadow); }
.news-item time, .news-reader time { display: block; font-size: 13px; font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.news-item h3 { font-size: 17px; margin-bottom: 6px; }
.news-item h3 a { color: var(--ink); text-decoration: none; }
.news-item h3 a::after { content: ''; position: absolute; inset: 0; }
.news-item { position: relative; }
.news-item h3 a:hover { color: var(--teal); }
.news-item p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

.news-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.news-pager a {
  min-width: 40px; height: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--bg-soft); color: var(--ink); font-weight: 700; text-decoration: none; font-size: 15px;
}
.news-pager a:hover { background: var(--line); }
.news-pager a.is-active { background: var(--teal); color: var(--white); }
.news-pager a.pager-arrow { font-size: 22px; line-height: 1; }
.news-pager a.is-disabled { opacity: .35; pointer-events: none; }

.news-reader {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 40px; box-shadow: var(--shadow); min-height: 300px; transition: opacity .2s; outline: none;
}
.news-reader > h3 { font-size: clamp(22px, 2.2vw, 28px); color: var(--teal-dark); margin-bottom: 18px; }
.news-reader.is-collapsed { max-height: 720px; overflow: hidden; position: relative; }
.news-reader.is-collapsed::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 85%);
}
.news-more { margin-top: 16px; }
.is-loading { opacity: .45; pointer-events: none; }

/* partners */
.section-partners { background: var(--bg-soft); }
.partner-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.partner {
  height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 22px 16px; background: var(--white); border-radius: 14px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); transition: transform .15s, box-shadow .15s;
}
a.partner:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--teal); }
.partner-logo { height: 90px; display: flex; align-items: center; justify-content: center; }
.partner-logo img { max-height: 90px; max-width: 150px; object-fit: contain; filter: grayscale(.35); transition: filter .2s; }
a.partner:hover .partner-logo img { filter: none; }
.partner-name { font-size: 14px; font-weight: 700; line-height: 1.35; }

/* contacts */
.section-contacts { background: var(--teal-dark); color: #e7f2f0; }
.section-contacts .kicker { color: var(--green); }
.section-contacts .section-title { color: var(--white); }
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.contacts-prose { color: #e7f2f0; font-size: 18px; }
.contacts-prose span, .contacts-prose .black { color: #9fd9bf !important; text-decoration: none !important; font-weight: 700; }
.contacts-prose a { color: var(--sun); }
.contacts-prose strong { color: var(--white); }
.contacts-map { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); line-height: 0; background: #fff; }
.contacts-map img { width: 100%; }

/* footer */
.site-footer { background: #17333a; color: #a9c4c0; font-size: 14.5px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.footer-brand strong { display: block; color: var(--white); font-size: 15px; }
.footer-copy { margin: 0; }
.footer-copy a { color: var(--white); }
.to-top {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: var(--white); font-size: 20px; font-weight: 800; text-decoration: none;
}
.to-top:hover { background: var(--sun); color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .main-nav a { padding: 9px 10px; font-size: 15px; }
  .about-grid { grid-template-columns: 320px 1fr; gap: 44px; }
}
@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 10px;
    background: var(--white); padding: 12px 24px 22px; box-shadow: 0 18px 30px rgba(20, 50, 55, .15);
    display: none;
  }
  .nav-open .main-nav { display: flex; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { padding: 12px 14px; border-radius: 10px; font-size: 17px; }
  .lang-switch { padding: 4px 14px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding-top: 64px; padding-bottom: 64px; min-height: 0; }
  .hero::after { background: linear-gradient(180deg, rgba(25, 58, 64, .9) 0%, rgba(35, 71, 77, .82) 100%); }
  .about-grid, .news-grid, .contacts-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-side { position: static; }
  .about-photo img { aspect-ratio: 16 / 7; }
  .section { padding: 72px 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .header-inner { min-height: 70px; }
  .brand img { width: 150px; }
  .nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .main-nav { padding: 10px 16px 18px; }
  .hero-inner { padding-top: 44px; padding-bottom: 48px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-card { padding: 18px 18px; }
  .section { padding: 56px 0; scroll-margin-top: 76px; }
  .section-head { margin-bottom: 28px; }
  .prose { font-size: 16px; }
  .about-text > p:first-child { font-size: 18px; }
  .project-logo { height: 150px; }
  .project-body { padding: 22px 20px 24px; }
  .news-reader { padding: 24px 20px; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .partner { padding: 16px 10px; }
  .partner-logo { height: 70px; }
  .partner-logo img { max-height: 70px; max-width: 120px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* grid items must be allowed to shrink below the width of wide tables/images in the news text */
.hero-inner > *, .about-grid > *, .news-grid > *, .contacts-grid > *, .project-grid > * { min-width: 0; }
