:root {
--menu-width: 70px; /* Declare the variable */
}
@font-face {
    font-family: 'MnglWhite';
    src: url('../mnglwhiteotf.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'MnglWhite', Arial, sans-serif;
    height: 100dvh;  /* Ensures the body takes up the full screen height */
    overflow-x: auto;  /* Allow horizontal scrolling */
    overflow-y: hidden; /* Prevent vertical scrolling */
    display: flex;
}

.content {
    display: flex;
    flex-direction: row; /* Ensure paragraphs are placed side by side */
    align-items: flex-start; /* Align text to the top */
    min-height: calc(100dvh - 70px); /* Forces 100px bottom space */
    overflow-x: visible;
    overflow-y: hidden;
    box-sizing: border-box; /* Ensures padding doesn’t expand height */
    padding: 20px 0px 80px 0px; /* Forces bottom space */
}

.vertical {
    height: calc(98vh - 2vh); /* reduce height to account for margin */
    margin-top: 2vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* or space-evenly */
    gap: 1vh;
    overflow: hidden;
    box-sizing: border-box;
}

/* Maintain 3:10 ratio = 30% to 100% on index page */


.download-link {
    flex: 1 1 0;
    font-size: 2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 0;
}

/* Ensure each paragraph becomes a properly wrapped vertical column */
.content p {
    writing-mode: vertical-lr; /* Keeps text vertical */
    line-height: 1.4em; 
}

.horizontal {
     writing-mode: horizontal-tb;
}

.verse {
    writing-mode: vertical-lr;
    font-size: 20px;
}

.q1 {
    display: block;
    text-indent: 1em;
    margin-top: 1em;
    font-size: 20px;
}


.sp {
    display: block;
    text-indent: 1em;
    margin-top: 1em;
    font-size: 20px;
}

.s {
    display: block;
    font-size: 22px;
    font-weight: bold;
}

.cl {
    display: block;
    font-size: 26px;
    font-weight: bold;
}

.footnote {
    font-family: 'MnglWhite', Arial, sans-serif;
    background-color: #0066B3 !important;
    color: white;
    padding: 15px;
    margin-top: 5px;
    border-radius: 5px;
    position: absolute;
    left: 20%;
    display: none;  /* Start hidden */
    writing-mode: vertical-lr;
}

.menu {
    justify-content: space-between; 
    flex-direction: column;
    box-sizing: border-box; /* Ensures padding doesn’t expand height */
    padding: 20px 0px 50px 0px; /* Forces bottom space */
    display: flex; /* Align items in a row */
    align-items: center; /* Align text and buttons vertically */
    gap: 10px; /* Space between items */
    background: #0066B3;
    height: auto; /* New: allow it to grow only as needed */
    max-height: 100dvh; /* Optional: avoid overflow */
}

.menu-top, .menu-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Only the text inside rotates */
.vertical-text {
  writing-mode: vertical-lr;
  text-orientation: mixed;
}


h2 {
    color: #333;
    writing-mode: vertical-lr;
    vertical-align: top;
}

/* Style for both buttons */
.toggle-btn, .toggle-chapter-btn {
    font-family: 'MnglWhite', Arial, sans-serif;
    font-size: 24px;
    padding: 10px 15px;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none; /* removes underline */
    width: 80%; 
    box-sizing: border-box;
    display: flex;              /* 💡 key for centering */
    justify-content: center;   /* horizontal center */
    align-items: center;       /* vertical center */
}

.nextprev-btn {
  background-color: black;
  color: white;
  width: 50px;
  height: 50px;
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  writing-mode: horizontal-tb;
}


.chapter-container,
.book-container {
    position: fixed;
    top: 0;
    left: 55px; /* ← adjust to match real visual size of .menu */
    width: 0px; 
    height: 100dvh; /* Optional: avoid overflow */
    background: #0066B3;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto; /* Allow scrolling if content is large */
    transition: width 0.1s ease-in-out; /* Expand width smoothly */
    box-sizing: border-box;
    color: white; /* Set text color to white */
    
}

.chapter-container.expanded,
.book-container.expanded {
    width: calc(75vw - 40px);  /* account for left/right spacing */
    padding: 20px; /* Add padding when visible */
}

/* Ensure chapter links are centered */
.chapter-section {
    text-align: center;
}

.section {
    overflow-y: hidden;
    white-space: nowrap;
    padding: 20px 0;
}

ul {
    list-style-type: none;
    padding: 0;
    display: inline-block;
    vertical-align: top;
    margin-right: 20px;
    writing-mode: vertical-lr;
    height: 150px;
}

li {
    padding: 8px 8px;
    font-size: 24px;    
    /* border-left: 3px solid #fff;  */
    white-space: nowrap;
}

li a {
    text-decoration: none;
    color: inherit;
    /* padding: 10px 15px;
    border: 2px solid white;
    border-radius: 4px; */
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 10px;
}

.chapter-link {
    background-color: #000;       /* black box */
    color: #fff;     
    width: 60px;              /* square width */
    height: 60px;             /* square height */
    display: flex;
    align-items: center;      /* vertical center */
    justify-content: center;  /* horizontal center */
    text-align: center;
    font-size: 22px;
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid white;
}

.logo-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-item img {
    max-width: 70px;
    object-fit: cover;
}

.logo-label {
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Top image = 30% of the vertical column */
.img-small {
  flex: 0 0 auto;     /* don't stretch */
  height: 30%;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  min-height: 0;
}

/* Middle block = 20% (two icons + text, side-by-side) */
.download-icons {
  flex: 0 0 auto;
  height: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5vw;
  width: 30%;
  box-sizing: border-box;
}

/* Link contains icon + text stacked vertically */
.download-icons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  height: 100%;
  justify-content: center;
  font-size: clamp(12px, 1.6vh, 16px); /* scale text */
}

/* Icon inside link — smaller than before */
.platform-icon {
  max-height: 50%;  /* shrink from 60% to 50% of middle block */
  width: auto;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.platform-icon:hover {
  transform: scale(1.05);
}
/* Bottom image = 50% of the vertical column */
.img-large {
  flex: 0 0 auto;
  height: 50%;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  min-height: 0;
}


:root {
  --fab-size: 56px;    /* floating button diameter */
  --player-pad: 8px;   /* padding of expanded player */
  --menu-width: 70px;  /* left-hand menu width */
}

/* Floating container */
#toolbar-bottom {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: grid;
  place-items: center;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 9999px;
  background: #DA2031;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  overflow: hidden; /* only when collapsed */
  transition:
    width 160ms ease,
    height 160ms ease,
    border-radius 160ms ease,
    padding 160ms ease,
    box-shadow 160ms ease;
}

/* Collapsed: only the FAB is visible */
#toolbar-bottom .fab {
  all: unset;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 22px;
  text-align: center;
}

/* Expanded: show the audio player */
#toolbar-bottom[aria-expanded="true"] {
  padding: var(--player-pad) calc(var(--player-pad) * 1.5);
  width: auto;
  max-width: calc(100vw - var(--menu-width) - 40px); /* viewport minus left menu & spacing */
  height: auto;
  border-radius: 10px;
  overflow: visible;     /* let children breathe */
  box-sizing: border-box;
}

/* Hide FAB when expanded; show player */
#toolbar-bottom[aria-expanded="true"] .fab { display: none; }
#toolbar-bottom .audio-player { display: none; }
#toolbar-bottom[aria-expanded="true"] .audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

/* Audio control sizing */
#toolbar-bottom .audio-player audio {
  flex: 1 1 280px;   /* base width ~280px, grows/shrinks */
  max-width: 100%;   /* don’t overflow container */
  min-width: 160px;  /* don’t collapse to zero */
  height: 32px;
}

/* Close (collapse) button */
#toolbar-bottom .close-btn {
  all: unset;
  flex: 0 0 auto;  /* fixed size */
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-weight: bold;
  line-height: 1;
}
#toolbar-bottom .close-btn:hover { background: rgba(0,0,0,0.35); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #toolbar-bottom { transition: none; }
}
