/*
 * Program pages (page-program.php) and the glossary (page-glossary.php).
 * Theme of the page: .pg--light / .pg--dark / .pg--cyan sets the colors through variables,
 * the layout is the same for all sections.
 */

.pg {
  --pg-bg: var(--palette-v2-bg);
  --pg-title: var(--palette-v2-t1);
  --pg-txt: var(--palette-v2-t2);
  --pg-strong: var(--palette-v2-t1);
  --pg-chip-bg: var(--palette-v2-d2);
  --pg-chip-color: var(--palette-v2-t2);
  --pg-chip-hover: var(--palette-v2-d3);
  --pg-chip-on-bg: var(--palette-v2-br);
  --pg-chip-on-color: var(--palette-v2-bg);
  --pg-icon-bg: var(--palette-v2-d3);
  --pg-icon-color: var(--palette-v2-white);
  --pg-quote-bg: #00508a;
  --pg-quote-color: var(--palette-v2-t1);
  --pg-quote-author: var(--palette-v2-t3-tint);
  background: var(--pg-bg);
}

.pg--light {
  --pg-bg: var(--palette-v2-white);
  --pg-title: var(--palette-v2-bg);
  --pg-txt: var(--palette-v2-d1);
  --pg-strong: var(--palette-v2-bg);
  --pg-chip-bg: var(--palette-v2-t3-tint);
  --pg-chip-color: var(--palette-v2-bg);
  --pg-chip-hover: var(--palette-v2-br);
  --pg-chip-on-bg: var(--palette-v2-bg);
  --pg-chip-on-color: var(--palette-v2-white);
  --pg-icon-bg: var(--palette-v2-br);
  --pg-icon-color: var(--palette-v2-bg);
  --pg-quote-bg: var(--palette-v2-t3-tint);
  --pg-quote-color: var(--palette-v2-d1);
  --pg-quote-author: var(--palette-v2-d2);
}

.pg--cyan {
  --pg-bg: var(--palette-v2-br);
  --pg-title: var(--palette-v2-bg);
  --pg-txt: var(--palette-v2-d1);
  --pg-strong: var(--palette-v2-bg);
  --pg-chip-bg: var(--palette-v2-d3);
  --pg-chip-color: var(--palette-v2-white);
  --pg-chip-hover: var(--palette-v2-d2);
  --pg-chip-on-bg: var(--palette-v2-bg);
  --pg-chip-on-color: var(--palette-v2-white);
  --pg-icon-bg: var(--palette-v2-d3);
  --pg-icon-color: var(--palette-v2-white);
  --pg-quote-bg: var(--palette-v2-t1);
  --pg-quote-color: var(--palette-v2-d1);
  --pg-quote-author: var(--palette-v2-d2);
}

.pg--cyan .section_dots span:nth-child(2) {
  background: var(--palette-v2-bg);
}

@media (min-width: 1281px) {
  .pg_sec {
    --pad: 80px;
  }
}

.pg_sec {
  background: transparent;
}

/* ---------- Chips of the program pages ---------- */

.pg_chips_wrap {
  padding-top: 56px;
}

@media (min-width: 1025px) {
  /* chips wrap in two rows, as in the mockup (row 964 wide) */
  .pg_chips_wrap .pg_chips {
    max-width: 1000px;
  }
}

.pg_chip {
  height: auto;
  min-height: 44px;
  padding: 10px 20px;
  background: var(--pg-chip-bg);
  color: var(--pg-chip-color);
  text-decoration: none;
}

.pg_chip:hover {
  background: var(--pg-chip-hover);
  color: var(--pg-chip-color);
}

.pg_chip.is-active,
.pg_chip.is-active:hover {
  background: var(--pg-chip-on-bg);
  color: var(--pg-chip-on-color);
}

/* ---------- Head ---------- */

.pg_head {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pg_icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pg-icon-bg);
  color: var(--pg-icon-color);
}

.pg_icon svg,
.pg_icon img {
  width: 30px;
  height: 30px;
}

.pg_icon svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.pg_icon svg [fill]:not([fill="none"]):not(svg) {
  fill: currentColor;
}

.pg_title,
.pg .sh_title {
  font-weight: 800;
  font-size: 44px;
  line-height: 52px;
  color: var(--pg-title);
}

.pg .sh_subtitle {
  padding-top: 0;
  font-size: 18px;
  line-height: 28px;
  color: var(--palette-v2-t3-tint);
}

/* ---------- Body ---------- */

.pg_body {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 40px;
}

.pg_top {
  display: grid;
  grid-template-columns: minmax(0, 828fr) minmax(0, 820fr);
  align-items: center;
  column-gap: 72px;
}

.pg_intro_txt {
  font-size: 26px;
  line-height: 40px;
  color: var(--pg-txt);
}

.pg--dark .pg_intro_txt {
  color: var(--palette-v2-t1);
}

.pg_photo_img {
  overflow: hidden;
  aspect-ratio: 820 / 462;
  border-radius: 24px;
  background: var(--pg-icon-bg);
}

.pg_photo_img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* quotes: one - full width, two - in two columns */
.pg_quotes {
  display: grid;
  gap: 32px 80px;
}

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

/* page without a photo (Засади): the quote comes first and is narrower */
.pg_body > .pg_quotes:first-child {
  max-width: 1386px;
}

.pg_quote {
  margin: 0;
  padding: 20px 28px 20px 33px;
  border-left: 5px solid var(--palette-v2-red-accent);
  background: linear-gradient(90deg, var(--pg-quote-bg) 0%, transparent 100%);
}

.pg_quote_txt {
  font-weight: 600;
  font-style: italic;
  font-size: 22px;
  line-height: 32px;
  color: var(--pg-quote-color);
}

.pg_quote_author {
  margin-top: 8px;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: var(--pg-quote-author);
}

.pg_cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 80px;
}

/* text from the editor: paragraphs, bold, lists, h3 / h4 */
.pg_txt {
  font-size: 18px;
  line-height: 30px;
  color: var(--pg-txt);
}

.pg_txt > * + * {
  margin-top: 16px;
}

.pg_txt p {
  margin-bottom: 0;
}

.pg_txt strong,
.pg_txt b {
  font-weight: 600;
  color: var(--pg-strong);
}

/* a paragraph that is all bold - a statement in the heading font (Figma: Nata Sans 18/26), alt_program_text() */
.pg_txt p.is-statement {
  font-family: "Nata Sans", sans-serif;
  font-size: 18px;
  line-height: 26px;
}

.pg_txt p.is-statement strong {
  font-weight: 800;
}

/* in the glossary bold lead-ins stay in the text font */
.gl_item .pg_txt p.is-statement {
  font-family: inherit;
  line-height: inherit;
}

.gl_item .pg_txt p.is-statement strong {
  font-weight: 600;
}

.pg_txt ul,
.pg_txt ol {
  margin-bottom: 0;
  padding-left: 24px;
  list-style: disc;
}

.pg_txt ol {
  list-style: decimal;
}

.pg_txt li::marker {
  color: var(--palette-v2-red-accent);
}

.pg_txt li + li {
  margin-top: 6px;
}

.pg_txt h3,
.pg_txt h4 {
  margin: 0;
  padding-top: 10px;
  font-weight: 800;
  font-size: 20px;
  line-height: 30px;
  color: var(--pg-title);
}

.pg_txt a {
  color: inherit;
  text-decoration: underline;
}

/* ---------- Glossary ---------- */

.gl_intro_txt {
  margin-top: 24px;
  color: var(--palette-v2-t1);
}

.gl_chips {
  margin-top: 40px;
}

.gl_list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
}

.gl_item {
  --pg-txt: var(--palette-v2-t2);
  --pg-strong: var(--palette-v2-t1);
  --pg-title: var(--palette-v2-t1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 32px 36px;
  border-radius: 24px;
  background: var(--palette-v2-d2);
  scroll-margin-top: 121px;
  transition: background var(--transition);
}

/* open card - light (Figma: Глосарій розгорнуто) */
.gl_item.is-open {
  --pg-txt: var(--palette-v2-bg);
  --pg-strong: var(--palette-v2-bg);
  --pg-title: var(--palette-v2-bg);
  background: var(--palette-v2-t2);
}

.gl_item_title {
  font-weight: 800;
  font-size: 28px;
  line-height: 36px;
  color: var(--pg-title);
}

.gl_item .pg_txt {
  align-self: stretch;
  line-height: 28px;
}

.gl_item_details {
  padding-top: 16px;
}

.gl_item_btn {
  height: 44px;
  margin-top: 24px;
  padding: 0 20px;
  border: 0;
  cursor: pointer;
}

/* ---------- 1024 (tablet) ---------- */

@media (max-width: 1024px) {
  .pg_chips_wrap {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .pg_title,
  .pg .sh_title {
    font-size: 38px;
    line-height: 46px;
  }

  .pg_top {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
  }

  .pg_intro_txt {
    font-size: 22px;
    line-height: 34px;
  }

  .pg_photo_img {
    aspect-ratio: 944 / 531;
  }

  .pg_quotes--many {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
  }

  .pg_quote {
    padding: 20px 24px;
  }

  .pg_quote_txt {
    font-size: 18px;
    line-height: 28px;
  }

  .pg_cols {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 48px;
  }

  .pg_txt {
    font-size: 16px;
    line-height: 26px;
  }

  .gl_item {
    padding: 28px;
  }

  .gl_item_title {
    font-size: 26px;
    line-height: 34px;
  }

  .gl_item .pg_txt {
    line-height: 26px;
  }
}

/* ---------- 600 (mobile) ---------- */

@media (max-width: 600px) {
  .pg_chips_wrap {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .pg_chips {
    gap: 12px;
  }

  .pg_head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .pg_title,
  .pg .sh_title {
    font-size: 32px;
    line-height: 40px;
  }

  .pg_body {
    gap: 24px;
    margin-top: 32px;
  }

  .pg_sh + .pg_body {
    margin-top: 24px;
  }

  .pg_top {
    row-gap: 32px;
  }

  .pg_photo_img {
    aspect-ratio: 324 / 182;
  }

  .pg_quotes--many {
    row-gap: 24px;
  }

  .pg_quote {
    padding: 18px 20px 18px 28px;
  }

  .pg_quote_txt {
    font-size: 20px;
    line-height: 30px;
  }

  .pg_quote_author {
    font-size: 15px;
    line-height: 22px;
  }

  .pg_cols {
    row-gap: 16px;
  }

  .gl_chips {
    gap: 12px;
    margin-top: 32px;
  }

  .gl_list {
    gap: 12px;
    margin-top: 32px;
  }

  .gl_item {
    padding: 24px 20px;
  }

  .gl_item_title {
    font-size: 24px;
    line-height: 32px;
  }
}
