/* =========================================
   Louie Merriam - Personal Site Stylesheet
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent:    #234d6b;
  --accent-lt: #234d6b;
  --text:      #181a1d;
  --muted:     #5d6670;
  --border:    #dde3e8;
  --bg:        #ffffff;
  --sidebar-w: 170px;
  --max-w:     880px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', Times, serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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

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

/* --- Site wrapper --- */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / Nav --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px 28px;
  border-bottom: 1px solid var(--border);
  padding: 18px 0 12px;
}

.site-title {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0;
}

.site-title a {
  color: inherit;
}

nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 0;
}

nav a {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  padding-bottom: 0;
  border-bottom: none;
  transition: color 0.15s ease;
}

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

nav a.active {
  color: var(--text);
  font-weight: 600;
}

/* --- Main layout --- */
.page-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 34px;
  padding: 30px 0 56px;
}

/* Single-column pages (blog, projects list) */
.page-body.single-col {
  grid-template-columns: 1fr;
}

/* --- Sidebar --- */
.sidebar {
  padding-top: 4px;
}

.sidebar .name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.sidebar .contact {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.sidebar .contact a {
  color: var(--accent);
}

.sidebar-links {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-links a {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--accent);
}

/* --- Main content --- */
.main-content {
  min-width: 0;
  max-width: 42rem;
}

.page-body.single-col .main-content {
  max-width: 46rem;
}

.projects-content {
  max-width: none;
}

.main-content p {
  margin-bottom: 1.2em;
}

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

/* --- Section headers --- */
.section-header {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  margin: 2.2em 0 0.75em;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--text);
  clear: both;
}

.section-header:first-child {
  margin-top: 0;
}

/* --- Cards (projects / blog) --- */
.card-list {
  list-style: none;
  margin-top: 1em;
}

.card {
  display: block;
  margin-bottom: 1.8em;
  padding-bottom: 1.8em;
  border-bottom: 1px solid var(--border);
}

.card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2em;
  color: var(--text);
}

.card-title a {
  color: inherit;
}

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

.card-meta {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45em;
  letter-spacing: 0;
}

.card-desc {
  font-size: 0.94rem;
  color: var(--text);
}

.card-desc p {
  margin-bottom: 0.8em;
}

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

.card-has-img {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.card-image-wrap {
  flex: 0 0 150px;
}

.card-img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border: none;
  border-radius: 0;
  background: transparent;
}

.projects-content .card-has-img {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.projects-content .card-image-wrap {
  width: 180px;
}

.projects-content .card-img {
  width: 180px;
  aspect-ratio: 4 / 3;
}

.feature-figure {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.feature-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.feature-figure figcaption {
  margin-top: 0.45rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: 0;
}

.feature-figure-block {
  max-width: 560px;
  margin: 0 0 1.35rem;
}

.feature-figure-wide {
  max-width: 460px;
  margin: 1rem 0 1.35rem;
}

.feature-figure-wide img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}

/* --- Blog post page --- */
.post-header {
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.4em;
}

.post-meta {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
}

.post-body p {
  margin-bottom: 1.3em;
}

.post-body h2 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2em 0 0.6em;
}

/* --- Tag pills --- */
.tag {
  display: inline-block;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  background: transparent;
  color: var(--muted);
  padding: 0;
  border-radius: 0;
  margin-right: 0.35rem;
}

/* --- Back link --- */
.back-link {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 1.5em;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* --- Publications --- */
.pub-list {
  list-style: none;
  margin-top: 0.8em;
  margin-bottom: 2em;
}

.pub-item {
  padding: 0.9em 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:first-child {
  border-top: 1px solid var(--border);
}

.pub-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25em;
  line-height: 1.4;
}

.pub-meta {
  font-size: 0.84rem;
  color: var(--muted);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.pub-note {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.4em;
  font-style: italic;
}

.pub-status {
  display: inline-block;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0;
  border-radius: 0;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.pub-status.review {
  background: transparent;
  color: var(--muted);
}

.pub-status.forthcoming {
  background: transparent;
  color: var(--muted);
}

/* --- Section subheader --- */
.section-subheader {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2em 0 0.2em;
}

/* --- CV entries (about page) --- */
.cv-entry {
  margin-bottom: 1.6em;
  padding-bottom: 1.6em;
  border-bottom: 1px solid var(--border);
}

.cv-entry:last-of-type {
  border-bottom: none;
}

.cv-where {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.15em;
}

.cv-when {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4em;
}

.cv-detail {
  font-size: 0.91rem;
  color: var(--muted);
  line-height: 1.65;
}

.cv-list {
  list-style: none;
  margin-top: 0.5em;
}

.cv-list li {
  padding: 0.6em 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.91rem;
  line-height: 1.55;
}

.cv-list li:first-child {
  border-top: 1px solid var(--border);
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 16px 0 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  color: #7d8791;
}

.inline-photo {
  display: block;
  width: 260px;
  max-width: 58%;
  margin: 0.75rem 0 0;
}

.inline-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.inline-photo-caption {
  display: block;
  margin-top: 0.35rem;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  header {
    align-items: flex-start;
  }

  .page-body {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .sidebar {
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
  }

  nav {
    gap: 16px;
    flex-wrap: wrap;
  }

  .card-has-img {
    flex-direction: column;
    gap: 14px;
  }

  .projects-content .card-has-img {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card-image-wrap {
    flex: none;
    width: 100%;
  }

  .projects-content .card-image-wrap,
  .projects-content .card-img {
    width: 100%;
  }

  .card-img {
    aspect-ratio: 16 / 9;
  }

  .feature-figure-block {
    max-width: 100%;
  }

  .inline-photo {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0.9rem 0 0;
  }
}
