/* =====================================================================
   DEBORAH HEINLEN PHOTOGRAPHY: BLOG POST STYLES
   Every blog post links to this file, right after site.css:
     <link rel="stylesheet" href="/css/blog-post.css" />

   Change something here and it changes on every blog post at once.
   Colors come from the CONTROL PANEL at the top of site.css.
   ===================================================================== */


/* Pushes the page below the fixed header and nav */
.page-content { padding-top: calc(var(--header-h) + var(--nav-h)); }


/* =====================================================================
   POST HERO
   Title and intro on the left, photo on the right.
   ===================================================================== */
.post-hero {
  display: flex;
  align-items: stretch;
  min-height: 70vh;
  border-bottom: 1px solid var(--line-faint);
}

.post-hero-content {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 6vw;
}

/* Photo width: change the 50% to make it wider or narrower */
.post-hero-image {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
}
.post-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.85);
  display: block;
}
/* Soft fade on the edge of the photo that meets the text.
   Works whether the photo is placed first (left) or second (right) in the HTML. */
.post-hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, transparent 65%, var(--bg) 100%);
  pointer-events: none;
}
.post-hero-image:first-child::after {
  background: linear-gradient(to right, transparent 65%, var(--bg) 100%);
}

/* Post title: change the last clamp value to make it larger or smaller */
.post-hero-content h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  color: var(--text);
  letter-spacing: 0.03em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

/* Italic intro under the title */
.post-intro {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.02em;
}


/* =====================================================================
   DATE AND CATEGORY TAG
   Used in the post hero and the related article cards.
   ===================================================================== */
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.post-date {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
}

/* The small outlined category tag: "Tips", "Pricing", etc. */
.post-tag {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 0.2rem 0.6rem;
}


/* =====================================================================
   ARTICLE BODY
   Inside <article class="post-body">:
     <h2>            section heading
     <h3>            small spaced-capitals subheading
     <h4>            small plain subheading
     <p>             paragraph
     <strong>        bold words inside a paragraph
     <ul> / <ol>     bulleted or numbered list
     <blockquote><p> pulled quote with a line beside it
     <a>             underlined link
     <div class="post-rule"></div>     short centered divider line
     <div class="client-grid"> 3 photos </div>   row of photos
     <figure class="post-image"><img ... /><figcaption>Caption</figcaption></figure>
                     one large photo with an optional caption
   ===================================================================== */
.post-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
}

.post-body p {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.3vw, 1.02rem);
  line-height: 2;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 1.8rem;
}

.post-body h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 3rem 0 1.2rem;
}

/* Small spaced-capitals subheading */
.post-body h3 {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin: 2.5rem 0 1rem;
}

/* Small plain subheading */
.post-body h4 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 1.5rem 0 0.6rem;
}

.post-body strong { font-weight: 400; color: var(--text); }

/* Bulleted and numbered lists inside a post */
.post-body ul,
.post-body ol {
  margin: 0 0 1.8rem 1.4rem;
}
.post-body li {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.3vw, 1.02rem);
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.post-body blockquote {
  border-left: 2px solid var(--text);
  padding: 0.5rem 0 0.5rem 2rem;
  margin: 2.5rem 0;
}
.post-body blockquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 0.02em;
  margin-bottom: 0;
}

.post-body a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s;
}
.post-body a:hover { border-color: var(--text); }

.post-rule {
  width: 60px;
  height: 1px;
  background: var(--line-strong);
  margin: 3rem auto;
}

/* One large photo inside a post, with an optional caption */
.post-image { width: 100%; margin: 3rem 0; }
.post-image img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.88);
  display: block;
}
.post-image figcaption {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  margin-top: 0.8rem;
}

/* Row of client photos inside a post */
.client-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}
.client-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}


/* =====================================================================
   AUTHOR BOX AND BACK LINK
   ===================================================================== */
.post-author {
  max-width: 780px;
  margin: 0 auto 2rem;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.author-image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.author-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.85);
  display: block;
}

/* "WRITTEN BY" */
.author-info h4 {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.author-info p {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1.6;
}

.back-to-blog {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

/* "← Back to All Articles" */
.back-link {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.2s;
}
.back-link:hover { gap: 0.8rem; }


/* =====================================================================
   MORE FROM THE BLOG
   Three related article cards near the bottom.
   ===================================================================== */
.related-section {
  border-top: 1px solid var(--line-faint);
  padding: 5rem 8vw 6rem;
}

/* "MORE FROM THE BLOG" (older posts use related-label, newer use section-label) */
.related-section .section-label,
.related-label {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text);
  display: block;
  margin-bottom: 3rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.related-card {
  display: block;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
  transition: border-color 0.3s;
}
.related-card:hover { border-color: var(--text); }

.related-card-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.85);
  display: block;
  transition: transform 0.6s ease;
}
.related-card:hover .related-card-image img { transform: scale(1.05); }

.related-card .post-meta { margin-bottom: 0.6rem; }

.related-card h3 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  color: var(--text);
  letter-spacing: 0.03em;
  line-height: 1.25;
}


/* =====================================================================
   FINAL CTA
   ===================================================================== */
.cta-section {
  background: var(--bg);
  border-top: 1px solid var(--line-faint);
  padding: 7rem 8vw;
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}

.cta-section p {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 3rem;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}


/* =====================================================================
   TABLETS AND PHONES
   ===================================================================== */
@media (max-width: 900px) {
  /* Photo moves above the title, whichever side it was on */
  .post-hero { flex-direction: column; }
  .post-hero-image { order: -1; flex: none; width: 100%; min-height: 350px; }
  .post-hero-image::after,
  .post-hero-image:first-child::after { background: linear-gradient(to bottom, transparent 60%, var(--bg) 100%); }
  .post-hero-content { flex: none; width: 100%; padding: 3rem 2rem; }

  .related-grid { grid-template-columns: 1fr 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .post-body, .post-author, .back-to-blog { padding-left: 1.5rem; padding-right: 1.5rem; }
  .related-section { padding: 4rem 1.5rem 5rem; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card-image { height: 260px; }
  .client-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 5rem 1.5rem; }
  .cta-buttons { flex-direction: column; align-items: center; }
}
