/*****************************************************************************/
/*
/* Common
/*
/*****************************************************************************/

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

:root {
  --color-text: #3d3530;
  --color-heading: #1a1512;
  --color-accent: #1d5f8a;
  --color-accent-hover: #154766;
  --color-muted: #8a7e76;
  --color-border: #e2dbd3;
  --color-bg: #faf8f5;
  --color-bg-subtle: #f5f1ec;
  --color-bg-muted: #ede8e2;
  --color-link-visited: #4a5f70;
  --max-width: 40rem;
  --header-height: 3.75rem;
}

html, body { height: 100%; }

html {
  font-size: 18px;
  /* Keep anchor targets (#more, footnotes) clear of the sticky header */
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
}

@media (max-width: 768px) {
  html { font-size: 17px; }
}

@media (max-width: 480px) {
  html { font-size: 16px; }
}

body {
  background-color: var(--color-bg);
  font-family: "Literata", "Georgia", serif;
  color: var(--color-text);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Subtle warm grain texture */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.025;
  z-index: 999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Page load animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*****************************************************************************/
/*
/* Typography
/*
/*****************************************************************************/

h1, h2, h3, h4, h5, h6 {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.2;
  text-align: left;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.6em;
  text-align: center;
  letter-spacing: -0.025em;
  font-weight: 800;
}

h2 {
  font-size: 1.4rem;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.3em;
  color: var(--color-muted);
}

h5, h6 {
  font-size: 0.9rem;
  margin-bottom: 0.2em;
}

p {
  margin-bottom: 1.3em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

a:visited {
  color: var(--color-link-visited);
}

.small {
  font-size: 70%;
}

blockquote {
  border-left: 3px solid var(--color-accent);
  color: var(--color-muted);
  font-style: italic;
  margin: 1.75em 0;
  padding: 0.75em 0 0.75em 1.5em;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/*****************************************************************************/
/*
/* Header
/*
/*****************************************************************************/

/* Blue accent stripe */
.header-accent {
  height: 3px;
  background: linear-gradient(90deg,
    var(--color-accent) 0%,
    #2e78a6 40%,
    #174f73 70%,
    var(--color-accent) 100%
  );
  position: sticky;
  top: 0;
  z-index: 101;
  transition: height 0.3s ease, opacity 0.3s ease;
}

.header-accent.scrolled {
  height: 2px;
}

.header {
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.5rem;
  position: sticky;
  top: 3px;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 248, 245, 0.92);
  transition: top 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
  top: 2px;
  box-shadow: 0 1px 12px rgba(26, 21, 18, 0.06);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.header a {
  text-decoration: none;
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Title group: monogram + name */
.title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-heading);
  transition: color 0.25s ease;
}

.title-group:visited {
  color: var(--color-heading);
}

.title-group:hover {
  color: var(--color-accent);
}

.title-group:hover .monogram {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
  transform: rotate(-3deg);
}

.monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--color-heading);
  border-radius: 5px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--color-heading);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.title-text {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Navigation */
.navbar {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.header a.nav {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 0;
  position: relative;
  transition: color 0.25s ease;
}

.header a.nav:visited {
  color: var(--color-muted);
}

/* Animated underline indicator */
.header a.nav::after {
  content: "";
  position: absolute;
  bottom: 0.15rem;
  left: 0.65rem;
  right: 0.65rem;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.header a.nav:hover::after {
  transform: scaleX(1);
}

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

.header a.nav.active::after {
  transform: scaleX(1);
  background: var(--color-accent);
}

.header a.nav:hover {
  color: var(--color-heading);
}

/* Animated hamburger icon */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 16px;
  position: relative;
}

.menu-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-muted);
  border-radius: 1px;
  position: absolute;
  left: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 7px; }
.menu-icon span:nth-child(3) { top: 14px; }

/* Hamburger → X animation */
.menu-toggle.is-active .menu-icon span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
  background-color: var(--color-accent);
}

.menu-toggle.is-active .menu-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.is-active .menu-icon span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
  background-color: var(--color-accent);
}

.menu-toggle:hover .menu-icon span {
  background-color: var(--color-heading);
}

@media (max-width: 640px) {
  .menu-toggle {
    display: flex;
  }

  .navbar {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    gap: 0;
    box-shadow: 0 12px 32px rgba(26, 21, 18, 0.08);
  }

  .navbar.open {
    display: flex;
    animation: menuReveal 0.3s ease-out both;
  }

  @keyframes menuReveal {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .header a.nav {
    padding: 0.7rem 0.75rem;
    width: 100%;
    border-radius: 6px;
    font-size: 0.88rem;
    transition: color 0.25s ease, background-color 0.25s ease;
  }

  .header a.nav::after {
    display: none;
  }

  .header a.nav.active {
    background: var(--color-bg-muted);
  }

  .header a.nav:hover {
    background: var(--color-bg-muted);
  }

  .header {
    position: sticky;
  }

  .title-text {
    font-size: 1rem;
  }

  .monogram {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.65rem;
  }
}

/*****************************************************************************/
/*
/* Main Content
/*
/*****************************************************************************/

.main {
  font-size: 1rem;
  text-align: left;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 2.25rem;
  line-height: 1.75;
  animation: fadeUp 0.5s ease-out both;
}

.main a {
  text-decoration: none;
  color: var(--color-accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.main a:hover {
  border-bottom-color: var(--color-accent);
}

.main a:visited {
  color: var(--color-link-visited);
}

.main a:visited:hover {
  border-bottom-color: var(--color-link-visited);
}

/* External link styling */
.main a[href^="http"]:not([href*="alexcwatt.com"]):not([href*="localhost"]):not([href*="127.0.0.1"])::after {
  content: " \2197";
  font-size: 0.65em;
  opacity: 0.4;
  margin-left: 0.1em;
  font-weight: 500;
}

h1 a, h1 a:hover {
  color: var(--color-heading);
  text-decoration: none;
  border-bottom: none;
}

h1 a:visited {
  color: var(--color-heading);
}

/*****************************************************************************/
/*
/* Lists
/*
/*****************************************************************************/

ul {
  margin: 0.75em 0;
  list-style-type: disc;
  padding-left: 1.5em;
}

ul ul {
  margin: 0.25em 0;
  list-style-type: circle;
}

ol {
  margin: 0.75em 0;
  padding-left: 1.5em;
}

li {
  margin-left: 0;
  padding-bottom: 0.3em;
}

hr {
  margin: 2.25em 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

img,
video {
  max-width: 100%;
  border-radius: 6px;
}

/*****************************************************************************/
/*
/* Posts
/*
/*****************************************************************************/

.post ul, .post ol {
  margin-left: 0;
}

.main code {
  background-color: var(--color-bg-muted);
  border-radius: 4px;
  border: 1px solid var(--color-border);
  padding: 0.15em 0.4em;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  color: #2c2520;
  font-size: 0.86em;
  display: inline;
  white-space: nowrap;
  overflow-x: auto;
}

.main pre code {
  font-size: 0.8em;
  background-color: #2c2520;
  color: #e8e2db;
  border: none;
  padding: 1.35em;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(26, 21, 18, 0.12), 0 8px 24px rgba(26, 21, 18, 0.06);
  font-family: 'SF Mono', 'Fira Code', 'Source Code Pro', monospace;
  line-height: 1.65;
  margin-bottom: 1.3em;
  tab-size: 4;
}

/* terminal */
.post pre.terminal {
  border: 1px solid #2c2520;
  background-color: #2c2520;
  color: #e8e2db;
}

.post pre.terminal code {
  background-color: #2c2520;
}

.meta {
  color: var(--color-muted);
  text-align: center;
  font-size: 0.8rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: 3rem;
  margin-bottom: 0;
}

/*****************************************************************************/
/*
/* Footer
/*
/*****************************************************************************/

.footer {
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-muted);
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  flex-wrap: wrap;
}

.footer-sep {
  color: var(--color-border);
}

.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.footer a {
  color: var(--color-muted);
  transition: color 0.25s ease;
  display: inline-flex;
  align-items: center;
}

.footer a:visited {
  color: var(--color-muted);
}

.footer a:hover {
  color: var(--color-accent);
}

.footer a svg {
  display: block;
}

/*****************************************************************************/
/*
/* Home page
/*
/*****************************************************************************/

.posts {
  list-style-type: none;
  margin-bottom: 2em;
  padding-left: 0;
}

.posts li {
  line-height: 1.75em;
  padding: 0.2em 0;
}

.posts span {
  color: var(--color-muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.78em;
}

/*****************************************************************************/
/*
/* Blog listing
/*
/*****************************************************************************/

.post-link {
  font-size: 1.6rem;
  margin-bottom: 0.3em;
  margin-top: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.post-link a {
  color: var(--color-heading);
  border-bottom: none;
  transition: color 0.25s ease;
}

.post-link a:visited {
  color: var(--color-heading);
}

.post-link a:hover {
  color: var(--color-accent);
}

p.continue-reading {
  font-size: 0.82rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  border: none;
  text-align: right;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

p.continue-reading a {
  color: var(--color-accent);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25em;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
}

.pagination .older {
  margin-right: auto;
}

.pagination .newer {
  margin-left: auto;
}

/*****************************************************************************/
/*
/* Bits & bytes, email subscription
/*
/*****************************************************************************/

.bits-bytes {
  font-size: 0.8em;
  font-style: italic;
  padding: 1em 1.5em;
}

.email-subscription {
  font-size: 0.8em;
  font-family: "Bricolage Grotesque", sans-serif;
  background-color: var(--color-bg-muted);
  padding: 1.1em;
  border-radius: 8px;
}

.email-subscription input[type="text"] {
  height: 2em;
  width: 16em;
  padding: 0.1em;
}

.email-subscription .subscribe:hover {
  border-top-color: var(--color-accent-hover);
  background: var(--color-accent-hover);
  color: #ccc;
}

.email-subscription .subscribe:active {
  border-top-color: #7a3818;
  background: #7a3818;
}

/*****************************************************************************/
/*
/* Footnotes
/*
/*****************************************************************************/

sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  top: -0.5em;
  color: var(--color-accent);
  margin-left: 0.1em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.footnotes {
  margin-top: 3rem;
  font-size: 0.85em;
  color: var(--color-muted);
}

/* Short rule instead of a full-width divider */
.footnotes::before {
  content: "";
  display: block;
  width: 4rem;
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.footnotes ol {
  padding-left: 0;
  margin: 0 0 0 1.2em;
}

.footnotes li {
  padding: 0.2em 0;
  line-height: 1.6;
}

.footnotes li p {
  margin: 0;
}

.footnotes .reversefootnote {
  margin-left: 0.15em;
  opacity: 0.7;
}

/*****************************************************************************/
/*
/* Social & comments
/*
/*****************************************************************************/

a.comment-count, a.comment-count:hover {
  font-size: 70%;
  float: right;
  border: none;
}

/*****************************************************************************/
/*
/* Image credit
/*
/*****************************************************************************/

span.image-credit {
  font-size: 0.75rem;
  text-align: center;
  display: block;
  color: var(--color-muted);
}

/*****************************************************************************/
/*
/* Blog post series
/*
/*****************************************************************************/

.series {
  width: 90%;
  font-size: 0.8rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.85em 1.3em;
  margin: 0 auto 1.75em;
  text-align: left;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 500;
}

/*****************************************************************************/
/*
/* Buttons (Bootstrap-adapted)
/*
/*****************************************************************************/

.btn {
  display: inline-block;
  padding: 0.55em 1.1em;
  margin-bottom: 0;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: "Bricolage Grotesque", sans-serif;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.btn:focus,
.btn:active:focus,
.btn.active:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
}

.btn:active,
.btn.active {
  background-image: none;
  outline: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  color: #fff;
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/*****************************************************************************/
/*
/* Video wrapper
/*
/*****************************************************************************/

.videoWrapper {
  aspect-ratio: 16 / 9;
  margin-bottom: 1.3em;
  border-radius: 8px;
  overflow: hidden;
}

.videoWrapper iframe,
.videoWrapper embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/*****************************************************************************/
/*
/* Utilities
/*
/*****************************************************************************/

.underline {
  border-bottom: 1px solid var(--color-border);
}

/*****************************************************************************/
/*
/* Cover images
/*
/*****************************************************************************/

.cover-image {
  min-height: 400px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-image h1 {
  color: #faf8f5;
  background-color: rgba(26, 21, 18, 0.6);
  padding: 0.5em 1.25em;
  font-size: 2em;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

/*****************************************************************************/
/*
/* Gallery
/*
/*****************************************************************************/

.galleries {
  text-align: center;
}

.galleries li {
  display: inline-block;
  text-align: center;
  margin: 0;
}

.galleries li img {
  display: block;
}

.photo-gallery {
  text-align: center;
  padding-left: 0;
}

.photo-gallery li a {
  border-bottom: none;
}

.photo-gallery li {
  display: inline-block;
  filter: grayscale(40%);
  transition: filter 0.4s ease, transform 0.4s ease;
  border-radius: 4px;
  overflow: hidden;
}

.photo-gallery li:hover {
  filter: none;
  transform: scale(1.02);
}

/*****************************************************************************/
/*
/* Homepage
/*
/*****************************************************************************/

/* Override .main padding when homepage is the content */
.main:has(.homepage) {
  padding: 0;
  animation: none;
}

.homepage {
  max-width: var(--max-width);
  margin: 0 auto;
  /* Last section's own 2rem padding + this ≈ the 2.25rem gap on post pages */
  padding: 0 1.5rem 0.25rem;
}

/* Hero */
.homepage-hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 3rem 0 2.5rem;
  animation: fadeUp 0.5s ease-out both;
}

.homepage-hero-photo {
  flex-shrink: 0;
}

.homepage-hero-photo img {
  width: 180px;
  height: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(26, 21, 18, 0.08);
}

.homepage-hero-text h1 {
  text-align: left;
  font-size: 1.8rem;
  margin-bottom: 0.4em;
}

.homepage-hero-text p {
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: 0.8em;
  line-height: 1.7;
}

.homepage-hero-link {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.25s ease;
}

.homepage-hero-link:hover {
  color: var(--color-accent-hover);
}

.homepage-hero-text p.homepage-hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  margin: 1.1em 0 0;
}

.main a.homepage-hero-link-secondary,
.main a.homepage-hero-link-secondary:visited {
  color: var(--color-muted);
  font-weight: 500;
}

.main a.homepage-hero-link-secondary:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Sections */
.homepage-section {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  opacity: 0;
  animation: fadeUp 0.5s ease-out both;
}

.homepage-latest { animation-delay: 0.1s; }
.homepage-featured { animation-delay: 0.2s; }

.homepage-section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

/* Reset .main a border-bottom on homepage card links (.main a has 0,1,1 specificity) */
.main a.homepage-post-card,
.main a.homepage-post-card:visited {
  border-bottom: 1px solid var(--color-border);
}
.main a.homepage-post-card:hover,
.main a.homepage-post-card:visited:hover {
  border-bottom: 1px solid var(--color-accent);
}
.main a.homepage-post-item,
.main a.homepage-post-item:visited {
  border-bottom: 1px solid var(--color-border);
}
/* Keep the border on hover so rows below don't shift by 1px */
.main a.homepage-post-item:hover,
.main a.homepage-post-item:visited:hover {
  border-bottom: 1px solid var(--color-border);
}
/* Dividers only between rows: the section rule above already frames the list */
.main a.homepage-post-item:last-child,
.main a.homepage-post-item:last-child:hover {
  border-bottom: none;
}

/* Featured post cards */
.homepage-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.homepage-post-card {
  display: block;
  padding: 1.25rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.homepage-post-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(29, 95, 138, 0.08);
  transform: translateY(-2px);
}

.homepage-post-card h3 {
  font-size: 1rem;
  margin: 0 0 0.4em;
  color: var(--color-heading);
  line-height: 1.3;
}

.homepage-post-card:hover h3 {
  color: var(--color-accent);
}

.homepage-post-card p {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.55;
}

.homepage-post-card:visited h3 {
  color: var(--color-heading);
}

.homepage-post-card:visited:hover h3 {
  color: var(--color-accent);
}

/* Latest post list */
.homepage-post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* No horizontal padding, so dates line up with the heading and "See all posts" */
.homepage-post-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}

.homepage-post-date {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
  white-space: nowrap;
  min-width: 3.75rem;
}

.homepage-post-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-heading);
  transition: color 0.25s ease;
}

.homepage-post-item:hover .homepage-post-title {
  color: var(--color-accent);
}

.homepage-post-item:visited .homepage-post-title {
  color: var(--color-heading);
}

.homepage-post-item:visited:hover .homepage-post-title {
  color: var(--color-accent);
}

.homepage-see-all {
  margin-top: 1rem;
  margin-bottom: 0;
}

.homepage-see-all a {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.main .homepage-see-all a:visited {
  color: var(--color-accent);
}

.main .homepage-see-all a:hover {
  color: var(--color-accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .homepage-hero {
    gap: 1.5rem;
  }

  .homepage-hero-photo img {
    width: 140px;
    height: 140px;
  }

  .homepage-hero-text h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .homepage-hero {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
    padding: 2rem 0 2rem;
  }

  .homepage-hero-text h1 {
    text-align: center;
    font-size: 1.4rem;
  }

  .homepage-hero-text p {
    font-size: 0.95rem;
  }

  .homepage-hero-text p.homepage-hero-links {
    justify-content: center;
  }

  .homepage-post-item {
    flex-direction: column;
    gap: 0.15rem;
  }

  .homepage-post-date {
    min-width: auto;
  }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  .homepage-hero,
  .homepage-section {
    animation: none;
    opacity: 1;
  }
}
