/* Layout for the public site.
 *
 * The prototype computed every grid from window.innerWidth in JavaScript and
 * re-rendered on resize. Server-rendered pages cannot do that, so the same
 * layouts are expressed here as media queries against the prototype's own
 * breakpoints: 700px ("narrow") and 1024px ("mobile"), plus 1200px where the
 * university grid changes column count.
 */

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 48px;
  padding-right: 48px;
}

@media (max-width: 1099px) {
  .container { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 719px) {
  .container { padding-left: 20px; padding-right: 20px; }
}

/* ── header ── */

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-divider);
}

.hdr-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
  min-width: 0;
}

@media (max-width: 1179px) { .hdr-inner { gap: 16px; } }
@media (max-width: 1023px) { .hdr-inner { gap: 12px; } }

.hdr-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: inherit;
}

/* The organiser's mark is an image, so it carries no frame of its own: the
   blueprint border that framed the old "РО" monogram would box it in. */
.hdr-mark {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: contain;
}

.hdr-title { display: flex; flex-direction: column; line-height: 1.15; }
.hdr-title b {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 16px;
  letter-spacing: 0.02em;
}
.hdr-title span {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

.hdr-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  gap: 10px 18px;
  font-size: 14.5px;
}

.navlink { color: var(--color-text); cursor: pointer; }
.navlink[aria-current="page"] { color: var(--color-accent); }

.hdr-burger { display: none; }
.hdr-menu { display: none; }

@media (max-width: 1023px) {
  .hdr-nav { display: none; }
  .hdr-burger {
    display: inline-flex;
    width: 40px;
    height: 40px;
    font-size: 18px;
    flex: 0 0 auto;
  }
  /* The menu is a checkbox target so it opens with no JavaScript at all. */
  .hdr-menu-toggle:checked ~ .hdr-menu {
    display: flex;
    flex-direction: column;
    padding: 8px 20px 16px;
    gap: 2px;
    border-top: 1px solid var(--color-divider);
  }
  .hdr-menu a {
    padding: 13px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--color-divider);
    color: var(--color-text);
  }
  .hdr-menu a[aria-current="page"] { color: var(--color-accent); }
  /* The call to action inside the menu keeps its button styling. */
  .hdr-menu .btn {
    margin-top: 14px;
    padding: 13px 20px;
    font-size: 15px;
    border-bottom: none;
    justify-content: center;
  }
}

/* On a phone the header carries the brand, the language switch and the menu
   button — nothing else fits. The registration call to action is a tap away
   inside the menu, and it also sits in the hero right below. */
@media (max-width: 767px) {
  .hdr-cta { display: none; }
  .hdr-inner { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .hdr-mark { width: 38px; height: 38px; }
  .hdr-title b { font-size: 14px; }
  .hdr-title span { font-size: 9.5px; letter-spacing: 0.12em; }
  .lang-switch { gap: 2px; }
  .lang-switch a { padding: 4px 6px; font-size: 11px; }
}

@media (max-width: 359px) {
  /* Below this the brand's second line costs more than it gives. */
  .hdr-title span { display: none; }
}

.hdr-menu-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* ── hero ── */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #F4FBFE 0%, #ffffff 55%, #EAF7FD 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 48px;
  align-items: center;
  position: relative;
}

.hero-shape-1,
.hero-shape-2 { position: absolute; }

.hero-shape-1 {
  left: -14%;
  top: -32%;
  width: 46%;
  height: 150%;
  background: var(--color-accent);
  border-radius: 0 60% 55% 0 / 0 50% 50% 0;
  opacity: .95;
}

.hero-shape-2 {
  right: -8%;
  bottom: -40%;
  width: 30%;
  height: 70%;
  background: var(--color-accent);
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  opacity: .14;
}

.hero-photo {
  position: relative;
  z-index: 2;
  padding: 48px 0;
  display: flex;
}

.hero-photo-frame {
  position: relative;
  flex: 1;
  min-height: 460px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .14);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  overflow: hidden;
}

.hero-photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* A real picture replaces the placeholder chrome: the dashed frame and its
   tint only exist to mark an empty slot. The photograph is a transparent
   cut-out, so it is shown whole and flush with the bottom of the blue band,
   which reads as standing on it rather than as an image cropped at the waist. */
.hero-photo.has-photo {
  /* The grid centres its columns; this one is stretched instead so the photo
     can meet the bottom edge of the band. */
  align-self: stretch;
  align-items: flex-end;
  padding-bottom: 0;
}

.hero-photo.has-photo .hero-photo-frame {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  border-radius: 0;
}

.hero-photo.has-photo img {
  height: auto;
  border-radius: 0;
}

.hero-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 56px 0;
}

.hero-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 72px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 0 40px;
  border-top: 1px solid var(--color-divider);
  padding-top: 20px;
}

.hero-fact { display: flex; flex-direction: column; gap: 3px; }
.hero-fact-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-800);
}
.hero-fact-value {
  font-family: var(--font-heading);
  font-size: 25px;
  color: var(--color-navy);
}

@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-photo, .hero-shape-1, .hero-shape-2 { display: none; }
  .hero-title { font-size: 58px; }
}

@media (max-width: 699px) {
  .hero-title { font-size: 44px; }
  .hero-facts { grid-template-columns: 1fr; gap: 14px; }
}

/* ── sections ── */

.section { padding-top: 56px; padding-bottom: 56px; }

.section-tinted {
  background: var(--color-neutral-100);
  border-radius: 12px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.page-head { padding-top: 44px; padding-bottom: 8px; }

.breadcrumbs {
  font-size: 12.5px;
  color: var(--color-neutral-700);
  margin-bottom: 14px;
}
.breadcrumbs a { color: inherit; }
.breadcrumbs a:hover { color: var(--color-accent); }

.page-title { margin: 0 0 10px; font-size: 48px; line-height: 1.04; }
.page-lead { margin: 0; font-size: 16px; color: var(--color-neutral-700); max-width: 640px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 56px;
}

.stack { display: flex; flex-direction: column; gap: 16px; }

.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
/* An odd card count would otherwise leave a hole in the last row. */
.cards-2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.logo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

@media (max-width: 1023px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .logo-grid { grid-template-columns: repeat(4, 1fr); }
  .page-title { font-size: 38px; }
}

@media (max-width: 699px) {
  .cards-2, .cards-3 { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 32px; }
  .section-head h2 { font-size: 28px; }
}

/* ── call to action band ── */

.cta { background: var(--color-accent); color: #ffffff; }

.cta-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}

@media (max-width: 1023px) {
  .cta-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ── tabs and chips ── */

.tabs {
  display: flex;
  border: 1px solid var(--color-divider);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  width: max-content;
  max-width: 100%;
}

/* A row of tabs that cannot shrink any further scrolls sideways rather than
   pushing the whole page wider. */
@media (max-width: 767px) {
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
}

.tab {
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text);
  background: #ffffff;
  white-space: nowrap;
}
.tab + .tab { border-left: 1px solid var(--color-divider); }
.tab:hover { background: var(--color-neutral-100); }
.tab[aria-selected="true"] { background: var(--color-accent); color: #ffffff; }
.tab[aria-selected="true"]:hover { background: var(--color-accent-600); }

.tab-big {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 24px;
  text-align: left;
}

/* The two programme days carry a date and a full title each, so side by side
   they need more width than a phone has. Stacked, both stay readable. */
@media (max-width: 767px) {
  .tabs-days {
    flex-direction: column;
    width: 100%;
    overflow-x: visible;
  }
  .tabs-days .tab {
    white-space: normal;
    width: 100%;
  }
  .tabs-days .tab + .tab {
    border-left: none;
    border-top: 1px solid var(--color-divider);
  }
  .tab-big { padding: 12px 18px; }
  .tab-big strong { font-size: 18px; }
}
.tab-big small {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: .75;
}
.tab-big strong {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 22px;
  line-height: 1.1;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-divider);
  background: #ffffff;
  color: var(--color-text);
  line-height: 1.3;
}
.chip:hover { border-color: var(--color-accent-400); }
.chip[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

/* A chip backed by a real checkbox stays keyboard-operable and works with no
   JavaScript: the input is visually hidden, the label carries the styling. */
.chip-input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-input:focus-visible + .chip { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.chip-input:checked + .chip {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

/* ── university catalogue ── */

.catalog-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding-top: 32px;
  padding-bottom: 64px;
}

.filter-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-right: 32px;
  border-right: 1px solid var(--color-divider);
  height: max-content;
}

.filter-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

/* align-items:start, not the default stretch: cards carry photos of their own
   or none at all, and a stretched short card grows a hole in the middle
   rather than simply ending sooner than its neighbour. */
/* ── venue map ── */

.venue-map { overflow: hidden; line-height: 0; }
.venue-map iframe { display: block; width: 100%; height: 340px; border: 0; }

.venue-map-placeholder {
  min-height: 340px;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px,
      color-mix(in srgb, var(--color-text) 6%, transparent) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px,
      color-mix(in srgb, var(--color-text) 6%, transparent) 39px 40px),
    #ffffff;
}

.venue-map-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-accent) 25%, transparent);
}

.uni-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* The card carries no padding of its own so a campus photograph can run to
   its edges; everything below it is padded by .unicard-body instead. */
.unicard { padding: 0; gap: 0; overflow: hidden; }

.unicard-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

.uni-photo {
  display: block;
  width: 100%;
  /* height:auto is load-bearing: the width/height attributes on the tag are
     presentational hints, and without this the 540 would win over the ratio. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-neutral-100);
}

.uni-logo {
  width: 66px;
  height: 66px;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-size: 14px;
  line-height: 1.05;
  text-align: center;
  padding: 3px;
  /* An abbreviation is meant to be a few letters, but nothing stops an editor
     from typing a phrase: let it wrap and shrink rather than be sliced. */
  overflow-wrap: anywhere;
  color: var(--color-accent-800);
  overflow: hidden;
}
.uni-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.uni-head { display: flex; gap: 16px; align-items: flex-start; }
.uni-name { font-family: var(--font-heading); font-size: 20px; line-height: 1.12; }
.uni-city {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}
.uni-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-divider);
  font-size: 12px;
  color: var(--color-neutral-700);
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.results-count { font-size: 13px; color: var(--color-neutral-700); }

@media (max-width: 1199px) {
  .uni-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
  .catalog-grid { grid-template-columns: 1fr; gap: 28px; }
  .filter-col { padding-right: 0; border-right: none; }
}

/* ── programme ── */

.program-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0 4px;
  font-size: 12.5px;
  color: var(--color-neutral-700);
}
.program-legend span:last-child { flex: 1; height: 1px; background: var(--color-divider); }

.program-row {
  display: grid;
  grid-template-columns: 120px 1fr 190px 170px;
  gap: 24px;
  align-items: start;
  padding: 18px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.program-time {
  font-family: var(--font-heading);
  font-size: 25px;
  line-height: 1;
  color: var(--color-accent-800);
}
.program-title { font-family: var(--font-heading); font-size: 21px; line-height: 1.15; }
.program-desc { font-size: 13.5px; color: var(--color-neutral-700); }
.program-place { font-size: 13.5px; }

@media (max-width: 1023px) {
  .program-row { grid-template-columns: 86px 1fr; gap: 12px 16px; }
  .program-place, .program-row .tag { grid-column: 2; }
}

/* ── news ── */

.article-wrap {
  display: grid;
  grid-template-columns: minmax(0, 720px) 1fr;
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 64px;
}

.article-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 42px;
  line-height: 1.06;
  text-wrap: pretty;
}
.article-lead { margin: 0; font-size: 19px; line-height: 1.55; color: var(--color-accent-800); }
.article-body { display: flex; flex-direction: column; gap: 16px; }
.article-body p { margin: 0; font-size: 17px; line-height: 1.68; }

@media (max-width: 1023px) {
  .article-wrap { grid-template-columns: 1fr; gap: 32px; }
  .article-title { font-size: 32px; }
}

/* ── FAQ ── */

.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }

.faq-item { background: #ffffff; overflow: hidden; }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 20px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  color: var(--color-accent-700);
  font-family: var(--font-body);
}
.faq-item[open] summary::after { content: "–"; }
.faq-answer {
  padding: 0 22px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-neutral-800);
}

/* ── forms ── */

.reg-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  padding-top: 44px;
  padding-bottom: 64px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }

@media (max-width: 1023px) {
  .reg-wrap { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 699px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-note {
  padding: 14px 16px;
  border-radius: 8px;
  background: #fdf6f5;
  border: 1px solid #f0c9c4;
  color: #b3261e;
  font-size: 14px;
}

.form-ok {
  padding: 18px;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--color-accent-800);
}

/* ── registration receipt ── */

.receipt {
  max-width: 620px;
  background: var(--color-accent);
  color: #ffffff;
  border-radius: 12px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.receipt h2 { margin: 0; font-size: 34px; line-height: 1.08; color: #ffffff; }
.receipt p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.receipt-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .28);
  font-size: 14.5px;
}
.receipt-row { display: flex; justify-content: space-between; gap: 12px; }
.receipt-row span:first-child { color: #E8F7FE; }
.receipt-code {
  font-family: var(--font-heading);
  font-size: 30px;
  letter-spacing: 0.04em;
}

/* ── footer ── */

.footer { background: var(--color-neutral-100); border-top: 1px solid var(--color-divider); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.1fr;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 32px;
}

.footer-logo { width: 132px; height: auto; margin-bottom: 4px; }

.footer-col { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.footer-heading {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--color-divider);
  font-size: 12.5px;
  color: var(--color-neutral-700);
}

@media (max-width: 1023px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 699px) { .footer-grid { grid-template-columns: 1fr; } }

/* ── language switch ── */

.lang-switch { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.lang-switch a {
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--color-neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11.5px;
}
.lang-switch a[aria-current="true"] {
  background: var(--color-accent);
  color: #ffffff;
}

/* ── misc ── */

.page { animation: fadeup .28s ease both; }

.empty-state {
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #ffffff;
  padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
  * { transition-duration: .001ms !important; }
}

/* The page is a column so the footer sits at the bottom on short pages. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}
