/* --- ESSENTIAL RESET --- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: transparent; /* Transparent so we see the layer */
  font-family: "Times New Roman", Times, serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* --- FIXED BACKGROUND LAYER --- */
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  pointer-events: none;
}

/* --- GEOMETRY VARIABLES --- */
:root { --pad: 40px; }
@media (max-width: 600px) { :root { --pad: 20px; } }

/* --- HEADER / CROSS --- */
.header-section {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}
.cross-icon {
  width: 105px;
  height: auto;
  display: block;
  pointer-events: auto;
  cursor: pointer;
}

/* --- MAIN CONTAINER --- */
.container {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 41vh;
  padding-bottom: var(--pad);
  padding-left: 0;
  padding-right: 0;
  cursor: pointer;
}

/* --- DAY NAV --- */
.day-nav {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: var(--pad);
  z-index: 1000;
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
  font-family: "Times New Roman", Times, serif;
  color: #fe9a03;
}
.day-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
  pointer-events: auto;
  display: inline-block;
  mix-blend-mode: difference;
}
.day-button:hover {
  font-style: italic;
}
.day-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #F9F7F1;
  border: 1px solid #000;
  width: 150px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem 0;
  box-shadow: 5px 5px 0px rgba(0,0,0,0.2);
  pointer-events: auto;
  margin-top: 5px;
  mix-blend-mode: normal;
  color: #000;
  isolation: isolate;
  z-index: 1001;
}
.day-dropdown a {
  display: block;
  padding: 5px 15px;
  color: black;
  text-decoration: none;
  font-size: 0.9rem;
}
.day-dropdown a:hover {
  background-color: #eee;
  font-style: italic;
}
.day-dropdown a.active {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- LIST SECTION --- */
.list-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  margin: 0;
}
.accordion-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}
.accordion-trigger {
  width: 100%;
  padding-left: var(--pad);
  padding-right: var(--pad);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  background: transparent;
  margin: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-align: left;
  pointer-events: auto;
  color: #fe9a03;
  mix-blend-mode: difference;
  position: relative;
  z-index: 10;
}
.accordion-trigger:hover {
  font-style: italic;
}
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s ease-out, margin 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  width: 100%;
  margin-top: 0;
}
.accordion-content > div { overflow: hidden; }
.accordion-content.active {
  opacity: 1;
  grid-template-rows: 1fr;
  margin-top: 1.35rem;
  margin-bottom: 1.75rem;
}

/* Card styling */
.text-card {
  background-color: #F9F7F1;
  border: 1px solid #000;
  box-shadow: 5px 5px 0px rgba(0,0,0,0.05);
  width: min(760px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
  cursor: auto;
  color: #000;
  mix-blend-mode: normal;
  position: relative;
  z-index: 20;
}
.inner-box {
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: justify;
}
.inner-box::-webkit-scrollbar { width: 4px; }
.inner-box::-webkit-scrollbar-track { background: transparent; }
.inner-box::-webkit-scrollbar-thumb { background: #dcdcdc; border-radius: 2px; }

/* Typography helpers */
.bible-title {
  display: block;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bible-subheader {
  display: block;
  font-weight: bold;
  font-style: italic;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.bible-prose {
  margin-bottom: 1rem;
  text-align: justify;
}
.scripture-verse {
  margin: 0 0 0.9rem;
  text-align: left;
}
.scripture-verse sup {
  font-size: 0.72em;
  line-height: 0;
  margin-right: 0.25rem;
}
.chapter-marker {
  display: block;
  margin: 1.4rem 0 0.5rem;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  color: #555;
}
.scripture-verse:first-of-type .chapter-marker {
  margin-top: 0;
}
.scripture-source {
  margin-top: 1.6rem;
  font-size: 0.78rem;
  font-style: italic;
  text-align: center;
  color: #555;
}
.companion-quote {
  margin: 1.4rem 0 1rem;
  padding: 0;
  border: 0;
  font-size: 1.05rem;
  line-height: 1.58;
  text-align: left;
}
.companion-quote p {
  margin: 0 0 1rem;
}
.companion-quote p:last-child {
  margin-bottom: 0;
}
.quote-source {
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
  color: #555;
}
.bible-poetry-block {
  margin: 1rem 0 1rem 2rem;
  text-align: left;
  border-left: 2px solid #eee;
  padding-left: 1rem;
}
.bible-poetry-line {
  display: block;
  text-indent: -1rem;
  padding-left: 1rem;
  margin-bottom: 0.25rem;
}
.psalm-note {
  display: block;
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 1rem;
  text-align: center;
  color: #555;
}

/* Painting styles */
.painting-container img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.painting-container img.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  object-fit: contain;
  background-color: #F9F7F1;
  padding: 2rem;
  cursor: zoom-out;
}
.caption {
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 0.8rem;
  text-align: center;
  color: #444;
}
.external-link {
  color: #000;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .header-section {
    top: 30vh;
  }
  .cross-icon {
    width: 96px;
  }
  .container {
    padding-top: 55vh;
  }
  .accordion-content.active {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
  }
  .text-card {
    width: calc(100% - 30px);
  }
  .bible-poetry-block {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
  }
  .inner-box {
    padding: 1rem;
    max-height: 80vh;
    font-size: 1rem;
    line-height: 1.55;
  }
}
