/* =========================================
   styles-Resources.css - Resources + Single Post
   ========================================= */


/* ══════════════════════════════════════════
   RESOURCES PAGE - Hero
══════════════════════════════════════════ */

.resources-hero {
  background: linear-gradient(160deg, var(--gray) 55%, var(--white) 55%);
  padding: 0 0 50px 0;
}

.resources-hero-layout {
  display: block;
}

.resources-hero-left {
  width: 100%;
}

.resources-hero h1 {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  font-size: 46px;
  font-weight: 600;
  line-height: 55px;
  letter-spacing: .18px;
  color: var(--text-muted);
  margin: 25px 0 15px 0;
}

.resources-hero-desc {
  font-size: 20px;
  font-weight: 400;
  line-height: 35px;
  letter-spacing: .4px;
  max-width: 700px;
  margin-bottom: 0;
}


/* ══════════════════════════════════════════
   RESOURCES PAGE - Filter
══════════════════════════════════════════ */

.resources-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 28px;
}

.resources-filter-label {
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bbb;
}

.resources-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resources-filter-btn {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.resources-filter-btn:hover {
  border-color: var(--light-blue);
  color: var(--light-blue);
}

.resources-filter-btn.active {
  background: var(--light-blue);
  color: #fff;
  border-color: var(--light-blue);
}

.post-card.hidden {
  display: none;
}

.resources-no-results {
  display: none;
  grid-column: 1 / -1;
  padding: 60px 20px;
  font-size: 16px;
  text-align: center;
  color: #888;
}

.resources-no-results.visible {
  display: block;
}


/* ══════════════════════════════════════════
   RESOURCES PAGE - Post grid
══════════════════════════════════════════ */

.resources-posts {
  padding: 50px 0 70px;
}

.resources-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}


/* ══════════════════════════════════════════
   POST CARD
══════════════════════════════════════════ */

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10);
}

.post-card:focus-within {
  outline: 2px solid var(--light-blue);
  outline-offset: 4px;
}

.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Thumbnail */
.post-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gray);
}

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

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

/* Card body */
.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}

/* Meta row */
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.post-meta time {
  font-size: 13px;
  color: #888;
}

.post-cat {
  display: inline-block;
  width: fit-content;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 20px;
  background: #e8f3fd;
  color: var(--light-blue);
}

/* Title */
.post-title {
  flex: 1;
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 550;
  line-height: 1.4;
  letter-spacing: .2px;
  text-align: left;
  color: var(--text-muted);
}

.post-title a {
  position: relative;
  z-index: 1;
  color: inherit;
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--light-blue);
}

/* Excerpt */
.post-excerpt {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #888;
}

/* Card footer */
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.post-author {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #888;
}

.post-card-actions {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  gap: 12px;
}

/* Read more link */
.post-read-more {
  display: inline;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--light-blue) !important;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease, color 0.2s;
  text-decoration-color: transparent;
}

.post-read-more:hover {
  text-decoration: underline;
  text-decoration-color: var(--light-blue);
  text-decoration-thickness: 1.5px;
}

/* Reading time badge */
.post-reading-time-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  white-space: nowrap;
  color: #888;
}

.post-reading-time-badge svg {
  flex-shrink: 0;
}


/* ══════════════════════════════════════════
   SINGLE POST - Hero
══════════════════════════════════════════ */

.post-single-hero {
  background: linear-gradient(160deg, var(--gray) 55%, var(--white) 55%);
  padding: 0 0 25px;
}

.post-single-hero h1 {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  max-width: 620px;
  margin: 50px 0 15px 0;
  font-size: 46px;
  font-weight: 600;
  line-height: 55px;
  letter-spacing: .18px;
  color: var(--text-muted);
}

.post-single-intro {
  max-width: 620px;
  margin-bottom: 28px;
  font-size: 20px;
  font-weight: 400;
  line-height: 35px;
  letter-spacing: .4px;
}

/* Hero layout: text left + thumb right */
.post-hero-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.post-hero-left {
  flex: 1;
  min-width: 0;
}

/* Desktop hero thumbnail */
.post-hero-thumb {
  flex-shrink: 0;
  width: 420px;
  height: 282px;
  align-self: center;
  margin-top: 50px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09);
}

.post-hero-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Mobile hero thumbnail */
.post-hero-thumb-mobile {
  display: none;
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.post-hero-thumb-mobile img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Author card */
.post-author-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 8px;
}

.post-author-img {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: 2px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
}

.post-author-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.post-author-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-author-name {
  font-size: 18px;
  font-weight: 500;
  color: #444;
}

.post-author-linkedin {
  display: flex;
  align-items: center;
  color: #0077b5;
  transition: opacity 0.2s;
}

.post-author-linkedin:hover {
  opacity: 0.75;
}

.post-author-role {
  font-size: 14px;
  color: #888;
}

/* Post meta row */
.post-single-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.post-single-meta time {
  font-size: 13px;
  color: #888;
}

.post-reading-time {
  font-size: 13px;
  color: #888;
}


/* ══════════════════════════════════════════
   SINGLE POST - Body layout
══════════════════════════════════════════ */

.post-single-body {
  padding: 55px 0 0;
  background: var(--white);
}

.post-single-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  align-items: start;
  gap: 60px;
}

/* In-content featured image */
.post-featured-img {
  margin: 36px 0;
  overflow: hidden;
  line-height: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.post-featured-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}


/* ══════════════════════════════════════════
   SINGLE POST - Content typography
══════════════════════════════════════════ */

.post-content h2 {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  margin: 44px 0 14px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .18px;
  text-align: left;
  color: var(--text-muted);
}

.post-content h2:first-of-type {
  margin-top: 0;
}

.post-content h3 {
  margin: 28px 0 10px;
  text-align: left;
  color: #444;
}

.post-content p {
  margin-bottom: 18px;
}

.post-content ul {
  padding-left: 22px;
  margin-bottom: 20px;
}

.post-content ol {
  padding-left: 28px;
  margin-bottom: 20px;
}

.post-content li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-muted);
}

.post-content strong {
  color: #444;
}

.post-content a {
  color: var(--light-blue);
  text-decoration: underline;
}

.post-content a:hover {
  color: #1565C0;
  text-decoration: underline;
}

.post-content code {
  padding: 1px 6px;
  font-size: 15px;
  font-family: 'Courier New', monospace;
  background: #f0f4f8;
  color: #c0392b;
  border-radius: 4px;
}


/* ══════════════════════════════════════════
   SINGLE POST - Sidebar
══════════════════════════════════════════ */

.post-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  padding: 24px;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sidebar-widget-title {
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 500;
  color: #444;
}

.sidebar-widget-desc {
  margin-bottom: 16px;
}

.sidebar-cta-btn {
  display: block;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  background: var(--btn-green);
  color: #fff !important;
  border-radius: 8px;
  transition: opacity 0.2s;
}

.sidebar-cta-btn:hover {
  opacity: 0.88;
}


/* ══════════════════════════════════════════
   DESKTOP TOC (sidebar widget)
══════════════════════════════════════════ */

.toc-list {
  padding-left: 0;
  margin: 0;
  list-style: none;
  counter-reset: toc-counter;
}

.toc-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  counter-increment: toc-counter;
}

.toc-list li::before {
  content: counter(toc-counter) ".";
  flex-shrink: 0;
  min-width: 18px;
  font-size: 14px;
  line-height: 1.45;
  color: #888;
}

.toc-list a {
  display: inline;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
  transition: color 0.2s;
}

.toc-list a:hover,
.toc-list a.toc-active {
  font-weight: 550;
  color: var(--light-blue);
}


/* ══════════════════════════════════════════
   MOBILE TOC - Button
══════════════════════════════════════════ */

.toc-mobile-btn {
  display: none;
  position: fixed;
  top: 92px;
  left: 50%;
  z-index: 901;
  transform: translateX(-50%);
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 550;
  white-space: nowrap;
  background: var(--light-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: opacity 0.2s;
}

.toc-mobile-btn:hover {
  opacity: 0.88;
}

@supports (top: env(safe-area-inset-top)) {
  .toc-mobile-btn {
    top: calc(92px + env(safe-area-inset-top, 0px));
  }
}

body:has(.toc-mobile.active) .toc-mobile-btn {
  opacity: 0;
  pointer-events: none;
}


/* ══════════════════════════════════════════
   MOBILE TOC - Overlay
══════════════════════════════════════════ */

.toc-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
  transition: opacity 0.35s;
}

.toc-mobile-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: all;
}


/* ══════════════════════════════════════════
   MOBILE TOC - Panel
══════════════════════════════════════════ */

.toc-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 75vh;
  overflow-y: auto;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom, 0px)) 0;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.toc-mobile.active {
  transform: translateY(0);
}

.toc-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 10px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.toc-mobile-header strong {
  font-size: 15px;
  font-weight: 600;
  color: #444;
}

/* Back & Hide buttons - shared style */
.back-button,
#toc-mobile-close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.back-button:hover,
#toc-mobile-close:hover {
  background: #e8f3fd;
  color: var(--light-blue);
  border-color: var(--light-blue);
}

.back-button a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

/* TOC list items */
#toc-mobile-list {
  list-style: none;
  padding: 10px 0 0;
  margin: 0;
}

#toc-mobile-list li {
  border-bottom: 1px solid var(--border);
}

#toc-mobile-list li:last-child {
  border-bottom: none;
}

#toc-mobile-list a {
  display: block;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

#toc-mobile-list a:hover,
#toc-mobile-list a.toc-active {
  font-weight: 550;
  color: var(--light-blue);
  background: #f0f8ff;
}


/* ══════════════════════════════════════════
   SINGLE POST - Related posts
══════════════════════════════════════════ */

.post-related {
  padding: 55px 0;
  background: var(--white);
}

.post-related-title {
  margin: 0 0 30px;
  text-align: left;
}

.post-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-related-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: linear-gradient(#fbfbfb, #f5fbfe);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-related-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
  transform: translateY(-3px);
}

.post-related-card h3 {
  flex: 1;
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  color: #444;
}

.post-related-card .post-read-more {
  margin-top: 4px;
  font-size: 16px;
  color: var(--light-blue) !important;
}


/* ══════════════════════════════════════════
   SINGLE POST - Share buttons
══════════════════════════════════════════ */

.post-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.post-share-label {
  font-size: 13px;
  white-space: nowrap;
  color: #aaa;
}

.post-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  text-decoration: none;
  background: var(--white);
  color: #888;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.post-share-btn:hover {
  border-color: currentColor;
}

.post-share-btn.share-x:hover {
  color: #000;
}

.post-share-btn.share-li:hover {
  color: #0077b5;
}

.post-share-btn.share-copy:hover {
  color: var(--light-blue);
}

.post-share-btn.share-copy.copied {
  color: var(--btn-green);
  border-color: var(--btn-green);
}


/* ══════════════════════════════════════════
   SINGLE POST - Tables
══════════════════════════════════════════ */

.post-content .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.post-content table {
  width: 100%;
  max-width: 100%;
  margin: 28px 0;
  font-size: 15px;
  table-layout: auto;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.post-content thead tr {
  background: #eef3fb;
}

.post-content th {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.03em;
  text-align: left;
  color: #444;
  border-bottom: 2px solid var(--border);
}

.post-content td {
  padding: 11px 16px;
  line-height: 1.55;
  vertical-align: top;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.post-content tbody tr:last-child td {
  border-bottom: none;
}

.post-content tbody tr:nth-child(even) {
  background: #fafcfe;
}

.post-content tbody tr:hover {
  background: #f0f7ff;
}

/* Status badges inside tables */
.post-content .tbl-good {
  font-weight: 550;
  color: #16a34a;
}

.post-content .tbl-warn {
  font-weight: 550;
  color: #d97706;
}

.post-content .tbl-bad {
  font-weight: 550;
  color: #dc2626;
}


/* ══════════════════════════════════════════
   SINGLE POST - FAQ
══════════════════════════════════════════ */

.post-content .faq-toggle {
  color: var(--light-blue);
}

.post-content .faq-item.active .faq-question h3 {
  color: var(--light-blue);
}

.post-content .faq-question h3 {
  margin: 0;
  font-size: 20x;
  font-weight: 500;
  line-height: 1.4;
}

.post-content section {
  padding: 0;
}

.post-content .faq-container {
  margin: 0;
}

.post-content .faq-question {
  padding: 15px 30px;
}

.post-content .faq-answer {
  padding: 0 30px;
}

.post-content .faq-item.active .faq-answer {
  max-height: 300px;
}


/* ══════════════════════════════════════════
   SINGLE POST - Author bio
══════════════════════════════════════════ */

.post-author-bio {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 40px 0 28px;
  padding: 22px 24px;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.post-author-bio-img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border: 2px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
}

.post-author-bio-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.post-author-bio-name {
  margin: 0;
  font-size: 16px;
  font-weight: 550;
  color: #444;
}

.post-author-bio-role {
  margin: 0 0 6px;
  font-size: 13px;
  color: #888;
}

.post-author-bio-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #666;
}


/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .resources-hero {
    background: linear-gradient(125deg, var(--white) 50%, var(--gray) 50%);
  }

  .resources-hero h1 {
    font-size: 34px;
    line-height: 40px;
  }

  .resources-hero-desc {
    font-size: 18px;
    line-height: 25px;
  }

  .resources-posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .post-hero-thumb {
    display: none;
  }

  .post-hero-thumb-mobile {
    display: block;
    margin-bottom: 22px;
  }

  .post-single-hero {
    background: linear-gradient(125deg, var(--white) 50%, var(--gray) 50%);
  }

  .post-single-hero h1 {
    max-width: 100%;
    margin-top: 16px !important;
    font-size: 34px;
    line-height: 40px;
  }

  .post-single-intro {
    font-size: 18px;
    line-height: 25px;
  }

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

  .post-sidebar {
    display: none;
  }

  .toc-mobile-btn {
    display: block;
  }

  .toc-mobile {
    display: block;
  }

  .post-single-body {
    padding: 30px 0 0;
  }

  .post-related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-content h2:first-of-type {
    margin-top: 0 !important;
  }

  .post-content .faq-question {
    padding: 20px 0;
  }

  .post-content .faq-answer {
    padding: 0 2px;
  }

  .post-content .faq-item.active .faq-answer {
    max-height: 350px;
  }

  .post-author-bio {
    flex-direction: column;
  }

  .post-author-bio-img {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 860px) {

  .post-single-body .container,
  .post-single-hero .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .post-content table {
    min-width: 480px;
  }
}

@media (max-width: 600px) {
  .resources-posts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-single-hero h1 {
    font-size: 26px;
  }

  .post-single-body .container,
  .post-single-hero .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .post-content {
    overflow-x: hidden;
    word-break: break-word;
  }

  .post-content .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: calc(100vw - 32px);
  }

  .post-content table {
    min-width: 420px;
    font-size: 13px;
  }

  .post-content th,
  .post-content td {
    padding: 8px 10px;
  }
}