/* ======= Libration der Mondes CSS File ========
   2025 | hc greier | Graz Austria
*/


/* ================ Main Fonts ================= */
@font-face {
  font-family: 'MainFont';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/mainfont.woff2') format('woff2'),
       url('./fonts/mainfont.woff') format('woff');
}

@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/courier-prime-v7-latin-regular.woff2') format('woff2'),
       url('./fonts/courier-prime-v7-latin-regular.woff') format('woff');
}




/* ============= Custom properties ============== */

:root {
  --astrored: rgba(224, 102, 102, 0.7);
  --astrogreen: rgba(170, 239, 170, 1);
  --astroyellow: rgb(242, 242, 145);
  --astroblue: rgba(115, 183, 228, 1);
}

/* ================ Main setup ================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

html,
body {
  font-family: 'MainFont', Arial, Helvetica, sans-serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-size: 18px;
}

body {
  margin: 0;
  padding: 0;
  color: rgba(44, 44, 44, 0.8);
  background-color: rgba(255, 255, 0, 0.15);
  line-height: 1.6rem;
}

a {
  color: #900;
  background: rgba(255, 255, 255, 0.25);
  /* padding: 0 0.4rem 2px; */
  text-decoration: none;
}

a:hover {
  background: rgba(255, 255, 255, 0.7);
}

p {
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-weight: 700;
  line-height: 1.5;
  color: rgba(44, 44, 44, 0.8);
  padding: 10px 0 0 1rem;
}

h1 {
  font-size: 2.1rem;
  font-weight: 700;
  background-color: rgba(0, 0, 255, 0.1);
  border-bottom: 1px solid #999;
  border-radius: 5px 5px 0 0;
}

h2 {
  font-size: 1.74rem;
  font-weight: 700;
  border-bottom: 1px solid #999;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 5px 5px 0 0;
  padding: 0.5rem 0 0 1rem;
  margin: 0;
}

h3 {
  font-size: 1.45rem;
  margin: 0;
  letter-spacing: -1px;
  background-color: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #999;
  border-radius: 5px 5px 0 0;
}

h4 {
  font-size: 1.32rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #999;
  border-radius: 5px 5px 0 0;
}

h5 {
  font-size: 1.2rem;
  margin-top: 1rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #999;
  border-radius: 4px 4px 0 0;
  padding: 6px 0 0 1.5rem;
}

ul {
  padding-left: 20px;
}

img {
  padding: 3px;
  border: 1px solid #999;
}

hr {
  width: 60%;
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #999;
  margin: 1rem auto 2rem auto;
  padding: 0;
}

/* ========== Loading spinner ========== */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 255, 0.1);
  font-family: sans-serif;
  font-size: 1.2em;
  z-index: 9999;
}

.spinner {
  border: 4px solid #eee;
  border-top: 4px solid #333;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ========== Astro Header EphemPedia ========== */

.headerdiv {
  padding: 0;
  height: 88px;
  border-bottom: 1px solid #999;
  background-color: #f5deb3;
}

.headerh {
  padding-top: 6px;
  margin: 0;
  border: none;
  background-color: transparent;
}

.logoimg {
  float: left;
  margin: 4px 1rem 4px 4px;
  border: none;
  width: 80px;
  height: auto;
}

.logoimg::after {
  clear: both;
}

.subhead {
  font-size: 18px;
  margin-top: -15px;
}

.subhead a {
  color: inherit;
  text-decoration: underline;
}


/* ================= Container ================= */

.container {
  width: 65%;
  margin: 0 auto;
  border-left: 1px solid cadetblue;
  border-right: 1px solid cadetblue;
  border-bottom: 1px solid cadetblue;
  padding: 0;
  background-color: rgb(170, 239, 172);
}

.container2 {
  font-size: 20px;
  width: 65%;
  margin: 0 auto;
  margin-bottom: 38px;
  border-left: 1px solid cadetblue;
  border-right: 1px solid cadetblue;
  border-bottom: 1px solid cadetblue;
  padding: 1rem;
  background-color: rgb(170, 239, 172);
  quotes: "„" "“" "‚" "‘";
}

.container2 h2,
.container2 h3 {
  margin: 2rem -1rem 1rem -1rem;
  padding: 12px 0 12px 25px;
}

.container2 img {
  padding: 2px 4px 2px;
  margin-top: -3px;
  border: 1px solid #999;
  border-radius: 4px;
}

.container2 ul li {
  line-height: inherit;
  padding-bottom: 0.5rem;
}

.container2 ul li ul li {
  list-style-type: square;
  padding-bottom: 0.2rem;
}

.container2 ul li ul li ul li {
  list-style-type: circle;
  padding-bottom: 0.2rem;
}

.container2 ol li {
  margin-bottom: 8px;
}

.container2 ol li:last-child {
  margin-bottom: 0;
}


/* ======== Checkbox Toggle E/W und N/S ======== */

/* Switches anstatt Checkboxen */
.switchEW {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  vertical-align: text-top;
  background-image: url('../imgs/eastwest_bgr.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50px 24px;
}

.switchNS {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  vertical-align: text-top;
  background-image: url('../imgs/northsouth_bgr.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50px 24px;
}

/* Switches nicht schrumpfen/wachsen */
.switchEW,
.switchNS {
  flex: 0 0 50px;
  width: 50px;
  height: 24px;
}

/* Wenn deaktiviert (geozentrisch) */
.switchEW input:disabled,
.switchNS input:disabled {
  pointer-events: none;
}

.switchEW:has(input:disabled),
.switchNS:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Checkbox ausblenden */
.switchNS input,
.switchEW input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Der Slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: transparent;
  -webkit-transition: .2s;
  transition: .2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  -webkit-transition: .2s;
  transition: .2s;
}

input:checked+.slider {
  background-color: transparent;
}

input:focus+.slider {
  box-shadow: 0 0 1px transparent;
}

input:checked+.slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}


/* =============== IDs, Classes ================ */

/* Große Chart für Librationskurve */
#chartContainer {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  position: relative;
}

/* Kleine Chart (in Modal) */
.sphereContainer {
  position: relative;
  width: 240px;
  height: 240px;
  /* aspect-ratio: 1 / 1; */
  background-color: #FFFFD9;
  border-left: 1px solid #999;
  border-right: 1px solid #999;
  border-bottom: 1px solid #999;
}

#mySphere {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

#myPhase {
  position: absolute;
  bottom: 3px;
  left: 3px;
  width: 50px !important;
  height: 50px !important;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}



/* Dynamischer Container, falls Mondhöhe angezeigt wird */
#newCanvasContainer {
  border-bottom: 1px solid #999;
  background-color: rgba(115, 183, 228, 0.2);
}

/* Seitenverhältnis beibehalten */
canvas {
  width: 100% !important;
  height: 100% !important;
}

label {
  padding: 0;
  margin: 0;
}

input[type="number"] {
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #000;
  text-align: center;
  border: 1px solid #999;
  height: 28px;
  padding-top: 5px;
}

/* Pfeile in Stepper immer zeigen */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  opacity: 1;
}


select {
  font-size: 0.9rem;
  font-weight: 900;
}

option {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  padding-left: 5px;
  font-size: 1rem;
  font-weight: 600;
  padding: 0;
  margin: 0;
}

optgroup {
  color: #000;
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  /* Keinen Background in optgroup wegen 
     verschiedener Darstellung in Browsern */
}

/* =============== Time stepper ================ */
#yrs {
  width: 78px;
  margin-right: 0.5rem;
}

#mth {
  width: 50px;
}

#hrs {
  margin-left: 0.5rem;
}

#hrs, #mins {
  width: 55px;
}

/* ============= Long/Lat stepper ============== */
#lonD {
  width: 62px;
  margin-left: 0.5rem;
}

#latD {
  width: 58px;
  margin-left: 0.5rem;
}

#lonM,
#lonS,
#latM,
#latS {
  width: 50px;
}

/* ============= Quickhours select ============= */
#quickHrs {
  margin-right: 5px;
  height: 30px;
}

/* ============== Timezone select ============== */
#timezone {
  width: 72px;
  height: 30px;
}


/* =========== Liste Beobachtungsorte ========== */
.locSelect {
  width: 32px;
  height: 32px;
  margin-left: 10px;
  border: 1px solid #999;
  border-radius: 4px;
  text-align: left;
  background: url('../imgs/earth_globe.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px 26px;
  background-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: transparent;
  cursor: pointer;
  margin-top: 3px;
}

/* Wenn Liste disabled */
#locSelect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(50%);
}

.locSelect>option {
  color: #333;
  /* Für Orte Farben zurücksetzen */
  font-size: 0.8rem;
  font-weight: 600;
  background-color: rgba(115, 183, 228, 1);
}

#locReset {
  width: 32px;
  height: 32px;
  margin-left: 10px;
  margin-top: 2px;
  border: 1px solid #999;
  border-radius: 4px;
  background: url('../imgs/loc_reset.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  background-color: orange;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: orange;
  cursor: pointer;
}

/* Wenn Button disabled */
#locReset:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(50%);
}

#todayBtn {
  height: 30px;
  width: 30px;
  padding: 0;
  margin-right: 0px;
  border: 1px solid #999;
  border-radius: 4px;
  cursor: pointer;
  background-image: url('../imgs/today.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

#nowBtn {
  height: 28px;
  width: 28px;
  padding: 0;
  margin-right: 5px;
  border: 1px solid #999;
  border-radius: 4px;
  cursor: pointer;
  background-image: url('../imgs/pc_time.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

/* Noch nicht benutzt ################################## */
/* #resetAll {
  position: absolute;
  bottom: 5px;
  right: 5px;
  margin: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  background-color: rgba(204, 0, 0, 0.6);
  border: 1px solid #999;
  border-radius: 4px;
  cursor: pointer;
  background-image: url('../imgs/reset_all.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
} */


#resetYrs,
#resetMth {
  text-decoration: none;
  color: #333;
  background: none;
}

#resetYrs:hover,
#resetMth:hover {
  color: #c00;
  background: rgba(255, 255, 255, 0.7);
}

#resetMth {
  margin-left: 10px;
}




/* ================= Hauptfarben =============== */
.astrored {
  background-color: var(--astrored);
}

.astrogreen {
  background-color: var(--astrogreen);
}

.astroyellow {
  background-color: var(--astroyellow);
}

.astroblue {
  background-color: var(--astroblue);
}


/* =========== Flex für Einstellungen ========== */
.parent {
  display: flex;
  flex-wrap: wrap; /* erlaubt mehrere Zeilen */
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  font-weight: 600;
}

.parent > div {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 1px solid #999;
}

/* 1. Zeile */
.astrored {
  flex: 1 1 45%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
}

.astroblue {
  flex: 1 1 55%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 48px;
}

/* 2. Zeile */
.astroyellow {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* Items 1, 2, 3 */
.astroyellow .item:nth-child(1),
.astroyellow .item:nth-child(2),
.astroyellow .item:nth-child(3) {
  flex: 0 0 28.33%;
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 0.5rem;
}

.astroyellow .item:nth-child(1) {
  flex: 0 0 20.0%;
}

/* 4. Item */
.astroyellow .item:nth-child(4) {
  flex: 0 0 15%;      
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 0.5rem;
}


/* Geo-/Topozentrisch Toggle Checkbox
   unsichtbar, aber zugänglich     */
.astroyellow input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Label Toggle Checkbox als Grafik */
.astroyellow .icon {
  width: 32px;
  height: 32px;
  border: 1px solid #999;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background-color: transparent;
}

/* Grafik als Hintergrund innerhalb der Checkbox */
/* OFF-Grafik */
.astroyellow .icon::before {
  content: "";
  width: 26px;
  height: 26px;
  background-image: url("../imgs/geocentric.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: block;
}

/* ON-Grafik */
#toggleTopo:checked + .icon::before {
  background-image: url("../imgs/topocentric.png");
}

/* Text neben der Grafik */
#toggleTopoText::before {
  content: "geozentrisch";
}

#toggleTopo:checked ~ #toggleTopoText::before {
  content: "topozentrisch";
}

#toggleTopoText {
  margin-left: 0.5rem;
}

img.float {
  float: left;
  margin: 10px 14px 2px 0;
}

img.float2 {
  float: right;
  margin: 10px 0 2px 14px;
}

.responsive-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Box WICHTIG  */
.box {
  border: 1px solid #999;
  border-radius: 5px;
  background: rgba(255, 255, 0, 0.1);
  padding: 8px 1rem 0 2rem;
  margin: 1rem 0;
}

footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #f5deb3;
  color: #333;
  text-align: center;
  margin: 0 auto;
  padding: 7px 0 0 0;
  border-top: 1px solid #999;
  font-family: 'Courier Prime', Courier, monospace;
  font-size: 80%;
  font-weight: 400;
  height: 40px;
}


/* =============== Popup Modal für Mond 3D =================*/
.modal {
  position: fixed;
  width: 240px;
  min-height: 272px;
  background-color: var(--astroyellow);
  background-color: rgba(232, 232, 145, 1);
  display: none;
  user-select: none;
  z-index: 200;
}

/* Header des Modals zum Ziehen */
.modal .header {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: #AAEFAC;
  cursor: move;
  border: 1px solid #999;
  
}

.modal .header:active {
  cursor: move;
}

.modal .controls button {
  background: transparent;
  border: none;
  font-size: 14px;
  padding: 4px;
  cursor: pointer;
  pointer-events: auto;
}

.modal .controls button:hover {
  color: red;
  font-weight: 700;
}

.modal .content {
  text-align: center;
  margin: 0 auto;
  padding: 0;
}

/* Daten-Texte unterhalb Pseudo-3D Grafik */
#dataInModal {
  width: 100%;
  padding: 4px 8px;
  line-height: 1.25rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  font-weight: 700;
  background-color: var(--astroyellow);
  border: 1px solid #999;
}

/* Copy Button im Modal */
#copyDataBtn {
  padding-top: 4px !important;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  font-weight: 700;
}

#copyDataBtn:hover {
  box-shadow: none;
  background-color: #007267 !important;
}

#dataInModal, #copyDataBtn {
  position: relative;
  z-index: 2;
}



/* =============== Media queries =============== */
@media only screen and (max-width: 992px) {
  .container {
    width: 100%;
    padding: 0;
  }
  .container2 {
    width: 100%;
    padding: 1rem;
  }
  h2 {
    font-size: 1.6rem;
    padding: 1rem 0 0.5rem 10px;
  }
}

/* Für Data Modal */
@media only screen and (max-width: 650px) {
  ul {
    padding-left: 10px;
  }
}

@media only screen and (max-width: 570px) {
  .headerh {
    font-size: 1.4rem;
    padding-top: 1rem;
  }
  h4 {
    font-size: 1.1rem;
  }
}

@media only screen and (max-width: 480px) {
  .logoimg {
    transform: scale(0.75);
    margin: 4px;
  }
  .container {
    width: 100%;
    padding: 0;
  }
  .container2 {
    width: 100%;
    padding: 1rem;
  }
  .headerh {
    font-size: 1.2rem;
    padding-top: 1rem;
  }
  .subhead {
    font-size: 16px;
    margin-top: -6px;
  }
  .footer {
    font-size: 60%;
  }
}



/* ♫ So long, Marianne */