/* AstroScienceHub V2
   Neue zentrale Gestaltung. V0 (`oliXstyle.css`) wird hier nicht importiert. */

:root {
  --ash-navy: #06172a;
  --ash-navy-light: #0a1d33;
  --ash-hero-overlay: linear-gradient(180deg, rgba(1, 9, 22, .20), rgba(1, 9, 22, .34));
  --ash-hero-image-desktop: url("/assets/images/hero/hero-nebula-premium-desktop-v1.webp");
  --ash-hero-image-mobile: url("/assets/images/hero/hero-nebula-premium-mobile-v1.webp");
  --ash-gold: #e6b65a;
  --ash-gold-dark: #c9912e;
  --ash-cream: #f7f1e6;
  --ash-paper: #fffdf7;
  --ash-text: #07182b;
  --ash-text-soft: #526071;
  --ash-line: rgba(7, 24, 43, 0.14);
  --ash-content: 820px;
  --ash-wide: 1140px;
  --ash-gap: 1.5rem;
  --ash-radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ash-paper);
  color: var(--ash-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

main.content {
  grid-column: screen-start / screen-end !important;
  width: 100%;
  max-width: var(--ash-content);
  margin-inline: auto;
  padding-inline: 1.25rem;
  overflow-wrap: anywhere;
}

/* Die Startseite besitzt bereits einen eindeutigen Scope. Dadurch können
   breite Bereiche ohne fragile, vom Quarto-Spaltenraster abhängige Offsets
   direkt am Viewport ausgerichtet werden. */
main.content:has(> .ash-home) {
  grid-column: screen-start / screen-end !important;
  width: auto;
  max-width: none;
  margin-inline: 0;
  padding-inline: 0;
}

.ash-home {
  width: 100%;
}

.ash-home > h1,
.ash-home > h2,
.ash-home > h3,
.ash-home > p,
.ash-home > ul,
.ash-home > ol,
.ash-home > blockquote,
.ash-home > section:not(.ash-muted) {
  width: min(var(--ash-content), calc(100% - 2.5rem));
  margin-right: auto;
  margin-left: auto;
}

.ash-home > .hero,
.ash-home > section.ash-muted {
  width: 100%;
  left: auto;
  margin-left: 0;
}

.ash-home > section#faq {
  width: min(var(--ash-wide), calc(100% - 2.5rem));
}

h1,
h2,
h3 {
  color: var(--ash-text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

h2 {
  margin-top: 3.5rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p,
li {
  color: var(--ash-text-soft);
}

blockquote {
  max-width: var(--ash-wide);
  margin: 1rem auto;
  padding: .8rem 1rem;
  border-left: 4px solid var(--ash-gold);
  background: #fff4c7;
  color: #4c3a05;
}

blockquote p {
  margin: 0;
  color: inherit;
}

.navbar {
  background: #fff !important;
  border-bottom: 1px solid rgba(7, 24, 43, .08);
}

.navbar-brand,
.navbar-nav .nav-link {
  color: var(--ash-text) !important;
}

.hero {
  width: 100vw;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  left: 50%;
  margin-left: -50vw;
  padding: clamp(2.5rem, 6vw, 5rem) max(1.25rem, calc((100vw - var(--ash-wide)) / 2));
  background: var(--ash-hero-overlay), var(--ash-hero-image-desktop) 50% 46% / cover no-repeat;
  color: #fff;
  text-align: center;
}

main.content .hero::before,
main.content .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(42vw, 590px);
  aspect-ratio: 1;
  top: 5.5rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

main.content .hero::before {
  left: 25vw;
  transform: translateX(-50%);
  background-image: url("/assets/images/hero/astro_wheel_v2.svg");
  opacity: .72;
}

main.content .hero::after {
  left: 75vw;
  transform: translateX(-50%);
  background-image:
    url("/assets/images/hero/synastry-aspects-overlay.svg"),
    url("/assets/images/hero/astro_wheel_v2.svg");
  opacity: .78;
}

.hero h1,
.hero h2,
.hero h3,
.hero p {
  color: #fff;
}

.hero h1 {
  color: var(--ash-gold);
  background: linear-gradient(105deg, #f7d98a 0%, var(--ash-gold) 48%, #fff0b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .ash-emph {
  display: inline;
  color: var(--ash-gold);
  font-size: inherit;
  font-weight: 500;
  background: linear-gradient(105deg, #f7d98a 0%, var(--ash-gold) 48%, #fff0b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1,
.hero h2 {
  max-width: 900px;
  margin: 0 auto 1rem;
}

.hero > p,
.hero > section > p {
  max-width: 820px;
  margin: 0 auto 1.25rem;
}

section.ash-muted {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-top: 4rem;
  padding: 3.5rem max(1.25rem, calc((100vw - var(--ash-content)) / 2));
  background: var(--ash-cream);
  border-block: 1px solid rgba(7, 24, 43, .08);
}

section.ash-muted > h2 {
  margin-top: 0;
}

.ash-media {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 2rem;
  align-items: start;
  width: min(var(--ash-content), calc(100% - 2.5rem));
  margin: 4rem auto 2rem;
}

.ash-media.ash-muted {
  padding: 1.5rem;
  border: 0;
  border-radius: var(--ash-radius);
  background: var(--ash-cream);
}

.ash-media > p:first-child {
  grid-column: 1;
  grid-row: 1 / 4;
  margin: 0;
}

.ash-media > p:first-child img {
  display: block;
  width: 152px;
  height: auto;
  border-radius: 9px;
}

.ash-media > h2,
.ash-media > p:not(:first-child) {
  grid-column: 2;
}

.ash-media > h2 {
  margin: .25rem 0 .7rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
}

.ash-media > p {
  margin: 0 0 .7rem;
}

.ash-media a {
  color: var(--ash-gold-dark);
  text-decoration: none;
}

.ash-media a:hover,
.ash-media a:focus-visible {
  text-decoration: underline;
}

.ash-media.ash-media-right {
  grid-template-columns: minmax(0, 1fr) 152px;
}

.ash-media.ash-media-right > p:first-child {
  grid-column: 2;
}

.ash-media.ash-media-right > h2,
.ash-media.ash-media-right > p:not(:first-child) {
  grid-column: 1;
}

.ash-cols-2,
.ash-cols-3 {
  display: grid;
  gap: var(--ash-gap);
  width: min(var(--ash-wide), calc(100vw - 2.5rem));
  max-width: var(--ash-wide);
  position: relative;
  left: 50%;
  margin: 2rem 0;
  transform: translateX(-50%);
}

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

.ash-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ash-cols-2 > .ash-col,
.ash-cols-3 > .ash-col {
  height: 100%;
  padding: 1.6rem;
  border: 1px solid var(--ash-line);
  border-radius: var(--ash-radius);
  background: #fff;
}

.ash-cols-2 > .ash-col > h3:first-child,
.ash-cols-3 > .ash-col > h3:first-child {
  margin-top: 0;
}

.ash-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ash-gap);
  width: min(var(--ash-wide), calc(100vw - 2.5rem));
  max-width: var(--ash-wide);
  position: relative;
  left: 50%;
  margin: 2rem 0;
  transform: translateX(-50%);
}

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

.ash-cards.ash-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ash-cards.ash-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ash-cards > hr {
  display: none;
}

.ash-cards > .ash-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.6rem;
  border: 1px solid var(--ash-line);
  border-radius: var(--ash-radius);
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 24, 43, .1);
  color: var(--ash-text);
  text-align: left;
}

.ash-card h3,
.ash-card p {
  color: var(--ash-text);
}

.hero .ash-card {
  border-color: rgba(230, 182, 90, .74);
  background: rgba(5, 25, 43, .94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .18);
  color: #fff;
  text-align: center;
}

.hero .ash-card:nth-child(even) {
  background: rgba(19, 28, 63, .94);
}

.hero .ash-card h3,
.hero .ash-card p,
.hero .ash-card li {
  color: #fff;
}

.hero .ash-card > p:first-child strong {
  color: var(--ash-gold);
  font-size: .82rem;
  letter-spacing: .04em;
}

.ash-card > p:last-child {
  margin-top: auto;
}

/* Sprachunabhängige Homepage-Assets behalten feste visuelle Proportionen. */
.ash-card > p:first-child:has(img[src*="assets/icons/"]) {
  margin: 0 auto .55rem;
}

.ash-card img[src*="assets/icons/"] {
  display: block;
  width: 48px;
  height: 48px;
  max-width: none;
  filter: none;
}

.hero .ash-card img[src*="assets/icons/"] {
  width: 58px;
  height: 58px;
  padding: 10px;
  border: 1px solid rgba(230, 182, 90, .75);
  border-radius: 50%;
}

.ash-btn {
  display: inline-block;
  padding: .78rem 1.1rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none !important;
  transition: transform .15s ease, background-color .15s ease;
}

.ash-btn:hover,
.ash-btn:focus-visible {
  transform: translateY(-1px);
}

.ash-btn-primary {
  border-color: var(--ash-gold);
  background: var(--ash-gold);
  color: var(--ash-text) !important;
}

.ash-btn-primary:hover,
.ash-btn-primary:focus-visible {
  background: #f0c763;
}

.ash-btn-secondary {
  border-color: var(--ash-text);
  background: #fff;
  color: var(--ash-text) !important;
}

/* Allgemeine Vorschau der ersten Seite eines verlinkten PDF-Berichts. */
.ash-pdf-preview-layer {
  left: 0;
  max-height: calc(100vh - 36px);
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transition: opacity .16s ease, transform .16s ease;
  transform: translateY(.45rem);
  width: min(390px, calc(100vw - 36px));
  z-index: 10050;
}

.ash-pdf-preview-layer[hidden] {
  display: none;
}

.ash-pdf-preview-layer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ash-pdf-preview-image {
  display: block;
  filter: drop-shadow(0 1rem 1.1rem rgba(11, 24, 38, .34));
  height: auto;
  max-height: calc(100vh - 36px);
  max-width: 100%;
  object-fit: contain;
  transform: rotate(-1.4deg);
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .ash-pdf-preview-layer {
    transition: opacity .01ms linear;
    transform: none;
  }

  .ash-pdf-preview-image {
    transform: none;
  }
}

/* Shared PDF dialog: Bootstrap owns backdrop, focus trap and close behavior. */
.ash-pdf-modal .modal-title {
  border: 0;
  margin: 0;
  padding: 0;
}

.ash-pdf-modal .modal-content {
  height: calc(100vh - 3.5rem);
  height: calc(100dvh - 3.5rem);
}

.ash-pdf-modal .modal-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
}

.ash-pdf-modal-frame {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.ash-pdf-modal-frame[hidden] {
  display: none;
}

/* Touch devices: pages rendered by PDF.js inside the same dialog. */
.ash-pdf-modal-pages {
  background: var(--ash-cream);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .75rem;
}

.ash-pdf-modal-pages canvas {
  background: #fff;
  box-shadow: 0 1px 4px var(--ash-line);
  display: block;
  height: auto;
  margin: 0 auto .75rem;
  max-width: 100%;
  width: 100%;
}

.ash-pdf-modal-status {
  display: block;
  margin: 2rem auto;
  width: fit-content;
}

@media (max-width: 575.98px) {
  .ash-pdf-modal .modal-content {
    height: 100vh;
    height: 100dvh;
  }
}

.hero .ash-btn-secondary {
  border-color: rgba(255, 255, 255, .72);
}

#preview-status {
  min-height: 2.5em;
  margin-top: 1em;
  color: var(--ash-text-soft);
  font-style: italic;
}

/* Technischer Vertrag für eingebettete Radix- und Synastrieanimationen. */
.ash-why-animation {
  margin: 1.5rem 0 2rem;
}

.ash-why-animation iframe {
  display: block;
  width: 100%;
  height: min(78vh, 760px);
  min-height: 600px;
  border: 2px solid var(--ash-gold-dark);
  border-radius: 10px;
  background: var(--ash-navy-light);
}

.ash-why-animation figcaption {
  margin-top: 0.6rem;
  color: var(--ash-text-soft);
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 700px) {
  .ash-why-animation iframe {
    height: 760px;
    min-height: 0;
  }
}

footer.footer {
  margin-top: 4rem;
  background: var(--ash-navy);
  color: #fff;
}

footer.footer a,
footer.footer p {
  color: #fff;
}

footer.footer .nav-footer {
  background-color: var(--ash-navy);
}

/* A final hero can be a section or a fenced div, directly in main or inside
   the final Quarto section. Keep the established home-wrapper contract.
   Remove the trailing content row and default main margin in these cases. */
#quarto-content.page-rows-contents:has(
  > main.content > .hero:last-child,
  > main.content > section:last-child > .hero:last-child,
  > main.content > .ash-home .hero:last-child
) {
  min-height: max-content;
  grid-template-rows: [content-top] max-content [content-bottom] 0 [page-bottom];
}

#quarto-content:has(
  > main.content > .hero:last-child,
  > main.content > section:last-child > .hero:last-child,
  > main.content > .ash-home .hero:last-child
) > main.content {
  margin-bottom: 0;
}

/* Continue the final hero's background through the footer navigation row. */
main.content > .hero:last-child, main.content > section:last-child > .hero:last-child,
main.content > .ash-home .hero:last-child,
body:has(main.content > .hero:last-child, main.content > section:last-child > .hero:last-child, main.content > .ash-home .hero:last-child) footer.footer {
  background: var(--ash-hero-overlay), var(--ash-hero-image-desktop) 50% 46% / cover no-repeat fixed;
  background-attachment: fixed, fixed;
}

body:has(main.content > .hero:last-child, main.content > section:last-child > .hero:last-child, main.content > .ash-home .hero:last-child) footer.footer {
  margin-top: 0;
}

body:has(main.content > .hero:last-child, main.content > section:last-child > .hero:last-child, main.content > .ash-home .hero:last-child) footer.footer .nav-footer {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, .28);
}

/* Hero-page frame: overlay the header on the opening hero. */
body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) {
  padding-top: 0 !important;
}

body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) #quarto-content > main.content {
  padding-top: 0 !important;
}

body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) #quarto-header .navbar {
  background: transparent !important;
  border-bottom: 0;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) #quarto-header.headroom--not-top .navbar {
  background: var(--ash-navy) !important;
  box-shadow: 0 2px 18px rgba(0, 0, 0, .22);
}

/* An expanded menu must cover the page, including during its animation. */
body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) #quarto-header .navbar:has(.navbar-collapse.show, .navbar-collapse.collapsing) {
  background: var(--ash-navy) !important;
  transition: none;
}

body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) #quarto-header :is(.navbar-brand, .navbar-nav .nav-link, .navbar-toggler, .quarto-search-button, .aa-DetachedSearchButtonIcon) {
  color: #fff !important;
}

/* Bootstrap's icon variable is local to the icon in Quarto's dark theme. */
body.nav-fixed:has(
  main.content > section.hero:first-child,
  main.content > .ash-home > .hero:first-child
) #quarto-header .navbar-toggler-icon {
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (min-width: 992px) {
  body.nav-fixed:has(
    main.content > section.hero:first-child,
    main.content > .ash-home > .hero:first-child
  ) #quarto-header .navbar-brand {
    font-size: 1.1rem;
  }

  body.nav-fixed:has(
    main.content > section.hero:first-child,
    main.content > .ash-home > .hero:first-child
  ) #quarto-header .navbar-nav .nav-link {
    font-size: .94rem;
    white-space: nowrap;
  }

  body.nav-fixed:has(main.content > section.hero:first-child)
  main.content > section.hero:first-child,
  body.nav-fixed:has(main.content > .ash-home > .hero:first-child)
  main.content > .ash-home > .hero:first-child {
    padding-top: 10rem;
  }
}

@media (max-width: 991.98px) {
  body.nav-fixed:has(main.content > section.hero:first-child)
  main.content > section.hero:first-child,
  body.nav-fixed:has(main.content > .ash-home > .hero:first-child)
  main.content > .ash-home > .hero:first-child {
    padding-top: 8rem;
  }
}

@media (min-width: 900px) {
  .hero .ash-cards {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .hero .ash-cards.ash-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero .ash-cards.ash-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero .ash-cards.ash-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 899px) {
  .ash-cards.ash-cols-3,
  .ash-cards.ash-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero {
    padding-block: 2.5rem;
    background-image:
      linear-gradient(180deg, rgba(1, 9, 22, .13), rgba(1, 9, 22, .46)),
      var(--ash-hero-image-mobile);
    background-position: 50% 28%;
  }

  main.content > .hero:last-child, main.content > section:last-child > .hero:last-child,
  main.content > .ash-home .hero:last-child,
  body:has(main.content > .hero:last-child, main.content > section:last-child > .hero:last-child, main.content > .ash-home .hero:last-child) footer.footer {
    background-image:
      linear-gradient(180deg, rgba(1, 9, 22, .13), rgba(1, 9, 22, .46)),
      var(--ash-hero-image-mobile);
    background-position: 50% 28%;
  }

  main.content .hero::before,
  main.content .hero::after {
    width: 46vw;
    top: 4.2rem;
    opacity: .34;
  }

  main.content .hero::before { left: 25vw; }
  main.content .hero::after  { left: 75vw; }

  .ash-cols-2,
  .ash-cols-3,
  .ash-cards,
  .hero .ash-cards,
  .ash-cards.ash-cols-2,
  .ash-cards.ash-cols-3,
  .ash-cards.ash-cols-4 {
    grid-template-columns: 1fr;
  }

  .ash-card,
  .ash-cols-2 > .ash-col,
  .ash-cols-3 > .ash-col {
    padding: 1.2rem;
  }

  .ash-btn {
    width: 100%;
  }

  .ash-media,
  .ash-media.ash-media-right {
    grid-template-columns: 1fr;
    padding: 1.15rem;
  }

  .ash-media > p:first-child,
  .ash-media.ash-media-right > p:first-child,
  .ash-media > h2,
  .ash-media.ash-media-right > h2,
  .ash-media > p:not(:first-child),
  .ash-media.ash-media-right > p:not(:first-child) {
    grid-column: 1;
  }

  .ash-media > p:first-child,
  .ash-media.ash-media-right > p:first-child {
    grid-row: auto;
    margin-bottom: 1rem;
  }
}


.ash-center {
  text-align: center;
}

/* Technischer Vertrag: interaktive, eigenständige Wheel-SVGs. */
[data-ash-wheel-svg],
[data-ash-synastry-svg] {
  display: block;
  width: min(100%, 760px);
  aspect-ratio: 1;
  margin-inline: auto;
}

[data-ash-wheel-svg] > svg {
  display: block;
  width: 100%;
  height: auto;
}

.ash-svg-tooltip {
  position: fixed;
  z-index: 1080;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.45rem 0.65rem;
  border-radius: 0.4rem;
  background: rgba(24, 29, 38, 0.94);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.22);
}
