/* ==========================================================================
   Singles: blog post (single.php) + success story (single-project.php)
   Loaded on is_singular( post | project ) – see inc/single.php
   Cards + CTA styles come from blog.css.
   ========================================================================== */

/* Header
   ========================================================================== */

.single-header {
  padding: 7.5rem 0 2.5rem; /* clears the fixed site header (80px) */
}

.single-header__trail {
  margin-bottom: 1rem;
}

.single-header__trail a,
.project-trail a {
  color: inherit;
  text-decoration: none;
}

.single-header__trail a:hover,
.project-trail a:hover {
  color: var(--wp--preset--color--link);
}

.single-header__trail span {
  margin: 0 0.375rem;
  opacity: 0.6;
}

.single-header__title {
  max-width: 54rem;
  margin: 0 0 1.5rem;
}

.single-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  font-size: 0.875rem;
  opacity: 0.85;
}

.single-byline__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.35;
}

.single-byline__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: var(--wp--custom--space-xxxs);
  background-color: var(--wp--preset--color--grey-900);
}

.single-byline__name {
  font-weight: 700;
}

/* Featured image (1440 x 680)
   ========================================================================== */

.single-image {
  margin: 0 auto 3.5rem;
}

.single-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1440 / 680;
  object-fit: cover;
  border-radius: 0.5rem;
}

.single-image figcaption {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  opacity: 0.7;
}

/* Layout: content + sidebar
   Desktop: content left, TOC + aside right.
   Mobile:  TOC > content > aside.
   ========================================================================== */

.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "toc"
    "content"
    "aside";
  gap: 2rem;
  margin-bottom: 5rem;
}

.single-toc {
  grid-area: toc;
}
.single-content {
  grid-area: content;
}
.single-aside {
  grid-area: aside;
}

@media (min-width: 992px) {
  .single-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "content toc"
      "content aside";
    column-gap: 3rem;
    row-gap: 1.5rem;
  }

  .single-layout--project {
    grid-template-areas:
      "content aside"
      "content aside";
  }
}

/* Content typography */
.single-content__body {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.single-content__body > *:first-child {
  margin-top: 0;
}

.single-content__body h2 {
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 7rem; /* fixed header */
}

.single-content__body h3 {
  margin: 2rem 0 0.75rem;
}

.single-content__body img {
  height: auto;
  border-radius: 0.375rem;
}

.single-content__body blockquote,
.single-content__body .wp-block-quote {
  margin: 2.5rem 0;
  padding: 1.75rem 2rem;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-left: 0;
  border-radius: 0.5rem;
  background: var(--wp--preset--color--background);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
}

.single-content__body blockquote cite,
.single-content__body .wp-block-quote cite {
  display: block;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 400;
  opacity: 0.75;
}

.single-tags {
  margin-top: 2rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* "Das Wichtigste in Kürze" */
.single-summary {
  margin-bottom: 2.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: 0.5rem;
  background: var(--wp--preset--color--background);
}

.single-summary__title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  color: var(--wp--preset--color--link);
}

.single-summary ul {
  margin: 0;
  padding-left: 1.25rem;
}

.single-summary li + li {
  margin-top: 0.5rem;
}

/* Rank Math FAQ block */
.single-content__body .rank-math-faq-block,
.single-content__body .wp-block-rank-math-faq-block {
  margin: 2.5rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.single-content__body .rank-math-faq-item,
.single-content__body .rank-math-list-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}

.single-content__body .rank-math-question {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.single-content__body .rank-math-answer > *:last-child {
  margin-bottom: 0;
}

/* Sidebar
   ========================================================================== */

.single-toc,
.single-services {
  box-sizing: border-box;
  width: 100%;
  background: var(--wp--preset--color--background);
  padding: 1.375rem;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: 0.5rem;
  align-self: start;
}

.single-toc__title,
.single-services__title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

.single-toc__list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.9375rem;
}

.single-toc__list a,
.single-services a {
  text-decoration: none;
}

.single-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
}

.single-services ul {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* CTA as sidebar box (markup: template-parts/content/modules/blog-cta.php) */
.blog-cta--box {
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 1.5rem;
}

.blog-cta--box .blog-cta__text {
  flex: 0 0 auto;
}

.blog-cta--box .blog-cta__title {
  font-size: 1.1875rem;
}

.blog-cta--box p {
  font-size: 0.9375rem;
}

/* Author box
   ========================================================================== */

.single-author {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 3rem;
  padding: 1.625rem;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: 0.5rem;
}

.single-author__avatar {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
}

.single-author__text {
  flex: 1 1 18rem;
  min-width: 0;
}

.single-author__label {
  font-size: 0.8125rem;
  opacity: 0.7;
}

.single-author__name {
  font-size: 1.1875rem;
  font-weight: 800;
}

.single-author__position {
  margin-bottom: 0.625rem;
  opacity: 0.8;
}

.single-author__bio {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

.single-author__link {
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

/* Related posts / more success stories
   ========================================================================== */

.single-related {
  padding: 4rem 0 6rem;
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.single-related .posts--grid {
  gap: 24px;
}

.single-related .post[data-style="card-background"] {
  min-height: 22rem;
}

.single-related .post[data-style="card-background"] .card-box__color {
  opacity: 1 !important;
  background: linear-gradient(to top, rgba(18, 20, 33, 0.96) 0%, rgba(18, 20, 33, 0.7) 40%, rgba(18, 20, 33, 0.1) 75%) !important;
}

@media (max-width: 767px) {
  .single-related {
    padding: 3rem 0 4rem;
  }
}

/* Success story: hero in card look + facts
   ========================================================================== */

.single-article--project {
  padding-top: 7.5rem; /* clears the fixed site header */
}

.project-trail {
  margin-bottom: 1rem;
}

.project-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 1440 / 680;
  min-height: 26rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: 0.5rem;
  color: #fff;
}

.project-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 20, 33, 0.95) 0%, rgba(18, 20, 33, 0.8) 35%, rgba(18, 20, 33, 0.15) 75%);
}

.project-hero__content {
  position: relative;
  max-width: 48rem;
  padding: 2.75rem;
}

.project-hero__logo img {
  display: block;
  width: auto;
  max-width: 11rem;
  max-height: 3.5rem;
  margin-bottom: 1.25rem;
}

.project-hero__title {
  margin: 0 0 0.875rem;
  color: inherit;
}

.project-hero__teaser {
  margin: 0;
  font-size: 1.125rem;
  opacity: 0.9;
}

@media (max-width: 767px) {
  .project-hero {
    aspect-ratio: auto;
  }

  .project-hero__overlay {
    background: linear-gradient(to top, rgba(18, 20, 33, 0.96) 0%, rgba(18, 20, 33, 0.8) 55%, rgba(18, 20, 33, 0.2) 100%);
  }

  .project-hero__content {
    padding: 1.75rem 1.5rem;
  }
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px;
  margin: 2rem 0 3.5rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: 0.5rem;
  background: color-mix(in srgb, currentColor 15%, transparent);
}

.project-facts__item {
  padding: 1.25rem 1.375rem;
  background: var(--wp--preset--color--background, #121421);
}

.project-facts dt {
  font-size: 0.8125rem;
  opacity: 0.7;
}

.project-facts dd {
  margin: 0.125rem 0 0;
  font-size: 1.0625rem;
  font-weight: 800;
}

.project-facts a {
  color: inherit;
}

/* Author image: ACF image or initials
   ========================================================================== */

.single-byline__avatar,
.single-author__avatar {
  object-fit: cover;
}

.single-byline__avatar--initials,
.single-author__avatar--initials {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--wp--preset--color--link);
  color: #121421;
  font-weight: 800;
  line-height: 1;
}

.single-byline__avatar--initials {
  font-size: 0.875rem;
}

.single-author__avatar--initials {
  font-size: 1.5rem;
}
