:root {
  --navy: #17335c;
  --red: #c43b2f;
  --gold: #e6b64a;
  --ink: #26313f;
  --cream: #f5efe3;
  --paper: #fffaf0;
  --line: #d8cdbb;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: Merriweather, Georgia, serif;
  color: #17263b;
  line-height: 1.16;
}

h2 { color: var(--red); }

a { color: var(--red); }

.container { width: min(1180px, calc(100% - 48px)); }
.container, .content-panel, .content-flow, .category-card, .table-wrap { min-width: 0; }
.content-panel h1, .content-panel h2, .content-panel h3, .content-panel p, .content-panel a,
.hub-intro h2, .hub-intro p, .hub-intro a, .category-card h2, .category-card p, .menu-nav a {
  overflow-wrap: anywhere;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 24px rgba(23, 51, 92, .22);
}

.nav-shell {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
}

.brand-logo-custom {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-family: Merriweather, Georgia, serif;
  font-size: 23px;
  font-weight: 800;
}

.brand-logo-custom:hover, .menu-nav a:hover { color: #fff; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: radial-gradient(circle at 35% 35%, #fff 0 13%, var(--gold) 14% 40%, var(--red) 41% 100%);
  color: var(--navy);
  font-weight: 900;
  font-family: "Source Sans 3", Arial, sans-serif;
}

.menu-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  background: transparent;
  box-shadow: none;
  height: auto;
  line-height: 1.3;
}

.menu-item {
  position: relative;
  display: inline-flex;
}

.menu-nav a {
  color: #fff;
  border-bottom: 2px solid transparent;
  padding: 7px 0;
  font-size: 15px;
  font-weight: 700;
}

.menu-nav a:hover { border-color: var(--gold); }

.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  min-width: 220px;
  padding: 10px 14px;
  background: #102544;
  border-radius: 6px;
}

.has-children:hover .menu-dropdown { display: grid; gap: 8px; }

.home-hero {
  background: linear-gradient(135deg, #fffaf0 0%, #f3e5cb 100%);
  border-bottom: 3px solid var(--gold);
}

.hero-grid {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 44px;
  align-items: center;
  padding: 72px 0;
}

.section-label {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-hero h1, .home-hero h2 {
  max-width: 760px;
  font-size: 46px;
}

.home-hero p {
  max-width: 660px;
  font-size: 20px;
}

.hero-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 180px;
  gap: 14px;
}

.hero-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(23, 51, 92, .2);
}

.hero-images img:first-child { grid-row: span 2; }

.home-catalog, .page-main { padding: 68px 0; }

.content-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 46px);
}

.page-title {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.page-title h1 { margin: 0; font-size: clamp(32px, 5vw, 46px); }
.summary { color: #596171; font-size: 19px; }

.content-flow > * + * { margin-top: 18px; }

.content-image img, .content-flow > img, .main-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.gallery-grid figure {
  margin: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.card-flow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.card-flow h2, .card-flow h3 {
  font-size: 20px;
  margin-top: 0;
}

.card-flow .content-image, .card-flow > p, .card-flow > h2, .card-flow > h3 {
  margin: 0;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.catalog-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.catalog-item img {
  width: 140px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.table-wrap { max-width: 100%; overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap td, .table-wrap th { overflow-wrap: anywhere; word-break: break-word; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.category-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.category-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.category-card div { padding: 18px; }
.category-card h2 { font-size: 22px; margin-top: 0; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
}

.toc a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.article-layout.navpos-left, .article-layout.navpos-right {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
}

.toc.side {
  position: sticky;
  top: 110px;
  align-self: start;
  display: grid;
}

.site-footer {
  padding: 30px 0;
  background: #102544;
  color: rgba(255,255,255,.86);
}

.site-footer h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 24px;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.footer-links a { color: #fff; font-weight: 700; }

@media (max-width: 900px) {
  .nav-shell { align-items: flex-start; flex-direction: column; }
  .menu-nav { justify-content: flex-start; }
  .hero-grid, .article-layout.navpos-left, .article-layout.navpos-right { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .home-hero h1, .home-hero h2 { font-size: 38px; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 32px, 1180px); }
  .hero-images, .category-grid, .card-flow { grid-template-columns: 1fr; }
  .catalog-item { grid-template-columns: 1fr; }
  .home-hero h1, .home-hero h2 { font-size: 32px; }
  .page-title h1 { font-size: 28px; }
  .table-wrap table { table-layout: fixed; min-width: 0; }
}
