/* ==========================================================================
   FLORIDA IMPLANTS — BLOG.CSS  (v2 — editorial redesign)
   Styles for blog archive, category filter, single post editorial layout,
   reading progress, TOC, sidebar widgets, share bar, and responsive rules.
   ========================================================================== */

/* ==========================================================================
   1. BLOG ARCHIVE & CATEGORY FILTER TABS
   ========================================================================== */
.blog-grid-section {
  padding: var(--section-gap) 0;
  background-color: var(--color-surface-2);
}

.category-tabs-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 56px;
}

.category-tabs-container {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  background-color: rgba(0, 0, 0, 0.03);
  padding: 6px;
  border-radius: var(--radius-pill);
  justify-content: center;
}

.category-tab {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  white-space: nowrap;
}

.category-tab:hover {
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.5);
}

.category-tab.active {
  color: var(--color-primary);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
}


/* ==========================================================================
   2. POST GRID CARD DESIGN
   ========================================================================== */
.blog-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.blog-grid-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-image-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 16/10;
  box-shadow: var(--shadow-sm);
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

.blog-card-body-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

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

.blog-category-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background-color: rgba(30, 43, 94, 0.05);
  border: 1px solid rgba(30, 43, 94, 0.12);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}

.blog-category-pill:hover {
  background-color: rgba(30, 43, 94, 0.1);
  border-color: rgba(30, 43, 94, 0.25);
}

.blog-card-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.blog-card-title-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 12px;
}

.blog-card-title-heading a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card-title-heading a:hover {
  color: var(--color-primary);
}

.blog-card-excerpt-text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-read-more-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.925rem;
  color: var(--color-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  transition: color 0.2s ease;
}

.blog-card-read-more-link span.arrow {
  transition: transform 0.2s ease;
}

.blog-card-read-more-link:hover {
  color: var(--color-secondary);
}

.blog-card-read-more-link:hover span.arrow {
  transform: translateX(4px);
}


/* ==========================================================================
   3. PAGINATION BUTTONS
   ========================================================================== */
.blog-pagination-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 56px;
}

.blog-pagination-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: 2px solid var(--color-primary);
}

.blog-pagination-nav a:first-child {
  background: transparent;
  color: var(--color-primary) !important;
}

.blog-pagination-nav a:first-child:hover {
  background-color: var(--color-primary);
  color: #FFFFFF !important;
  transform: translateY(-2px);
}

.blog-pagination-nav a:last-child {
  background: var(--grad-cta);
  color: #FFFFFF !important;
  border-color: transparent;
  box-shadow: var(--shadow-cta);
}

.blog-pagination-nav a:last-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 166, 35, 0.45);
}


/* ==========================================================================
   4. SINGLE POST — READING PROGRESS BAR
   ========================================================================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-cta);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}


/* ==========================================================================
   5. SINGLE POST — HERO (full-width featured image)
   ========================================================================== */
.single-post-hero {
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--header-height) + 60px);   /* nav clearance */
  padding-bottom: 64px;
  background-color: var(--color-text); /* fallback when no image */
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.single-post-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

/* category pill in hero context — white variant */
.hero-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s;
}

.hero-cat-pill:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

.single-post-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.18;
  color: #FFFFFF;
  margin: 0 0 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Gradient underline accent below H1 */
.hero-title-underline {
  width: 72px;
  height: 3px;
  background: var(--grad-cta);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.single-post-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 4px;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hero-meta-sep {
  opacity: 0.5;
  margin: 0 4px;
}


/* ==========================================================================
   6. SINGLE POST — TWO-COLUMN BODY GRID
   ========================================================================== */
.single-post-content-section {
  padding: 72px 0 var(--section-gap);
  background-color: var(--color-surface);
}

.single-post-body-grid {
  display: grid;
  grid-template-columns: 65% 32%;
  column-gap: 3%;
  align-items: start;
}


/* ==========================================================================
   7. SINGLE POST — POST CONTENT BODY TYPOGRAPHY
   ========================================================================== */
.post-content-body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--color-text);
}

/* Headings inside post body */
.post-content-body h2,
.post-content-body h3 {
  font-family: var(--font-display);
  color: var(--color-text);
  border-left: 3px solid var(--color-primary);
  padding-left: 14px;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.post-content-body h2 {
  font-size: 1.625rem;
  font-weight: 700;
}

.post-content-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.post-content-body h4,
.post-content-body h5,
.post-content-body h6 {
  font-family: var(--font-display);
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* Paragraphs */
.post-content-body p {
  margin-bottom: 1.5rem;
}

/* Links */
.post-content-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

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

/* Blockquotes — gradient left border */
.post-content-body blockquote {
  border-left: 4px solid;
  border-image: var(--grad-cta) 1;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background-color: rgba(30, 43, 94, 0.04);
  padding: 20px 24px;
  margin: 2rem 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.post-content-body blockquote p {
  margin-bottom: 0;
}

/* Lists */
.post-content-body ul,
.post-content-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content-body li {
  margin-bottom: 0.5rem;
}

/* Images */
.post-content-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
  margin: 2rem auto;
}

/* Code */
.post-content-body pre,
.post-content-body code {
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  background-color: var(--color-surface-2);
  border-radius: var(--radius-md);
}

.post-content-body pre {
  padding: 20px 24px;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--color-border);
}

.post-content-body code {
  padding: 2px 6px;
}

/* Tables */
.post-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.post-content-body th,
.post-content-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.post-content-body th {
  font-family: var(--font-display);
  font-weight: 600;
  background-color: var(--color-surface-2);
}

/* Legacy readable-body-p class kept for backward compat */
.readable-body-p {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}


/* ==========================================================================
   8. SINGLE POST — SHARE BAR
   ========================================================================== */
.post-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 28px;
  margin-top: 40px;
  gap: 16px;
  flex-wrap: wrap;
}

.share-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.share-buttons-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.share-btn:hover {
  background: rgba(30, 43, 94, 0.07);
  border-color: rgba(30, 43, 94, 0.3);
  transform: translateY(-2px);
}

/* Copy button resets */
button.share-btn {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  line-height: 1;
}


/* ==========================================================================
   9. SINGLE POST — AUTHOR BIO BOX
   ========================================================================== */
.post-author-bio-box {
  margin-top: 56px;
  padding: 40px;
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  gap: 28px;
  align-items: center;
}

.author-avatar {
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.author-bio-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.author-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.author-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}


/* ==========================================================================
   10. SIDEBAR — STICKY CONTAINER
   ========================================================================== */
.post-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* ==========================================================================
   11. SIDEBAR — TABLE OF CONTENTS WIDGET
   ========================================================================== */
.toc-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.toc-widget h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 12px;
  font-weight: 700;
}

.toc-widget ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-widget li {
  margin: 0;
}

.toc-link {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 5px 0 5px 10px;
  border-left: 2px solid transparent;
  line-height: 1.45;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-link:hover {
  color: var(--color-primary);
  border-left-color: rgba(30, 43, 94, 0.3);
}

.toc-link.toc-active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 500;
}


/* ==========================================================================
   12. SIDEBAR — SEARCH WIDGET
   ========================================================================== */
.sidebar-search-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  font-weight: 700;
}

.sidebar-search-form {
  width: 100%;
}

.sidebar-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-input {
  width: 100%;
  padding: 12px 48px 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface-2);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.sidebar-search-input::placeholder {
  color: var(--color-text-muted);
}

.sidebar-search-input:focus {
  border-color: var(--color-primary);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(30, 43, 94, 0.12);
}

.sidebar-search-submit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--grad-cta);
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-search-submit:hover {
  opacity: 0.88;
  transform: translateY(-50%) scale(1.05);
}


/* ==========================================================================
   13. SIDEBAR — CTA WIDGET
   ========================================================================== */
.sidebar-cta-widget {
  background: var(--grad-cta);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.sidebar-cta-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.sidebar-cta-copy {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.45;
  margin: 0;
}

.sidebar-cta-btn {
  margin-top: 4px;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.875rem;
  padding: 10px 20px;
}

.sidebar-cta-btn:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  transform: translateY(-2px);
}


/* ==========================================================================
   14. RELATED ARTICLES
   ========================================================================== */
.related-posts-section {
  padding: var(--section-gap) 0;
  background-color: var(--color-surface-2);
  border-top: 1px solid var(--color-border);
}

.related-posts-section h2 {
  margin-bottom: 48px;
}


/* ==========================================================================
   15. RESPONSIVENESS — TABLET & MOBILE
   ========================================================================== */

/* ── Tablet: collapse to single column ── */
@media (max-width: 1024px) {
  .single-post-body-grid {
    grid-template-columns: 1fr;
  }

  .post-sidebar {
    position: static;
    top: auto;
  }

  .single-post-hero-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
}

/* ── Medium: 2-column blog grid → 2-col ── */
@media (max-width: 992px) {
  .blog-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .post-author-bio-box {
    padding: 32px 24px;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .blog-grid-container {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 480px;
    margin: 0 auto;
  }

  .category-tabs-container {
    border-radius: 20px;
  }

  .category-tab {
    padding: 8px 16px;
  }

  .post-author-bio-box {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 28px 20px;
  }

  .single-post-hero {
    min-height: 380px;
    padding-bottom: 48px;
  }

  .post-share-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .share-buttons-row {
    gap: 8px;
  }

  .sidebar-cta-widget {
    padding: 24px 20px;
  }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
  .single-post-hero-meta {
    font-size: 0.8rem;
  }

  .sidebar-search-input {
    font-size: 0.875rem;
    padding: 11px 44px 11px 16px;
  }
}
