/*
Theme Name: MGIMO Guide
Theme URI: https://guide.mgimo.ru/
Author: MGIMO Guide
Description: A lightweight custom theme for the MGIMO first-year guide.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mgimo-guide
*/

@font-face {
  font-family: "MGIMO Guide Font";
  src: url("assets/fonts/font.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "MGIMO Guide Font";
  src: url("assets/fonts/font-bold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  --ink: #292e44;
  --ink-soft: #334352;
  --paper: #fff;
  --mist: #f4f4f4;
  --muted: #8d93a1;
  --accent-red: #cd2653;
  --header-h: 60px;
  --rail-width: 20%;
  --panel-padding-y: clamp(28px, 4vw, 42px);
  --panel-padding-x: clamp(34px, 4vw, 56px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "MGIMO Guide Font", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.site-main p a,
.site-main ul a,
.site-main ol a {
  color: #0073e6;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left calc(100% - 0.08em);
  background-size: 0 1px;
  transition: background-size 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.accentColor {
  color: #0073e6;
}

li:has(a[href*="kuzmina"]) {
    display: none !important;
}

.noUnderline {
  text-decoration: none;
}

.noList,
.noList li {
  list-style: none !important;
  padding: 0 !important;
}

.noList li::before {
  display: none !important;
}

.site-main p a:hover,
.site-main ul a:hover,
.site-main ol a:hover,
.site-main p a:focus-visible,
.site-main ul a:focus-visible,
.site-main ol a:focus-visible {
  background-size: 100% 1px;
}

@media (prefers-reduced-motion: reduce) {
  .site-main p a {
    transition: none;
  }
}

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

.alignRight {
  text-align: right;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.screen-reader-text:focus {
  z-index: 1000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: #fff;
  color: #000;
}

.site-main {
  padding-top: var(--header-h);
  overflow: hidden;
}

:where([id^="section-"]) {
  scroll-margin-top: var(--header-h);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
}

.guide-rail {
  background: #ffffff;
}

.guide-panel {
  grid-column: span 6;
  min-width: 0;
  padding: var(--panel-padding-y) var(--panel-padding-x);
  color: var(--ink);
}

.borderBoxLeft {
  padding: 20px;
  background: #fff;
  border-left: 6px solid #e3e3e3;
}

.guide-panel:has(> .guide-row) {
  padding: 0;
}

.guide-panel:has(> .sectionTitle) {
  padding-bottom: 0;
}

.guide-panel > .guide-row {
  width: 100%;
  min-width: 0;
}

.guide-panel.col-100 {
  grid-column: span 12;
}

.guide-panel.col-66 {
  grid-column: span 8;
}

.guide-panel.col-50 {
  grid-column: span 6;
}

.guide-panel.col-33 {
  grid-column: span 4;
}

.guide-panel.col-25 {
  grid-column: span 3;
}

.guide-canvas {
    background: #f4f4f4;
}

.guide-grid:has(> .guide-rail + .guide-canvas) {
  grid-template-columns: var(--rail-width) calc(100% - var(--rail-width));
}

.guide-grid:has(> .guide-rail + .guide-canvas) > .guide-rail,
.guide-grid:has(> .guide-rail + .guide-canvas) > .guide-canvas {
  grid-column: auto;
  width: auto;
  min-width: 0;
  max-width: none;
}

.has-rail-reveals .guide-rail-reveal {
  opacity: 0;
  transform: translate3d(22px, 0, 0);
  transition:
    opacity 480ms ease-out,
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.has-rail-reveals .guide-rail-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .has-rail-reveals .guide-rail-reveal,
  .has-rail-reveals .guide-rail-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.guide-section:first-child > .guide-grid > .guide-panel:first-child {
  display: grid;
  align-items: center;
  justify-items: end;
  min-height: calc(100vh - var(--header-h));
  text-align: right;
}

.guide-section:first-child > .guide-grid > .guide-panel:first-child > .guide-row > .guide-grid > .guide-panel {
  display: grid;
  align-content: center;
  justify-items: end;
  min-height: calc(100vh - var(--header-h));
  padding: var(--panel-padding-y) var(--panel-padding-x);
}

.guide-section:first-child > .guide-grid > .guide-panel:last-child {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  background: url("assets/media/hero.webp") center / cover no-repeat;
  color: #fff;
}

.guide-section:first-child > .guide-grid > .guide-panel:last-child::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(41, 46, 68, 0.84);
}

.guide-section:first-child > .guide-grid > .guide-panel:last-child .guide-panel {
  padding: var(--panel-padding-y) var(--panel-padding-x);
  background: transparent;
  color: #fff;
}

.guide-section:first-child h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.chapter-intro .guide-rail {
  background: #e3e3e3;
}

.guide-section.chapter-intro > .guide-grid > .guide-panel:last-child {
  background: var(--ink-soft);
  color: #fff;
}

.guide-section.chapter-intro > .guide-grid > .guide-panel:first-child {
  display: grid;
  align-content: center;
  justify-items: end;
  height: auto;
  padding: var(--panel-padding-y) var(--panel-padding-x);
}

.guide-section.chapter-intro > .guide-grid > .guide-panel:last-child {
  display: grid;
  align-content: center;
  height: auto;
  padding: var(--panel-padding-y) var(--panel-padding-x);
  color: #fff;
}

.guide-section.chapter-intro h2 {
  margin: 0;
  font-size: 3em;
  line-height: 0.95;
  text-align: left;
}

.chapter-number {
  font-size: 78px;
  font-weight: 400;
}

.guide-en .en-inline-marker {
  display: inline-block;
  width: 10px;
  max-width: 10px;
  margin-right: 16px;
  vertical-align: middle;
}

.guide-en table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  background: #fff;
}

.guide-en th,
.guide-en td {
  padding: 12px 14px;
  border: 1px solid #d9dbe1;
  text-align: left;
  vertical-align: top;
}

.guide-en th {
  background: var(--mist);
}

.guide-en iframe {
  max-width: 100%;
}

.guide-en .guide-canvas > :first-child,
.guide-en .guide-rail > :first-child {
  margin-top: 0;
}

.guide-panel:empty {
    min-height: 190px;
    background: #ffffff;
}

.guide-row > .guide-grid:nth-child(even) > .guide-panel:first-child,
.guide-section > .guide-grid:nth-child(even) > .guide-panel:first-child {
  background: var(--mist);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.65em;
  color: inherit;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 5.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 4.5rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: clamp(1.45rem, 2vw, 2.25rem);
}

h4 {
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
}

h5 {
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
}

.guide-display-label,
.guide-person-name,
.guide-label {
  display: block;
  margin: 0 0 0.65em;
  font-weight: 700;
  line-height: 1.12;
}

.guide-display-label {
  font-size: clamp(1.8em, 2.7vw, 2em);
}

.guide-person-name,
.guide-label {
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
}

p,
ul,
ol {
  font-size: 17px;
  margin: 0 0 1.25em;
}

p.small,
.small p {
  font-size: 14px !important;
  line-height: 1.45em !important;
}

ul,
ol {
  margin: 1.25em 0;
  padding-left: 1.4em;
}

.guide-panel ul {
  padding-left: 0;
  list-style: none;
}

.guide-panel ul li {
  position: relative;
  padding-left: 20px;
}

.guide-panel ul li::before {
  content: "";
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.guide-divider {
    width: 36px;
    margin: 25px 0;
    border: 0;
    border-top: 3px solid var(--accent-red);
}

blockquote {
  margin: 1.5em 0;
  padding: 0.25em 0 0.25em 20px;
  border-left: 4px solid var(--accent-red);
}

blockquote > :last-child {
  margin: 0;
}

.hymn-chorus-ref {
  color: var(--accent-red);
}

.guide-structure-list {
    display: grid;
    gap: 18px;
}

.guide-structure-item {
  background: #fff;
  padding: 20px;
}

.guide-structure-item.highlighted {
  background: #eeeeee;
}

.guide-cafe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.guide-cafe-card {
  padding: 20px;
  background: #fff;
}

.guide-cafe-card > :last-child {
  margin-bottom: 0;
}

.guide-panel > .guide-row.guide-dorm-card {
  width: calc(100% - 40px);
  margin: 0 20px 16px;
}

.guide-dorm-card > .guide-grid {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.guide-dorm-card .guide-panel {
  grid-column: auto;
  padding: 20px 20px 20px 20px;
}

.guide-dorm-card__info {
  background: #fff;
}

.guide-dorm-card__contact {
  background: var(--ink-soft);
  color: #fff;
}

.guide-dorm-card p {
  margin: 0 0 0.25em;
}

.guide-dorm-card p:last-child {
  margin-bottom: 0;
}

.site-main .guide-dorm-card__contact p a {
  color: #fff;
}

.guide-structure-item h4 {
    margin-bottom: 0.45em;
    font-size: 18px;
    line-height: 1.35;
}

.guide-structure-item p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.55;
}

.guide-structure-item a {
  font-weight: 700;
  color: #0073e6;
}

.guide-structure-list + h3 {
  margin-top: 42px;
}

.guide-heading-small {
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
  font-weight: 700;
}

.guide-club-title {
  position: relative;
  display: block;
  margin-bottom: 20px;
  font-size: clamp(1rem, 1vw, 1.2rem);
  font-weight: 700;
  text-transform: uppercase;
  text-wrap: pretty;
  text-align: center;
}

.guide-club .guide-socials {
    position: relative;
    display: flex;
    margin: 0 auto;
    justify-content: center;
}

.guide-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  margin: 0 0 30px;
  object-fit: cover;
}

.guide-club-logo {
  max-width: 200px;
  position: relative;
  display: block;
  margin: 0 auto 30px;
}

.guide-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 30px;
}

.guide-gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 6 / 4;
  object-fit: cover;
}

.guide-gallery--studsouz {
  gap: 30px;
  margin-top: 30px;
}

.guide-gallery--studsouz img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.guide-gallery--volunteers {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr) minmax(0, 1.333fr) minmax(0, 1.5fr);
  align-items: center;
  gap: 30px;
  margin-bottom: 0;
}

.guide-gallery--volunteers img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.guide-gallery--volunteers-three {
  grid-template-columns: minmax(0, 1.333fr) minmax(0, 1.41fr) minmax(0, 0.749fr);
}

.guide-gallery--three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.guide-gallery--three-column img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.guide-key-event-card__media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-key-event-card__media .guide-image {
  height: auto;
  margin: 0;
}

.guide-panel:has(> .guide-gallery--volunteers) {
  padding-bottom: 0;
}

.guide-row:has(.guide-gallery--volunteers) + .guide-row > .guide-grid > .guide-panel {
  padding-top: 20px;
}

.guide-button {
  display: inline-flex;
  padding: 12px 22px;
  border: 1px solid currentColor;
  text-decoration: none;
}

.error-404 > .guide-grid > .guide-rail {
  padding: var(--panel-padding-y) var(--panel-padding-x);
}

.error-404-code {
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 700;
  line-height: 1;
}

.error-404-label {
  font-weight: 700;
  text-transform: uppercase;
}

.error-404 .guide-button {
  color: #fff;
}

.guide-socials {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.guide-socials:has(> a:nth-child(2)) {
  padding: 10px 12px;
  border-radius: 20px;
  background: #f4f4f4;
}

.guide-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  text-decoration: none;
  transition: color 160ms ease;
}

.guide-socials a:hover,
.guide-socials a:focus-visible {
  color: var(--ink);
}

.guide-link-icon {
  display: block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: url("assets/icons/icon_link.svg") center / contain no-repeat;
  mask: url("assets/icons/icon_link.svg") center / contain no-repeat;
}

.guide-link-icon--vk {
  -webkit-mask-image: url("assets/icons/icon_vk.svg");
  mask-image: url("assets/icons/icon_vk.svg");
}

.guide-link-icon--telegram {
  -webkit-mask-image: url("assets/icons/icon_telegram.svg");
  mask-image: url("assets/icons/icon_telegram.svg");
}

.guide-link-icon--max {
  -webkit-mask-image: url("assets/icons/icon_max.svg");
  mask-image: url("assets/icons/icon_max.svg");
}

.guide-link-icon--instagram {
  -webkit-mask-image: url("assets/icons/icon_instagram.svg");
  mask-image: url("assets/icons/icon_instagram.svg");
}

.guide-link-icon--rutube {
  -webkit-mask-image: url("assets/icons/icon_rutube.svg");
  mask-image: url("assets/icons/icon_rutube.svg");
}

.guide-link-icon--youtube {
  -webkit-mask-image: url("assets/icons/icon_youtube.svg");
  mask-image: url("assets/icons/icon_youtube.svg");
}

.site-footer {
  padding: 25px 5vw;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  :root {
    --panel-padding-y: 42px;
    --panel-padding-x: 26px;
  }

  .guide-grid,
  .guide-grid:has(> .guide-rail + .guide-canvas) {
    display: block;
  }

  .guide-panel {
    width: 100%;
    min-height: 0;
    padding: var(--panel-padding-y) var(--panel-padding-x);
  }

  .guide-panel:has(> .guide-row) {
    padding: 0;
  }

  .guide-panel:empty {
    display: none;
  }

  .guide-section:first-child > .guide-grid > .guide-panel:first-child,
  .guide-section:first-child > .guide-grid > .guide-panel:last-child {
    width: 100%;
    min-height: 0;
  }

  .guide-section.chapter-intro > .guide-grid > .guide-panel:first-child,
  .guide-section.chapter-intro > .guide-grid > .guide-panel:last-child {
    width: 100%;
    height: auto;
  }

  .guide-grid > .guide-rail,
  .guide-grid > .guide-canvas {
    width: 100%;
    min-width: 0;
  }

  .guide-section:first-child > .guide-grid > .guide-panel:first-child {
    min-height: 210px;
    justify-items: start;
    text-align: left;
  }

  .guide-section:first-child > .guide-grid > .guide-panel:first-child > .guide-row > .guide-grid > .guide-panel {
    min-height: 210px;
    padding: var(--panel-padding-y) var(--panel-padding-x);
    justify-items: start;
  }

  .guide-section:first-child > .guide-grid > .guide-panel:last-child {
    min-height: 0;
  }

  .guide-section.chapter-intro > .guide-grid > .guide-panel:first-child {
    height: auto;
    justify-items: start;
  }

  .guide-section.chapter-intro h2 {
    text-align: left;
  }

  .guide-gallery--studsouz {
    gap: 10px;
  }

  .guide-gallery--volunteers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
  }

  .guide-gallery--three-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-cafe-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .guide-gallery {
    grid-template-columns: 1fr;
  }

  .guide-gallery img {
    height: auto;
    max-height: 420px;
  }
}
