/* =========================================================
   css/main.css
   GLOBAL LAYOUT AND STRUCTURE
   AbrahamicFamily.org
   ========================================================= */

:root {
  --header-total: 115px;
  --footer-height: 32px;
  --max-width: 1280px;
  --text-color: #2f331f;
  --bg-color: #f9f8f5;
  --accent: #c2a661;
  /* Modern universal sans-serif stack */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
}

/* =============================
   GLOBAL RESET
============================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100.1%;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  scroll-padding-top: var(--header-total);
  overflow-y: scroll;
}

/* =============================
   BODY
============================= */
body {
  line-height: 1.6;
  font-size: 18px;
  padding-bottom: var(--footer-height);
}

/* =============================
   HEADER (fixed)
============================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  z-index: 200;
}

.header-logo {
  text-align: center;
  padding: 5px 0 0 0;
}

.header-logo img {
  height: 52px;
}

/* =============================
   MAIN NAVIGATION
============================= */
nav.main-menu {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 5px 0;
  background: white;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  font-size: 18px;
}

nav.main-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

nav.main-menu a:hover {
  color: var(--accent);
}

nav.main-menu a.active {
  border-bottom-color: var(--accent);
  color: #000;
}

/* =============================
   PAGE WRAPPER
============================= */
.page-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  max-width: var(--max-width);
  margin: var(--header-total) auto 80px;
  padding: 0 12px;
}

/* =============================
   CONTENT AREA
============================= */
.content-area {
  flex: 1;
  max-width: 1024px;
  min-width: 0;
  text-align: justify;
}

.submenu-content-area {
  flex: 1;
  max-width: 866px;
  min-width: 0;
  text-align:justify;
}

/* =============================
   LAMB LOGO (INDEX ONLY)
============================= */
.lamb-logo {
  display: block;
  margin: 20px auto;
  width: 190px;
  height: auto;
}

/* =============================
   VERTICAL SUBMENU
============================= */
.submenu-vertical {
  width: 140px;
  position: sticky;
  top: var(--header-total);
  align-self: flex-start;
  padding: 0;
  margin: 0;
  max-height: calc(100vh - var(--header-total));
  overflow-y: auto;
}

.submenu-vertical ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.submenu-vertical li {
  margin-bottom: 0px;
}

.submenu-vertical a {
  display: block;
  padding: 3px 5px;
  color: #2a2a2a;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: border-left-color .15s, color .15s;
}

.submenu-vertical a:hover,
.submenu-vertical a.active {
  border-left-color: var(--accent);
  color: #000;
}

/* =============================
   Typography
============================= */

/* Headings */
h1 {
  font-size: 30px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

h2 {
  font-size: 26px;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  line-height: 1.35;
}

h3 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  line-height: 1.4;
}

h4 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  line-height: 1.45;
}

/* Paragraphs */
p {
  font-size: 18px;
  line-height: 1.7;
  margin: 1em 0;
}

/* Italics — for references */
i {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 12px;
  color: #4a4a4a;
}

/* =============================
   FOOTER (fixed)
============================= */
footer.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  background: white;
  border-top: 1px solid #eee;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 180;
}

footer.site-footer .inner {
  font-size: 12px;
  color: #444;
  text-align: center;
}
/* =========================================
   MOBILE HAMBURGER
========================================= */
.mobile-nav-toggle {
  display: none;
  font-size: 30px;
  padding: 5px 5px;
  cursor: pointer;
  background: white;
  color: var(--text-color);
  position: absolute;
  top: 2px;
  left: 10px;
  z-index: 500;
}

/* =========================================
   MOBILE MENU (side panel)
========================================= */
.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: #ffffff;
  box-shadow: 2px 0 6px rgba(0,0,0,0.2);
  padding-top: 80px;
  z-index: 400;
}

.mobile-menu a {
  padding: 14px 20px;
  font-size: 20px;
  text-decoration: none;
  color: var(--text-color);
  border-bottom: 1px solid #eee;
}

.mobile-menu a:hover {
  background: #f4f3ef;
}

/* =========================================
   SHOW MOBILE ELEMENTS BELOW 768px
========================================= */
@media (max-width: 768px) {

  /* show hamburger */
  .mobile-nav-toggle {
    display: block;
  }

  /* hide desktop menu */
  nav.main-menu {
    display: none;
  }

  /* mobile menu is allowed to appear */
  .mobile-menu.show {
    display: flex;
  }
}

/* =====================================================
   MOBILE LAYOUT (max-width: 820px)
   Fixes submenu + content stacking and width issues
   ===================================================== */
@media (max-width: 820px) {

  :root {
    --header-total: 65px;  /* Adjust mobile header height */
  }

  /* Stack submenu ABOVE content */
  .page-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 12px;
  }

  /* Submenu becomes full-width horizontal bar */
  .submenu-vertical {
    width: 100%;
    position: sticky;
    top: var(--header-total);
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 6px 0;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-height: unset; /* allow proper height */
  }

  /* Turn vertical UL → horizontal row */
  .submenu-vertical ul {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 0 8px;
  }

  /* Menu items in one row */
  .submenu-vertical a {
    border-left: none;                 /* remove vertical highlight */
    border-bottom: 2px solid transparent;
    padding: 4px 6px;
    display: inline-block;
  }

  /* Active menu item underline */
  .submenu-vertical a.active {
    border-bottom-color: var(--accent);
  }

  /* Main content becomes full width */
  .submenu-content-area {
    max-width: 100%;
    margin-top: 20px;
  }
}

/* =============================
   NEXT PAGE LINK
============================= */
.next-page-link {
  margin-top: 60px;
  text-align: center;
}

.next-page-link a {
  display: inline-block;
  padding: 12px 22px;
  color: #2f331f;
  background: #f1eee6;
  border: 1px solid #d5cba9;
  text-decoration: none;
  font-size: 18px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.next-page-link a:hover {
  background: #e0d7bc;
  color: #000;
}

/* =============================
   INLINE REFERENCE LINKS
============================= */
.ref-link {
  color: var(--accent);
  font-style: italic;
  text-decoration: none;
}
.ref-link:hover {
  text-decoration: underline;
}

/* =============================
   REFERENCE BLOCKS (at bottom)
============================= */
.reference-block {
  margin: 22px 0;
  padding: 12px 16px;
  background: #f3f1eb;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
}

.reference-heading {
  font-size: 28px;
  margin-top: 60px;
  margin-bottom: 20px;
  text-align: left;
}

/* =============================
   BACK-TO-TEXT LINKS
============================= */
.back-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  text-decoration: none;
}
.back-link:hover {
  color: var(--accent);
  text-decoration: underline;
}