/* ===========================
   memos-standalone.css
=========================== */

/* ── Design Tokens ── */
:root {
  --pad:           clamp(24px, 4vw, 30px);
  --pad-content:   48px;
  --fs-title:      max(2rem, 2.5vw + 1rem);
  --fs-body:       clamp(1rem, 0.1905vw + 0.9536rem, 1.125rem);
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ── Screen reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Shared image fill ── */
.img-fill {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ───────────────────────────────
   PAGE
─────────────────────────────── */

.page-memos {
  padding-top: 162px;
}

/* ───────────────────────────────
   PROGRESS BAR
─────────────────────────────── */

.memos-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--blue);
  z-index: 1450;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ───────────────────────────────
   MEMO NAV
─────────────────────────────── */

.memos-nav {
  position: fixed;
  top: 90px;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 500;
  background: var(--white);
  border-top: 1px solid rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: stretch;
}

.memos-nav__arrow {
  flex-shrink: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: none;
  cursor: pointer;
  color: var(--black);
  font-size: 14px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  padding: 0;
}
.memos-nav__arrow:hover { opacity: 1; }
.memos-nav__arrow--prev { border-right: 1px solid rgba(0,0,0,0.06); }
.memos-nav__arrow--next { border-left: 1px solid rgba(0,0,0,0.06); }
.memos-nav__arrow.is-hidden { opacity: 0; pointer-events: none; }

.memos-nav__track {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.memos-nav__list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 100%;
  scroll-behavior: smooth;
}
.memos-nav__list::-webkit-scrollbar { display: none; }

.memos-nav__item {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.memos-nav__thumb-wrap {
  position: relative;
  flex-shrink: 0;
  display: block;
  width: 48px;
  height: 60px;
}

.memos-nav__item--pinned .memos-nav__thumb-wrap::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  pointer-events: none;
  z-index: 1;
}

.memos-nav__link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.4;
  transition: opacity 0.3s ease;
  position: relative;
}
.memos-nav__link:hover,
.memos-nav__link.is-active { opacity: 1; }

.memos-nav__thumb {
  width: 48px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.memos-nav__link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.memos-nav__link-date {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--black);
}

.memos-nav__link-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--black);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memos-nav__link.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--blue);
}

.memos-nav__toggle { display: none; }

/* ───────────────────────────────
   ARTIKEL
─────────────────────────────── */

.memo {
  display: grid;
  grid-template-columns: 0.55fr 1fr;
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
  padding: clamp(32px, 4vw, 64px) var(--pad);
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.85s ease, transform 0.85s ease;
  scroll-margin-top: 162px;
}

.memo-wrap {
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.memo-wrap:last-child {
  border-bottom: none;
}

.memo__image {
  display: flex;
  flex-direction: column;
}

.memo__image picture {
  display: block;
  aspect-ratio: 4/5;
  overflow: hidden;
  flex-shrink: 0;
}

.memo.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.memo__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memo__video {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  object-fit: cover;
  display: block;
}

.memo__image-credit {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 400;
  color: rgba(0,0,0,0.35);
  line-height: 1.4;
}

.memo__image-credit-link {
  color: inherit;
  text-decoration: none;
}
.memo__image-credit-link:hover { color: rgba(0,0,0,0.7); }

.memo__content { max-width: 65ch; }

.memo__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.memo__meta-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--black);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--black);
  background: transparent;
  cursor: default;
  pointer-events: none;
  line-height: 1.5;
}

.memo__title {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--black);
  margin: 0 0 16px;
}

.memo__subtitle {
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.5;
  color: var(--black);
  opacity: 0.6;
  margin: 0 0 32px;
}

.memo__body p {
  font-size: clamp(0.9917rem, 0.1905vw + 0.9536rem, 1rem);
  font-weight: 400;
  line-height: 1.7;
  color: var(--black);
  margin: 0 0 1.5em;
}
.memo__body p:last-child { margin-bottom: 0; }

.memo__pullquote {
  margin: 2em 0;
  padding: 0 0 0 1.5em;
}

.memo__pullquote p {
  font-size: max(1.125rem, 0.5143vw + 0.7184rem);
  font-weight: 500;
  font-style: normal;
  line-height: 1.6;
  color: var(--black);
  margin: 0;
}

.memo__author {
  font-size: clamp(0.8058rem, 0.1548vw + 0.7748rem, 0.8125rem);
  font-weight: 400;
  color: var(--black);
  opacity: 0.5;
  margin: 1.5em 0 0;
}

.memo__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  gap: 16px;
}

.memo__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.memo__pills--empty { flex: 1; }

.memo__pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 400;
  color: #e8e8e8;
  border: 1.5px solid #e8e8e8;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  line-height: 1.5;
}

.memo__meta-pill--pinned {
  background: var(--blue);
  border: 1.5px solid var(--blue);
  color: #fff;
}

/* ── Share ── */
.memo__share { position: relative; }

.memo__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--black);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--black);
  background: transparent;
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease;
}
.memo__share-btn:hover {
  background: var(--black);
  color: var(--white);
}

.memo__share-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  fill: currentColor;
}

.memo__share-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1.5px solid var(--black);
  border-radius: 8px;
  padding: 6px;
  min-width: 180px;
  z-index: 200;
}
.memo__share-menu.is-open { display: block; }

.memo__share-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--black);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.memo__share-menu-item:hover { background: rgba(0,0,0,0.06); }

.memo__share-menu-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}

.memo__share-copied {
  display: inline-block;
  font-size: 13px;
  font-weight: 400;
  color: var(--black);
  opacity: 0;
  margin-left: 8px;
  transition: opacity 0.2s ease;
}
.memo__share-copied.is-visible { opacity: 1; }

/* ───────────────────────────────
   MOBILE
─────────────────────────────── */

@media (max-width: 767px) {

  .memos-nav {
    position: sticky;
    top: 70px;
    left: auto;
    right: auto;
    height: auto;
    display: block;
    overflow: visible;
  }

  .page-memos {
    padding-top: 70px;
  }

  .memos-nav__arrow { display: none; }

  .memos-nav__track { overflow: visible; }

  .memos-nav__list {
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
    scroll-behavior: auto;
  }
  .memos-nav__list.is-open {
    max-height: 600px;
    overflow-y: auto;
  }

  .memos-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px var(--pad);
    font-size: 13px;
    font-weight: 500;
    color: var(--black);
    background: var(--white);
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    cursor: pointer;
  }

  .memos-nav__toggle-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
  }
  .memos-nav__toggle.is-open .memos-nav__toggle-arrow {
    transform: rotate(180deg);
  }

  .memos-nav__link {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px var(--pad);
    opacity: 1;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    white-space: normal;
  }
  .memos-nav__link.is-active {
    border-left: 2px solid var(--blue);
    padding-left: calc(var(--pad) - 2px);
  }
  .memos-nav__link.is-active::after { display: none; }

  .memos-nav__link-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .memo {
    grid-template-columns: 1fr;
    padding: clamp(32px, 5vw, 48px) var(--pad);
  }

  .memo__image {
    position: relative;
    top: auto;
  }

  .memos-header-bg {
    height: 70px;
  }
}

/* ── Floid-Integration ── */

/* overflow-x: clip bricht position: sticky — auf Memos-Pages korrigieren */
html:has(body[data-page="memos"]),
html:has(body[data-page="memos-en"]) {
  overflow-x: visible;
}

/* Weisser Header-Hintergrund nur auf Memos-Pages */
body[data-page="memos"] .main-header,
body[data-page="memos-en"] .main-header {
  transition: background-color 0s;
}

body[data-page="memos"] .main-header:not(.menu-open),
body[data-page="memos-en"] .main-header:not(.menu-open) {
  background-color: #fff;
  transition: background-color 0.4s ease;
}

/* Weisse Fläche über Memos-Nav — Desktop */
.memos-header-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: #fff;
  z-index: 499;
}


/* ── Burger-Menu offen: memos-header-bg ausblenden ── */
html.no-scroll .memos-header-bg {
  display: none;
}
