:root {
  --uz-blue: #223d71;
  --uz-blue-dark: #172b52;
  --uz-link: #4f7ca6;
  --uz-soft: #eff3f7;
  --uz-bg: #fafbfc;
  --uz-border: #c1d2e2;
  --uz-border-neutral: #dfe3e7;
  --uz-text: #2f3337;
  --uz-muted: #5a6470;
  --uz-white: #ffffff;
  --uz-focus: #d97706;
  --uz-max: 1170px;
  --uz-radius: 8px;
  --uz-shadow: 0 8px 24px rgba(34, 61, 113, 0.09);
  --uz-font: "Lato", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --uz-font-heading: "Karla", "Lato", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  scroll-behavior: smooth;
  scroll-padding-top: 124px;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  color: var(--uz-text);
  background: var(--uz-bg);
  font-family: var(--uz-font);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--uz-blue);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--uz-blue-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--uz-focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border: 2px solid var(--uz-blue);
  border-radius: 4px;
  color: var(--uz-blue);
  background: var(--uz-white);
  font-weight: 700;
  box-shadow: var(--uz-shadow);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell-container {
  width: min(calc(100% - 36px), var(--uz-max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  border-bottom: 1px solid var(--uz-border);
  background: var(--uz-white);
  box-shadow: 0 2px 12px rgba(34, 61, 113, 0.06);
}

.brand-panel {
  background: var(--uz-white);
}

.brand-row {
  min-height: 79px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

.institutional-logos {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.institutional-logos img {
  display: block;
  width: auto;
  object-fit: contain;
}

.institutional-logos .logo-unizar {
  height: 58px;
}

.institutional-logos .logo-bifi {
  height: 62px;
}

.site-heading {
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid var(--uz-border);
}

.site-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--uz-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-title {
  display: block;
  margin: 0;
  color: var(--uz-blue);
  font-family: var(--uz-font-heading);
  font-size: clamp(1.1rem, 1.8vw, 1.48rem);
  font-weight: 800;
  line-height: 1.15;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--uz-border);
  border-radius: 4px;
  color: var(--uz-blue);
  background: var(--uz-white);
  font-weight: 800;
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  width: 22px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -7px;
}

.nav-toggle-icon::after {
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.primary-nav {
  color: var(--uz-white);
  background: var(--uz-blue);
}

.primary-nav-list {
  min-height: 41px;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav-list li {
  display: flex;
}

.primary-nav-list a {
  min-height: 41px;
  display: flex;
  align-items: center;
  padding: 6px 16px;
  border-bottom: 3px solid transparent;
  color: var(--uz-white);
  font-weight: 700;
  text-decoration: none;
}

.primary-nav-list a:hover,
.primary-nav-list a[aria-current="page"],
.primary-nav-list a[aria-current="location"] {
  border-bottom-color: var(--uz-white);
  color: var(--uz-white);
  background: rgba(255, 255, 255, 0.1);
}

.primary-nav-list a:focus-visible {
  outline-color: var(--uz-white);
  outline-offset: -5px;
}

.site-footer {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.9);
  background: var(--uz-blue);
}

.footer-main {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 24px;
}

.footer-brand {
  font-family: var(--uz-font-heading);
  font-weight: 800;
}

.footer-meta {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--uz-white);
}

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

@media (max-width: 900px) {
  html {
    scroll-padding-top: 115px;
  }

  .brand-row {
    min-height: 70px;
  }

  .site-identity {
    gap: 15px;
  }

  .institutional-logos {
    gap: 10px;
  }

  .institutional-logos .logo-unizar {
    height: 47px;
  }

  .institutional-logos .logo-bifi {
    height: 48px;
  }

  .site-heading {
    padding-left: 15px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 76px;
  }

  .shell-container {
    width: min(calc(100% - 28px), var(--uz-max));
  }

  .brand-row {
    min-height: 65px;
    gap: 12px;
  }

  .site-identity {
    gap: 10px;
  }

  .institutional-logos .logo-unizar {
    height: 42px;
  }

  .institutional-logos .logo-bifi {
    height: 41px;
  }

  .site-heading {
    padding-left: 10px;
  }

  .site-kicker {
    display: none;
  }

  .site-title {
    font-size: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .nav-toggle-label {
    display: none;
  }

  .primary-nav-list {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-block: 6px;
  }

  .primary-nav-list li {
    display: block;
  }

  .primary-nav-list a {
    min-height: 46px;
    padding-inline: 18px;
    border-bottom: 0;
    border-left: 4px solid transparent;
  }

  .primary-nav-list a:hover,
  .primary-nav-list a[aria-current="page"],
  .primary-nav-list a[aria-current="location"] {
    border-bottom-color: transparent;
    border-left-color: var(--uz-white);
  }

  .footer-main,
  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    gap: 10px;
  }
}

@media (max-width: 540px) {
  .institutional-logos .logo-bifi {
    display: none;
  }

  .site-heading {
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
