/* Blog pages. Builds on css/styles.css (same tokens, header, footer, buttons). */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nav-menu a[aria-current="page"] {
  color: var(--brass-light);
  opacity: 1;
}

.blog-main {
  padding: 150px 24px 90px;
  background:
    radial-gradient(900px 420px at 85% -80px, rgba(198, 148, 46, 0.16), transparent 70%),
    var(--ink);
  min-height: 70vh;
}

.blog-wrap {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.blog-narrow {
  max-width: 760px;
}

/* ---------- hero / listing header ---------- */
.blog-hero {
  padding: 28px 0 38px;
}

.blog-hero h1 {
  margin: 0;
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.blog-lede {
  margin: 22px 0 0;
  max-width: 680px;
  color: var(--smoke);
  font-size: 1.15rem;
  line-height: 1.7;
}

.blog-search {
  position: relative;
  max-width: 460px;
  margin-top: 28px;
}

.blog-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 52px 0 16px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
}

.blog-search input::placeholder {
  color: var(--smoke);
}

.blog-search input:focus {
  outline: 2px solid var(--brass-light);
  outline-offset: 1px;
}

.blog-search button {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--brass-light);
  cursor: pointer;
  font-size: 1.3rem;
}

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.blog-cats a {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--cream);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.blog-cats a:hover,
.blog-cats a.is-active {
  background: var(--brass-light);
  border-color: var(--brass-light);
  color: var(--ink);
}

/* ---------- cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
}

.post-card-img {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--steel);
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.post-card:hover .post-card-img img {
  transform: scale(1.04);
}

.post-card-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(140deg, var(--raven), var(--steel));
}

.post-card-ph img {
  width: 56%;
  height: auto;
  object-fit: contain;
  opacity: 0.55;
}

.post-card:hover .post-card-ph img {
  transform: none;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}

.post-cat {
  align-self: flex-start;
  margin: 0 8px 10px 0;
  color: var(--ember);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.post-cat:hover {
  text-decoration: underline;
}

.post-card-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 900;
}

.post-card-title a {
  text-decoration: none;
}

.post-card-title a:hover {
  color: #8a5f0a;
}

.post-card-ex {
  margin: 12px 0 18px;
  color: #4f4a42;
  line-height: 1.65;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: auto;
  color: #6a6459;
  font-size: 0.86rem;
  font-weight: 700;
}

.post-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.post-card--featured .post-card-img {
  aspect-ratio: auto;
  min-height: 340px;
}

.post-card--featured .post-card-body {
  justify-content: center;
  padding: 38px 40px;
}

.post-card--featured .post-card-title {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.post-card--featured .post-card-ex {
  font-size: 1.08rem;
}

.post-card--featured .post-meta {
  margin-top: 6px;
}

/* ---------- pagination ---------- */
.blog-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 46px;
}

.blog-pager a,
.blog-pager span {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 800;
}

.blog-pager a:hover {
  border-color: var(--brass-light);
  color: var(--brass-light);
}

.blog-pager .is-current {
  background: var(--brass-light);
  border-color: var(--brass-light);
  color: var(--ink);
}

.blog-pager .pg-gap {
  border: 0;
}

.blog-empty {
  padding: 60px 30px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
}

.blog-empty h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.blog-empty p {
  margin: 0 0 24px;
  color: var(--smoke);
}

/* ---------- single post ---------- */
.preview-bar {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: var(--brass-light);
  color: var(--ink);
  font-weight: 800;
  border-radius: var(--radius);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 24px;
  color: var(--smoke);
  font-size: 0.88rem;
  font-weight: 700;
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--brass-light);
}

.crumbs span {
  opacity: 0.5;
}

.post-head {
  max-width: 880px;
  margin: 0 0 36px;
}

.post-cats {
  margin: 0 0 4px;
}

.post-cats .post-cat {
  color: var(--brass-light);
}

.post-head h1 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.9rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.post-meta--lg {
  margin-top: 20px;
  color: var(--smoke);
  font-size: 0.95rem;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

.post-body {
  background: var(--paper);
  color: #1b1913;
  border-radius: var(--radius);
  padding: 44px 52px 40px;
  box-shadow: 0 18px 50px var(--shadow);
  min-width: 0;
}

.post-hero-img {
  margin: -44px -52px 38px;
}

.post-hero-img img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.82;
  overflow-wrap: break-word;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content p {
  margin: 0 0 1.3em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  line-height: 1.15;
  margin: 1.8em 0 0.6em;
  color: #0e0c08;
}

.post-content h2 {
  font-size: 2rem;
}

.post-content h3 {
  font-size: 1.5rem;
}

.post-content h4 {
  font-size: 1.2rem;
}

.post-content a {
  color: #8a5f0a;
  font-weight: 700;
  text-underline-offset: 3px;
}

.post-content a:hover {
  color: var(--ember);
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.post-content li {
  margin: 0.4em 0;
}

.post-content img {
  height: auto;
  border-radius: var(--radius);
  margin: 0.4em 0;
}

.post-content figure {
  margin: 1.6em 0;
}

.post-content figcaption {
  margin-top: 8px;
  color: #6a6459;
  font-size: 0.9rem;
  text-align: center;
}

.post-content blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 22px;
  border-left: 4px solid var(--brass);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.6;
  color: #3a352b;
}

.post-content table {
  width: 100%;
  margin: 1.6em 0;
  border-collapse: collapse;
  font-size: 0.98rem;
  display: block;
  overflow-x: auto;
}

.post-content th,
.post-content td {
  padding: 10px 14px;
  border: 1px solid #e2d6bf;
  text-align: left;
}

.post-content th {
  background: #f3e6cb;
}

.post-content hr {
  border: 0;
  border-top: 1px solid #e2d6bf;
  margin: 2.2em 0;
}

.post-content pre,
.post-content code {
  font-size: 0.92em;
  background: #f3e6cb;
  border-radius: 4px;
}

.post-content code {
  padding: 1px 5px;
}

.post-content pre {
  padding: 14px 16px;
  overflow-x: auto;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid #e2d6bf;
  font-weight: 800;
  font-size: 0.9rem;
}

.post-tags a {
  padding: 5px 12px;
  background: #f3e6cb;
  border-radius: 99px;
  text-decoration: none;
  color: #5b4308;
}

.post-tags a:hover {
  background: var(--brass-light);
  color: var(--ink);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 30px;
}

.post-nav a {
  display: block;
  padding: 16px 18px;
  border: 1px solid #e2d6bf;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  line-height: 1.25;
}

.post-nav a:hover {
  border-color: var(--brass);
  background: #fff;
}

.post-nav span {
  display: block;
  margin-bottom: 4px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a5f0a;
}

.post-nav .next {
  text-align: right;
}

/* ---------- aside ---------- */
.blog-aside {
  display: grid;
  gap: 22px;
  position: sticky;
  top: 140px;
}

.aside-cta,
.aside-box {
  padding: 26px 26px 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: var(--raven);
}

.aside-cta {
  border-color: rgba(228, 189, 99, 0.45);
  background: linear-gradient(160deg, #1a2230, var(--raven));
}

.aside-cta h2,
.aside-box h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.1;
}

.aside-cta p {
  margin: 0 0 18px;
  color: var(--smoke);
  line-height: 1.6;
}

.aside-cta .eyebrow {
  margin: 0 0 8px;
}

.aside-cta .button {
  width: 100%;
}

.aside-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aside-box li {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.aside-box li:first-child {
  border-top: 0;
}

.aside-box a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0.9;
}

.aside-box a:hover {
  color: var(--brass-light);
  opacity: 1;
}

.aside-box a span {
  color: var(--smoke);
  font-weight: 400;
}

.related {
  margin-top: 70px;
}

.related h2 {
  margin: 0 0 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
  }

  .post-body {
    padding: 36px 36px 34px;
  }

  .post-hero-img {
    margin: -36px -36px 32px;
  }
}

@media (max-width: 900px) {
  .blog-main {
    padding-top: 130px;
  }

  .post-layout {
    grid-template-columns: 1fr;
  }

  .blog-aside {
    position: static;
  }

  .post-card--featured {
    grid-template-columns: 1fr;
  }

  .post-card--featured .post-card-img {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .post-card--featured .post-card-body {
    padding: 26px 24px 28px;
  }
}

@media (max-width: 640px) {
  .blog-main {
    padding: 118px 16px 120px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-body {
    padding: 26px 20px 28px;
  }

  .post-hero-img {
    margin: -26px -20px 24px;
  }

  .post-content {
    font-size: 1.05rem;
  }

  .post-content h2 {
    font-size: 1.65rem;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav .next {
    text-align: left;
  }
}
