/* =========================
   BLOG & SINGLE POST STYLES
   Prepared Supply Co.
   ========================= */

/* ---- Blog Hero (listing page) ---- */
.prep-blog-hero {
  position: relative;
  background: linear-gradient(160deg, #1a1d14 0%, #0e1008 60%, #14160e 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.prep-blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 80%, rgba(107, 113, 66, 0.12), transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(200, 146, 74, 0.06), transparent 50%);
  pointer-events: none;
}
.prep-blog-hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 80px 28px 60px;
  position: relative;
  z-index: 2;
}
.prep-blog-hero-inner h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.5vw, 56px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 12px;
}
.prep-blog-hero-inner p {
  color: var(--text-soft);
  font-size: 15px;
  max-width: 480px;
  line-height: 1.6;
}

/* Archive label above title */
.prep-archive-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--olive-bright);
  margin-bottom: 10px;
  padding: 4px 12px;
  border: 1px solid var(--olive);
  background: rgba(107, 113, 66, 0.1);
}

/* ---- Blog Listing Grid ---- */
.prep-blog-listing {
  padding: 60px 0 80px;
}
.prep-blog-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Featured (first) post spans full width */
.prep-blog-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--bg-card);
  border: 1px solid var(--line);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .25s, transform .25s;
}
.prep-blog-featured:hover {
  border-color: var(--olive);
  transform: translateY(-2px);
}
.prep-blog-featured-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2820, #14160e);
}
.prep-blog-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prep-blog-featured-body {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.prep-blog-featured-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 14px;
}
.prep-blog-featured-body p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Blog meta (category + date) */
.prep-blog-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.prep-blog-cat {
  color: var(--olive-bright);
}
.prep-blog-meta time {
  color: var(--text-mute);
}
.prep-post-reading {
  color: var(--text-mute);
}

/* Regular blog cards (reuse homepage card styles + enhancements) */
.prep-blog-list-grid .prep-blog-card {
  display: block;
}
.prep-blog-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #2a2820 0%, #14160e 100%);
}

/* Read more link */
.prep-blog-listing .prep-read-more,
.prep-post-article .prep-read-more {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive-bright);
  text-decoration: none;
  transition: color .2s;
}
.prep-read-more:hover {
  color: var(--amber-light);
}

/* ---- Pagination ---- */
.prep-blog-pagination {
  margin-top: 50px;
  text-align: center;
}
.prep-blog-pagination .page-numbers {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.prep-blog-pagination .page-numbers li {
  display: inline;
}
.prep-blog-pagination .page-numbers a,
.prep-blog-pagination .page-numbers span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  background: var(--bg-card);
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
}
.prep-blog-pagination .page-numbers a:hover {
  border-color: var(--olive);
  color: var(--text);
  background: var(--bg-card-2);
}
.prep-blog-pagination .page-numbers .current {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--text);
}
.prep-blog-pagination .page-numbers .prev,
.prep-blog-pagination .page-numbers .next {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.16em;
}

/* Empty state */
.prep-blog-empty {
  text-align: center;
  padding: 80px 0;
}
.prep-blog-empty h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 12px;
}
.prep-blog-empty p {
  color: var(--text-mute);
  font-size: 14px;
}

/* ================================================
   CATEGORIES PAGE
   ================================================ */
.prep-catpage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.prep-catpage-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .25s, border-color .25s;
}
.prep-catpage-card:hover {
  transform: translateY(-3px);
  border-color: var(--olive);
}
.prep-catpage-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2820, #14160e);
}
.prep-catpage-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.prep-catpage-card:hover .prep-catpage-thumb img {
  transform: scale(1.04);
}
.prep-catpage-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(14, 16, 8, 0.6) 100%);
  pointer-events: none;
}
.prep-catpage-body {
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.prep-catpage-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}
.prep-catpage-desc {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 12px;
  flex: 1;
}
.prep-catpage-count {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 12px;
}
.prep-catpage-card .prep-read-more {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive-bright);
}
@media (max-width: 1100px) {
  .prep-catpage-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .prep-catpage-grid { grid-template-columns: 1fr; }
}

/* ================================================
   SINGLE POST
   ================================================ */

/* ---- Post Hero ---- */
.prep-post-hero {
  position: relative;
  background: #0e1008 center / cover no-repeat;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.prep-post-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 16, 8, 0.72);
  z-index: 1;
}
.prep-post-hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 80px 28px 60px;
  position: relative;
  z-index: 2;
}
.prep-post-hero-inner h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.5vw, 42px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  max-width: 780px;
}

/* ---- Post Layout (3-col: TOC | Content | Sidebar) ---- */
.prep-post-layout {
  padding: 50px 0 60px;
}
.prep-post-grid-3col {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

/* Scroll offset for anchors (header height ~120px) */
.prep-post-content h2[id],
.prep-post-content h3[id] {
  scroll-margin-top: 130px;
}

/* ---- Table of Contents (left col) ---- */
.prep-toc {
  position: sticky;
  top: 130px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.prep-toc-inner {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px;
}
.prep-toc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive-bright);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.prep-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prep-toc-list li {
  margin-bottom: 0;
}
.prep-toc-link {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--text-mute);
  text-decoration: none;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--line);
  transition: color .2s, border-color .2s, background .15s;
}
.prep-toc-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.prep-toc-link.prep-toc-active {
  color: var(--olive-bright);
  border-left-color: var(--olive-bright);
  font-weight: 500;
}

/* ---- Post Article (center column) ---- */
.prep-post-article {
  min-width: 0;
}

/* Post content prose styling */
.prep-post-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-soft);
}
.prep-post-content p {
  margin-bottom: 1.4em;
}
.prep-post-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 2.2em 0 0.8em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.prep-post-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 1.8vw, 21px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin: 1.8em 0 0.6em;
}
.prep-post-content h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 1.5em 0 0.5em;
}
.prep-post-content a {
  color: var(--olive-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.prep-post-content a:hover {
  color: var(--amber-light);
}
.prep-post-content strong {
  color: var(--text);
  font-weight: 600;
}
.prep-post-content em {
  color: var(--text);
}
.prep-post-content blockquote {
  border-left: 3px solid var(--olive);
  margin: 1.8em 0;
  padding: 16px 24px;
  background: var(--bg-card);
  color: var(--text);
  font-style: italic;
}
.prep-post-content blockquote p:last-child {
  margin-bottom: 0;
}
.prep-post-content ul,
.prep-post-content ol {
  margin: 1.2em 0;
  padding-left: 1.5em;
}
.prep-post-content li {
  margin-bottom: 0.5em;
}
.prep-post-content ul li::marker {
  color: var(--olive-bright);
}
.prep-post-content ol li::marker {
  color: var(--olive-bright);
  font-family: var(--font-display);
  font-weight: 600;
}
.prep-post-content figure {
  margin: 2em 0;
  padding: 0;
}
.prep-post-content figure img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}
.prep-post-content figure figcaption {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
  font-style: italic;
  line-height: 1.5;
}
.prep-post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  margin: 1.5em 0;
}
.prep-post-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

/* ---- Tags ---- */
.prep-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.prep-post-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.prep-post-tag:hover {
  border-color: var(--olive);
  color: var(--text);
  background: var(--bg-card);
}

/* ---- Author Box ---- */
.prep-post-author {
  margin-top: 40px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
}
.prep-post-author-sig {
  font-family: var(--font-script);
  font-size: 26px;
  color: var(--olive-bright);
  line-height: 1.3;
  flex-shrink: 0;
  transform: rotate(-3deg);
}
.prep-post-author p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0;
}

/* ================================================
   SIDEBAR
   ================================================ */
.prep-post-sidebar {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sidebar widget base */
.prep-sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 24px;
}
.prep-sidebar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* Sidebar Newsletter */
.prep-sidebar-newsletter p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 14px;
}
.prep-sidebar-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prep-sidebar-newsletter input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  color: var(--text);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  margin-bottom: 5px;
}
.prep-sidebar-newsletter input[type="email"]:focus {
  border-color: var(--olive-light);
}
.prep-sidebar-btn {
  padding: 11px 14px !important;
  font-size: 11px !important;
  width: 100%;
  text-align: center;
}

/* Sidebar Recent Posts */
.prep-sidebar-posts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prep-sidebar-post {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: opacity .2s;
}
.prep-sidebar-post:hover {
  opacity: 0.85;
}
.prep-sidebar-post-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2820, #14160e);
  border: 1px solid var(--line);
}
.prep-sidebar-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prep-sidebar-post-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.prep-sidebar-post-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prep-sidebar-post-info time {
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

/* Sidebar Products */
.prep-sidebar-products {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prep-sidebar-product {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: opacity .2s;
}
.prep-sidebar-product:hover {
  opacity: 0.85;
}
.prep-sidebar-product-img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2820, #14160e);
  border: 1px solid var(--line);
}
.prep-sidebar-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prep-sidebar-product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.prep-sidebar-product-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prep-sidebar-product-price {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--olive-bright);
}
.prep-sidebar-product-price del {
  color: var(--text-mute);
  font-weight: 400;
  font-size: 12px;
}
.prep-sidebar-product-price ins {
  text-decoration: none;
}
.prep-sidebar-shoplink {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive-bright);
  text-decoration: none;
  transition: color .2s;
}
.prep-sidebar-shoplink:hover {
  color: var(--amber-light);
}

/* Sidebar Categories */
.prep-sidebar-cats {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.prep-sidebar-cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  transition: color .2s;
}
.prep-sidebar-cat-link:last-child {
  border-bottom: none;
}
.prep-sidebar-cat-link:hover {
  color: var(--olive-bright);
}
.prep-sidebar-cat-link span {
  font-size: 11px;
  color: var(--text-mute);
  background: var(--bg-deep);
  padding: 2px 8px;
  border-radius: 2px;
}

/* ---- Related Posts ---- */
.prep-related {
  padding: 60px 0 70px;
  border-top: 1px solid var(--line);
}

/* ---- Newsletter CTA (post bottom) ---- */
.prep-post-newsletter {
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 50%, rgba(107, 113, 66, 0.08), transparent 60%), var(--bg-deep);
  padding: 60px 0;
}
.prep-post-newsletter-inner {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.prep-post-newsletter-inner h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
}
.prep-post-newsletter-inner p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.prep-newsletter-form {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
}
.prep-newsletter-form input[type="email"] {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-right: none;
  color: var(--text);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.prep-newsletter-form input[type="email"]:focus {
  border-color: var(--olive-light);
}
.prep-newsletter-form .prep-btn {
  white-space: nowrap;
}

/* Form feedback messages */
.prep-form-msg {
  display: block;
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}
.prep-msg-ok {
  color: var(--olive-bright);
}
.prep-msg-err {
  color: #d9534f;
}
.prep-btn-success {
  background: var(--olive) !important;
  border-color: var(--olive) !important;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1100px) {
  .prep-blog-list-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .prep-blog-featured {
    grid-template-columns: 1fr;
  }
  .prep-blog-featured-thumb {
    aspect-ratio: 2/1;
  }
  .prep-blog-featured-body {
    padding: 28px 24px;
  }
  /* 3-col → 2-col on tablet: TOC hidden, content + sidebar */
  .prep-post-grid-3col {
    grid-template-columns: 1fr 280px;
    gap: 30px;
  }
  .prep-toc {
    display: none;
  }
  .prep-post-sidebar {
    position: static;
  }
}
@media (max-width: 720px) {
  .prep-blog-hero-inner {
    padding: 50px 28px 40px;
  }
  .prep-blog-list-grid {
    grid-template-columns: 1fr;
  }
  .prep-blog-featured-body h2 {
    font-size: 20px;
  }
  .prep-post-hero-inner {
    padding: 50px 20px 40px;
  }
  .prep-post-layout {
    padding: 30px 0 40px;
  }
  .prep-post-author {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
  .prep-post-author-sig {
    transform: none;
  }
  .prep-newsletter-form {
    flex-direction: column;
    gap: 8px;
  }
  .prep-newsletter-form input[type="email"] {
    border-right: 1px solid var(--line-soft);
  }
  .prep-blog-grid {
    grid-template-columns: 1fr;
  }
  /* Full single column on mobile */
  .prep-post-grid-3col {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .prep-post-sidebar {
    position: static;
  }
}
