/* CMS page shells — list layout with link grid (e.g. /admission/). */

/* theme-default uses overflow-x:hidden on html/body, which breaks position:sticky. */
html:has(.pg-layout),
body.nu-site:has(.pg-layout) {
  overflow-x: clip;
}

.pg-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
  padding-bottom: 56px;
}

.nu-main .pg-page-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.22;
  max-width: 1000px;
  text-wrap: balance;
  margin: 0 0 28px;
  text-align: left;
}

.pg-section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin: 28px 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pg-section-title:first-child,
.pg-content-title + .pg-section-title,
.pg-banner-img + .pg-section-title {
  margin-top: 0;
}

.pg-section-title + .pg-linkgrid {
  margin-bottom: 8px;
}

.pg-banner-img {
  display: block;
  width: 100%;
  border-radius: var(--r);
  margin: 0 0 28px;
}

.pg-section-title .bar,
.pg-prose-h .bar {
  width: 30px;
  height: 3px;
  background: var(--cyan);
  border-radius: 2px;
  flex: 0 0 auto;
}

.pg-prose-h .bar {
  width: 26px;
  transform: translateY(-5px);
}

/* ---------- institute home: banner ---------- */
.pg-banner {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: flex-end;
  min-height: 300px;
  margin: 0;
  background: linear-gradient(135deg, var(--navy-80) 0%, var(--navy) 100%);
}

.pg-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pg-banner-cap {
  position: relative;
  z-index: 2;
  padding: 18px 22px;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(transparent, rgba(0, 58, 93, 0.72));
}

.pg-banner--video {
  min-height: 0;
  display: block;
  background: var(--navy);
}

.pg-banner--video .embed-responsive {
  margin: 0 !important;
  border-radius: 0;
}

/* ---------- institute home: prose + contacts ---------- */
.pg-firstgrid {
  display: grid;
  grid-template-columns: 1fr 326px;
  gap: 36px;
  margin-top: 30px;
  align-items: start;
}

.pg-firstgrid--contacts-only {
  grid-template-columns: minmax(0, 420px);
}

.pg-prose {
  display: grid;
  gap: 26px;
}

.pg-prose-h {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 9px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pg-prose p {
  margin: 0;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink);
  text-wrap: pretty;
}

.pg-prose p + p {
  margin-top: 12px;
}

.pg-wikilink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--cyan);
  font-size: 14px;
  margin-top: 10px;
  transition: gap 0.15s;
  text-decoration: none;
}

.pg-wikilink:hover {
  gap: 10px;
  color: var(--cyan);
  text-decoration: none;
}

.pg-wikilink svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pg-contacts {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #fff;
}

.pg-contacts-head {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 13px 18px;
}

.pg-contacts-body {
  padding: 4px 18px 12px;
}

.pg-cline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}

.pg-cline:last-child {
  border-bottom: 0;
}

.pg-cline .ic {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--navy-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

.pg-cline .ic svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pg-cline .lbl {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-2);
  font-weight: 600;
}

.pg-cline .val {
  display: block;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

a.pg-cline .val:hover,
.pg-cline a.val:hover {
  color: var(--cyan);
  text-decoration: none;
}

.pg-social {
  display: flex;
  gap: 9px;
  padding: 14px 18px;
  background: var(--navy-tint-2);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pg-social a {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: 0.16s;
  text-decoration: none;
  line-height: 1;
}

.pg-social a:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  transform: translateY(-2px);
  text-decoration: none;
}

.pg-social a i {
  font-size: 15px;
  width: 1em;
  text-align: center;
  line-height: 1;
}

.pg-social a .fa-facebook-f {
  font-size: 16px;
  position: relative;
  top: 0.5px;
}

.pg-social a .fa-wikipedia-w {
  font-size: 14px;
}

.pg-linkgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.pg-linkgrid--after-content {
  margin-top: 28px;
}

.pg-content > .pg-prose,
.pg-content > .pg-body {
  margin-bottom: 8px;
}

/* Rich CMS HTML — normal flow (not grid; grid breaks centered tables/embeds). */
.pg-body {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.62;
}

.pg-body > *:first-child {
  margin-top: 0;
}

.pg-body > *:last-child {
  margin-bottom: 0;
}

.pg-body :is(p, ul, ol) {
  margin: 0 0 1em;
}

.pg-body img {
  max-width: 100%;
  height: auto;
}

.pg-body .table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

/* Neutralize TinyMCE/inline “card” wrappers so site table styles can apply cleanly. */
.pg-body > div:has(> table) {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 0 24px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow-x: auto;
  font-family: inherit !important;
}

.pg-lcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 120px;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  text-decoration: none;
  color: inherit;
}

.pg-lcard::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
  z-index: 2;
}

.pg-lcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(0, 58, 93, 0.13);
  border-color: transparent;
  text-decoration: none;
  color: inherit;
}

.pg-lcard:hover::before {
  transform: scaleX(1);
}

.pg-lcard--media {
  padding-top: 0;
  gap: 16px;
}

.pg-lcard .img {
  display: block;
  margin: 0 -20px 0;
  aspect-ratio: 16 / 9;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.pg-lcard .img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 16px 20px;
  box-sizing: border-box;
}

/* People lists (проректори, etc.): 2-up with large portrait photos */
.pg-lcard--person {
  min-height: 0;
  gap: 14px;
  padding-bottom: 18px;
}

.pg-lcard--person .img {
  aspect-ratio: 4 / 5;
  background: var(--navy);
  border-bottom: 0;
}

.pg-lcard--person .img img {
  object-fit: cover;
  object-position: center top;
  padding: 0;
}

.pg-lcard--person .t {
  font-size: 20px;
  padding: 0 2px;
}

.pg-lcard--person .d {
  padding: 0 2px;
  font-size: 14px;
  line-height: 1.45;
}

.pg-lcard .t {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
  text-wrap: balance;
}

.pg-lcard .d {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--gray);
  margin-top: -4px;
}

.pg-content-end {
  margin-top: 28px;
}

.nu-main .pg-content-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.22;
  margin: 0 0 28px;
  text-wrap: balance;
}

/* News cards / detail inside page shell (department blog). */
.pg-content > .nl-title {
  margin-top: 0;
}

.pg-content > .nl-list,
.pg-content > .nl-empty {
  margin-top: 0;
}

.pg-content .nw-title {
  font-size: 34px;
}

/* ---------- filter forms (catalogs) ---------- */
.pg-filter {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 22px 22px 18px;
  margin: 0 0 28px;
}

.pg-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.pg-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  min-width: 0;
}

.pg-field--span2 {
  grid-column: 1 / -1;
}

.pg-field .lbl {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-2);
}

.pg-field select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23003A5D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 38px 11px 14px;
  line-height: 1.3;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pg-field select:hover {
  border-color: var(--gray);
}

.pg-field select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(255, 82, 0, 0.18);
}

.pg-filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.pg-btn:hover {
  background: var(--cyan);
  color: #fff;
}

.pg-resultlist {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #fff;
}

.pg-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.pg-result:last-child {
  border-bottom: 0;
}

.pg-result:hover {
  background: var(--navy-tint-2);
  text-decoration: none;
  color: inherit;
}

.pg-result-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pg-result-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

.pg-result:hover .pg-result-title {
  color: var(--cyan);
}

.pg-result-meta {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.4;
}

.pg-result-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--navy);
  background: var(--navy-tint);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

.pg-empty {
  margin: 0;
  padding: 10px 0px;
  color: var(--gray-2);
  font-size: 14.5px;
}

@media (max-width: 1180px) {
  .pg-linkgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .pg-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .pg-layout > .pg-content {
    order: 1;
  }

  .pg-layout > .pg-side {
    order: 2;
  }
}

@media (max-width: 820px) {
  .pg-firstgrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .nu-main .pg-page-title,
  .nu-main .pg-content-title {
    font-size: 24px;
  }

  .pg-linkgrid {
    grid-template-columns: 1fr;
  }

  .pg-lcard {
    min-height: 0;
  }

  .pg-banner {
    min-height: 220px;
  }

  .pg-filter {
    padding: 18px 16px 14px;
  }

  .pg-filter-grid {
    grid-template-columns: 1fr;
  }

  .pg-field--span2 {
    grid-column: auto;
  }

  .pg-filter-actions {
    justify-content: stretch;
  }

  .pg-btn {
    width: 100%;
  }

  .pg-result {
    flex-direction: column;
    gap: 10px;
  }
}
