/* Dave and Ki's Website - Modern Replacement Styles */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

#body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#doc {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
#hd {
  background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
  color: #fff;
  padding: 1.5rem 2rem;
}

#hd h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

#hMisc {
  display: none;
}

/* Wrapper - contains nav and content side by side */
#wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Navigation - Left Sidebar */
#navigation {
  width: 200px;
  flex-shrink: 0;
  background: #1a365d;
  border-right: 3px solid #c6a962;
}

#mainNav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#mainNav li {
  margin: 0;
}

#mainNav li a {
  display: block;
  padding: 0.875rem 1.25rem;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease, color 0.2s ease;
}

#mainNav li a:hover {
  background: #2c5282;
  color: #fff;
}

#mainNav li.active a {
  background: #c6a962;
  color: #1a365d;
}

/* Main Content Area */
#bd {
  flex: 1;
  padding: 1.5rem 2rem;
  min-width: 0;
}

#pageName {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

#pageName h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1a365d;
  font-weight: 600;
}

/* Content Zones - Main content left, Downloads right */
#zWrap {
  display: grid;
  grid-template-columns: 1fr 220px;
  grid-template-rows: auto auto;
  gap: 1rem 2rem;
}

#zA {
  grid-column: 1;
  grid-row: 1;
}

#zB {
  grid-column: 1;
  grid-row: 2;
}

/* Right sidebar for downloads */
#zC {
  grid-column: 2;
  grid-row: 1 / 3;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  align-self: start;
}

/* Hide empty sidebar */
#zC:has(.modWrap:empty) {
  display: none;
}

#zWrap:has(#zC:empty),
#zWrap:has(#zC .modWrap:empty) {
  grid-template-columns: 1fr;
}

.modWrap {
  line-height: 1.7;
}

.modWrap p {
  margin: 0 0 1rem 0;
}

.modWrap p:last-child {
  margin-bottom: 0;
}

.modWrap h3 {
  margin: 0 0 1rem 0;
  color: #1a365d;
  font-size: 1.25rem;
}

/* Links */
a {
  color: #2c5282;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #1a365d;
}

/* PDF Download Links */
.modWrap a[href$=".pdf"]:not(:empty),
.modWrap a[href$=".prc"]:not(:empty) {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #2c5282;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  max-width: 100%;
  word-break: break-word;
  box-sizing: border-box;
}

.modWrap a[href$=".pdf"]:not(:empty):hover,
.modWrap a[href$=".prc"]:not(:empty):hover {
  background: #1a365d;
}

/* Footer */
#ft {
  background: #1a365d;
  color: #e2e8f0;
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.875rem;
  margin-top: auto;
}

#fMisc, #fBadges {
  display: none;
}

/* Clean up deprecated font tags */
font {
  font-family: inherit !important;
  font-size: inherit !important;
}

font[size="2"], font[size="-1"] {
  font-size: 0.9rem !important;
}

/* Responsive */
@media (max-width: 900px) {
  #wrapper {
    flex-direction: column;
  }

  #navigation {
    width: 100%;
    border-right: none;
    border-bottom: 3px solid #c6a962;
  }

  #mainNav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  #mainNav li a {
    border-bottom: none;
    padding: 0.75rem 1rem;
  }

  #zWrap {
    grid-template-columns: 1fr;
  }

  #zC {
    grid-column: 1;
    grid-row: 3;
    margin-top: 0.5rem;
  }
}

@media (max-width: 600px) {
  #hd {
    padding: 1rem;
  }

  #hd h1 {
    font-size: 1.5rem;
  }

  #mainNav {
    flex-direction: column;
  }

  #mainNav li a {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  #bd {
    padding: 1rem;
  }

  #pageName h2 {
    font-size: 1.25rem;
  }
}

/* Print styles */
@media print {
  #navigation, #ft {
    display: none;
  }

  #doc {
    box-shadow: none;
  }

  #hd {
    background: none;
    color: #000;
    border-bottom: 2px solid #000;
  }
}
