@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

:root {
  /* ── Base ── */
  --bg:             #ffffff;
  --bg-alt:         #f7f5f2;

  /* ── LADA Brand (warm rust) ── */
  --primary:        #3a1e0e;
  --primary-mid:    #6a3318;
  --accent:         #b84c28;
  --accent-light:   #f6ede7;

  /* ── Text ── */
  --text:           #1a1614;
  --text-mid:       #3d3835;
  --text-light:     #726963;

  /* ── Borders ── */
  --border:         #ddd9d3;
  --border-light:   #edeae5;
  --white:          #ffffff;

  /* ── Chrome ── */
  --topbar-bg:      #1e1008;
  --nav-bg:         #2e1408;
  --footer-bg:      #180e06;

  /* ── Typography ── */
  --font-serif:     'Lora', Georgia, serif;
  --font-sans:      'Source Sans 3', system-ui, sans-serif;

  /* ── Layout ── */
  --max-w:          1100px;
  --topbar-h:       34px;
  --header-h:       72px;
  --navbar-h:       44px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════
   INSTITUTIONAL TOP BAR
   ══════════════════════════════════════════ */
#site-topbar {
  background: var(--topbar-bg);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid #2e1a0c;
}

.topbar-inner {
  width: 100%;
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.topbar-crumb {
  font-size: 0.7rem;
  color: #7a6050;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar-crumb a { color: #7a6050; text-decoration: none; transition: color 0.15s; }
.topbar-crumb a:hover { color: #b8906a; }
.topbar-crumb .sep { color: #4a3020; }

/* ══════════════════════════════════════════
   SITE HEADER  (logo + title + badge)
   ══════════════════════════════════════════ */
#site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-inner {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.header-lada {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--white);
  background: var(--primary);
  letter-spacing: 0.06em;
  text-decoration: none;
  line-height: 1;
  padding: 0.3rem 0.7rem 0.35rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.header-title-main {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-title-sub {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 400;
}

.header-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ub-logo {
  height: 28px;
  width: auto;
  display: block;
  opacity: 0.85;
}

.header-dept {
  font-size: 0.67rem;
  color: var(--text-light);
  text-align: right;
  line-height: 1.4;
  max-width: 210px;
}

/* ══════════════════════════════════════════
   HORIZONTAL NAV BAR
   ══════════════════════════════════════════ */
#site-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid #1a0a04;
  flex-shrink: 0;
  position: relative;
}

.navbar-inner {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: var(--navbar-h);
}

/* Nav links list */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}
.nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}

/* Praktikum CTA */
.nav-links a.nav-cta {
  color: #f4c49a;
  border: 1px solid rgba(244,196,154,0.35);
  margin-left: 0.5rem;
}
.nav-links a.nav-cta:hover {
  background: rgba(244,196,154,0.15);
  border-color: rgba(244,196,154,0.6);
  color: #f9d8b4;
}
.nav-links a.nav-cta.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* Hamburger button – hidden on desktop */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  border-radius: 3px;
  transition: background 0.15s;
  margin-left: auto;
}
#nav-toggle:hover { background: rgba(255,255,255,0.1); }
#nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.18s ease, width 0.18s ease;
  transform-origin: center;
}

/* X when open */
#site-nav.open #nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#site-nav.open #nav-toggle span:nth-child(2) { opacity: 0; width: 0; }
#site-nav.open #nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════════════ */
.page-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── HOME HERO ── */
.home-hero {
  background: var(--primary);
  padding: 3.5rem 0 3rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.home-hero::after {
  content: 'LADA';
  position: absolute;
  right: -0.04em;
  bottom: -0.12em;
  font-family: var(--font-serif);
  font-size: clamp(7rem, 16vw, 13rem);
  font-weight: 600;
  color: rgba(255,255,255, 0.05);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.home-hero-inner {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}
.home-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 700px;
}
.home-hero p {
  font-size: 1rem;
  color: rgba(255,255,255, 0.88);
  font-weight: 300;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  max-width: 560px;
}
.hero-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255, 0.55);
  flex-wrap: wrap;
}

/* ── PAGE HEADER (interior pages) ── */
.page-header {
  background: var(--bg-alt);
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
}
.page-header-inner {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.25;
}
.page-header p {
  font-size: 0.97rem;
  color: var(--text-mid);
  max-width: 580px;
  font-weight: 300;
}

/* ── MAIN ── */
main {
  flex: 1;
  padding: 2.5rem 2rem 3rem;
  max-width: calc(var(--max-w) + 4rem);
  width: 100%;
  align-self: center;
  box-sizing: border-box;
}

/* ── CONTAINER ── */
.container {
  max-width: var(--max-w);
}

/* ── SECTION TITLES ── */
.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
h2.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
h3.subsection {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-mid);
  margin: 2rem 0 0.5rem;
}

p + p { margin-top: 0.75rem; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: currentColor; }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.4rem 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,0.07);
  border-color: #ccc8c2;
}
.card-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  background: var(--primary-mid);
  display: inline-block;
  padding: 0.16rem 0.52rem;
  border-radius: 2px;
  margin-bottom: 0.6rem;
}
.card h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
  line-height: 1.4;
}
.card p {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.65;
}
.card-status {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-status.active   { color: #3a7d44; }
.card-status.completed { color: var(--text-light); }

/* ── TWO-COL (home page right sidebar) ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

/* ── SIDEBAR BOXES (right column on home) ── */
.sidebar-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
}
.sidebar-box h4 {
  font-family: var(--font-serif);
  font-size: 0.93rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
}
.sidebar-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sidebar-box li {
  font-size: 0.84rem;
  color: var(--text-mid);
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
  line-height: 1.45;
}
.sidebar-box li strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  font-size: 0.86rem;
}

/* ── MEMBERS ── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}
.member-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.member-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.07); }

.member-avatar {
  width: 100%;
  aspect-ratio: 1;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.1rem;
  color: var(--accent);
  font-weight: 500;
}
.member-info { padding: 1rem 1.15rem; }
.member-info h3 {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.1rem;
  line-height: 1.3;
}
.member-role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.member-bio {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.6;
}
.member-contact {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--accent);
}

/* ── NEWS ── */
.news-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.news-item {
  background: var(--white);
  padding: 1.1rem 1.4rem;
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 1.1rem;
  align-items: start;
  transition: background 0.15s;
}
.news-item:hover { background: var(--bg-alt); }
.news-date {
  font-size: 0.78rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}
.news-body h3 {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}
.news-body p {
  font-size: 0.87rem;
  color: var(--text-mid);
  line-height: 1.6;
}
.news-category {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.12rem 0.42rem;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 0.3rem;
}
.cat-meeting     { background: #e0eaf7; color: #2a4f8a; }
.cat-grant       { background: #ddf0e4; color: #2a6640; }
.cat-publication { background: #fdf3d9; color: #7a5810; }
.cat-event       { background: #fde8e0; color: #8a3018; }
.cat-general     { background: var(--bg-alt); color: var(--text-mid); }

/* ── FILTER BUTTONS ── */
.filter-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.28rem 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ── TABLE ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
}
th {
  background: var(--bg-alt);
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.6rem 0.9rem;
  color: var(--text-mid);
  border-bottom: 2px solid var(--border);
}
td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-alt); }

/* ── INFO GRID ── */
.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1.4rem;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.info-label {
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}

/* ── PROSE ── */
.prose p { margin-bottom: 1rem; }
.prose ul { margin: 0.5rem 0 1rem 1.5rem; line-height: 1.75; }
.prose li { margin-bottom: 0.2rem; }

/* ── HIGHLIGHT BOX ── */
.highlight-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.35rem;
  border-radius: 0 3px 3px 0;
  margin: 1.5rem 0;
}
.highlight-box p { font-size: 0.93rem; color: var(--text); }

/* ── DIVIDER ── */
hr.section-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 2.5rem 0;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.65rem;
}
.breadcrumb a { color: var(--text-light); }

/* ── LOADING ── */
.loading {
  text-align: center;
  color: var(--text-light);
  padding: 2rem;
  font-size: 0.88rem;
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
footer {
  background: var(--footer-bg);
  color: #b8a898;
  padding: 2.5rem 2rem;
  font-size: 0.84rem;
}
.footer-inner {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 3rem;
  align-items: start;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.2rem;
}
.footer-sub {
  font-size: 0.72rem;
  color: #8a7868;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.5;
}
.footer-col { flex: 1; }
.footer-col h5 {
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9a8878;
  margin-bottom: 0.6rem;
}
.footer-col a {
  display: block;
  color: #c0a890;
  text-decoration: none;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  max-width: calc(var(--max-w) + 4rem);
  margin: 1.25rem auto 0;
  padding: 1.1rem 2rem 0;
  border-top: 1px solid #3a2418;
  font-size: 0.73rem;
  color: #7a6a58;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

html, body { overflow-x: hidden; }
.page-content, .home-hero, .page-header, main { min-width: 0; }

/* ── Medium: two-col stacks, card grid narrows ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 1.5rem; }
  .header-badge { display: none; }
  .header-title-main { font-size: 0.95rem; }
}

/* ── Mobile: hamburger nav ── */
@media (max-width: 680px) {
  /* Show hamburger, hide links */
  #nav-toggle { display: flex; }
  .nav-links { display: none; }

  /* Dropdown menu when open */
  #site-nav.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 2px solid var(--accent);
    padding: 0.5rem 0 0.75rem;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  #site-nav.open .nav-links a { padding: 0.65rem 1.5rem; width: 100%; border-radius: 0; }
  #site-nav.open .nav-links a.nav-cta { margin-left: 0; border-left: 3px solid var(--accent); border-top: none; border-right: none; border-bottom: none; border-radius: 0; }

  .topbar-crumb { display: none; }
  .header-lada { font-size: 1.5rem; padding: 0.2rem 0.5rem; }
  .header-titles { display: none; }
  .header-inner { padding: 0 1rem; }

  main { padding: 1.25rem 1rem; }
  .page-header { padding: 1.25rem 0 1rem; }
  .page-header-inner { padding: 0 1rem; }
  .home-hero { padding: 1.75rem 0; }
  .home-hero-inner { padding: 0 1rem; }
  .home-hero::after { font-size: 30vw; }

  .card-grid { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: repeat(2, 1fr); }
  .news-item { grid-template-columns: 1fr; gap: 0.1rem; }

  .footer-inner { flex-direction: column; gap: 1.25rem; padding: 0 1rem; }
  .footer-bottom { padding: 1.1rem 1rem 0; }
}
