/* =========================================================
   DOCUMENTS — Hero library page
   Bulgaria in Interreg Knowledge Hub
   Loaded after local-hub.css
   ========================================================= */

.documents-library-page {
  background:
    radial-gradient(circle at 10% 7%, rgba(195, 229, 220, 0.42), transparent 31rem),
    radial-gradient(circle at 90% 15%, rgba(223, 240, 237, 0.76), transparent 30rem),
    linear-gradient(180deg, #fbfcf8 0%, #f8fbf7 52%, #eef8f5 100%);
}

.documents-library-page .main-nav a.is-active {
  color: #007a70;
}

.documents-library-page main {
  overflow: hidden;
}

.docs-shell {
  width: min(1480px, calc(100% - 112px));
  margin-inline: auto;
}

.docs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: #007a70;
  font-size: 0.92rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.docs-kicker::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 999px;
  background: #078f86;
  box-shadow: 0 0 0 6px rgba(7, 143, 134, 0.12);
}

/* ------------------------- HERO ------------------------- */

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 28px;
  align-items: stretch;
  padding-top: 58px;
  padding-bottom: 30px;
}

.docs-hero-main,
.docs-important {
  border: 1px solid rgba(155, 199, 196, 0.58);
  box-shadow: 0 24px 62px rgba(21, 79, 98, 0.10);
}

.docs-hero-main {
  min-height: 410px;
  display: grid;
  grid-template-columns: minmax(0, 0.97fr) minmax(350px, 0.83fr);
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.92), transparent 24rem),
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(238,248,245,0.90));
}

.docs-hero-copy {
  position: relative;
  z-index: 2;
  padding: 42px 20px 42px 46px;
  align-self: center;
}

.docs-hero-copy h1 {
  max-width: 730px;
  margin: 0 0 19px;
  color: #073466;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 3.30vw, 3.25rem);
  line-height: 0.99;
  letter-spacing: -0.048em;
}

.docs-lead {
  max-width: 720px;
  margin: 0;
  color: #28536a;
  font-size: 1.03rem;
  line-height: 1.62;
}

.docs-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.docs-hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: 0 16px;
  border: 1px solid rgba(5, 96, 143, 0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  color: #004b8d;
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(21, 79, 98, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.docs-hero-actions a:hover,
.docs-hero-actions a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 112, 0.38);
  box-shadow: 0 15px 30px rgba(21, 79, 98, 0.10);
}

.docs-hero-art {
  min-height: 410px;
  background-position: center;
  background-size: cover;
  border-left: 1px solid rgba(155, 199, 196, 0.34);
}

.docs-important {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 31px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 15%, rgba(231,247,241,0.88), transparent 17rem),
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(242,249,247,0.92));
}

.docs-important h2 {
  margin: 2px 0 14px;
  color: #073466;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.85rem;
  line-height: 1.05;
}

.docs-important p {
  margin: 0;
  color: #315d72;
  font-size: 0.98rem;
  line-height: 1.58;
}

.docs-important strong {
  display: block;
  margin-top: 23px;
  padding: 17px 18px;
  border: 1px solid rgba(226, 186, 91, 0.48);
  border-radius: 18px;
  background: rgba(255, 248, 228, 0.92);
  color: #6b4b0f;
  font-size: 0.94rem;
  line-height: 1.45;
}

/* ------------------------- ART ------------------------- */

.docs-art {
  position: relative;
  overflow: hidden;
  background-color: #edf5f2;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.docs-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(7,52,102,0.035));
}

/* The first gradient acts as a graceful fallback if an image file is not present yet. */
.docs-art--hero {
  background-image:
    linear-gradient(135deg, rgba(231,245,240,0.26), rgba(218,235,242,0.20)),
    url("../images/documents/documents-hero.webp");
}

.docs-art--programmes {
  background-image:
    linear-gradient(135deg, rgba(231,245,240,0.18), rgba(218,235,242,0.12)),
    url("../images/documents/documents-entry-programmes.webp");
}

.docs-art--types {
  background-image:
    linear-gradient(135deg, rgba(231,245,240,0.16), rgba(249,239,214,0.12)),
    url("../images/documents/documents-entry-types.webp");
}

.docs-art--control {
  background-image:
    linear-gradient(135deg, rgba(218,235,242,0.12), rgba(231,245,240,0.14)),
    url("../images/documents/documents-control.webp");
}

.docs-art--procurement {
  background-image:
    linear-gradient(135deg, rgba(239,231,246,0.11), rgba(231,245,240,0.12)),
    url("../images/documents/documents-procurement.webp");
}

.docs-art--reporting {
  background-image:
    linear-gradient(135deg, rgba(218,235,242,0.10), rgba(231,245,240,0.12)),
    url("../images/documents/documents-reporting.webp");
}

.docs-art--templates {
  background-image:
    linear-gradient(135deg, rgba(231,245,240,0.12), rgba(249,239,214,0.12)),
    url("../images/documents/documents-templates.webp");
}

.docs-art--official-programmes {
  background-image:
    linear-gradient(135deg, rgba(218,235,242,0.10), rgba(231,245,240,0.10)),
    url("../images/documents/documents-official-programmes.webp");
}

.docs-art--official-systems {
  background-image:
    linear-gradient(135deg, rgba(218,235,242,0.13), rgba(231,245,240,0.08)),
    url("../images/documents/documents-official-systems.webp");
}

.docs-art--official-national {
  background-image:
    linear-gradient(135deg, rgba(249,239,214,0.10), rgba(218,235,242,0.10)),
    url("../images/documents/documents-official-national.webp");
}

/* ------------------------- SECTIONS ------------------------- */

.docs-section {
  padding-top: 34px;
  padding-bottom: 38px;
}

.docs-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 520px);
  gap: 38px;
  align-items: end;
  margin-bottom: 23px;
}

.docs-section-head h2,
.docs-official-intro h2,
.docs-related-copy h2 {
  margin: 0;
  color: #073466;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 2.5vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.docs-section-head > p,
.docs-official-intro > p:not(.docs-kicker),
.docs-related-copy > p:not(.docs-kicker) {
  margin: 0;
  color: #315d72;
  font-size: 1rem;
  line-height: 1.56;
}

/* ------------------------- PRIMARY CARDS ------------------------- */

.docs-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.docs-primary-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(155, 199, 196, 0.58);
  border-radius: 28px;
  background: rgba(255,255,255,0.91);
  box-shadow: 0 18px 46px rgba(21, 79, 98, 0.08);
  transition: transform 0.20s ease, box-shadow 0.20s ease, border-color 0.20s ease;
}

.docs-primary-card:hover,
.docs-primary-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(0, 122, 112, 0.42);
  box-shadow: 0 26px 58px rgba(21, 79, 98, 0.13);
}

.docs-primary-art {
  height: 270px;
}

.docs-primary-body {
  padding: 25px 27px 28px;
}

.docs-card-label {
  display: inline-flex;
  margin-bottom: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 122, 112, 0.09);
  color: #007a70;
  font-size: 0.79rem;
  font-weight: 900;
}

.docs-primary-body h3,
.docs-collection-body h3,
.docs-official-body h3 {
  margin: 0 0 10px;
  color: #073466;
  line-height: 1.14;
}

.docs-primary-body h3 {
  font-size: 1.45rem;
}

.docs-primary-body p,
.docs-collection-body p,
.docs-official-body p {
  color: #315d72;
}

.docs-primary-body p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.52;
}

.docs-primary-body em,
.docs-collection-body em,
.docs-related-links em {
  display: inline-block;
  margin-top: 18px;
  color: #004b8d;
  font-style: normal;
  font-weight: 900;
}

/* ------------------------- COLLECTIONS ------------------------- */

.docs-collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.docs-collection-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(155, 199, 196, 0.56);
  border-radius: 24px;
  background: rgba(255,255,255,0.90);
  box-shadow: 0 16px 40px rgba(21, 79, 98, 0.07);
  transition: transform 0.20s ease, box-shadow 0.20s ease, border-color 0.20s ease;
}

.docs-collection-card:hover,
.docs-collection-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(0, 122, 112, 0.40);
  box-shadow: 0 24px 52px rgba(21, 79, 98, 0.12);
}

.docs-collection-art {
  height: 190px;
}

.docs-collection-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 21px 21px 23px;
}

.docs-collection-body h3 {
  font-size: 1.15rem;
}

.docs-collection-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.48;
}

.docs-collection-body em {
  margin-top: auto;
  padding-top: 17px;
  font-size: 0.9rem;
}

/* ------------------------- OFFICIAL SOURCES ------------------------- */

.docs-official {
  display: grid;
  grid-template-columns: minmax(290px, 0.78fr) minmax(0, 1.72fr);
  gap: 28px;
  align-items: stretch;
}

.docs-official-intro {
  padding: 29px;
  border: 1px solid rgba(155, 199, 196, 0.56);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255,255,255,0.94), transparent 20rem),
    linear-gradient(135deg, rgba(255,255,255,0.93), rgba(238,248,245,0.88));
  box-shadow: 0 18px 44px rgba(21,79,98,0.07);
}

.docs-official-intro h2 {
  margin-bottom: 15px;
}

.docs-text-link {
  display: inline-flex;
  margin-top: 20px;
  color: #004b8d;
  font-weight: 900;
}

.docs-official-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.docs-official-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(155, 199, 196, 0.56);
  border-radius: 24px;
  background: rgba(255,255,255,0.90);
  box-shadow: 0 16px 40px rgba(21,79,98,0.07);
  transition: transform 0.20s ease, box-shadow 0.20s ease, border-color 0.20s ease;
}

.docs-official-card:hover,
.docs-official-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(0,122,112,0.40);
  box-shadow: 0 24px 52px rgba(21,79,98,0.12);
}

.docs-official-art {
  height: 170px;
}

.docs-official-body {
  padding: 20px 20px 22px;
}

.docs-official-body h3 {
  font-size: 1.05rem;
}

.docs-official-body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* ------------------------- RELATED GUIDANCE ------------------------- */

.docs-related {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.72fr);
  gap: 28px;
  align-items: start;
}

.docs-related-copy {
  padding: 28px;
  border: 1px solid rgba(155, 199, 196, 0.56);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.93), rgba(247,244,232,0.88));
  box-shadow: 0 18px 44px rgba(21,79,98,0.07);
}

.docs-related-copy h2 {
  margin-bottom: 14px;
}

.docs-related-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.docs-related-links a {
  min-width: 0;
  min-height: 225px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(155,199,196,0.56);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 12%, rgba(231,247,241,0.72), transparent 10rem),
    rgba(255,255,255,0.91);
  box-shadow: 0 16px 40px rgba(21,79,98,0.07);
  transition: transform 0.20s ease, box-shadow 0.20s ease, border-color 0.20s ease;
}

.docs-related-links a:hover,
.docs-related-links a:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(0,122,112,0.40);
  box-shadow: 0 24px 52px rgba(21,79,98,0.12);
}

.docs-related-links strong {
  color: #073466;
  font-size: 1.06rem;
  line-height: 1.18;
}

.docs-related-links small {
  display: block;
  margin-top: 9px;
  color: #315d72;
  font-size: 0.88rem;
  line-height: 1.46;
}

.docs-related-links em {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.88rem;
}

/* ------------------------- BACK ------------------------- */

.docs-bottom-back {
  display: flex;
  justify-content: center;
  padding-top: 22px;
  padding-bottom: 60px;
}

.docs-bottom-back a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 0 20px;
  border: 1px solid rgba(5,96,143,0.24);
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  color: #004b8d;
  font-size: 0.92rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(21,79,98,0.06);
}

.docs-bottom-back a:hover,
.docs-bottom-back a:focus-visible {
  border-color: rgba(0,122,112,0.38);
  background: #ffffff;
}

/* ------------------------- RESPONSIVE ------------------------- */

@media (max-width: 1260px) {
  .docs-shell {
    width: min(1180px, calc(100% - 64px));
  }

  .docs-hero-main {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  }

  .docs-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-official,
  .docs-related {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .docs-hero {
    grid-template-columns: 1fr;
  }

  .docs-important {
    max-width: none;
  }

  .docs-section-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
  }

  .docs-official-grid,
  .docs-related-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .docs-shell {
    width: calc(100% - 40px);
  }

  .docs-hero {
    padding-top: 38px;
  }

  .docs-hero-main {
    grid-template-columns: 1fr;
  }

  .docs-hero-copy {
    padding: 32px 26px 28px;
  }

  .docs-hero-art {
    min-height: 300px;
    border-left: 0;
    border-top: 1px solid rgba(155,199,196,0.34);
  }

  .docs-primary-grid {
    grid-template-columns: 1fr;
  }

  .docs-primary-art {
    height: 240px;
  }

  .docs-official-grid,
  .docs-related-links {
    grid-template-columns: 1fr;
  }

  .docs-related-links a {
    min-height: auto;
  }
}

@media (max-width: 580px) {
  .docs-shell {
    width: calc(100% - 32px);
  }

  .docs-hero-main,
  .docs-important,
  .docs-primary-card,
  .docs-collection-card,
  .docs-official-card,
  .docs-official-intro,
  .docs-related-copy,
  .docs-related-links a {
    border-radius: 22px;
  }

  .docs-hero-copy h1 {
    font-size: clamp(2.15rem, 11vw, 3rem);
  }

  .docs-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-hero-actions a {
    width: 100%;
  }

  .docs-important {
    padding: 25px 22px;
  }

  .docs-section {
    padding-top: 27px;
    padding-bottom: 29px;
  }

  .docs-collection-grid {
    grid-template-columns: 1fr;
  }

  .docs-collection-art,
  .docs-official-art {
    height: 185px;
  }

  .docs-primary-body,
  .docs-collection-body,
  .docs-official-body,
  .docs-official-intro,
  .docs-related-copy,
  .docs-related-links a {
    padding-left: 20px;
    padding-right: 20px;
  }

  .docs-bottom-back {
    padding-bottom: 44px;
  }
}
