/* ============================================================
   Scott Cook — Academic Website
   Shared stylesheet — muted earth-tone palette
   ============================================================ */

:root {
  /* Earth tones — kept muted and warm, nothing saturated/bright */
  --color-bg:        #f4efe4;   /* warm parchment cream */
  --color-bg-alt:    #ece3d2;   /* slightly deeper cream, for cards/sections */
  --color-border:    #d8cbb0;   /* soft tan border */
  --color-text:      #3d332a;   /* deep warm brown, body text */
  --color-text-soft: #6b5d4f;   /* softened brown, secondary text */
  --color-heading:   #4a3826;   /* darker coffee brown, headings */
  --color-accent:    #795f43;   /* clay / tan accent (darkened for WCAG AA contrast) */
  --color-accent-2:  #5e674e;   /* muted sage/olive accent (darkened for WCAG AA contrast) */
  --color-accent-3:  #8f5736;   /* soft muted terracotta, sparingly (darkened for WCAG AA contrast) */
  --color-nav-bg:    #3d332a;   /* dark brown nav background */
  --color-nav-text:  #f4efe4;   /* cream text on nav */

  --max-width: 960px;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--color-heading);
  line-height: 1.25;
  margin-top: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-3);
  text-decoration: underline;
}

p {
  margin: 0 0 1em 0;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  padding: 3rem 0 4rem 0;
}

/* ---------- Nav ---------- */

.site-nav {
  background-color: var(--color-nav-bg);
  border-bottom: 3px solid var(--color-accent);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.site-nav .brand {
  color: var(--color-nav-text);
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.site-nav .brand:hover {
  color: #e6dcc4;
  text-decoration: none;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a.nav-link {
  color: var(--color-nav-text);
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  opacity: 0.88;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.site-nav a.nav-link:hover {
  opacity: 1;
  text-decoration: none;
  border-bottom: 2px solid var(--color-accent-3);
}

.site-nav a.nav-link.active {
  opacity: 1;
  border-bottom: 2px solid var(--color-accent);
}

/* ---------- Hero (home page) ---------- */

.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: 1rem 0 3rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
}

.hero img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--color-bg-alt);
  box-shadow: 0 3px 10px rgba(61, 51, 42, 0.18);
  flex-shrink: 0;
}

.hero-text h1 {
  font-size: 2.1rem;
  margin-bottom: 0.3rem;
}

.hero-text .credentials {
  color: var(--color-accent);
  font-weight: bold;
  margin-bottom: 0.9rem;
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1rem;
}

.hero-text p {
  max-width: 55ch;
  color: var(--color-text-soft);
}

/* ---------- Section preview cards on home page ---------- */

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
}

.section-card {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.section-card:hover {
  box-shadow: 0 4px 14px rgba(61, 51, 42, 0.14);
  transform: translateY(-2px);
}

.section-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.section-card h3 a {
  color: var(--color-heading);
}

.section-card h3 a:hover {
  color: var(--color-accent-3);
  text-decoration: none;
}

.section-card p {
  color: var(--color-text-soft);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.section-card .read-more {
  font-size: 0.88rem;
  font-weight: bold;
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---------- Page header (interior pages) ---------- */

.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  font-size: 1.9rem;
  margin-bottom: 0.4rem;
}

.page-header .subtitle {
  color: var(--color-text-soft);
  font-size: 1.05rem;
}

/* ---------- Timeline (academics / achievements) ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--color-border);
}

.timeline li {
  position: relative;
  padding: 0 0 1.8rem 1.8rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -8.5px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid var(--color-bg);
}

.timeline .entry-title {
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: bold;
  color: var(--color-heading);
  font-size: 1.05rem;
}

.timeline .entry-meta {
  color: var(--color-accent);
  font-size: 0.88rem;
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  margin-bottom: 0.4rem;
}

.timeline .entry-detail {
  color: var(--color-text-soft);
  font-size: 0.95rem;
  margin: 0.2rem 0 0 0;
}

.timeline ul.detail-list {
  margin: 0.4rem 0 0 0;
  padding-left: 1.1rem;
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.timeline ul.detail-list li {
  padding: 0 0 0.25rem 0;
}

.timeline ul.detail-list li::before {
  content: none;
}

/* ---------- Achievements year list ---------- */

.year-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.year-list li {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: baseline;
}

.year-list li:last-child {
  border-bottom: none;
}

.year-list .year {
  flex-shrink: 0;
  width: 4.5rem;
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: bold;
  color: var(--color-accent);
}

.year-list .desc {
  color: var(--color-text);
}

.year-list .desc .org {
  color: var(--color-text-soft);
  font-style: italic;
}

/* ---------- Callout / highlight box ---------- */

.callout {
  background-color: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent-2);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.8rem;
}

.callout .label {
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: bold;
  color: var(--color-accent-2);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  display: block;
}

/* ---------- Placeholder sections (Photography / Musings) ---------- */

.placeholder-box {
  background-color: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--color-text-soft);
  margin-bottom: 2rem;
}

.placeholder-box .icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  opacity: 0.6;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-grid .frame {
  aspect-ratio: 4 / 3;
  background-color: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ---------- Photo tiles + lightbox ---------- */

.photo-tile {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-alt);
  box-shadow: 0 2px 6px rgba(61, 51, 42, 0.1);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.photo-tile:hover {
  box-shadow: 0 6px 16px rgba(61, 51, 42, 0.22);
  transform: translateY(-2px);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(28, 22, 16, 0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  position: absolute;
  bottom: 1.6rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--color-nav-text);
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  opacity: 0.9;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--color-nav-text);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-nav-text);
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  padding: 0.5rem 1rem;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

@media (max-width: 600px) {
  .lightbox-nav {
    font-size: 2.2rem;
    padding: 0.4rem 0.6rem;
  }
}

.musing-entry {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--color-border);
}

.musing-entry:last-child {
  border-bottom: none;
}

.musing-entry h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
  color: var(--color-text-soft);
}

.musing-entry .date {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  margin-bottom: 0.5rem;
}

.page-disclaimer {
  font-style: italic;
  font-size: 0.82rem;
  color: var(--color-text-soft);
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-border);
}

/* ---------- Footer ---------- */

.site-footer {
  background-color: var(--color-nav-bg);
  color: var(--color-nav-text);
  padding: 1.8rem 0;
  margin-top: 2rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  opacity: 0.85;
}

.site-footer a {
  color: var(--color-nav-text);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }
  .hero-text p {
    max-width: none;
  }
  .site-nav .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}
