/* Josefin Sans (SIL Open Font License, see fonts/OFL.txt), served from this site instead of Google Fonts */
@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/josefin-sans-semibold.woff") format("woff");
}
@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/josefin-sans-bold.woff") format("woff");
}

/* ===== Space theme ===== */
:root {
  --space-bg: #0b0d21;
  --space-bg-2: #141737;
  --panel: rgba(23, 26, 54, 0.82);
  --panel-border: rgba(185, 166, 255, 0.22);
  --ink: #e8e6f5;
  --ink-muted: #a9a6c4;
  --purple: #b9a6ff;        /* links */
  --purple-hover: #d6cbff;
  --purple-strong: #6d4bff; /* buttons */
  --purple-strong-hover: #5a38f0;
  --gold: #f5cf6b;
  /* Heading font — to try another, change it here and in the Google Fonts link in _Layout.cshtml */
  --heading-font: "Josefin Sans", system-ui, sans-serif;
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  color: var(--ink);
  background-color: var(--space-bg);
  /* Two layers of tiny stars over a deep-space gradient */
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 140px 80px, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 90px 160px, #d6cbff, transparent),
    radial-gradient(1px 1px at 200px 220px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 260px 40px, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 330px 190px, #fff, transparent),
    radial-gradient(ellipse at 80% -10%, rgba(109, 75, 255, .35), transparent 55%),
    radial-gradient(ellipse at -10% 110%, rgba(59, 130, 246, .18), transparent 50%),
    linear-gradient(180deg, var(--space-bg) 0%, var(--space-bg-2) 100%);
  background-size:
    360px 260px, 360px 260px, 360px 260px, 360px 260px, 360px 260px, 360px 260px,
    100% 100%, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, .navbar-brand, .display-4, .display-5 {
  font-family: var(--heading-font);
  font-weight: 600;
  letter-spacing: .02em;
}

/* Links: purple */
a { color: var(--purple); }
a:hover, a:focus { color: var(--purple-hover); }

/* Navbar */
.navbar.space-nav {
  background: rgba(11, 13, 33, 0.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-border);
}
.space-nav .navbar-brand { color: #fff; font-weight: 700; }
.space-nav .navbar-brand:hover { color: var(--purple-hover); }
.space-nav .nav-link { color: var(--purple) !important; }
.space-nav .nav-link:hover, .space-nav .nav-link:focus { color: var(--purple-hover) !important; }

/* Panels and cards: no boxes — content sits directly on the starfield */
.card, .bg-light, .bg-white {
  background: transparent !important;
  color: var(--ink);
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
}
.shadow-sm { box-shadow: none !important; }
hr { background-color: var(--panel-border); color: var(--panel-border); border: 0; opacity: 1; }

/* Text colors tuned for dark backgrounds */
.text-muted, .text-secondary { color: var(--ink-muted) !important; }
.text-dark { color: var(--ink) !important; }
.text-primary { color: var(--purple) !important; }
.text-warning { color: var(--gold) !important; }
.text-info { color: #67d4ef !important; }
.lead { color: var(--ink); }

/* Buttons */
.btn-primary {
  color: #fff;
  background-color: var(--purple-strong);
  border-color: var(--purple-strong);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  color: #fff;
  background-color: var(--purple-strong-hover);
  border-color: var(--purple-strong-hover);
}
.btn-link { color: var(--purple); }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 0.1rem var(--space-bg), 0 0 0 0.25rem var(--purple);
}

/* Form fields */
.form-control, .form-select {
  background-color: rgba(11, 13, 33, 0.7);
  color: var(--ink);
  border: 1px solid var(--panel-border);
}
.form-control:focus, .form-select:focus {
  background-color: rgba(11, 13, 33, 0.9);
  color: var(--ink);
  border-color: var(--purple);
}
.form-select option { background: var(--space-bg-2); color: var(--ink); }
input[type="datetime-local"] { color-scheme: dark; }

/* Tables */
.table { color: var(--ink); border-color: var(--panel-border); }

/* Footer */
.footer { border-top: 1px solid var(--panel-border) !important; color: var(--ink-muted) !important; }

/* Moon Data sidebar */
.space-sidebar a { text-decoration: none; }
.space-sidebar a:hover { text-decoration: underline; }
.space-sidebar .section-title {
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink);
  margin: .9rem 0 .4rem;
}
/* Planet sub-list: symbol and name on one row */
.planet-list { list-style: none; padding-left: .85rem; margin: 0; border-left: 1px solid var(--panel-border); }
.planet-list li { margin: .1rem 0; }
.planet-list a { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.planet-list .glyph { display: inline-block; width: 1.2em; text-align: center; font-size: 1.1rem; }
.planet-list a:hover .glyph { text-shadow: 0 0 8px rgba(185,166,255,.8); }

/* Narrow, centered forms so inputs don't stretch the full column */
.compact-form { max-width: 340px; margin: 0 auto; }

/* Moon Tracker results */
.moon-emoji { font-size: 5rem; line-height: 1; filter: drop-shadow(0 0 18px rgba(245, 236, 200, .35)); }

/* Links on sign names inside headings keep the heading's color */
a.sign-link { color: inherit; text-decoration: none; border-bottom: 2px dotted currentColor; }
a.sign-link:hover { color: var(--purple-hover); }

/* Zodiac grid */
.zodiac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.25rem .75rem; }
.zodiac-tile { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .75rem .25rem; text-decoration: none; color: var(--ink); border-radius: 14px; transition: transform .15s ease, background-color .15s ease; }
.zodiac-tile:hover, .zodiac-tile:focus { color: var(--ink); background: rgba(185, 166, 255, .08); transform: translateY(-3px); }
.zodiac-tile .name { font-family: var(--heading-font); font-size: 1.2rem; font-weight: 600; color: var(--purple); }
.zodiac-tile .dates { font-size: .8rem; color: var(--ink-muted); }

/* Element pills */
.element { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; margin-top: .2rem; }
.element-fire { background: rgba(255, 138, 92, .18); color: #ffb08f; }
.element-earth { background: rgba(143, 209, 138, .18); color: #a9e3a4; }
.element-air { background: rgba(159, 211, 255, .18); color: #b9dcff; }
.element-water { background: rgba(127, 224, 220, .18); color: #9feae6; }

/* Sign detail page */
.keyword { display: inline-block; margin: .15rem; padding: .15rem .65rem; border: 1px solid var(--panel-border); border-radius: 999px; font-size: .85rem; color: var(--ink-muted); }
.sign-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 1.5rem 0; text-align: center; }
.sign-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); font-weight: 600; }
.sign-facts dd { margin: 0; font-size: 1.05rem; }

/* Space Ipsum */
.ipsum-controls { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: center; }
.ipsum-text p { font-size: 1.05rem; line-height: 1.75; margin-bottom: 1.25rem; }
.form-check-input { background-color: rgba(11, 13, 33, 0.7); border-color: var(--panel-border); }
.form-check-input:checked { background-color: var(--purple-strong); border-color: var(--purple-strong); }

/* About page timeline */
.timeline { border-left: 2px solid var(--panel-border); padding-left: 1.25rem; margin-left: .35rem; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before {
  content: ""; position: absolute; left: calc(-1.25rem - 6px); top: .35rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 8px rgba(185, 166, 255, .8);
}
.timeline-when { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); margin-bottom: .15rem; }

/* Home hero: the 1902 "A Trip to the Moon" clip, feathered into the starfield */
.hero { padding: .5rem 0 1rem; }
.hero-film { position: relative; max-width: 560px; margin: 0; }
.hero-film video {
  display: block; width: 100%; height: auto; border-radius: 50%/42%;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 52%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 52%, transparent 72%);
  filter: sepia(.25) hue-rotate(205deg) saturate(1.4) contrast(1.05);
}
.hero-film-toggle {
  position: absolute; right: 12%; bottom: 10%;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--panel-border); background: rgba(11, 13, 33, .75); color: var(--ink);
  font-size: .8rem; line-height: 1; cursor: pointer; opacity: .7;
}
.hero-film-toggle:hover, .hero-film-toggle:focus-visible { opacity: 1; border-color: var(--purple); }
.hero h1 { font-size: 2.6rem; }
.hero-credit { font-size: .75rem; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) {
  .hero-film video { animation: none; }
}

/* Tint an emoji purple (used for the Space Ipsum rocket) */
.emoji-purple {
  display: inline-block;
  filter: grayscale(1) sepia(1) hue-rotate(205deg) saturate(3.5) brightness(.85) contrast(1.15) drop-shadow(0 0 6px rgba(185, 166, 255, .65));
}

/* Space Ipsum: planets drifting around the page edges */
.ipsum-sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ipsum-page { position: relative; z-index: 1; }
.float-planet { position: absolute; height: auto; opacity: .9; animation: planet-float 9s ease-in-out infinite; }
.p-saturn  { width: 150px; top: 14%; left: 4%;  animation-delay: -1s; }
.p-jupiter { width: 130px; top: 58%; left: 7%;  animation-delay: -4s; animation-duration: 11s; }
.p-mars    { width: 70px;  top: 38%; left: 15%; animation-delay: -2s; animation-duration: 8s; }
.p-mercury { width: 46px;  top: 82%; left: 20%; animation-delay: -6s; }
.p-neptune { width: 110px; top: 16%; right: 6%; animation-delay: -3s; animation-duration: 10s; }
.p-venus   { width: 80px;  top: 44%; right: 14%; animation-delay: -5s; }
.p-uranus  { width: 110px; top: 66%; right: 5%; animation-delay: -7s; animation-duration: 12s; }
.p-pluto   { width: 44px;  top: 86%; right: 22%; animation-delay: -2.5s; animation-duration: 7s; }
@keyframes planet-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}
/* On narrow screens there's no empty margin, so fade the planets behind the text */
@media (max-width: 1199px) {
  .float-planet { opacity: .25; }
}
@media (prefers-reduced-motion: reduce) {
  .float-planet { animation: none; }
}

/* Pages laid out to fit on one screen without scrolling (desktop) */
.fit-page { padding-top: .25rem; }
.fit-page h1, .fit-page h2 { line-height: 1.15; }
.sign-facts-compact { grid-template-columns: repeat(2, 1fr); margin: .5rem 0 0; gap: .5rem; }
@media (min-width: 992px) {
  .result-panel { border-left: 1px solid var(--panel-border); padding-left: 2rem; }
}

/* Compact Moon Data sidebar so it doesn't force scrolling on laptop screens */
.space-sidebar { padding-top: .5rem !important; }
.space-sidebar p { margin-bottom: .2rem !important; }
.space-sidebar .section-title { margin: .5rem 0 .2rem; }
.space-sidebar > .d-flex { margin-bottom: .5rem !important; }
.planet-list { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; column-gap: .9rem; margin-bottom: .2rem !important; }
.planet-list li { margin: 0; }
.space-sidebar { padding-left: 0 !important; padding-right: .5rem !important; }
.planet-list { padding-left: .55rem; column-gap: .6rem; font-size: .92rem; }
.planet-list a { gap: .3rem; }
.planet-list .glyph { width: 1em; font-size: 1rem; }
.moon-emoji-sm { font-size: 3.5rem; }

/* Collapsible Moon Data sidebar: the "Moon Data" heading is the toggle button */
.sidebar-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; border: 0; padding: .5rem 0 .25rem; margin: 0;
  color: var(--ink); font-size: 1rem; cursor: pointer;
}
.sidebar-toggle:hover .sidebar-toggle-icon, .sidebar-toggle:focus-visible .sidebar-toggle-icon { color: var(--purple-hover); border-color: var(--purple); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }
.sidebar-logo { filter: invert(1) drop-shadow(0 0 6px rgba(214,203,255,.7)); }
.sidebar-toggle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border: 1px solid var(--panel-border); border-radius: 50%;
  color: var(--purple); font-size: .95rem; line-height: 1;
}
.space-sidebar { padding-top: 0 !important; }
.moon-shell.collapsed .moon-aside { flex: 0 0 auto; width: auto; }
.moon-shell.collapsed #moonSidebar { display: none; }
.moon-shell.collapsed .moon-main { flex: 1 1 0; width: auto; max-width: none; }
@media (max-width: 575.98px) {
  .moon-shell.collapsed .moon-aside { width: 100%; }
}

/* Home page: twinkling stars that drift like the Space Ipsum planets */
.float-star {
  position: absolute; filter: drop-shadow(0 0 6px rgba(255, 246, 194, .75));
  animation: planet-float 9s ease-in-out infinite, star-twinkle 3.5s ease-in-out infinite;
}
.s1  { top: 14%; left: 8%;  animation-delay: -1s, -.5s; }
.s2  { top: 30%; left: 18%; animation-delay: -3s, -1.2s; animation-duration: 11s, 2.8s; }
.s3  { top: 48%; left: 6%;  animation-delay: -5s, -2s; }
.s4  { top: 66%; left: 15%; animation-delay: -2s, -.8s; animation-duration: 8s, 4s; }
.s5  { top: 82%; left: 9%;  animation-delay: -6s, -2.6s; animation-duration: 12s, 3s; }
.s6  { top: 22%; left: 26%; animation-delay: -4s, -1.6s; }
.s7  { top: 12%; right: 10%; animation-delay: -2.5s, -1s; animation-duration: 10s, 3.2s; }
.s8  { top: 28%; right: 22%; animation-delay: -7s, -.3s; }
.s9  { top: 44%; right: 7%;  animation-delay: -1.5s, -2.2s; animation-duration: 11s, 4.2s; }
.s10 { top: 62%; right: 17%; animation-delay: -3.5s, -1.4s; }
.s11 { top: 78%; right: 8%;  animation-delay: -5.5s, -.9s; animation-duration: 9s, 2.6s; }
.s12 { top: 88%; right: 25%; animation-delay: -6.5s, -3s; }
@keyframes star-twinkle {
  0%, 100% { opacity: .95; }
  50% { opacity: .35; }
}
@media (max-width: 1199px) {
  .float-star { opacity: .5; }
}
@media (prefers-reduced-motion: reduce) {
  .float-star { animation: none; }
}

/* My Favorite Things */
.favorites-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem 2rem; }
.favorite-group h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.favorite-group ul { list-style: none; padding: 0; margin: 0; }
.favorite-group li { margin-bottom: .6rem; }
.favorite-note { display: block; font-size: .9rem; color: var(--ink-muted); }

/* Error and 404 pages */
.lost-page { max-width: 640px; padding-top: 3rem; }
.lost-emoji { font-size: 5rem; line-height: 1; margin-bottom: 1rem; }

/* Birth chart */
.birth-form { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; justify-content: center; align-items: flex-start; }
.birth-field { min-width: 160px; }
.birth-place { position: relative; flex: 1 1 280px; max-width: 360px; }
.birth-submit { align-self: center; padding-top: .9rem; }
.place-results {
  position: absolute; z-index: 20; left: 0; right: 0; top: 4.1rem; margin: 0; padding: .25rem 0; list-style: none;
  background: var(--space-bg-2); border: 1px solid var(--purple); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  max-height: 260px; overflow-y: auto;
}
.place-results li { padding: .4rem .75rem; cursor: pointer; color: var(--ink); }
.place-results li:hover, .place-results li.active { background: rgba(185, 166, 255, .18); }
.notice-error { color: #ffb4b4; }
.big-three { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 3rem; text-align: center; }
.big-three-item { min-width: 150px; }
.big-three-unknown {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; border: 1px dashed var(--panel-border);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--ink-muted);
}
.chart-wheel { width: 100%; max-width: 480px; height: auto; }
.chart-wheel .wheel-bg { fill: rgba(11, 13, 33, .55); stroke: var(--panel-border); }
.chart-wheel .sign-seg { fill-opacity: .14; stroke: rgba(185, 166, 255, .3); stroke-width: 1; }
.chart-wheel .sign-glyph { font-size: 20px; text-anchor: middle; dominant-baseline: central; font-family: "Segoe UI Symbol", "Noto Sans Symbols", "DejaVu Sans", sans-serif; }
.chart-wheel .ring { fill: none; stroke: rgba(185, 166, 255, .35); }
.chart-wheel .ring.faint { stroke: rgba(185, 166, 255, .15); }
.chart-wheel .spoke { stroke: rgba(185, 166, 255, .15); }
.chart-wheel .house-num { fill: var(--ink-muted); font-size: 11px; text-anchor: middle; dominant-baseline: central; }
.chart-wheel .axis { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .8; }
.chart-wheel .axis-label { fill: var(--gold); font-size: 11px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.chart-wheel .tick { stroke: var(--ink); stroke-width: 1.5; }
.chart-wheel .leader { stroke: rgba(232, 230, 245, .35); stroke-width: 1; }
.chart-wheel .planet circle { fill: #171a36; stroke: var(--purple); stroke-width: 1.2; }
.chart-wheel .planet text { fill: #fff; font-size: 15px; text-anchor: middle; dominant-baseline: central; font-family: "Segoe UI Symbol", "Noto Sans Symbols", "DejaVu Sans", sans-serif; }
.chart-wheel .planet:hover circle { stroke: var(--gold); }
.chart-table { font-size: .95rem; }
.chart-table th { color: var(--ink-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; border-color: var(--panel-border); }
.chart-table td { border-color: rgba(185, 166, 255, .12); padding: .35rem .5rem; }
.chart-table .glyph { display: inline-block; width: 1.4em; text-align: center; color: var(--purple); font-family: "Segoe UI Symbol", "Noto Sans Symbols", "DejaVu Sans", sans-serif; }
.chart-table .chart-angles td { color: var(--gold); }

/* Houses: guide page, hover hints and the "Your houses" section on the chart */
.houses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.75rem 2.25rem; }
.house-entry-head { display: flex; align-items: center; gap: .85rem; }
.house-number {
  flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--heading-font); font-weight: 700; font-size: 1.15rem; color: #fff;
  border: 1px solid var(--purple); box-shadow: 0 0 12px rgba(185, 166, 255, .45);
}
.house-entry h4 { font-size: 1.15rem; }
.house-hint { border-bottom: 1px dotted var(--ink-muted); cursor: help; }
.chart-wheel .house-label { cursor: help; }
.house-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.5rem; }
.house-card { border-left: 2px solid var(--purple); padding: .15rem 0 .15rem .85rem; }
.house-card-num { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); }
.house-card h5 { font-size: 1rem; }
.house-card-planets { display: flex; flex-wrap: wrap; gap: .1rem .9rem; font-size: .92rem; }
.house-card-planets .glyph { color: var(--purple); font-family: "Segoe UI Symbol", "Noto Sans Symbols", "DejaVu Sans", sans-serif; }
