/*
Theme Name: GSWG Left Navigation
Theme URI: https://gswg.mikulcak.me
Author: GSWG
Description: A restrained content-first theme with persistent left navigation for the GSWG migration.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: gswg-leftnav
*/

:root {
  --gswg-bg: #f7f6f1;
  --gswg-surface: #ffffff;
  --gswg-text: #202124;
  --gswg-muted: #62666d;
  --gswg-rule: #d9d4c8;
  --gswg-accent: #0e5f66;
  --gswg-accent-dark: #083f45;
  --gswg-link: #874f18;
  --gswg-max-content: 860px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--gswg-bg);
  color: var(--gswg-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.62;
}

a {
  color: var(--gswg-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus {
  color: var(--gswg-accent-dark);
}

img,
iframe,
table {
  max-width: 100%;
}

table {
  border-collapse: collapse;
}

.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.site-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 32px 28px;
  background: var(--gswg-surface);
  border-right: 1px solid var(--gswg-rule);
}

.site-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.24;
  font-weight: 750;
}

.site-title a {
  color: var(--gswg-text);
  text-decoration: none;
}

.sidebar-header {
  position: relative;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--gswg-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.language-switcher > * + *::before {
  margin-right: 7px;
  color: var(--gswg-rule);
  content: "|";
}

.language-switcher a {
  color: var(--gswg-muted);
  text-decoration: none;
}

.language-switcher a:hover,
.language-switcher a:focus,
.language-switcher-current {
  color: var(--gswg-accent-dark);
}

.mobile-menu-toggle {
  display: none;
}

.site-description {
  margin: 10px 0 28px;
  color: var(--gswg-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 7px 0;
  color: var(--gswg-text);
  text-decoration: none;
  font-size: 0.96rem;
  line-height: 1.3;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--gswg-accent);
  font-weight: 700;
}

.site-nav .sub-menu,
.site-nav .children {
  margin: 2px 0 8px 14px;
  padding-left: 12px;
  border-left: 1px solid var(--gswg-rule);
}

.site-nav .sub-menu a,
.site-nav .children a {
  color: var(--gswg-muted);
  font-size: 0.9rem;
}

.site-nav .is-collapsible > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-nav .is-collapsible > a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.site-nav .is-collapsible.is-open > a::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.site-nav .is-collapsible:not(.is-open) > .sub-menu {
  display: none;
}

.sidebar-contact {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--gswg-rule);
  color: var(--gswg-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.site-main {
  padding: 48px min(7vw, 72px);
}

.content-frame {
  max-width: var(--gswg-max-content);
}

.entry-header {
  margin-bottom: 28px;
}

.entry-title,
.archive-title {
  margin: 0;
  color: var(--gswg-accent-dark);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  font-weight: 760;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--gswg-accent-dark);
  line-height: 1.18;
}

.entry-content h1 {
  font-size: 2.4rem;
}

.entry-content h2 {
  margin-top: 2.1em;
  font-size: 1.55rem;
}

.entry-content h3 {
  margin-top: 1.65em;
  font-size: 1.18rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  max-width: 72ch;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--gswg-rule);
  margin: 32px 0;
}

.gswg-record-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.gswg-record {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--gswg-rule);
  border-radius: 6px;
}

.gswg-record h3 {
  margin-top: 0;
}

.gswg-document-language {
  color: var(--gswg-muted);
  font-size: 0.78em;
  font-weight: 500;
}

.gswg-event-gallery-source {
  display: none;
}

.gswg-expertise-nav {
  margin: 28px 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--gswg-rule);
  border-radius: 6px;
}

.gswg-expertise-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gswg-expertise-group {
  margin-top: 18px;
  border: 1px solid var(--gswg-rule);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.46);
  scroll-margin-top: 24px;
}

.gswg-expertise-group > summary {
  padding: 16px 18px;
  color: var(--gswg-accent-dark);
  cursor: pointer;
}

.gswg-expertise-heading {
  font-size: 1.25rem;
  font-weight: 700;
}

.gswg-expertise-count {
  color: var(--gswg-muted);
}

.gswg-expert-list {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.gswg-expert-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: var(--gswg-surface);
  border: 1px solid var(--gswg-rule);
  border-radius: 6px;
}

.gswg-expert-portrait img {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: cover;
}

.gswg-expert-body h3 {
  margin: 0 0 10px;
}

.gswg-expert-body p {
  margin: 5px 0;
}

.gswg-expert-details {
  margin-top: 12px;
}

.gswg-expert-details summary {
  color: var(--gswg-link);
  cursor: pointer;
  font-weight: 650;
}

.gswg-expert-details ul {
  margin-bottom: 0;
}

.post-list {
  display: grid;
  gap: 28px;
}

.post-summary {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gswg-rule);
}

.post-summary h2 {
  margin-bottom: 8px;
}

.post-summary h2 a {
  color: var(--gswg-accent-dark);
  text-decoration: none;
}

.entry-meta {
  color: var(--gswg-muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  max-width: var(--gswg-max-content);
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--gswg-rule);
  color: var(--gswg-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--gswg-muted);
}

.footer-nav a:hover,
.footer-nav a:focus,
.footer-nav .current-menu-item a {
  color: var(--gswg-accent-dark);
}

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

@media (max-width: 860px) {
  .site-shell {
    display: block;
  }

  .site-sidebar {
    position: relative;
    height: auto;
    padding: 18px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--gswg-rule);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .sidebar-header .language-switcher {
    margin: 0 0 0 auto;
  }

  .site-sidebar.is-mobile-menu-ready .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 7px 11px;
    border: 1px solid var(--gswg-rule);
    border-radius: 4px;
    background: var(--gswg-bg);
    color: var(--gswg-text);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 650;
    cursor: pointer;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus-visible {
    border-color: var(--gswg-accent);
    color: var(--gswg-accent-dark);
  }

  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .mobile-menu-icon {
    position: relative;
  }

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

  .mobile-menu-icon::before {
    top: -6px;
  }

  .mobile-menu-icon::after {
    top: 6px;
  }

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

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

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

  .sidebar-panel {
    padding-top: 18px;
  }

  .site-description {
    margin-top: 0;
  }

  .site-nav ul {
    columns: 2;
    column-gap: 24px;
  }

  .site-nav .children {
    display: none;
  }

  .site-nav .is-collapsible.is-open > .sub-menu {
    display: block;
  }

  .sidebar-contact {
    margin-top: 18px;
  }

  .site-main {
    padding: 32px 22px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .sidebar-header {
    flex-wrap: wrap;
  }

  .site-title {
    flex: 1 1 calc(100% - 180px);
  }

  .site-nav ul {
    columns: 1;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .gswg-expert-card {
    grid-template-columns: 1fr;
  }

  .entry-title,
  .archive-title {
    font-size: 2rem;
  }
}
