// <uniquifier>: Use a unique and descriptive class name
// <weight>: Use a value from 400 to 900

.alegreya-<uniquifier> {
  font-family: "Alegreya", serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
}
html, body { overflow-x:hidden; }
body { 
	font-family: "Alegreya", serif; 
	font-size:21px;
  width:100%;
}

#togglematthew {background-color:#918003;}
#togglemark {background-color:#406827}
#toggleluke {background-color:#355168;}
#togglejohn {background-color:#843131;}


h3 {margin-bottom: -15px;}

#introblurb {background: #ededed; padding: 4px 6px 12px 8px; color: #3b3b3b; }
#introblurb h3 {margin-top: 2px;}
.h3reference {font-weight: normal; font-style: italic; font-size: 13pt; color: #7d7d7d; padding-left: .5em;}

.ot {font-weight: bold; font-style: italic;}
.otallusion {font-style: italic;}

p {
  line-height: 1.7;
  margin: 18px 0px 0px 0px;
}

.base {  opacity: 0;}



/*  Just adding the identical texts' formatting */
span.matthew {color:#918003; background-color:rgba(216,197,22,0.1);}
span.mark {color:#406827; background-color:rgba(77,183,8,0.1);}
span.luke {color:#355168; background-color:rgba(58,134,211,0.1);}
span.john {color:#843131; background-color:rgba(238,80,74,0.1);}
span.matthew.mark, span.matthew.luke, span.matthew.john,
span.mark.luke, span.mark.john, span.luke.john {color:#424242;}	

span.matthew.mark { background: url("matthew-mark.png") repeat; }
span.matthew.luke { background: url("matthew-luke.png") repeat; }
span.matthew.john { background: url("matthew-john.png") repeat; }
span.mark.luke { background: url("mark-luke.png") repeat; }
span.mark.john { background: url("mark-john.png") repeat; }
span.luke.john { background: url("luke-john.png") repeat; }

span.matthew.mark.luke { background: url("matthew-mark-luke.png") repeat; }
span.matthew.mark.john { background: url("matthew-mark-john.png") repeat; }
span.mark.luke.john { background: url("mark-luke-john.png") repeat; }
span.matthew.luke.john { background: url("matthew-luke-john.png") repeat; }
span.matthew.mark.luke.john { background: url("all.png") repeat; }

span.significant.parent {background-color: rgba(255,255,255,0); background: url("transparent.png") repeat;}



.chapter {font-weight: bold; font-size: 150%; line-height:.667; }

/* Reduce the opacity to 0.1 for any chapter span that explicitly carries 
   the inactive state '0' suffix for its gospel type. */
span.chapter[class*="matthew0"],
span.chapter[class*="mark0"],
span.chapter[class*="luke0"],
span.chapter[class*="john0"] {
    opacity: 0.1 !important;
}

/* hiding verse 1 after a chapter */
span.chapter + span.ref, span.chapter + span.ref + span.ref { opacity:0; with: 1px;}

span.chapter + span.chapter { margin-left: 2px; }
a.before + span.chapter { margin-left: 2px; }


a.after, a.before { text-decoration: none; opacity:0.5;}

a.matthew:is(.after, .before) {color:#918003; background-color:rgba(216,197,22,0.1);}
a.mark:is(.after, .before) {color:#406827; background-color:rgba(77,183,8,0.1);}
a.luke:is(.after, .before) {color:#355168; background-color:rgba(58,134,211,0.1);}
a.john:is(.after, .before) {color:#843131; background-color:rgba(238,80,74,0.1);}


/* ==========================================================================
   1. BASE STRUCTURE & WIDTH RESERVATION (Condition 2)
   ========================================================================== */

/* By default, all links are hidden from view but STILL occupy their natural 
   layout width. This ensures that a single Luke element and a double Mark 
   element maintain their maximum potential combined footprint, preventing 
   the surrounding text from shifting or jumping when states toggle.
*/
div#scripture a.before,
div#scripture a.after {
    visibility: hidden;
    opacity: 0;
    pointer-events: none; /* Prevents clicking while hidden */
}

/* ==========================================================================
   2. GLOBAL EXCLUSIVITY TOGGLES (Condition 3)
   ========================================================================== */

/* Links break out of hidden mode and become fully visible ONLY if their 
   matching gospel is "1" AND all other three gospels are "0" on the 
   main div#scripture container.
*/

/* MATTHEW IS ACTIVE ONLY */
div#scripture[class*="matthew1"][class*="mark0"][class*="luke0"][class*="john0"] a.before[class*="matthew1"],
div#scripture[class*="matthew1"][class*="mark0"][class*="luke0"][class*="john0"] a.after[class*="matthew1"],

/* MARK IS ACTIVE ONLY */
div#scripture[class*="matthew0"][class*="mark1"][class*="luke0"][class*="john0"] a.before[class*="mark1"],
div#scripture[class*="matthew0"][class*="mark1"][class*="luke0"][class*="john0"] a.after[class*="mark1"],

/* LUKE IS ACTIVE ONLY */
div#scripture[class*="matthew0"][class*="mark0"][class*="luke1"][class*="john0"] a.before[class*="luke1"],
div#scripture[class*="matthew0"][class*="mark0"][class*="luke1"][class*="john0"] a.after[class*="luke1"],

/* JOHN IS ACTIVE ONLY */
div#scripture[class*="matthew0"][class*="mark0"][class*="luke0"][class*="john1"] a.before[class*="john1"],
div#scripture[class*="matthew0"][class*="mark0"][class*="luke0"][class*="john1"] a.after[class*="john1"] {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   3. MUTUALLY EXCLUSIVE STRUCTURAL CLEANUP (FIXED)
   ========================================================================== */

/* When a gospel is turned off on the main div#scripture container, we switch 
   its corresponding link tracks to visibility: hidden. 
   
   Using visibility instead of display:none ensures that single, isolated links 
   never collapse the document flow or cause text jumping when toggled off.
*/
div#scripture[class*="matthew0"] a[class*="matthew"],
div#scripture[class*="mark0"]    a[class*="mark"],
div#scripture[class*="luke0"]    a[class*="luke"],
div#scripture[class*="john0"]    a[class*="john"] {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}








/*  Preventing html from stripping initial and final spaces */
span:is(.reg, .parent) {
  white-space: pre-wrap;
  margin-left: -3px;
}

span:is(.significant, .insignificant)  span {
  white-space: pre-wrap;
  margin-left: 0px;
}

span:is(.reg, .significant, .insignificant) + span.insignificant {
    margin-left: -4px;
}

span.ref:not(:first-of-type) {
  /* Applies only to the .ref spans that are not the first span sibling */
  margin-left: 0px;
}

/* Structural block padding shifts instead of inline text-indent */
p.indent { 
  margin: 18px 0px 0px 0px;
  padding-left: 1.5em; 
}

p.break {
  margin: 0px 0px 0px 0px;
  padding-left: 3em;  
  text-indent: 0 !important; /* Forces a zero baseline so child elements align flawlessly */
  line-height: 1.7;
}

/* Safely pulls the leading scripture numbers back out into the hanging margin */
p.break > span.ref:first-child {
  display: inline-block;
  margin-left: -1.5em !important; 
  width: 1.5em;
  text-align: left;
}

/* ==================== NOTE & POPUP RESET ==================== */

.note {
  display: inline-block; /* Forces the superscript icon to maintain a reliable, unscrambled bounding box */
  text-indent: 0 !important; /* Prevents .indent paragraph rules from shifting the icon or its children */
  line-height: 1 !important; /* Prevents vertical layout alignment shifts inside .break lines */
  cursor: pointer;
}

#note-popup {
  display: none;
  position: absolute;
  background-color: #fffdf7;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 1005; /* Pushes it safely above any competing structural elements */
  max-width: 280px;
  
  /* STRICT STRUCTURAL ISOLATION RESETS */
  text-align: center;        /* Keeps the text and trailing ellipsis perfectly centered */
  text-indent: 0 !important; /* Absolute protection against inheriting paragraph indents */
  line-height: 1.4;          /* Gives the internal popup text safe, uniform spacing */
  box-sizing: border-box;    /* Prevents inner padding adjustments from clipping dimensions */
}

/* Dynamically track text colors based on the parent class */
.matthew { --current-text-color: #918003; }
.mark    { --current-text-color: #406827; }
.luke    { --current-text-color: #355168; }
.john    { --current-text-color: #843131; }

/* Handle parallel text areas where multiple classes exist together */
.matthew.mark, .matthew.luke, .matthew.john,
.mark.luke, .mark.john, .luke.john {
  --current-text-color: #424242; /* Standard dark grey for overlaps */
}

/* Style the superscript into a prominent outline comic speech bubble */
sup.note {
  display: inline-block;
  position: relative;
  width: 24px;
  height: 20px;
  background-color: #FFFFFF;
  /* Automatically inherits the exact context color of the surrounding text block */
  border: 2px solid var(--current-text-color, #424242); 
  border-radius: 6px 6px 6px 0px; 
  cursor: pointer;
  vertical-align: middle;
  margin: 0 4px;
  top: -4px; 
  transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  box-sizing: border-box; 
}

/* Create the outline triangle tail using the dynamic color track */
sup.note::after {
  content: '';
  position: absolute;
  bottom: -6px; 
  left: -2px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 6px 0 0;
  border-color: var(--current-text-color, #424242) transparent transparent transparent; 
}

/* Three dots matching the dynamic text color */
sup.note::before {
  content: '•••';
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--current-text-color, #424242); 
  font-size: 10px;
  letter-spacing: 0.5px;
  font-family: Arial, sans-serif;
  font-weight: bold;
}

/* Hover state: Makes it slightly more vibrant on hover for clean feedback */
sup.note:hover {
  transform: scale(1.12); 
  filter: brightness(0.7); /* Safely darkens the current variable color automatically */
}

#scripture { 
	margin-left: 20px; 
	margin-right: 20px;
	margin-top: 100px; /* Enhanced to provide spacing under the top bar */
}

span.matthew {color:#918003; background-color:rgba(216,197,22,0.1);}
span.mark {color:#406827; background-color:rgba(77,183,8,0.1);}
span.luke {color:#355168; background-color:rgba(58,134,211,0.1);}
span.john {color:#843131; background-color:rgba(238,80,74,0.1);}
span.matthew.mark, span.matthew.luke, span.matthew.john,
span.mark.luke, span.mark.john, span.luke.john {color:#424242;}	

span.matthew.mark { background: url("matthew-mark.png") repeat; }
span.matthew.luke { background: url("matthew-luke.png") repeat; }
span.matthew.john { background: url("matthew-john.png") repeat; }
span.mark.luke { background: url("mark-luke.png") repeat; }
span.mark.john { background: url("mark-john.png") repeat; }
span.luke.john { background: url("luke-john.png") repeat; }

span.matthew.mark.luke { background: url("matthew-mark-luke.png") repeat; }
span.matthew.mark.john { background: url("matthew-mark-john.png") repeat; }
span.mark.luke.john { background: url("mark-luke-john.png") repeat; }
span.matthew.luke.john { background: url("matthew-luke-john.png") repeat; }
span.matthew.mark.luke.john { background: url("all.png") repeat; }

span.significant.parent {background-color: rgba(255,255,255,0); background: url("transparent.png") repeat;}

/* INITIAL STATE */

span.base {
display: inline !important;    /* Let it flow horizontally */
    visibility: hidden !important; /* Make it completely invisible */
    opacity: 0 !important;          /* Safety opacity drop */
    pointer-events: none !important;/* Prevent any mouse interactions */
}
/* hide all texts  */
.reg,
.ref,
.parent > span {opacity: .1;}

/* show basic texts  */
.reg.matthew1, .reg.mark1, .reg.luke1, .reg.john1,
.ref.matthew1, .ref.mark1, .ref.luke1, .ref.john1,
.parent > .matthew1, .parent > .mark1, .parent > .luke1, .parent > .john1  {opacity: 1;}


/* For 'insignificant' types, this targets all siblings of an active primary span. If I add types of visiblity, this would need to change. */
.insignificant.matthew1:has(> .primary.matthew1) > span:not(.primary.matthew1) { opacity: 0; }
.insignificant.mark1:has(> .primary.mark1) > span:not(.primary.mark1) { opacity: 0; }
.insignificant.luke1:has(> .primary.luke1) > span:not(.primary.luke1) { opacity: 0; }
.insignificant.john1:has(> .primary.john1) > span:not(.primary.john1) { opacity: 0; }

/* Adjusted Rule: ONLY hide tertiary if primary is invisible, 
   secondary is visible, AND tertiary is ALSO INVISIBLE */

.parent:has(> .primary:not([class*="matthew1"]):not([class*="mark1"]):not([class*="luke1"]):not([class*="john1"])):has(> .secondary:is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])):has(> .tertiary:not([class*="1"])) > .tertiary {
    display: none;
}

/* Basic universal formatting for significant */
.significant { position: relative; }
.significant .plong { position:absolute; left: -0.15em;}
.significant .pshort { position: absolute; left: -0.15em; white-space: pre;}
.significant .tertiary { position: absolute; left: -0.15em; white-space: pre;}


/* Updated height adjustment: Only raises primary if either secondary or tertiary is visible */
.significant.matthew1:is(.mark1, .luke1, .john1):has(> :is(.secondary, .tertiary):is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])) > .primary.matthew1,
.significant.mark1:is(.matthew1, .luke1, .john1):has(> :is(.secondary, .tertiary):is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])) > .primary.mark1,
.significant.luke1:is(.mark1, .matthew1, .john1):has(> :is(.secondary, .tertiary):is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])) > .primary.luke1,
.significant.john1:is(.mark1, .luke1, .matthew1):has(> :is(.secondary, .tertiary):is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])) > .primary.john1 { 
    top: -.4em; 
}

/* Significant height adjustment: When both matthew and another gospel are active, and matthew is secondary, matthew gets moved lower  */
/* Combined rule for secondary/tertiary height adjustments */
.significant:is(.matthew1, .mark1, .luke1, .john1):has(> .primary:is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])) > :is(.matthew1, .mark1, .luke1, .john1):is(.secondary) {
    top: .5em;
    font-size: 90%;
}

/* Add extra line spacing for lines that might have 3 options */
.significant.parent:has(> .tertiary) { margin-bottom: .7em;}

/* Significant height adjustment: When both matthew and another gospel are active, and matthew is secondary, matthew gets moved lower  */
/* Combined rule for secondary/tertiary height adjustments */
.significant:is(.matthew1, .mark1, .luke1, .john1):has(> .primary:is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])) > :is(.matthew1, .mark1, .luke1, .john1):is(.tertiary) {
    top: 1.4em;
    font-size: 90%;
}


/* Target the tertiary span inside a 'significant' parent where:
   1. The primary element IS visible (has any "1")
   2. The secondary element IS NOT visible (has NO "1") */

.significant:has(> .primary:is([class*="matthew1"], [class*="mark1"], [class*="luke1"], [class*="john1"])):has(> .secondary:not([class*="matthew1"]):not([class*="mark1"]):not([class*="luke1"]):not([class*="john1"])) > .tertiary {
    top: .5em;
}




/* When primary is INVISIBLE, but secondary & tertiary are BOTH VISIBLE:
   Move secondary up (-0.5em) and tertiary down (0.5em) */

/* 1. Target the secondary child */
.significant:has(> .primary:not([class*="1"])):has(> .secondary:is([class*="1"])):has(> .tertiary:is([class*="1"])) > .secondary {
    top: -.4em; font-size: 80%;
}

/* 2. Target the tertiary child */
.significant:has(> .primary:not([class*="1"])):has(> .secondary:is([class*="1"])):has(> .tertiary:is([class*="1"])) > .tertiary {
    top: .5em;
}


/* In insignificant parents: if primary is invisible, 
   keep secondary visible but hide tertiary */
.insignificant.parent:has(> .primary:not([class*="1"])):has(> .secondary:is([class*="1"])):has(> .tertiary:is([class*="1"])) > .tertiary {
    display: none;
}










/* Establish an inline-relative context that honors the text reading flow, hanging indents, and row wraps */
span.parent.insignificant, span.parent.significant {
  position: relative;
  display: inline-block; 
  white-space: pre;  
  padding: 0;
  margin: 0;
  line-height: 1.6;
}
span.parent.insignificant {
  height: 1.1em;
}
span.parent.significant {
  margin-top: .5em;
  padding: .1em 0 .1em;
}





/* Let the longer string carve out the physical space inside the text row */
span.parent.insignificant > .plong {
    display: inline;
    position: absolute;
    left: 0;
    top: 0;
    white-space: pre;        
}

/* Force the shorter variation to lock to the exact left edge of its sibling's relative space */
span.parent.insignificant > .pshort, span.parent.insignificant > .tertiary {
  position: absolute;       
  left: 2px;
  text-indent: 0 !important; /* Complete isolation from parent paragraph indent metrics */
 white-space: pre;    
}




  button.toggle {
      width: 80px;
      height: 40px;
	  background-color:#4a4a4a;
	  opacity: .2;
      border: none;
      border-radius: 25px;
      color: white;
      font-size: 13px;
      cursor: pointer;
	  display:inline;
	  margin-bottom: 4px;
    }
 
  button.matthew1, button.mark1, button.luke1, button.john1 { 
      opacity: 1;
	}

p {  line-height: 1.6;}


span.ref {
	font-size:60%;
	vertical-align: super;
}
	
	
 /* ============== MENU STYLING =====================*/

.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  width: 100%;
}

.open > #gospelsmenu.dropdown-menu  {
	display: flex;
	top: 0;
}

/* Removing the gospel button positioning to allow for the next step */ 
.dropdown-submenu { position: static;}

/* Positioning the chapter menu below all the gospels */ 
.dropdown-submenu .dropdown-menu.chaptermenu,
.dropdown-submenu .dropdown-menu.versemenu {
  top: 38px;
  left: 0;
 }
 
 /* making the chapter numbers side-by-side */ 
 .dropdown-menu.chaptermenu li {
	display: inline-block;
 }
 /* formatting numbers */ 
.dropdown-menu.chaptermenu li > a {
	padding: 3px 3px;
	width: 2.5em;
}

.dropdown-submenu a {
	cursor:pointer;
}


/* ==================== MATRIX NAV DRAWER ==================== */

#nav-drawer {
  position: fixed;
  top: 0;
  left: -340px; /* Start hidden offscreen */
  width: 320px;
  height: 100%;
  background: #fffdf7;
  border-right: 1px solid #c9c1a8;
  box-shadow: 4px 0 14px rgba(0,0,0,0.15);
  z-index: 1003;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 20px;
  box-sizing: border-box;
}

#nav-drawer.open {
  transform: translateX(340px);
}

#nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 1002;
  display: none;
}

#nav-overlay.visible {
  display: block;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e0dabf;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

/* Tab controls styling */
.matrix-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 6px 12px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  color: #7a7565;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: #424242;
  border-bottom-color: #4a4a4a;
}

.tab-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#menu-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #843131;
}

/* Panel management logic switching profiles toggled by JS classes */
.matrix-panel {
  display: none;
}

.matrix-panel.active {
  display: block;
}

/* Book Sections and Chapter Layout Configurations */
.book-section {
  margin-bottom: 22px;
}

.book-title-heading {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-section.matthew-sec .book-title-heading { color: #918003; }
.book-section.mark-sec .book-title-heading    { color: #406827; }
.book-section.luke-sec .book-title-heading    { color: #355168; }
.book-section.john-sec .book-title-heading    { color: #843131; }

.chapters-subgrid, .verses-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.verse-header-info {
  font-weight: bold;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #424242;
}

.matrix-btn, .verse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #c9c1a8;
  background: #ffffff;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  color: #424242;
  transition: all 0.15s ease;
}

/* Contextual feedback color matching on active actions */
.book-section.matthew-sec .matrix-btn:hover, .matthew-active .verse-btn:hover { background: #918003; color: #fff; border-color: #918003; }
.book-section.mark-sec .matrix-btn:hover, .mark-active .verse-btn:hover       { background: #406827; color: #fff; border-color: #406827; }
.book-section.luke-sec .matrix-btn:hover, .luke-active .verse-btn:hover       { background: #355168; color: #fff; border-color: #355168; }
.book-section.john-sec .matrix-btn:hover, .john-active .verse-btn:hover       { background: #843131; color: #fff; border-color: #843131; }


/* ==================== RISK AND INTERACTION STYLE OVERRIDES ==================== */

#scripture span:hover {
  background-color: rgba(201, 193, 168, 0.25); /* Active text block tracking hint indicator */
  cursor: help;                                 
}

/* Ensure the tooltip handles source list tags cleanly */
#note-popup.source-popup {
  font-weight: bold;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}


/* ==================== UNIFIED BAR LAYOUT ENGINE (MOBILE DEFAULT) ==================== */

#topbar {
  position: fixed;
  width: 100vw;               /* Spans full horizontal width */
  left: 0;
  top: 0;
  background-color: rgba(0, 0, 0, 0.9); /* 90% solid translucent black backdrop */
  padding: 10px 20px; 	
  z-index: 1000;              /* Stays on top of scripture lines */
  box-sizing: border-box; 
  
  /* Mobile Layout: Row-based alignment to prevent vertical dropping */
  display: flex;
  flex-direction: row;        
  align-items: center;
  justify-content: space-between; 
}

/* ADD THIS BLOCK RIGHT HERE to fix the mobile stacking issue */
#topbar-content-wrapper {
  display: flex;
  flex-direction: row;        /* Forces logo and buttons into a row on mobile */
  align-items: center;
  flex-grow: 1;               /* Lets it fill the remaining space next to hamburger */
  margin-left: 12px;          /* Adds clean breathing room right next to the hamburger icon */
}

/* Add this specific rule to separate the logo from the buttons */
#app-logo {
  height: 38px;               
  width: auto;
  display: block;
  margin-right: auto;         /* CRITICAL: Automatically pushes the button cluster completely to the right */
  padding-right: 10px;
}

#buttons {
  margin: 0;
  width: max-content;         /* Hugs buttons with zero extra spacer bloat */
  display: flex;
  justify-content: center;    
  gap: 4px;                   /* Tight spacing gap between gospels buttons */
}

#menu-toggle {
  display: inline-block;      /* Avoid row collection layout drops */
  background: #4a4a4a;
  color: #fff;
  border: none;
  font-size: 20px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  box-sizing: border-box;
  
  /* Native relative properties avoid collision overlays */
  position: static;
  transform: none;
  z-index: 1001;
}

/* ==================== RESPONSIVE DESKTOP OVERRIDES ==================== */

@media (min-width: 768px) {
  #scripture {
    max-width: 750px;
    margin-left: auto;  
    margin-right: auto; 
    padding-left: 20px; 
    padding-right: 20px;
  }

  #topbar {
    max-width: none;
    left: 0 !important;
    transform: none;
    
    /* Expanded grid template parameters to give the logo and buttons custom column boundaries */
    display: grid;
    grid-template-columns: 80px 200px 1fr 280px; /* [☰ Menu] [Logo] [Centered Elastic Space] [Buttons] */
    align-items: center;
    padding: 10px 40px;
    gap: 0;
  }

  /* Clear the intermediate mobile wrapper logic on desktop so the grid rules apply cleanly */
  #topbar-content-wrapper {
    display: contents;        /* Allows interior elements to inherit global grid layout tracks directly */
  }

  #app-logo {
    height: 52px;             /* Upscaled presentation enhancement on desktop viewports */
    grid-column: 2;           /* Locks the logo cleanly to the left slot of the navigation section */
    margin-right: 0;          /* Reset mobile margin override values */
  }

  #buttons {
    margin: 0;                
    grid-column: 3;           /* Moves buttons into the central column track */
    justify-self: center;     /* Guarantees the 4 toggle buttons stay perfectly centered on desktop screens */
  }

  #menu-toggle {
    grid-column: 1;           /* Fixed isolation to the far left column slot */
    justify-self: start;      
  }
}


/* ==================== HIDING TOP BAR ON SCROLLING ==================== */

#topbar {
  /* ... keep your existing properties ... */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  
  /* Put the transition here so it handles smooth snapping back and forth on mobile */
  transition: transform 0.3s ease-in-out; 
}

/* Apply the hiding mechanism ONLY on mobile viewports */
@media (max-width: 767px) {
  #topbar.hidden {
    transform: translateY(-100%);
  }
}


/* 1. Force the container to behave like a single unified text token */
.keeptogether {
  display: inline-flex !important;
  vertical-align: baseline !important;
  white-space: pre !important;
  margin-left: 0px;
}

.reg + .keeptogether {
  margin-left: -2px;
}

/* 2. Target the first child span (around Galilee) */
.keeptogether > span:first-child {
  display: inline !important;
  white-space: pre !important; /* Overrides the problematic global pre-wrap */
  margin-left: 0 !important;       /* Resets the global negative margin shift */
}

/* 3. Target the second child span (The sticky period symbol) */
.keeptogether > span:nth-child(2) {
  display: inline !important;
  white-space: pre !important; /* Overrides the problematic global pre-wrap */
  margin-left: 0 !important;       /* Prevents punctuation tracking gaps */
}


/* ==================== SOMETHING ELSE ==================== */


@media screen and (max-width: 767px) {
  button.toggle {
	width:60px;
}
  .fullname {
	display:none;
}
}