/* ==============================
   Guidelines Page Styles
   ============================== */

/* CSS Variables */
:root {
  --guidelines-bg: #f8f8ef;
  --guidelines-dark-text: #241f20;
  --guidelines-accent: #e3dccd;
  --guidelines-primary: #969a8b;
  --guidelines-sidebar-width: 300px;
  --guidelines-content-left: calc(33.33% + 21px);
}

/* Body & Container */
.guidelines-body,
body {
  background: var(--guidelines-bg);
  font-family: "Archivo", sans-serif;
  color: var(--guidelines-dark-text);
  margin: 0;
  padding: 0;
  /* scrollbar-width: thin; */
  /* scrollbar-color: var(--guidelines-primary, #969a8b) var(--guidelines-accent, #e3dccd); */
  transition:
    background-color 0.3s ease-out,
    color 0.3s ease-out;
}

/* ::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--guidelines-accent, #e3dccd);
}

::-webkit-scrollbar-thumb {
  background-color: var(--guidelines-primary, #969a8b);
  border-radius: 999px;
  border: 2px solid var(--guidelines-accent, #e3dccd);
} */

.guidelines-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  margin: 0 auto;
  transition:
    background-color 0.3s ease-out,
    color 0.3s ease-out;
}

/* ==============================
   Sidebar Navigation
   ============================== */

.guidelines-sidebar {
  position: sticky;
  /* left: 112px; */
  top: 0;
  bottom: 0;
  flex: 1 0 var(--guidelines-sidebar-width);
  z-index: 100;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Logo */
.sidebar-logo {
  position: absolute;
  left: 1px;
  top: 52px;
  width: 175px;
  height: 47px;
}

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

/* Navigation Sections */
.sidebar-navigation {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 192px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--guidelines-primary, #969a8b) var(--guidelines-accent, #e3dccd);
}

.sidebar-navigation::-webkit-scrollbar {
  width: 8px;
}

.sidebar-navigation::-webkit-scrollbar-track {
  background: var(--guidelines-accent, #e3dccd);
  border-radius: 999px;
}

.sidebar-navigation::-webkit-scrollbar-thumb {
  background-color: var(--guidelines-primary, #969a8b);
  border-radius: 999px;
  border: 2px solid var(--guidelines-accent, #e3dccd);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section-title {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: normal;
  margin: 0;
  padding-top: 8px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.nav-section.active .nav-section-title {
  opacity: 1;
  /* padding-top: 0; */
}

.nav-section:first-child .nav-section-title {
  padding-top: 0;
}

.nav-link {
  color: var(--guidelines-dark-text);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.nav-link:hover {
  opacity: 0.7;
}

/* Subsections */
.nav-subsections {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  margin-bottom: 16px;
  --active-top: 0px;
  --active-height: 0px;
  --active-visible: 0;
}

.nav-subsections li {
  position: relative;
  padding-left: 17px;
}

/* Background indicator for all sections */
.nav-subsections::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  background: var(--guidelines-accent);
  border-radius: 4px;
}

/* Active section indicator */
.nav-subsections::after {
  content: "";
  position: absolute;
  left: 0;
  top: var(--active-top);
  width: 4px;
  height: var(--active-height);
  background: var(--guidelines-primary, #969a8b);
  border-radius: 4px;
  z-index: 1;
  opacity: var(--active-visible);
  transition:
    top 0.32s ease,
    height 0.32s ease,
    opacity 0.2s ease;
}

.nav-sublink {
  font-family: "Archivo", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: normal;
  color: var(--guidelines-dark-text);
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: block;
  padding: 5px 0;
}

.nav-sublink:hover {
  opacity: 0.7;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 32px 0;
}

.sidebar-footer-text {
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin: 0;
}

/* ==============================
   Main Content Area
   ============================== */

.guidelines-content {
  padding: 192px 0px 112px 0px;
  width: 100%;
  max-width: 1200px;
}

.content-wrapper {
  max-width: 790px;
}

/* Content Typography */
.content-intro {
  font-family: "Archivo", sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  line-height: normal;
  margin: 0 0 32px;
}

.content-heading {
  font-family: var(--profile-heading-font, "Meno Banner", serif);
  font-weight: 400;
  font-size: 54px;
  line-height: 1.2;
  margin: 0 0 32px;
}

.content-description {
  font-family: var(--profile-body-font, "Archivo", sans-serif);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

.content-description p {
  margin: 0 0 16px;
}

.content-description p:last-child {
  margin-bottom: 0;
}

/* ==============================
   Section-Specific Styles
   ============================== */

/* Logotyp Section */
.logotyp-grid {
  display: flex;
  flex-direction: column;
  gap: 64px;
  margin-top: 48px;
}
@media (min-width: 768px) {
  .logotyp-grid {
    gap: 128px;
  }
}
.logotyp-item {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.logotyp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.logotyp-title {
  font-family: "Archivo", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  margin: 0;
  flex: 0 0 328px;
}

.logotyp-description {
  font-family: "Archivo", sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  flex: 0 0 328px;
}

.logotyp-preview {
  border: 2px solid rgba(36, 31, 32, 0.1);
  border-color: color-mix(in srgb, var(--guidelines-dark-text) 15%, transparent);
  padding: 48px 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
}
@media (min-width: 768px) {
  .logotyp-preview {
    padding: 96px 100px;
  }
}

.logotyp-preview img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  max-width: none;
  max-height: 200px;
}

.logotyp-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (min-width: 768px) {
  .logotyp-downloads {
    gap: 24px;
  }
}

.logotyp-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 16px;
  border: 2px solid var(--guidelines-dark-text);
  border-radius: 999px;
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: var(--guidelines-dark-text);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}
@media (min-width: 768px) {
  .logotyp-download-btn {
    padding: 20px 26px;
    font-size: 16px;
  }
}

.logotyp-download-btn:hover {
  background: var(--guidelines-dark-text);
  color: var(--guidelines-bg);
}

/* Remove old download style */
.logotyp-download {
  display: inline-block;
  padding: 12px 24px;
  background: var(--guidelines-dark-text);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.3s ease;
  align-self: flex-start;
}

.logotyp-download:hover {
  opacity: 0.8;
}

/* Färger Section */
.farger-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
@media (min-width: 768px) {
  .typsnitt-header {
    margin-top: 209px;
  }
}

.farger-section {
  margin-top: 48px;
}

.farger-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 40px;
}

.farger-section-title {
  font-family: "Archivo", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.5;
  margin: 0;
  flex: 0 0 328px;
}

.farger-section-description {
  font-family: "Archivo", sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  flex: 0 0 328px;
}

.farger-colors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 766px;
}

.farger-color-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.farger-color-swatch {
  width: 100%;
  height: 128px;
  border-radius: 8px;
}

.farger-color-card.has-border .farger-color-swatch {
  border: 1px solid var(--guidelines-dark-text);
}

.farger-color-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 24px;
}

.farger-color-name {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: normal;
  text-transform: uppercase;
  margin: 0;
  color: var(--guidelines-dark-text);
}

.farger-color-codes {
  display: flex;
  gap: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--guidelines-dark-text);
}

.farger-code-labels {
  flex: 0 0 54px;
}

.farger-code-labels p {
  font-family: "Archivo", sans-serif;
  font-weight: 400;
  margin: 0;
}

.farger-code-values p {
  font-family: "Archivo", sans-serif;
  font-weight: 300;
  margin: 0;
}

.farger-color-usage {
  font-family: "Archivo", sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(36, 31, 32, 0.7);
  margin: 0;
  width: 100%;
}

/* Typsnitt Section */
.typsnitt-section {
  margin-top: 32px;
}

.typsnitt-section + .typsnitt-section {
  margin-top: 96px;
}

.typsnitt-section .typsnitt-header {
  margin-top: 0;
}

.typsnitt-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-top: 32px;
  /*margin-bottom: 87px;*/
  width: 100%;
  max-width: 790px;
}

.typsnitt-header-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.typsnitt-header-label {
  font-family: "Archivo", sans-serif;
  font-weight: 400;
  font-size: 28px;
  color: var(--guidelines-dark-text);
  width: 328px;
}

.typsnitt-header-value {
  font-family: "Archivo", sans-serif;
  font-weight: 300;
  font-size: 16px;
  color: var(--guidelines-dark-text);
  width: 328px;
}

.typsnitt-meta {
  margin-bottom: 24px;
  font-size: 16px;
}

.typsnitt-examples {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 766px;
}

.typsnitt-example {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 32px;
  align-items: start;
}

.typsnitt-example-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--guidelines-dark-text);
}

.typsnitt-example:last-of-type .typsnitt-example-label {
  margin-top: 0;
}

.typsnitt-example-letter {
  font-weight: 400;
  font-size: clamp(64px, 7vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.typsnitt-example-name {
  font-family: inherit;
  font-weight: 400;
  font-size: 20px;
}

.typsnitt-example-text {
  color: var(--guidelines-dark-text);
  width: 100%;
}

.typsnitt-h1 {
  font-family: "Meno Banner", serif;
  font-weight: 400;
  font-size: 64px;
  line-height: 1.2;
  font-style: normal;
}

.typsnitt-h2 {
  font-family: "Meno Banner", serif;
  font-weight: 400;
  font-size: 54px;
  line-height: 1.2;
  font-style: normal;
}

.typsnitt-h3 {
  font-family: "Meno Banner", serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.3;
  font-style: normal;
}

.typsnitt-body {
  font-family: "Archivo", sans-serif;
  font-weight: 300;
  font-size: clamp(16px, 3vw, 36px);
  line-height: 1.6;
}

.typsnitt-heading-sample {
  font-weight: 400;
  font-size: clamp(14px, 4vw, 26px);
  line-height: 1.2;
}

.typsnitt-body-sample {
  font-weight: 300;
  font-size: clamp(14px, 3vw, 20px);
  line-height: 1.6;
}

.typsnitt-downloads {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 0;
}

.typsnitt-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 26px 32px;
  border: 2px solid var(--guidelines-dark-text);
  border-radius: 999px;
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  color: var(--guidelines-dark-text);
  text-decoration: none;
  background: transparent;
  transition:
    background-color 0.2s,
    color 0.2s;
  cursor: pointer;
}

.typsnitt-download-btn:hover {
  background: var(--guidelines-dark-text);
  color: var(--guidelines-bg);
}

/* ==============================
   Swup Transitions
   ============================== */

/* Swup progress bar */
.swup-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-accent) 70%, transparent);
  z-index: var(--z-modal);
}

/* Fade transition for main content */
.transition-fade {
  opacity: 1;
}

html.is-changing .transition-fade {
  transition: opacity 250ms ease-in-out;
}

html.is-animating .transition-fade {
  opacity: 0;
}

/* Keep sidebar static during transitions */
.guidelines-sidebar {
  opacity: 1 !important;
  transition: none !important;
}

/* ==============================
   Responsive Design
   ============================== */

@media (max-width: 1024px) {
  .guidelines-sidebar {
    left: 32px;
    height: 100vh;
  }

  .sidebar-logo {
    left: 32px;
  }

  .guidelines-content {
    /* margin-left: calc(var(--guidelines-sidebar-width) + 64px); */
    padding: 192px 32px 64px 32px;
  }

  :root {
    --guidelines-content-left: calc(var(--guidelines-sidebar-width) + 64px);
  }
}

@media (max-width: 1024px) {
  .guidelines-sidebar {
    display: none;
  }

  .sidebar-logo {
    position: relative;
    left: 0;
    top: 0;
    margin-bottom: 32px;
  }

  .sidebar-nav {
    padding-top: 0;
  }

  .guidelines-content {
    margin-left: 0;
    padding: 128px 0 32px;
  }

  .guidelines-container {
    flex-direction: column;
  }

  .content-heading {
    font-size: 36px;
  }

  .logotyp-header,
  .farger-section-header {
    flex-direction: column;
    gap: 24px;
  }

  .logotyp-title,
  .logotyp-description,
  .farger-section-title,
  .farger-section-description {
    flex: 1 1 auto;
    width: 100%;
  }

  .farger-colors-grid {
    grid-template-columns: 1fr;
  }

  .typsnitt-example {
    display: block;
  }

  .typsnitt-example-label {
    margin-bottom: 16px;
  }

  .typsnitt-example-letter {
    font-size: clamp(48px, 12vw, 84px);
  }

  .typsnitt-example-text {
    width: 100%;
  }
}
