﻿:root {
  --bg: #E8EFF6;
  --surface: #FCFDFF;
  --text: #1B2739;
  --muted: #30638D;
  --brand: #30638D;
  --hover: #954b56;
  --header-start: #41648C;
  --header-end: #234064;
  --border: #B7C7D8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: #d3d9e0;
  line-height: 1.6;
}

.container {
  width: min(1150px, 92%);
  margin: 0 auto;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.5rem 0.75rem; z-index: 50; }

.site-header,
.header.container-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-image: linear-gradient(180deg, #466d98 0%, #2f4f78 65%, #28476d 100%);
  border-bottom: 1px solid var(--header-end);
}

.section-wrap {
  padding: 1.6rem 2.2rem 1.2rem;
}

.navbar-brand {
  max-width: 760px;
}

.site-grid {
  padding: 0;
}

.content-wrap {
  padding: 1rem;
}

.article-content {
  background: #cfd5dd;
  padding: 1rem;
  min-height: 240px;
}

.page-header h1 {
  margin: 0 0 0.75rem;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 62px;
  gap: 1rem;
  padding: 0 2.2rem 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: min(650px, 100%);
  height: auto;
}

.main-nav {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  margin-top: 0;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.nav-list > li {
  position: relative;
}

.main-nav a {
  text-decoration: none;
  color: #FCFDFF;
  padding: 0.45rem 1rem;
  font-size: 1.05rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}

.nav-item.has-sub > a::after {
  content: "";
  display: inline-block;
  margin-left: 0.55rem;
  width: 0;
  height: 0;
  border-left: 0.38rem solid transparent;
  border-right: 0.38rem solid transparent;
  border-top: 0.45rem solid rgba(255, 255, 255, 0.95);
  vertical-align: middle;
}

.main-nav a[aria-current="page"],
.main-nav a:hover {
  background: transparent;
  color: #FFFFFF;
  border-bottom-color: #FFFFFF;
  text-decoration: underline;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background: #00AFB9;
  border: 1px solid #0096a0;
  z-index: 30;
}

.submenu li a {
  display: block;
  padding: 0.55rem 0.9rem;
  border-bottom: none;
  text-decoration: none;
}

.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu {
  display: block;
}

.menu-toggle {
  display: none;
  border: 1px solid #FCFDFF;
  background: transparent;
  color: #FCFDFF;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.section { padding: 2rem 0 3rem; }

.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

h1, h2, h3 { line-height: 1.2; }
h1 { font-family: "Merriweather", Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 0; }

.prose a { color: var(--brand); }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .section-wrap {
    padding: 1rem 1rem 0.6rem;
  }
  .nav-wrap {
    padding: 0 1rem 0.75rem;
  }
  .brand-logo { width: min(470px, 92vw); }
  .menu-toggle { display: inline-block; }
  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--header-end);
    border-bottom: 1px solid var(--header-end);
    padding: 0.75rem 4%;
    display: none;
    flex-direction: column;
    margin-top: 0;
  }
  .nav-list {
    flex-direction: column;
  }
  .nav-list > li {
    width: 100%;
  }
  .main-nav a { padding: 0.5em 0.35em; font-size: 1rem; }
  .submenu {
    display: block;
    position: static;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: 0 0 0.35rem 1rem;
  }
  .submenu li a {
    padding: 0.35rem 0.35rem;
    font-size: 0.95rem;
    opacity: 0.95;
  }
  .main-nav.open { display: flex; }
}

.legacy-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  font-family: "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
  font-size: 0.98rem;
  line-height: 1.5;
}

/* Main menu behavior */
.navbar-collapse.collapse {
  display: none;
}

.navbar-collapse.collapse.show {
  display: block;
}

@media (min-width: 992px) {
  .navbar-collapse.collapse {
    display: block;
  }
}

.mm-collapse {
  display: none;
}

.mm-collapse.show {
  display: block;
}



/* Neutral navigation classes */
.main-nav-wrap { position: relative; }
.main-nav.collapse { display: none; }
.main-nav.collapse.show { display: block; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav-list > .nav-item { position: relative; }
.nav-list a { text-decoration: none; }
.submenu { list-style: none; margin: 0; padding: 0.3rem 0; display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #00AFB9; z-index: 20; }
.submenu.show { display: block; }
.nav-item:hover > .submenu { display: block; }
.submenu-toggle { background: transparent; border: 0; color: inherit; cursor: pointer; }

@media (min-width: 992px) {
  .main-nav.collapse { display: block; }
  .menu-toggle { display: none; }
  .submenu-toggle { display: none; }
}

@media (max-width: 991px) {
  .nav-list { flex-direction: column; }
  .submenu { position: static; min-width: 0; background: transparent; display: block; padding-left: 1rem; }
  .submenu:not(.show) { display: none; }
  .nav-item.has-sub > a::after { display: none; }
}

.presentation-hero {
  min-height: 220px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: end;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.presentation-hero h1 {
  margin: 0;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.presentation-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin: 0 0 1rem;
}

.presentation-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  align-items: start;
}

.presentation-image {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.presentation-note {
  color: #c50d0d;
  font-weight: 600;
}

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

/* Mobile layout polish */
@media (max-width: 991px) {
  .section-wrap {
    padding: 0.75rem 0.85rem 0.5rem;
  }

  .nav-wrap {
    padding: 0 0.85rem 0.75rem;
    gap: 0.6rem;
    align-items: stretch;
  }

  .brand-logo {
    width: min(100%, 520px);
  }

  .brand-logo img,
  .brand-logo > img {
    width: 100%;
    height: auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    align-self: flex-end;
    padding: 0.5rem 0.7rem;
  }

  .icon-menu,
  .icon-menu::before,
  .icon-menu::after {
    display: block;
    width: 20px;
    height: 2px;
    background: #FCFDFF;
    border-radius: 1px;
    content: "";
  }

  .icon-menu {
    position: relative;
  }

  .icon-menu::before {
    position: absolute;
    top: -6px;
    left: 0;
  }

  .icon-menu::after {
    position: absolute;
    top: 6px;
    left: 0;
  }

  .main-nav-wrap {
    width: 100%;
  }

  .main-nav.collapse {
    width: 100%;
    background: rgba(36, 66, 101, 0.98);
    border: 1px solid rgba(183, 199, 216, 0.45);
    border-radius: 10px;
    padding: 0.35rem 0;
    margin-top: 0.2rem;
  }

  .main-nav.collapse.show {
    display: block;
  }

  .nav-list {
    width: 100%;
  }

  .nav-list > .nav-item {
    width: 100%;
  }

  .nav-list > .nav-item > a {
    display: block;
    padding: 0.7rem 0.85rem;
    font-size: clamp(0.98rem, 3.8vw, 1.08rem);
    line-height: 1.35;
    word-break: break-word;
    border-bottom: 0;
  }

  .nav-item.has-sub {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .nav-item.has-sub > a {
    grid-column: 1;
    grid-row: 1;
    margin-right: 0.2rem;
  }

  .submenu-toggle {
    grid-column: 2;
    grid-row: 1;
    min-width: 44px;
    min-height: 44px;
    color: #FCFDFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .submenu-toggle::before {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
  }

  .submenu-toggle[aria-expanded="true"]::before {
    transform: rotate(225deg);
    margin-top: 3px;
  }

  .submenu {
    grid-column: 1 / -1;
    padding: 0 0 0.35rem 0.65rem;
    margin-top: -0.1rem;
  }

  .submenu li a {
    display: block;
    padding: 0.5rem 0.85rem;
    font-size: clamp(0.93rem, 3.4vw, 1rem);
    line-height: 1.3;
  }

  .content-wrap {
    padding: 0.75rem;
  }

  .article-content {
    padding: 0.85rem;
  }

  .page-header h1 {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
    line-height: 1.2;
  }
}

@media (max-width: 960px) {
  .main-nav.collapse {
    position: static;
    left: auto;
    right: auto;
    top: auto;
  }
}

/* Mobile hotfix: header/logo/menu scaling */
.navbar-brand img,
.brand-logo img {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 991px) {
  .header.container-header,
  .site-header {
    overflow: visible;
  }

  .navbar-brand {
    max-width: 100% !important;
  }

  .section-wrap {
    padding: 0.65rem 0.85rem 0.35rem !important;
  }

  .brand-logo,
  .navbar-brand .brand-logo {
    width: 100% !important;
    max-width: 100% !important;
  }

  .navbar-brand img,
  .brand-logo img {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 112px;
    object-fit: contain;
    object-position: left center;
  }

  .nav-wrap {
    min-height: auto !important;
    padding: 0 0.85rem 0.65rem !important;
    justify-content: flex-end;
  }

  .main-nav-wrap {
    width: 100%;
  }

  .menu-toggle {
    margin-left: auto;
    min-width: 46px;
    min-height: 46px;
    border-radius: 10px;
    border-width: 2px;
  }

  .content-wrap {
    padding-top: 0.6rem;
  }
}
