/* ============================
   Single Post – Editorial Layout
============================ */

/* Smooth scroll + offset for sticky header */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-offset, 0px) + 24px);
}

/* ---------- Reading Progress ---------- */
.reading-progress{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}

.reading-progress__bar{
  height: 100%;
  width: 0%;
  background: var(--c-text);
  transition: width 80ms linear;
}

/* ---------- Hero ---------- */
.single-hero{
  padding: 10px 0 clamp(26px, 5vh, 52px);
}

.single-hero__grid{
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 560px);
  gap: clamp(18px, 2.6vw, 52px);
  align-items: center;
  justify-content: center;
}

/* Bild: 4:5, editorial */
.single-hero__media{
  margin: 0;
  overflow: hidden;
  background: var(--c-paper);
  border: 1px solid var(--border-softer);
  border-radius: 8px;
  aspect-ratio: 4 / 5;
  max-width: 480px;
}

.single-hero__media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  color: transparent;
}

/* Textblock */
.single-hero__content{
  padding-top: 0;
}

/* Title */
.single-hero__title{
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.1;
  text-wrap: balance;
  font-size: clamp(32px, 3.4vw, 52px);
  max-width: 19ch;
}

/* ---------- Meta unter Title ---------- */
.single-meta{
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-meta__avatar{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.single-meta__avatar-img,
.single-meta__avatar img{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-softer);
  background: var(--panel);
}

.single-meta__text{
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.single-meta__author{
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.single-meta__author:hover{
  text-decoration: underline;
  text-underline-offset: 4px;
}

.single-meta__details{
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.4;
}

.single-meta__sep{
  margin: 0 4px;
  opacity: 0.6;
}

.single-meta__rt{ white-space: nowrap; }

/* Excerpt (optional) */
.single-hero__excerpt{
  margin: 16px 0 0;
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 56ch;
}

/* ---------- Body Wrapper ---------- */
.single-body{ padding: 0; }

/* Body: gleiche Breite wie Hero-Grid → linksbündig am Bild */
.single-body__inner{
  max-width: 1092px; /* 480 + 52 + 560 = Hero-Grid */
  margin: 0 auto;
}

/* ============================
   Body – Editorial Typography (Absätze optimiert)
============================ */
.entry-content{
  /* editorial serif body */
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", Times, serif;
  font-size: clamp(18px, 1.15vw, 20px);
  line-height: 1.75;
  letter-spacing: 0.005em;
  color: var(--c-text);

  /* optimale Lesebreite, linksbündig am Hero-Bild */
  max-width: 72ch;
  margin: 0;

  /* bessere Fließtext-Optik */
  text-rendering: optimizeLegibility;

  /* keine synthetischen Bold/Italic — echte Gewichte aus Variable Font */
  font-synthesis: none;

  /* Desktop: keine Silbentrennung */
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: break-word;

  /* modern (wenn unterstützt): schönere Zeilenumbrüche */
  text-wrap: pretty;
}

.entry-content > *:first-child{ margin-top: 0; }

/* Absätze: mehr Luft + ruhiger Rhythmus */
.entry-content p{
  margin: 0 0 24px;
}

/* Strong/Em etwas edler */
.entry-content strong{ font-weight: 700; }
.entry-content em{ font-style: italic; }

/* Links im Content: hochwertig und gut lesbar */
.entry-content a{
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- Headings ---------- */
.entry-content h2{
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
  font-size: clamp(26px, 2.4vw, 34px);
  margin: 56px 0 16px;
  padding-top: 12px;
  position: relative;
}

.entry-content h2::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 1px;
  background: var(--border-soft);
}

.entry-content h3{
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(22px, 1.9vw, 26px);
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
  margin: 44px 0 14px;
}

.entry-content h4{
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(19px, 1.2vw, 21px);
  letter-spacing: 0;
  line-height: 1.35;
  margin: 36px 0 10px;
}

/* Headings nicht „kleben" lassen */
.entry-content h2 + p,
.entry-content h3 + p,
.entry-content h4 + p{
  margin-top: 0;
}

/* ---------- Lists ---------- */
.entry-content ul,
.entry-content ol{
  margin: 0 0 24px;
  padding-left: 1.5em;
}

.entry-content li{
  margin: 8px 0;
}

.entry-content li > ul,
.entry-content li > ol{
  margin-top: 8px;
  margin-bottom: 8px;
}

/* ---------- Images / Figures ---------- */
.entry-content figure{
  margin: 40px 0;
}

.entry-content img{
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Bilder dürfen leicht breiter als Text sein */
.entry-content figure.wp-block-image,
.entry-content figure.alignwide{
  max-width: 80ch;
  margin-left: auto;
  margin-right: auto;
}

.entry-content figcaption{
  margin-top: 10px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: 0.015em;
}

/* ---------- Pullquote / Blockquote ---------- */
.entry-content blockquote{
  margin: 48px auto;
  max-width: 56ch;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.3;
  font-size: clamp(22px, 2.2vw, 28px);
  color: var(--c-text);
}

.entry-content blockquote p{
  margin: 0;
}

.entry-content blockquote cite,
.entry-content blockquote footer{
  display:block;
  margin-top: 16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ---------- WP Block: Hintergrund-Boxen (Redakteur-Boxen) ---------- */
.entry-content .has-background{
  background: var(--c-paper) !important;
  color: var(--c-text) !important;
  border: 1px solid var(--border-softer);
  border-radius: 8px;
  padding: 22px 24px;
  margin: 32px 0;
}

/* ---------- Callout / Infobox (bereit für späteren ACF Block) ---------- */
.callout{
  margin: 32px 0;
  padding: 22px 24px;
  background: var(--c-paper);
  border: 1px solid var(--border-softer);
  border-radius: 8px;
}

.callout__kicker{
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--c-muted);
}

.callout > *:last-child{ margin-bottom: 0; }

/* ---------- Buttons/CTA (WP Button Block) ---------- */
.entry-content .wp-block-button{
  margin: 30px 0 40px;
  text-align: center;
}

.entry-content .wp-block-button__link{
  padding: 12px 18px;
  border-radius: 999px;
}

/* ---------- Dividers ---------- */
.single-divider{
  margin: clamp(26px, 5vh, 44px) 0;
  border: 0;
  height: 1px;
  background: var(--border-softer);
}

/* ---------- Share Buttons ---------- */
.share-section{
  text-align: center;
}

.share-buttons{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.share-buttons__label{
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--c-muted);
}

.share-buttons__list{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.share-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border-softer);
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.share-btn:hover{
  background: var(--c-paper);
  border-color: var(--border-soft);
}

.share-btn svg{
  flex-shrink: 0;
}

/* Copy feedback */
.share-btn--copy.is-copied{
  border-color: var(--c-text);
}

.share-btn--copy.is-copied .share-btn__icon-copy{ display: none; }
.share-btn--copy.is-copied .share-btn__icon-check{ display: inline-block !important; }

/* Native share: hidden by default, shown via JS on mobile */
.share-btn--native[hidden]{ display: none; }

/* ---------- Author box (ohne Bild) ---------- */
.author-box{ text-align: center; }

.author-box__title{
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 2.1vw, 28px);
  line-height: 1.1;
}

.author-box__bio{
  margin: 0 auto;
  max-width: 72ch;
  color: var(--c-muted);
  line-height: 1.75;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ---------- Related Reading ---------- */
.related{ padding-top: 6px; }

.related__title{
  text-align: center;
  margin: 0 0 28px;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.related-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 40px);
}

.related-card{ text-align:center; }

.related-card__media{
  display:block;
  overflow:hidden;
  background: var(--c-paper);
  border: 1px solid var(--border-softer);
  border-radius: 8px;
  aspect-ratio: 4 / 5;
}

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

.related-card__meta{
  margin: 18px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 12px;
  color: var(--c-muted);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.related-card__title{
  margin: 16px auto 0;
  max-width: 22ch;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
  font-size: clamp(18px, 1.65vw, 21px);
}

.related-card__title a{ text-decoration:none; }
.related-card__title a:hover{ text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Comments ---------- */
.comments-section{
  max-width: var(--container);
  margin: 0 auto;
}

.comments-title{
  text-align: center;
  margin: 0 0 28px;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.comment-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list .comment{
  background: var(--c-paper);
  border-radius: 24px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.comment-list .children{
  list-style: none;
  padding: 0;
  margin: 16px 0 0 28px;
}

.comment-meta{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.comment-avatar__img{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-softer);
  background: var(--panel);
  display: block;
}

.comment-meta__text{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment-author{
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.comment-author a{
  text-decoration: none;
}

.comment-author a:hover{
  text-decoration: underline;
  text-underline-offset: 4px;
}

.comment-date{
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--c-muted);
}

.comment-content{
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", Times, serif;
  font-size: clamp(17px, 1.1vw, 19px);
  line-height: 1.7;
}

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

.comment-awaiting{
  font-size: 13px;
  color: var(--c-muted);
  font-style: italic;
  margin: 0 0 10px;
}

.comment-reply{
  margin-top: 10px;
}

.comment-reply-link{
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--c-muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.comment-reply-link:hover{
  color: var(--c-text);
}

/* Comment pagination */
.comments-section .nav-links{
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
  font-size: 14px;
}

.comments-section .nav-links a{
  text-decoration: none;
  color: var(--c-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.comments-section .nav-links a:hover{
  color: var(--c-text);
}

/* Comment form */
.comments-section .comment-respond{
  margin-top: 32px;
}

.comments-section .comment-reply-title{
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 2.1vw, 28px);
  line-height: 1.1;
  text-align: center;
}

.comments-section .comment-reply-title small{
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

.comments-section .comment-reply-title small a{
  color: var(--c-muted);
  text-decoration: none;
}

.comments-section .comment-reply-title small a:hover{
  text-decoration: underline;
  text-underline-offset: 4px;
}

.comment-form label{
  display: block;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--c-muted);
  margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea{
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-softer);
  border-radius: 12px;
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus{
  outline: none;
  border-color: var(--c-text);
}

.comment-form textarea{
  min-height: 160px;
  resize: vertical;
}

.comment-form p{
  margin: 0 0 16px;
}

.comment-form .submit{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 28px;
  border: 1px solid var(--border-softer);
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.comment-form .submit:hover{
  background: var(--c-paper);
  border-color: var(--border-soft);
}

.comments-closed,
.comments-protected{
  text-align: center;
  color: var(--c-muted);
  font-size: 14px;
  margin: 24px 0;
}

/* ---------- Table of Contents ---------- */
/* --- TOC wrapper --- */
.toc {
  margin: 0 0 24px;
}

/* --- <details> reset --- */
.toc__details {
  border-top: 1px solid var(--border-soft);
}

/* --- Toggle (summary) --- */
.toc__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  min-height: 44px;
}

.toc__toggle::-webkit-details-marker { display: none; }

.toc__toggle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--c-muted);
  border-bottom: 1.5px solid var(--c-muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s ease;
}

.toc__details[open] > .toc__toggle::after {
  transform: rotate(-135deg);
}

/* --- List --- */
.toc__list {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

/* --- Items --- */
.toc__item {
  counter-increment: toc;
  margin: 0;
  padding: 0;
}

.toc__item a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 16px;
  line-height: 1.45;
  text-decoration: none;
  color: var(--c-text);
}

.toc__item a::before {
  content: counter(toc) ".";
  flex-shrink: 0;
  min-width: 18px;
  color: var(--c-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.toc__item a:hover {
  color: var(--c-muted);
}


/* =========================================
   Responsive (Editorial Trick + Premium Byline)
========================================= */
@media (max-width: 980px){
  /* Hero: 1 Spalte */
  .single-hero__grid{
    grid-template-columns: 1fr;
    justify-content: stretch;
    align-items: start;
  }

  /* Reihenfolge: Title/Meta zuerst, dann Bild */
  .single-hero__content{
    order: 1;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
  }

  /* Meta: gestapelt + zentriert auf Tablet/Mobile */
  .single-meta{
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 20px;
    gap: 6px;
  }

  /* Hero Bild: kleiner + runder */
  .single-hero__media{
    order: 2;
    margin: 22px auto 0;
    max-width: 92vw;
    border-radius: 8px;
  }

  .single-hero__title{
    margin-left: auto;
    margin-right: auto;
    max-width: 18ch;
  }

  .single-hero__excerpt{
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  /* Body: zentriert auf Tablet/Mobile */
  .entry-content{
    margin: 0 auto;
  }

  .related-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Breadcrumbs: zentriert mit dem Textblock */
  .breadcrumbs__list{
    justify-content: center;
  }

  .breadcrumbs{
    margin-bottom: 12px;
  }

  /* Comments: nested replies */
  .comment-list .children{
    margin-left: 20px;
  }
}

@media (max-width: 768px){
  .related-grid{ grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 560px){
  .single-hero{
    padding: 2px 0 26px;
  }

  .single-hero__title{
    font-size: clamp(30px, 8.5vw, 40px);
    line-height: 1.12;
    max-width: 16ch;
  }

  .single-meta__details{
    font-size: 11px;
    letter-spacing: 0.18em;
  }

  .single-hero__media{
    border-radius: 8px;
  }

  .toc__item a {
    font-size: 15px;
  }

  /* Body: mobile optimal + Silbentrennung an */
  .entry-content{
    font-size: 18px;
    line-height: 1.72;
    max-width: 100%;
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  .entry-content p{
    margin-bottom: 21px;
  }

  .entry-content h2{
    font-size: 25px;
    margin-top: 44px;
    margin-bottom: 13px;
  }

  .entry-content h3{
    font-size: 22px;
    margin-top: 36px;
    margin-bottom: 12px;
  }

  .entry-content h4{
    font-size: 19px;
    margin-top: 30px;
  }

  .entry-content blockquote{
    margin: 36px auto;
    font-size: clamp(20px, 5.5vw, 24px);
  }

  .entry-content figure{
    margin: 32px 0;
  }

  .related-grid{
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .related-card__title{
    max-width: 30ch;
    font-size: 22px;
  }

  /* Breadcrumbs: kompakter auf Mobile */
  .breadcrumbs__list{
    font-size: 10px;
    letter-spacing: 0.22em;
  }

  /* Share: native button full width on mobile when available */
  .share-btn--native:not([hidden]){
    display: inline-flex;
    width: 100%;
    justify-content: center;
  }

  /* Hide desktop share buttons when native is available */
  .share-btn--native:not([hidden]) ~ .share-buttons__desktop{
    display: none;
  }

  .share-btn{
    padding: 10px 14px;
    font-size: 12px;
  }

  /* Comments: compact on mobile */
  .comment-list .children{
    margin-left: 16px;
  }

  .comment-list .comment{
    padding: 18px 18px;
  }
}

/* =========================================
   Reduced Motion
========================================= */
@media (prefers-reduced-motion: reduce){
  html {
    scroll-behavior: auto;
  }

  .toc__toggle::after,
  .reading-progress__bar,
  .share-btn,
  .comment-form input[type="text"],
  .comment-form input[type="email"],
  .comment-form textarea,
  .comment-form .submit{
    transition: none;
  }
}
