/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400..700;1,400..700&family=Spectral:wght@500;600&display=swap');

:root {
  --font-serif: 'Source Serif 4', Georgia, serif;  /* body */
  --font-display: 'Spectral', Georgia, serif;      /* headings, title */
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;

  --max-width: 960px;
  --text-color: #111;
  --background-color: #fefefe;
  --accent-color: #333;
}

html {
  font-size: 18px;
  line-height: 1.75;
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-serif);
  padding: 0;
  margin: 0;
}

body {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 2rem 1rem;
}

.post-body a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease;
}

.post-body a:hover {
  border-color: rgba(0, 0, 0, 0.5);
}

.post-byline {
  font-size: 0.85rem;
  color: #666;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
}

.no-style-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.site-title {
  font-family: 'Spectral', serif;
  font-size: 2.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.25rem;
}

.strapline {
  font-family: 'Spectral', serif;
  font-style: italic;
  font-size: 1rem;
  text-align: center;
  color: #555;
  margin-top: 0.25rem;
}

.pen-nib-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.5rem 0;
  opacity: 0.8;
}

.pen-nib-icon img {
  height: 2.75rem;
  width: auto;
}

.pen-nib-icon::before,
.pen-nib-icon::after {
  content: "";
  display: block;
  height: 1px;
  width: 40px;
  background-color: #ccc;
}

.small-caps-heading {
  font-variant: small-caps;
  font-size: 1.25rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 1rem;
}

.top-nav {
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.top-nav a {
  margin: 0 0.5rem;
  text-decoration: none;
  color: var(--accent-color);
  border-bottom: 1px solid transparent;
}

.top-nav a:hover {
  border-color: var(--accent-color);
}

/* Layout */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

/* Sidebar navigation */
.sidebar-nav {
  width: 120px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: right;
  margin-top: 2rem; /* Adjust this value until it aligns visually */
  padding-right: 1rem;
  border-right: 1px solid #ccc;
}

.sidebar-nav a {
  color: var(--accent-color);
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* subtle, fixed underline */
  padding-bottom: 1px;
}

.sidebar-nav a:hover {
  border-color: rgba(0, 0, 0, 0.4); /* darker on hover */
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  margin-bottom: 0.75rem;
}

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

/* Main content */

main.content {
  flex: 1;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-left: 1.5rem;
}

/* Post styling */
.post-title.large {
  font-family: 'Spectral', serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.post-title.small {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.post-title a {
  color: var(--text-color);
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

.post-standfirst {
  font-style: italic;
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 1rem;
}

.post-body p {
  margin-bottom: 1.25rem;
}

.post-body p:last-of-type {
  margin-bottom: 0;
}

.post-body figure {
  max-width: 620px;
  margin: 2rem auto;
}

.post-subhead {
  font-family: 'Georgia', serif;
  font-size: 1.2rem;
  font-style: italic;
  font-weight: normal;
  color: #666;
  margin: 1rem 0 1.5rem 0;
  line-height: 1.4;
}

.post-subhead + p {
  margin-top: 0;
}

.post-subsubhead {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  margin: 1.5rem 0 0.5rem 0;
  }

.post-body img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
}

.post-body figcaption {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  text-align: left;
  margin-top: 0.5rem;
}

.post-date {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}

.post-meta {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #555;
  font-variant: small-caps;
  position: relative;
  padding-top: 1rem;
}

.post-meta::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 0;
  left: 0;
}

.post-meta a {
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.post-meta a:hover {
  border-color: rgba(0, 0, 0, 0.4);
}

.read-more {
  display: inline-block;
  margin-top: 1rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--accent-color);
}

.read-more:hover {
  text-decoration: underline;
}

.pull-quote {
  font-family: 'Spectral', Georgia, serif;
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 400;
  color: #333;
  border-left: 4px solid #aaa;
  margin: 2em 0;
  padding-left: 1em;
  line-height: 1.6;
  max-width: 36rem;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 4rem;
  font-size: 0.875rem;
  color: #666;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .layout {
    flex-direction: column;
  }

  .sidebar-nav {
    text-align: center;
    border-right: none;
    padding-right: 0;
    margin-bottom: 2rem;
  }

  main.content {
    padding-left: 0;
    max-width: 100%;
  }
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.archive-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
}

.archive-title:hover {
  text-decoration: underline;
}

.archive-list .post-date {
  font-size: 0.85rem;
  color: #666;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  margin: 0.2rem 0;
}

.archive-list .post-standfirst {
  font-style: italic;
  color: #555;
  font-size: 1rem;
}

.tag-index {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.tag-index li {
  margin-bottom: 0.5rem;
  font-variant: small-caps;
}

.tag-index a {
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.tag-index a:hover {
  border-color: rgba(0, 0, 0, 0.4);
}

.tag-count {
  font-size: 0.85rem;
  color: #777;
  margin-left: 0.25rem;
}

.year-index {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.year-index li {
  margin-bottom: 0.5rem;
  font-variant: small-caps;
}

.year-index a {
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.year-index a:hover {
  border-color: rgba(0, 0, 0, 0.4);
}

.year-count {
  font-size: 0.85rem;
  color: #777;
  margin-left: 0.25rem;
}

.related-posts {
  margin-top: 1rem;
}

.related-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #222;
  padding-top: 0.5rem;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.related-card {
  flex: 1 1 calc(33.333% - 1rem);
  background-color: #f8f8f8;
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;
}

.related-card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.related-card a {
  text-decoration: none;
  color: inherit;
}

.related-card p {
  font-size: 0.9rem;
  margin: 0;
  color: #555;
}

.post-body-extended {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease, max-height 0.6s ease;
}

.post-body-extended.visible {
  opacity: 1;
}

@media (max-width: 768px) {
  .related-card {
    flex: 1 1 100%;
  }
}