/* ===========================================================================
   Jobdrive blog
   ---------------------------------------------------------------------------
   Post index, archives, search and single-post styling. Built from core blocks
   so posts stay editable in the Site Editor, dressed in the card design the
   Resources page already uses (Resources.html): border #e5e7eb, radius 16px,
   a sky uppercase category eyebrow and a Josefin 400 title.
   =========================================================================== */

/* ---- Shared page shell ---------------------------------------------------- */
.jd-blog {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 64px 32px 88px;
  box-sizing: border-box;
}

.jd-blog__eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--wp--preset--color--sky-deep, #0284c7);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
}

.jd-blog__title {
  font-family: var(--wp--preset--font-family--josefin-sans, 'Josefin Sans'), sans-serif;
  font-weight: 300;
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--wp--preset--color--contrast, #0f172a);
  margin: 18px 0 0;
  text-wrap: balance;
}

.jd-blog__lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--wp--preset--color--body, #475569);
  margin: 18px 0 0;
  max-width: 58ch;
}

/* ---- Post card grid ------------------------------------------------------- */
.jd-posts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.jd-posts > li { margin: 0; }

.jd-post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  border: 1px solid var(--wp--preset--color--border, #e5e7eb);
  border-radius: 16px;
  padding: 30px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s cubic-bezier(.4, 0, .2, 1);
}

.jd-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .08);
}

.jd-post-card__cat,
.jd-post-card__cat a {
  font-size: 12px;
  font-weight: 700;
  color: var(--wp--preset--color--sky-deep, #0284c7);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
}

.jd-post-card__title,
.jd-post-card__title a {
  font-family: var(--wp--preset--font-family--josefin-sans, 'Josefin Sans'), sans-serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  color: var(--wp--preset--color--contrast, #0f172a);
  margin: 0;
  text-decoration: none;
}

.jd-post-card__title a:hover { color: var(--wp--preset--color--sky-deep, #0284c7); }

.jd-post-card__excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: var(--wp--preset--color--body, #475569);
  margin: 0;
}

.jd-post-card__excerpt a { color: var(--wp--preset--color--sky-deep, #0284c7); font-weight: 700; }

.jd-post-card__image img {
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

/* ---- Pagination ----------------------------------------------------------- */
.jd-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 44px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.jd-pagination a,
.jd-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--wp--preset--color--border, #e5e7eb);
  border-radius: 10px;
  color: var(--wp--preset--color--body, #475569);
  text-decoration: none;
  background: #fff;
}

.jd-pagination a:hover { background: var(--wp--preset--color--sky-wash, #eff8ff); color: var(--wp--preset--color--sky-deep, #0284c7); }
.jd-pagination .current { background: var(--wp--preset--color--sky, #38bdf8); color: var(--wp--preset--color--contrast, #0f172a); border-color: var(--wp--preset--color--sky, #38bdf8); }

/* ---- Single post ---------------------------------------------------------- */
.jd-single { max-width: 760px; width: 100%; margin: 0 auto; padding: 64px 32px 40px; box-sizing: border-box; }

.jd-single__title {
  font-family: var(--wp--preset--font-family--josefin-sans, 'Josefin Sans'), sans-serif;
  font-weight: 300;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--wp--preset--color--contrast, #0f172a);
  margin: 16px 0 0;
  text-wrap: balance;
}

.jd-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 18px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--wp--preset--color--muted, #94a3b8);
}

.jd-post-meta a { color: var(--wp--preset--color--sky-deep, #0284c7); text-decoration: none; }

.jd-single__image { margin: 32px 0 0; }
.jd-single__image img { border-radius: 16px; width: 100%; height: auto; }

.jd-single__content { margin: 36px 0 0; font-size: 17px; line-height: 1.75; color: var(--wp--preset--color--body, #475569); }
.jd-single__content > * + * { margin-top: 22px; }

.jd-single__content h2,
.jd-single__content h3 {
  font-family: var(--wp--preset--font-family--josefin-sans, 'Josefin Sans'), sans-serif;
  font-weight: 300;
  color: var(--wp--preset--color--contrast, #0f172a);
  margin-top: 40px;
}

.jd-single__content h2 { font-size: 34px; line-height: 1.15; }
.jd-single__content h3 { font-size: 26px; line-height: 1.2; }
.jd-single__content a { color: var(--wp--preset--color--sky-deep, #0284c7); }

.jd-single__content blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--wp--preset--color--sky, #38bdf8);
  color: var(--wp--preset--color--contrast, #0f172a);
}

.jd-post-tags { margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }

.jd-post-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--wp--preset--color--sky-tint, #e1f0ff);
  color: var(--wp--preset--color--sky-deep, #0284c7);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* ---- Post navigation ------------------------------------------------------ */
.jd-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 48px 0 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--wp--preset--color--border, #e5e7eb);
  font-size: 15px;
  font-weight: 600;
}

.jd-post-nav a { color: var(--wp--preset--color--sky-deep, #0284c7); text-decoration: none; }

/* ---- Comments ------------------------------------------------------------- */
.jd-comments { margin: 56px 0 0; padding: 36px 0 0; border-top: 1px solid var(--wp--preset--color--border, #e5e7eb); }

.jd-comments__title {
  font-family: var(--wp--preset--font-family--josefin-sans, 'Josefin Sans'), sans-serif;
  font-weight: 300;
  font-size: 32px;
  color: var(--wp--preset--color--contrast, #0f172a);
  margin: 0 0 24px;
}

.jd-comments .wp-block-comment-author-name { font-weight: 700; color: var(--wp--preset--color--contrast, #0f172a); }
.jd-comments .wp-block-comment-date { font-size: 13px; color: var(--wp--preset--color--muted, #94a3b8); }

.jd-comments input[type="text"],
.jd-comments input[type="email"],
.jd-comments input[type="url"],
.jd-comments textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f8f9fb;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  box-sizing: border-box;
}

.jd-comments .wp-block-button__link {
  background: var(--wp--preset--color--sky, #38bdf8);
  color: var(--wp--preset--color--contrast, #0f172a);
  border-radius: 10px;
  font-weight: 700;
  min-height: 44px;
}

/* ---- No results ----------------------------------------------------------- */
.jd-no-results {
  border: 1px dashed var(--wp--preset--color--border, #e5e7eb);
  border-radius: 16px;
  padding: 44px 32px;
  text-align: center;
  color: var(--wp--preset--color--body, #475569);
  margin: 34px 0 0;
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 767px) {
  .jd-posts { grid-template-columns: 1fr; }
  .jd-post-nav { grid-template-columns: 1fr; }
  .jd-blog { padding: 44px 24px 64px; }
  .jd-single { padding: 44px 24px 32px; }
  .jd-blog__title { font-size: 34px; }
  .jd-single__title { font-size: 32px; }
  .jd-single__content h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .jd-post-card { transition: none; }
}

/* Separator between meta items, so an absent author leaves no stray dot. */
.jd-post-meta > * + *::before {
  content: "·";
  margin-right: 14px;
  color: var(--wp--preset--color--border, #e5e7eb);
}

/* An empty tag list or post-navigation must not draw its rule. */
.jd-post-tags:empty,
.jd-post-nav:empty { display: none; }

/* ---- Featured post card (Resources hub) ----------------------------------- */
.jd-featured {
  display: grid;
  /* One column by default: a post with no featured image must not leave half
     the card blank. The two-column split only applies when an image renders. */
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  border: 1px solid var(--wp--preset--color--border, #e5e7eb);
  border-radius: 18px;
  overflow: hidden;
  background: #fafcfe;
}

.jd-featured:has(.jd-featured__image img) {
  grid-template-columns: var(--jd-cols, 1.1fr .9fr);
}

.jd-featured__image:not(:has(img)) { display: none; }

.jd-featured__body { padding: 44px 40px; }

.jd-featured__eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--wp--preset--color--sky-deep, #0284c7);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
}

.jd-featured__title,
.jd-featured__title a {
  font-family: var(--wp--preset--font-family--josefin-sans, 'Josefin Sans'), sans-serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  color: var(--wp--preset--color--contrast, #0f172a);
  margin: 14px 0 0;
  text-decoration: none;
}

.jd-featured__title a:hover { color: var(--wp--preset--color--sky-deep, #0284c7); }

.jd-featured__excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: var(--wp--preset--color--body, #475569);
  margin: 14px 0 0;
}

.jd-featured__excerpt a { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--wp--preset--color--sky-deep, #0284c7); text-decoration: none; }

.jd-featured__image { margin: 0; height: 100%; }
.jd-featured__image img { width: 100%; height: 100%; object-fit: cover; border-left: 1px solid var(--wp--preset--color--border-soft, #eef2f6); }

@media (max-width: 1023px) {
  .jd-featured { gap: 0; }
  .jd-featured__body { padding: 32px 26px; }
  .jd-featured__image img { border-left: none; border-top: 1px solid var(--wp--preset--color--border-soft, #eef2f6); }
}
