/* ============================================================
   styles.css — Global stylesheet for the personal academic site
   To retheme the entire site, edit the CSS custom properties
   in the :root block below. No other changes needed.
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color palette — edit here to retheme */
  --color-bg:             #f7f5f0;
  --color-text:           #1c1c1c;
  --color-heading:        #0d1b2a;
  --color-accent:         #2563a8;
  --color-accent-hover:   #1a4a8a;
  --color-muted:          #666666;
  --color-border:         #d8d3c9;
  --color-surface:        #ffffff;
  --color-nav-bg:         #0d1b2a;
  --color-nav-text:       #cdd5df;
  --color-nav-hover:      #ffffff;
  --color-dropdown-bg:    #152742;
  --color-dropdown-hover: #1e3a5f;

  /* Typography */
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Layout */
  --content-max: 880px;
  --nav-height:  64px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Typography -------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-heading);
  line-height: 1.25;
  margin-bottom: 0.5em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.65rem; margin-top: 2rem; }
h3 { font-size: 1.2rem;  margin-top: 1.5rem; }
p  { margin-bottom: 1rem; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--color-accent-hover); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }

/* --- Main Layout ------------------------------------------- */
.content-wrapper {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
}

main { flex: 1; }

/* --- Navigation -------------------------------------------- */
#site-nav { position: sticky; top: 0; z-index: 1000; }

.main-nav {
  background: var(--color-nav-bg);
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 2rem;
  gap: 1.5rem;
  position: relative;
}

/* Brand / site title */
.brand {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--color-nav-text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--color-nav-hover); text-decoration: none; }

/* Primary nav list */
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

/* Primary nav link — uppercase small caps treatment */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.55rem 0.9rem;
  color: var(--color-nav-text);
  font-size: 0.8rem;
  font-family: var(--font-sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  line-height: var(--nav-height);
  height: var(--nav-height);
}
.nav-link:hover {
  color: var(--color-nav-hover);
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}
.caret { font-size: 0.65em; opacity: 0.65; }

/* CSS-driven dropdown — no JavaScript required */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-dropdown-bg);
  min-width: 210px;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  border-top: 2px solid var(--color-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.has-dropdown:hover .dropdown { display: block; }

.dropdown li a {
  display: block;
  padding: 0.6rem 1.1rem;
  color: var(--color-nav-text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown li a:hover {
  background: var(--color-dropdown-hover);
  color: var(--color-nav-hover);
}

/* Mobile hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-nav-text);
  font-size: 1.6rem;
  cursor: pointer;
  margin-left: auto;
  padding: 0.5rem;
}

/* --- Page Header Band -------------------------------------- */
.page-header {
  background: var(--color-heading);
  color: #e8e4d9;
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.page-header h1 { color: #ffffff; margin-bottom: 0.4rem; }
.page-header .subtitle {
  font-size: 1rem;
  color: #8fa3bb;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Section divider --------------------------------------- */
.section { margin-bottom: 3rem; }

.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* --- Media placeholder (science pages) --------------------- */
.media-placeholder {
  background: #ede9e1;
  border: 2px dashed #c0b9ae;
  border-radius: 4px;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-muted);
  font-style: italic;
  margin: 1.75rem 0;
  font-size: 0.9rem;
}

/* --- Home Page --------------------------------------------- */
.hero {
  background: linear-gradient(150deg, #0d1b2a 0%, #1a3558 100%);
  color: #e8e4d9;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
}
.hero h1 {
  color: #ffffff;
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.hero .tagline {
  font-size: 1.15rem;
  color: #9ab0c8;
  max-width: 640px;
  margin: 0 auto 0.5rem;
  line-height: 1.7;
  font-style: italic;
}
.hero .disciplines {
  font-size: 0.85rem;
  color: #6a8aaa;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 1.25rem;
}

/* Category cards on home page */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding: 0 1.5rem;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}
.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  padding: 1.75rem 1.25rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 180px;   /* grow, shrink, base 180px — cards fill the row evenly */
  max-width: 260px;  /* cap width so they don’t stretch too wide on large screens */
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.category-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
  text-decoration: none;
}
.category-card .card-icon { font-size: 2.25rem; line-height: 1; }
.category-card h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-top: 0.85rem;
  margin-bottom: 0.5rem;
}
.category-card p {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.5;
}

.home-footer-spacer { padding: 3rem 0; }

/* --- Morality dual-section (shared page) ------------------- */
.dual-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  padding: 1.75rem;
}
.panel h3 { margin-top: 0; color: var(--color-heading); }

/* --- Database Page ----------------------------------------- */
.db-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2rem;
  margin-bottom: 2.5rem;
}
.db-section-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--color-heading);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
}
.db-table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  background: var(--color-heading);
  color: #e8e4d9;
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
tbody tr:nth-child(even) { background: #f0ece4; }
tbody td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

/* Filter controls */
.filter-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-row label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
  font-weight: 600;
}
.filter-row input,
.filter-row select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: var(--color-bg);
  min-width: 150px;
  flex: 1;
}
.filter-row input:focus,
.filter-row select:focus {
  outline: 2px solid var(--color-accent);
  border-color: var(--color-accent);
}

/* McLellan results */
.results-list { list-style: none; padding: 0; margin: 0; }
.result-item {
  border-bottom: 1px solid var(--color-border);
  padding: 0.9rem 0;
}
.result-item:last-child { border-bottom: none; }
.result-title { font-weight: 700; color: var(--color-heading); margin-bottom: 0.2rem; }
.result-meta { font-size: 0.78rem; color: var(--color-muted); margin-bottom: 0.3rem; }
.result-summary { font-size: 0.875rem; line-height: 1.6; }
.tag-row { margin-top: 0.4rem; }
.tag {
  display: inline-block;
  background: #deeaf7;
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  letter-spacing: 0.04em;
}
.no-results { color: var(--color-muted); font-style: italic; padding: 1rem 0; }
#load-status { font-size: 0.85rem; color: var(--color-muted); font-style: italic; }

/* --- About Page -------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3.5rem;
  align-items: start;
  margin-top: 2.5rem;
}
.profile-img-placeholder {
  background: #ddd8cc;
  aspect-ratio: 3 / 4;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
  border: 1px solid var(--color-border);
}
.social-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.social-link {
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.social-link:hover {
  background: var(--color-accent);
  color: #ffffff;
  text-decoration: none;
}

/* --- Footer ------------------------------------------------ */
footer {
  background: var(--color-heading);
  color: #5d7a99;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  margin-top: auto;
}
footer a { color: #7a9bbf; }
footer a:hover { color: #ffffff; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 4rem 1rem 3rem; }

  /* Mobile nav */
  .main-nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0 1rem;
    align-items: flex-start;
  }
  .brand { padding: 1rem 0; }
  .nav-toggle { display: block; }
  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: 0.75rem;
    align-items: flex-start;
  }
  .main-nav.open .nav-list { display: flex; }
  .nav-item { width: 100%; }
  .nav-link {
    height: auto;
    line-height: 1;
    padding: 0.7rem 0.25rem;
    border-bottom-color: transparent !important;
    width: 100%;
  }
  .dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border-top: none;
    border-left: 2px solid var(--color-accent);
    padding: 0.25rem 0 0.25rem 0.75rem;
    background: transparent;
    min-width: unset;
  }
  /* On mobile, show dropdown on parent hover/focus */
  .has-dropdown:hover .dropdown { display: block; }

  .dual-section { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .profile-img-placeholder { max-width: 220px; }
}
