/* =============================================================================
   odyssey.css — Responsive rebuild for 8thfire.net
   Replaces the original table-based layout.
   Max width: 1100px. Fluid typography. Mobile-first.
   ============================================================================= */

/* ── CUSTOM PROPERTIES ──────────────────────────────────────────────────── */
:root {
  /* Brand colors (preserved from original) */
  --color-page-bg:      #664E74;   /* outer body / footer bg */
  --color-sidebar-bg:   #9073A1;   /* nav column */
  --color-content-bg:   #FFFFFF;   /* main content area */
  --color-footer-bg:    #664E74;
  --color-footer-text:  #E8D8F0;
  --color-nav-link:     #FFFFFF;
  --color-nav-hover:    #F0E0FF;
  --color-nav-active:   #F5EAFF;
  --color-link:         #594466;
  --color-link-hover:   #8B5E9B;
  --color-body-text:    #222222;
  --color-divider:      #C8A8D8;

  /* Layout */
  --max-width:          1100px;
  --sidebar-width:      185px;
  --gap:                0px;       /* sidebar/content share a flush border */

  /* Fluid type scale using clamp()
     Formula: clamp(min, preferred, max)
     Preferred uses viewport width so type scales smoothly between breakpoints */
  --text-xs:   clamp(0.65rem,  0.6rem  + 0.25vw, 0.75rem);
  --text-sm:   clamp(0.78rem,  0.72rem + 0.3vw,  0.875rem);
  --text-base: clamp(0.9rem,   0.82rem + 0.4vw,  1rem);
  --text-md:   clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.1rem,   0.95rem + 0.75vw, 1.35rem);
  --text-xl:   clamp(1.25rem,  1rem    + 1.25vw, 1.75rem);
}


/* ── RESET & BASE ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-page-bg);
  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-body-text);
}

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

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:hover, a:focus {
  color: var(--color-link-hover);
}

p {
  margin-top: 0;
  margin-bottom: 1em;
}
table {
    margin:1em;
}


/* ── SITE WRAPPER ────────────────────────────────────────────────────────── */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  background-color: var(--color-content-bg);
  /* Subtle shadow so the page lifts off the purple body */
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
}


/* ── HEADER ──────────────────────────────────────────────────────────────── */
.site-header {
  width: 100%;
  overflow: hidden;
  line-height: 0; /* collapse inline gap under img */
}

.site-header img {
  width: 100%;
  height: auto;
  display: block;
}


/* ── MOBILE NAV TOGGLE ───────────────────────────────────────────────────── */
.nav-toggle {
  display: none; /* hidden on desktop; shown via media query below */
  width: 100%;
  padding: 0.6em 1em;
  background: var(--color-sidebar-bg);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.nav-toggle:hover {
  background: var(--color-page-bg);
}


/* ── SITE BODY: SIDEBAR + CONTENT ────────────────────────────────────────── */
.site-body {
  display: flex;
  align-items: stretch;
}


/* ── SIDEBAR / NAV ───────────────────────────────────────────────────────── */
.site-nav {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background-color: var(--color-sidebar-bg);
  padding: 0.5em 0 1em 0;
}

/* Top-level nav list */
#nav {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
}

#nav > li {
  padding: 2px 0;
}

/* All nav links */
#nav a {
  display: block;
  color: var(--color-nav-link);
  font-size: var(--text-sm);
  text-decoration: none;
  line-height: 1.3;
  padding: 2px 4px 2px 2px;
  border-radius: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#nav a:hover,
#nav a:focus {
  background-color: rgba(255,255,255,0.15);
  color: var(--color-nav-hover);
  text-decoration: none;
}

#nav li#active > a {
  background-color: rgba(255,255,255,0.2);
  font-weight: bold;
  color: var(--color-nav-active);
}

/* Chapter parent items */
.nav-chapter > a {
  padding-top: 5px;
}

.nav-chapter > a strong {
  display: block;
  font-size: var(--text-sm);
}

.nav-dayrange {
  font-size: var(--text-xs);
  opacity: 0.85;
}

/* Sub-lists (day links within a chapter) */
#nav ul {
  list-style: none;
  margin: 2px 0 4px 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1px 0;
}

#nav ul li {
  width: 50%;  /* two-column day grid — fits the narrow sidebar nicely */
}

#nav ul li a {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.9);
  padding: 1px 2px;
}

#nav ul li a:hover {
  color: #fff;
  background-color: rgba(255,255,255,0.15);
}

/* Decorative dividers */
.nav-divider {
  list-style: none;
  color: var(--color-divider);
  font-size: var(--text-sm);
  padding: 6px 0 4px 2px;
  letter-spacing: 0.1em;
}

/* Search form */
.nav-search {
  margin-top: 10px;
  padding: 0 6px 0 2px;
}

.nav-search input[type="text"] {
  width: 100%;
  padding: 3px 5px;
  font-size: var(--text-xs);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  margin-bottom: 4px;
}

.nav-search input[type="text"]::placeholder {
  color: rgba(255,255,255,0.6);
}

.nav-search button {
  padding: 3px 8px;
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 4px;
}

.nav-search button:hover {
  background: rgba(255,255,255,0.35);
}

.nav-search-label {
  display: block;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
}


/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.site-content {
  flex: 1;
  min-width: 0; /* prevent flex blowout */
  background-color: var(--color-content-bg);
  padding: 1.25em 1.75em 1.5em 1.5em;
}

/* Content headings */
.site-content h1,
.site-content h2,
.site-content h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--color-link);
  line-height: 1.2;
}

.site-content h1 { font-size: var(--text-xl); margin-top: 0.25em; }
.site-content h2 { font-size: var(--text-lg); }
.site-content h3 { font-size: var(--text-md); }


/* ── HOME PANEL (intro blurb + audio) ───────────────────────────────────── */
.home-panel {
  text-align: center;
  border-bottom: 1px solid #e0d0ea;
  padding-bottom: 1.25em;
  margin-bottom: 1.5em;
}

.book-tagline {
  font-style: italic;
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-link);
  margin-bottom: 0.4em;
}

.book-subtitle {
  font-size: var(--text-sm);
  color: #555;
  margin-bottom: 1em;
}

/* Audio / cover-art row */
.audio-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25em;
  flex-wrap: wrap;
  margin: 0.75em auto 0.75em;
  padding: 0.75em 1em;
  border: 1px solid #c090c0;
  border-radius: 6px;
  max-width: 480px;
  background: #faf5fd;
}

.audio-main {
  flex: 1;
  min-width: 180px;
  text-align: center;
}

.audio-main p {
  margin: 4px 0;
  font-size: var(--text-sm);
}

.audio-main audio {
  width: 100%;
  max-width: 260px;
}

.audio-thumb img {
  width: 90px;
  height: auto;
  border: 2px solid #c090c0;
  border-radius: 3px;
}

.youtube-link {
  font-size: var(--text-sm);
  color: #555;
  margin-top: 0.5em;
}

.nav-divider-inline {
  color: var(--color-divider);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  margin: 0.5em 0 0;
}


/* ── INLINE CONTENT IMAGES (day entries) ─────────────────────────────────── */

/* The old site used nested tables for image+caption combos.
   After conversion, mark them up as <figure> / <figcaption>. */
.site-content figure {
  margin: 1.25em auto;
  text-align: center;
  max-width: 100%;
}

.site-content figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid #d0b8d8;
}

.site-content figcaption {
  font-size: var(--text-xs);
  font-style: italic;
  color: #555;
  margin-top: 0.35em;
  line-height: 1.4;
}

/* For content images that aren't yet in <figure> wrappers */
.site-content img {
  max-width: 100%;
  height: auto;
}

/* Float images on wider screens for inline flow (like the original) */
@media (min-width: 600px) {
  .site-content figure.float-right {
    float: right;
    margin: 0 0 1em 1.5em;
    max-width: 45%;
  }
  .site-content figure.float-left {
    float: left;
    margin: 0 1.5em 1em 0;
    max-width: 45%;
  }
}

/* Clearfix for floated figures */
.site-content p.clearfix::after,
.content-clearfix::after {
  content: "";
  display: table;
  clear: both;
}


/* ── SUPPORT / PAYPAL ASIDE ──────────────────────────────────────────────── */
.support-panel {
  margin-top: 2em;
  padding: 1em 1.25em;
  border-top: 2px solid #d0b0d8;
  background: #faf5fd;
  border-radius: 0 0 4px 4px;
  font-size: var(--text-sm);
}

.support-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75em 1.25em;
  margin-bottom: 0.75em;
}

.support-buttons form {
  display: inline-block;
  margin: 0;
}

.support-buttons img {
  display: inline-block;
  vertical-align: middle;
}

.support-cta {
  font-style: italic;
  color: #555;
  margin: 0;
}

.support-sig {
  text-align: right;
  margin-top: 0.5em;
}


/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  text-align: center;
  padding: 1.25em 1em 1.5em;
  font-size: var(--text-sm);
}

.footer-nav {
  margin-bottom: 0.6em;
  line-height: 2;
}

.footer-nav a {
  color: var(--color-footer-text);
  text-decoration: none;
  margin: 0 0.15em;
}

.footer-nav a:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-copy {
  font-size: var(--text-xs);
  opacity: 0.75;
  margin: 0;
}


/* ── LEGACY CLASS COMPATIBILITY ──────────────────────────────────────────── */
/* The day-entry HTML files use these old Dreamweaver classes.
   Map them to sensible values so content pages look right
   without touching each file. */

.style44 { font-size: var(--text-base); }
.style55,
.style56 { font-size: var(--text-sm); }
.style47 { font-size: var(--text-xs); }
.style59 { font-size: var(--text-sm); color: var(--color-divider); letter-spacing: 0.1em; }
.style66 { color: var(--color-divider); }

/* Scrub fixed font sizes that would break fluid type */
.style71 { color: #594466; }
.style72 { font-size: var(--text-base); }
.style76 { font-size: var(--text-base); font-weight: bold; }
.style79 { font-size: var(--text-sm); }
.style80 { font-size: var(--text-xs); }

/* Legacy link classes */
a.bodylink  { color: var(--color-link); }
a.bottomlink { color: var(--color-footer-text); }
a.bottomlink:hover { color: #fff; }


/* ── RESPONSIVE BREAKPOINTS ──────────────────────────────────────────────── */

/* ---- Tablet: 768px and below ------------------------------------------- */
@media (max-width: 768px) {

  /* Show the hamburger button */
  .nav-toggle {
    display: block;
  }

  /* Stack sidebar below toggle, collapsed by default */
  .site-body {
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
  }

  /* JS adds .is-open on toggle click */
  .site-nav.is-open {
    max-height: 9999px; /* large enough to show all content */
    padding: 0.5em 0 1em 0;
  }

  /* Make day sub-links 3-column on tablet for compact nav */
  #nav ul li {
    width: 33.333%;
  }

  .site-content {
    padding: 1em 1.1em;
  }

  .audio-panel {
    max-width: 100%;
  }
}

/* ---- Mobile: 480px and below ------------------------------------------- */
@media (max-width: 480px) {

  .site-content {
    padding: 0.85em 0.85em;
  }

  /* Day sub-links go 4-column on small screens — they're short labels */
  #nav ul li {
    width: 25%;
  }

  .support-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .audio-panel {
    flex-direction: column;
  }

  .audio-thumb img {
    width: 70px;
  }

  .site-content figure.float-right,
  .site-content figure.float-left {
    float: none;
    max-width: 100%;
    margin: 1em 0;
  }
}

/* ---- Wide: keep centered, no change needed above 1100px ----------------- */
/* .site-wrapper already has max-width: 1100px and margin: 0 auto */
