/*
Theme Name: Cosmic DM Runes
Theme URI: https://cosmicdmrunes.com
Author: Cosmic DM Runes
Description: A dark cosmic block theme for a humble Dungeon Master's epic journey.
Version: 1.6.15
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: cosmicdmrunes
*/

:root {
  --cosmic-ink: #070713;
  --cosmic-deep: #10102a;
  --cosmic-violet: #6f46c9;
  --cosmic-gold: #d9b86c;
  --cosmic-ivory: #f3eddf;
  --cosmic-muted: #b9b0ca;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(111,70,201,.22), transparent 28rem),
    radial-gradient(circle at 85% 32%, rgba(55,90,170,.16), transparent 25rem),
    var(--cosmic-ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .30;
  background-image:
    radial-gradient(circle, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle, #d9b86c 0 1px, transparent 1.4px);
  background-position: 0 0, 28px 37px;
  background-size: 73px 73px, 109px 109px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a { text-underline-offset: .18em; }

.cosmic-shell { position: relative; z-index: 1; }

.rune-rule {
  color: var(--cosmic-gold);
  font-size: clamp(.72rem, 1.8vw, 1rem);
  letter-spacing: .55em;
  opacity: .82;
  overflow: hidden;
  white-space: nowrap;
}

.cosmic-hero {
  min-height: 78vh;
  display: flex;
  align-items: center;
  border-block: 1px solid rgba(217,184,108,.28);
  background:
    linear-gradient(90deg, rgba(7,7,19,.94) 0%, rgba(7,7,19,.76) 42%, rgba(7,7,19,.28) 72%, rgba(7,7,19,.52) 100%),
    linear-gradient(180deg, rgba(7,7,19,.08) 45%, rgba(7,7,19,.66) 100%),
    url("assets/images/cosmic-occultist-hero.png") center bottom / cover no-repeat;
}

.cosmic-hero h1 {
  text-wrap: balance;
  text-shadow: 0 0 34px rgba(111,70,201,.45);
}

.cosmic-kicker {
  color: var(--cosmic-gold);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.cosmic-card {
  position: relative;
  height: 100%;
  border: 1px solid rgba(217,184,108,.24);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(29,25,57,.92), rgba(12,12,29,.94));
  box-shadow: 0 18px 45px rgba(0,0,0,.24);
  transition: transform .2s ease, border-color .2s ease;
}

.cosmic-path-link {
  color: inherit;
  text-decoration: none;
}

.cosmic-path-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.cosmic-card:has(.cosmic-path-link) {
  cursor: pointer;
}

.cosmic-card:has(.cosmic-path-link):focus-within {
  border-color: var(--cosmic-gold);
  box-shadow: 0 18px 45px rgba(0,0,0,.24), 0 0 0 3px rgba(217,184,108,.22);
}

.cosmic-card:hover {
  transform: translateY(-4px);
  border-color: rgba(217,184,108,.62);
}

.cosmic-sigil {
  color: var(--cosmic-gold);
  font-size: 2.1rem;
  line-height: 1;
}

.cosmic-quote {
  border-left: 2px solid var(--cosmic-gold);
  color: var(--cosmic-muted);
}

.cosmic-about {
  position: relative;
}

.cosmic-about::before {
  content: "ᛟ";
  display: block;
  margin-bottom: 1rem;
  color: var(--cosmic-gold);
  font-size: 2rem;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 24px rgba(217,184,108,.34);
}

.cosmic-footer { border-top: 1px solid rgba(217,184,108,.22); }

.cosmic-subscribe {
  margin-bottom: 1.25rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid rgba(217,184,108,.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(29,25,57,.72), rgba(12,12,29,.82));
  box-shadow: 0 16px 42px rgba(0,0,0,.2);
}

.cosmic-subscribe h2 { margin-top: 0; }

.cosmic-subscription-form form {
  max-width: 560px;
  margin-inline: auto;
}

.cosmic-subscription-form input[type="email"] {
  min-width: 0;
}

/* A long-form cosmic voyage for the About page and complete articles. */
body.cosmic-longform-page {
  background-color: var(--cosmic-ink);
  background-image:
    linear-gradient(90deg, rgba(7,7,19,.12), rgba(7,7,19,.60) 30%, rgba(7,7,19,.78) 50%, rgba(7,7,19,.60) 70%, rgba(7,7,19,.12)),
    url("assets/images/about-nebula-vertical.png");
  background-position: center top;
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-attachment: fixed;
}

body.cosmic-longform-page::before {
  opacity: .18;
  mask-image: none;
}

body.cosmic-longform-page main.cosmic-shell {
  margin-block: clamp(1.25rem, 4vw, 3.5rem);
  border: 1px solid rgba(217,184,108,.20);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(7,7,19,.16) 0%, rgba(7,7,19,.64) 18%, rgba(7,7,19,.86) 32%, rgba(7,7,19,.90) 50%, rgba(7,7,19,.86) 68%, rgba(7,7,19,.64) 82%, rgba(7,7,19,.16) 100%),
    linear-gradient(180deg, rgba(7,7,19,.18), rgba(10,9,24,.34));
  box-shadow: 0 30px 90px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(2px);
}

body.cosmic-longform-page main.cosmic-shell h1,
body.cosmic-longform-page main.cosmic-shell h2 {
  text-shadow: 0 0 28px rgba(111,70,201,.42);
}

/* Keep the About portrait present without overpowering the long-form copy. */
body.cosmic-about-page .wp-block-post-featured-image {
  width: min(100%, 680px);
  margin-inline: auto;
}

body.cosmic-about-page .wp-block-post-featured-image img {
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(0,0,0,.34);
}

.wp-block-navigation a { text-decoration: none; }
.wp-block-navigation a:hover { color: var(--cosmic-gold); }

/* Keep gallery captions in their own space instead of overlaying astronomy images. */
.wp-block-gallery.has-nested-images figure.wp-block-image {
  display: flex;
  flex-direction: column;
}

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
  height: auto;
  flex: 0 0 auto;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  position: static;
  width: 100%;
  max-height: none;
  margin: 0;
  padding: .6rem .45rem .2rem;
  overflow: visible;
  background: none;
  color: var(--cosmic-muted);
  font-size: .86rem;
  line-height: 1.4;
  text-align: center;
}

.cosmic-language-switcher {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-inline-start: .55rem;
  padding-inline-start: .85rem;
  border-inline-start: 1px solid rgba(217,184,108,.32);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.cosmic-language-switcher a {
  padding: .2rem .28rem;
  color: var(--cosmic-muted);
  text-decoration: none;
}

.cosmic-language-switcher a:hover,
.cosmic-language-switcher a[aria-current="true"] {
  color: var(--cosmic-gold);
}

.cosmic-language-switcher .cosmic-language-separator {
  color: rgba(217,184,108,.38);
}

@media (max-width: 782px) {
  .cosmic-hero {
    min-height: 72vh;
    background:
      linear-gradient(180deg, rgba(7,7,19,.74) 0%, rgba(7,7,19,.48) 48%, rgba(7,7,19,.72) 100%),
      url("assets/images/cosmic-occultist-hero.png") 61% bottom / cover no-repeat;
  }
  .rune-rule { letter-spacing: .28em; }

  .cosmic-subscription-form form {
    flex-direction: column;
  }

  .cosmic-subscription-form input[type="email"],
  .cosmic-subscription-form button {
    width: 100% !important;
  }

  .cosmic-language-switcher {
    margin-inline-start: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  body.cosmic-longform-page {
    background-size: auto 1450px;
    background-attachment: scroll;
  }

  body.cosmic-longform-page main.cosmic-shell {
    margin-block: .75rem;
    border-inline: 0;
    border-radius: 0;
    background: rgba(7,7,19,.84);
    backdrop-filter: none;
  }

  .wp-block-gallery.has-nested-images.columns-2 figure.wp-block-image:not(#individual-image) {
    width: 100%;
    flex-basis: 100%;
  }

  .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
    padding: .55rem .35rem .9rem;
    font-size: .82rem;
    line-height: 1.45;
  }
}
