:root {
  --grey: #d3d3d3;
  --grey-dark: #b9b9b9;
  --ink: #202124;
  --muted: #62676d;
  --line: #e4e4e4;
  --panel: #ffffff;
  --soft: #f6f7f8;
  --accent: #2f5f8f;
  --logo-ink: #244851;
  --max: 1120px;
}

@font-face {
  font-family: "AtelierRounded";
  src: url("files/roundedfont7.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  background: #fbfbfa;
}

body:has(.article-detail:target) {
  overflow: hidden;
}

a {
  color: inherit;
}

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

.site-header,
.site-footer {
  background: var(--grey) url("resources/fond-logo.jpg") repeat;
}

.site-header {
  border-bottom: 1px solid var(--grey-dark);
}

.brand {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.brand-logo-mobile {
  display: none;
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.menu-toggle {
  display: none;
}

.nav-inner {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}

.nav-inner a {
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  color: #333;
  padding: 8px 12px;
  border-radius: 7px;
}

.nav-inner a:hover,
.nav-inner a:focus {
  color: #fff;
  background: var(--accent);
}

.page {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
  background: #ffffff;
}

.intro {
  margin-bottom: 30px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.16;
  letter-spacing: 0;
}

.intro p {
  max-width: 780px;
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

.section {
  scroll-margin-top: 76px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 18px;
  color: var(--logo-ink);
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.15;
}

.section-note {
  margin: -8px 0 20px;
  color: var(--muted);
}

.latest-list,
.upcoming-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-list a,
.upcoming-list li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: baseline;
  text-decoration: none;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d9d9d3;
  border-radius: 7px;
}

.latest-list a:hover {
  border-color: var(--accent);
}

.date {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
}

.date .maj,
.tag .maj {
  display: block;
}

.latest-text {
  display: flex;
  gap: 7px;
  align-items: baseline;
  min-width: 0;
}

.latest-category {
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
}

.latest-title {
  color: var(--ink);
  font-weight: 700;
}

.upcoming-category {
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
}

.articles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.article-card {
  border: 1px solid #d9d9d3;
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-link:hover,
.card-link:focus {
  border-color: var(--accent);
}

.card-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.card-image-small {
  width: 60%;
  margin: 8px auto 0;
  background: #ffffff;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 220px;
  padding: 14px 16px 16px;
}

.card-meta,
.detail-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.card-meta {
  padding: 12px 16px 10px;
}

.card-meta span:last-child,
.detail-meta span:last-child {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.article-card h3 {
  margin: 8px 0 8px;
  color: #114f43;
  font-size: 21px;
  line-height: 1.2;
}

.article-card p,
.detail-body p {
  margin: 0 0 3px;
  color: #1f2730;
  font-style: italic;
}

.article-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.read-more {
  align-self: flex-end;
  margin-top: 8px;
  color: #74a8d8;
  font-size: 13px;
  font-style: italic;
}

.article-card:hover .read-more,
.article-card:focus-within .read-more {
  color: var(--accent);
}

.detail-body ul {
  margin: 4px 0 8px;
  padding-left: 24px;
  color: #1f2730;
  font-style: italic;
}

.detail-body li + li {
  margin-top: 3px;
}

.detail-body strong {
  display: block;
  margin: 16px 0 0;
  color: #114f43;
  font-style: normal;
}

.detail-body p:has(> strong) {
  margin: 0;
}

.detail-body p:has(> strong) + p,
.detail-body p:has(> strong) + ul {
  margin-top: 0;
}

.article-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  background: rgba(248, 248, 246, 0.96);
}

.article-detail:target {
  display: block;
}

.detail-panel {
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid #d9d9d3;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.detail-close {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.detail-panel h2 {
  margin: 10px 0 16px;
  color: #114f43;
  font-size: clamp(18px, 2.5vw, 26px);
  line-height: 1.12;
}

.detail-panel h1 {
  margin: 10px 0 16px;
  color: #114f43;
  font-size: clamp(20px, 2.8vw, 30px);
  line-height: 1.12;
}

.article-page {
  background: #fbfbfa;
  padding: 34px 0 48px;
}

.article-detail-page .detail-panel {
  width: min(880px, calc(100% - 32px));
  box-shadow: none;
}

.detail-image {
  width: min(100%, 620px);
  max-height: 360px;
  object-fit: contain;
  display: block;
  margin: 0 auto 24px;
  border-radius: 7px;
  background: #ffffff;
}

.detail-extra-image {
  width: min(100%, 620px);
  max-height: 360px;
  object-fit: contain;
  display: block;
  margin: 22px auto;
  border-radius: 7px;
  background: #ffffff;
}

.detail-extra-image-small {
  width: min(60%, 380px);
}

.detail-extra-image-small-left {
  float: left;
  width: min(60%, 360px);
  margin: 6px 24px 16px 0;
}

.article-spacer {
  height: 16px;
}

.article-spacer-large {
  height: 30px;
}

.subsection-title {
  color: #1e5f86;
}

.detail-video {
  margin: 24px auto 8px;
  text-align: center;
}

.detail-video video {
  width: min(100%, 620px);
  border-radius: 7px;
  background: #000;
}

.detail-video p,
.detail-video-link {
  margin: 8px 0 0;
  color: var(--accent);
  font-style: italic;
  font-weight: 700;
  text-align: center;
}

.detail-video-link a {
  color: inherit;
}

.video-preview {
  margin: 24px auto 8px;
  text-align: center;
}

.video-preview a {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
}

.video-preview-image {
  width: min(100%, 560px);
  border-radius: 7px;
  background: #ffffff;
  display: block;
}

.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 8px;
}

.site-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid #d9d9d3;
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent);
  font-style: italic;
  font-weight: 700;
  text-decoration: none;
}

.site-link:hover,
.site-link:focus {
  border-color: var(--accent);
}

.detail-body {
  clear: both;
  font-size: 17px;
  line-height: 1.62;
}

.empty-section {
  color: var(--muted);
  font-style: italic;
}

.site-footer {
  border-top: 1px solid var(--grey-dark);
  padding: 26px 0;
}

.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  text-align: center;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #202124;
  font-weight: 700;
  text-decoration: none;
}

.social-links img {
  width: auto;
  height: 34px;
  display: block;
}

.legal {
  font-size: 13px;
  color: #424242;
}

.legal a {
  color: inherit;
}

@media (max-width: 760px) {
  .brand {
    padding: 14px 0;
    text-align: center;
  }

  .brand-logo {
    display: none;
  }

  .brand-logo-mobile {
    display: block;
    width: min(100%, 360px);
    height: auto;
    margin: 0 auto;
  }

  .main-nav {
    background: rgba(255, 255, 255, 0.98);
  }

  .menu-toggle {
    display: flex;
    width: min(100% - 24px, 360px);
    min-height: 42px;
    margin: 0 auto;
    padding: 9px 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    color: var(--logo-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
  }

  .menu-toggle::after {
    content: "▾";
    margin-left: 8px;
    font-size: 12px;
  }

  .menu-toggle[aria-expanded="true"]::after {
    content: "▴";
  }

  .nav-inner {
    display: none;
    width: min(100% - 24px, 360px);
    padding: 8px 0 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-x: visible;
  }

  .nav-inner a {
    width: 100%;
    font-size: 13px;
    padding: 9px 12px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--line);
  }

  .menu-toggle[aria-expanded="true"] + .nav-inner {
    display: flex;
  }

  .page {
    width: min(100% - 24px, var(--max));
    padding-top: 24px;
  }

  .intro p {
    font-size: 16px;
  }

  .articles {
    grid-template-columns: 1fr;
  }

  .card-body {
    min-height: 190px;
  }

  .latest-list a {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .upcoming-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .latest-text {
    display: block;
  }

  .latest-category {
    display: block;
    white-space: normal;
  }

  .article-detail {
    padding: 12px;
  }

  .detail-panel {
    padding: 20px;
  }

  .detail-close {
    display: inline-block;
    margin-bottom: 12px;
  }

  .detail-extra-image-small,
  .detail-extra-image-small-left {
    float: none;
    width: min(100%, 420px);
    margin: 18px auto;
  }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .articles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
