/* Notes in the Margin - Parchment & copper theme */

:root {
  --parchment: #f5f0e8;
  --parchment-dark: #ede6d6;
  --ink: #1a1612;
  --ink-faded: #5c5248;
  --copper: #b5622a;
  --copper-light: #c97d45;
  --copper-pale: #e8c9a8;
  --rule: #d4c9b5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  min-height: 100vh;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
}

/* NAV */
.site-nav {
  padding: 28px 56px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  animation: fadeIn 0.8s ease both;
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.nav-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--copper);
  display: inline-block;
  position: relative;
  top: -2px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faded);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--copper); }

/* HERO */
.hero {
  padding: 80px 56px 28px;
  max-width: none;
  animation: slideUp 0.9s ease both 0.1s;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 24px;
  font-family: 'Crimson Pro', Georgia, serif;
}

.hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  color: var(--copper);
}

.hero-desc {
  font-size: 19px;
  color: var(--ink-faded);
  max-width: 560px;
  line-height: 1.7;
  font-weight: 400;
}

/* LAYOUT */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  max-width: none;
  margin: 0 56px;
  padding-bottom: 100px;
  border-top: 1px solid var(--rule);
}

/* POSTS FEED */
.posts-column {
  padding-right: 56px;
  border-right: 1px solid var(--rule);
  animation: slideUp 1s ease both 0.2s;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  padding: 28px 0 20px;
  font-family: 'Crimson Pro', Georgia, serif;
}

/* Post card */
.post-card {
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  transition: all 0.2s;
}

.post-card:hover .post-title a { color: var(--copper); }
.post-card:hover .post-arrow { transform: translateX(4px); color: var(--copper); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.post-source-type {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--parchment);
  background: var(--copper);
  padding: 3px 8px;
  border-radius: 2px;
}

.post-source-type.podcast { background: var(--ink-faded); }

.post-date {
  font-size: 13px;
  color: var(--ink-faded);
  font-style: italic;
  font-family: 'Libre Baskerville', Georgia, serif;
}

.post-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 8px;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

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

.post-attribution {
  font-size: 14px;
  color: var(--ink-faded);
  margin-bottom: 12px;
  font-style: italic;
}

.post-attribution strong {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

.post-excerpt {
  font-size: 16px;
  color: var(--ink-faded);
  line-height: 1.65;
  margin-bottom: 16px;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  border: 1px solid var(--copper-pale);
  padding: 3px 9px;
  border-radius: 2px;
  text-decoration: none;
}

.tag:hover { color: var(--copper-light); }

.post-arrow {
  font-size: 18px;
  color: var(--ink-faded);
  transition: all 0.2s;
}

/* Worth Stealing teaser */
.worth-stealing-preview {
  background: var(--parchment-dark);
  border-left: 2px solid var(--copper);
  padding: 16px 18px;
  margin: 16px 0;
  border-radius: 0 2px 2px 0;
}

.ws-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 8px;
  font-family: 'Crimson Pro', Georgia, serif;
}

.ws-item {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
}

.ws-item + .ws-item {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

/* SIDEBAR */
.sidebar {
  padding: 28px 0 0 44px;
  animation: slideUp 1s ease both 0.35s;
}

.sidebar-section {
  margin-bottom: 44px;
}

.sidebar-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 18px;
  font-family: 'Crimson Pro', Georgia, serif;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.about-text {
  font-size: 15px;
  color: var(--ink-faded);
  line-height: 1.7;
}

.about-text p + p { margin-top: 10px; }

/* Author list */
.author-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.15s;
}

.author-item a { text-decoration: none; }

.author-item:hover .author-name { color: var(--copper); }

.author-name {
  font-size: 15px;
  color: var(--ink);
  transition: color 0.15s;
}

.author-count {
  font-size: 12px;
  color: var(--ink-faded);
  font-style: italic;
}

/* Reading shelf */
.shelf-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.shelf-book {
  font-size: 15px;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 2px;
}

.shelf-author {
  font-size: 13px;
  color: var(--ink-faded);
}

.shelf-status {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--copper);
  margin-top: 4px;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 1.2s ease both 0.5s;
}

.footer-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  color: var(--ink-faded);
  letter-spacing: 0.04em;
}

.footer-dot { color: var(--copper); }

.footer-note {
  font-size: 13px;
  color: var(--ink-faded);
  font-style: italic;
}

/* Archive / Library page (reuses parchment theme) */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 56px;
}
.archive-container {
  max-width: 1200px;
  padding-top: 48px;
}
.archive-tabs {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0;
}
.archive-tabs .tab {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faded);
  text-decoration: none;
  padding: 0 0 0.6rem 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.archive-tabs .tab.active,
.archive-tabs .tab:hover {
  color: var(--ink);
  border-bottom-color: var(--copper);
}

/* Library page — filter dropdowns */
.filters-section { margin-bottom: 40px; }

.library-filters__row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
  align-items: flex-end;
}

.filter-dropdown {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}

.filter-dropdown__label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--copper);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.filter-dropdown__wrap {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
}

.filter-dropdown__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: var(--parchment-dark);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.filter-dropdown__trigger:hover {
  border-color: var(--copper-pale);
}

.filter-dropdown.is-open .filter-dropdown__trigger {
  background: #fff;
  border-color: var(--copper);
}

.filter-dropdown__value {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.filter-dropdown__chevron {
  flex-shrink: 0;
  margin-left: 0.75rem;
  color: var(--copper);
  transition: transform 0.2s ease;
}

.filter-dropdown.is-open .filter-dropdown__chevron {
  transform: rotate(180deg);
}

.filter-dropdown__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 8px 24px rgba(44, 31, 20, 0.1);
  z-index: 100;
  overflow: hidden;
  animation: filterFadeDown 0.15s ease forwards;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}

.filter-dropdown__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #4a3728;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  transition: background 0.1s;
}

.filter-dropdown__option:hover {
  background: #faf5ef;
}

.filter-dropdown__option.is-selected {
  font-weight: 700;
  color: var(--copper);
  background: #fdf7f2;
  border-left-color: var(--copper);
}

.filter-dropdown__option.is-selected::before {
  content: '';
  width: 8px;
  height: 6px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' fill='none'%3E%3Cpath d='M1 3L3 5L7 1' stroke='%23b5622a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.filter-dropdown__option:not(.is-selected)::before {
  content: '';
  width: 8px;
  flex-shrink: 0;
}

.library-filters__summary {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: #fdf7f2;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #7a5c44;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.library-filters__clear {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--copper);
  text-transform: uppercase;
  padding: 0;
  text-decoration: underline;
}

.library-filters__clear:hover {
  color: var(--copper-light);
}

@keyframes filterFadeDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.posts-list { margin-bottom: 60px; padding: 28px 0; }
.post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.post-item .post-title {
  font-size: 22px;
  margin-bottom: 8px;
}
.post-item .post-title a { color: var(--ink); text-decoration: none; }
.post-item .post-title a:hover { color: var(--copper); }
.post-item .post-meta {
  font-size: 13px;
  color: var(--ink-faded);
  font-style: italic;
  margin-bottom: 0;
}
.post-item .post-attrib-line {
  font-style: normal;
  color: var(--ink-faded);
}
.post-separator { margin: 0 6px; }
.empty-state { color: var(--ink-faded); padding: 32px 0; }

/* Post detail page */
.post-container {
  max-width: 1200px;
  padding-top: 48px;
}
.breadcrumb {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-bottom: 40px;
  color: var(--ink-faded);
}
.breadcrumb a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}
.breadcrumb a:hover,
.breadcrumb a:focus {
  color: var(--copper);
}
.breadcrumb a:visited {
  color: var(--ink);
}
.breadcrumb .separator {
  margin: 0 10px;
  color: var(--rule);
  font-weight: 400;
}
.commentary {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}
.commentary-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 24px 0;
  letter-spacing: 0.02em;
}
.commentary-content {
  line-height: 1.75;
  color: var(--ink);
}
.commentary-content p {
  margin-bottom: 16px;
}
.commentary-content p:last-child {
  margin-bottom: 0;
}
.commentary-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  padding-left: 28px;
  border-left: 3px solid var(--copper);
  background: rgba(181, 98, 42, 0.06);
  font-style: italic;
  color: var(--ink);
  font-size: 1.05rem;
}
.commentary-content blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: 0.9rem;
  font-style: normal;
  color: var(--ink-faded);
}
.article-header {
  margin-bottom: 40px;
}
.article-date {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 16px;
  font-family: 'Crimson Pro', Georgia, serif;
}
.article-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.article-source {
  font-size: 16px;
  color: var(--ink-faded);
  font-style: italic;
}
.article-source a {
  color: var(--copper);
  text-decoration: none;
  font-style: italic;
  transition: color 0.2s;
}
.article-source a:hover {
  color: var(--copper-light);
  text-decoration: underline;
}
.article-source a:visited {
  color: var(--copper);
}
.worth-stealing {
  margin-bottom: 48px;
}
.worth-stealing h2 {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 24px;
  font-family: 'Crimson Pro', Georgia, serif;
}
.points-card {
  background: var(--parchment-dark);
  border-left: 3px solid var(--copper);
  padding: 28px 32px;
  border-radius: 0 2px 2px 0;
  margin-bottom: 24px;
}
.point-item {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}
.point-item:last-child {
  margin-bottom: 0;
}
.point-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.point-content {
  flex: 1;
}
.point-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1.05rem;
  color: var(--ink);
}
.point-text {
  color: var(--ink);
  line-height: 1.7;
}
.post-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0 40px;
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.06em;
}
.post-navigation .nav-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.post-navigation .nav-link:hover {
  color: var(--copper);
}
.post-navigation .nav-link-prev {
  margin-right: auto;
}
.post-navigation .nav-link-next {
  margin-left: auto;
}
.post-navigation .nav-link-placeholder {
  display: block;
  min-width: 1px;
}

/* Series page */
.series-container {
  max-width: 1200px;
  padding-top: 48px;
}
.series-header {
  position: relative;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.series-header .bookmark-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-left: 24px solid transparent;
  border-top: 24px solid var(--copper);
}
.series-header .book-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.series-header .book-author {
  font-size: 16px;
  color: var(--ink-faded);
  font-style: italic;
  margin-bottom: 16px;
}
.series-header .book-description {
  font-style: italic;
  color: var(--ink-faded);
  margin-bottom: 20px;
  line-height: 1.65;
}
.series-stats {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 13px;
  color: var(--copper);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.series-stats .stat-separator {
  margin: 0 10px;
  color: var(--rule);
}
.chapters-list {
  margin-bottom: 48px;
}
.chapter-item {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s;
}
.chapter-item:hover {
  background: rgba(181, 98, 42, 0.03);
}
.chapter-item:last-child {
  border-bottom: none;
}
.chapter-number {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--copper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
  color: var(--copper);
}
.chapter-content {
  flex: 1;
}
.chapter-meta {
  font-size: 12px;
  color: var(--copper);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: 'Crimson Pro', Georgia, serif;
}
.chapter-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.3;
}
.chapter-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.chapter-title a:hover {
  color: var(--copper);
}
.chapter-excerpt {
  color: var(--ink-faded);
  font-size: 16px;
  line-height: 1.6;
}
.series-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0 40px;
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.06em;
}
.series-navigation .nav-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}
.series-navigation .nav-link:hover {
  color: var(--copper);
}
.series-navigation .nav-link-prev {
  margin-right: auto;
}
.series-navigation .nav-link-next {
  margin-left: auto;
}
.series-navigation .nav-link-placeholder {
  display: block;
  min-width: 1px;
}

@media (max-width: 768px) {
  .site-nav, .hero, .main-layout, .site-footer {
    padding-left: 24px;
    padding-right: 24px;
    margin-left: 0;
    margin-right: 0;
  }
  .container { padding-left: 24px; padding-right: 24px; }
  .main-layout { grid-template-columns: 1fr; }
  .posts-column { border-right: none; padding-right: 0; }
  .sidebar { padding-left: 0; border-top: 1px solid var(--rule); padding-top: 28px; }
  .library-filters__row {
    flex-wrap: wrap;
  }
  .filter-dropdown {
    flex: 1 1 100%;
    min-width: 0;
  }
}
