/* ─────────────────────────────────────────
   TPC Blog Listing — Stylesheet
   Font: Montserrat (loaded via Google Fonts
   — add to your theme or Elementor settings)
───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --tpc-blue-dark:   #1a3a6b;
  --tpc-blue-mid:    #1f5096;
  --tpc-red:         #d93025;
  --tpc-white:       #ffffff;
  --tpc-gray-border: #e2e8f0;
  --tpc-gray-text:   #6b7280;
  --tpc-gray-dark:   #1e293b;
  --tpc-font:        'Montserrat', sans-serif;
}

/* ── WRAPPER ── */
.tpc-blog-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  font-family: var(--tpc-font);
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-areas:
    "featured  sidebar"
    "main      sidebar";
  gap: 0 32px;
  align-items: start;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}
.tpc-featured-card  { grid-area: featured; }
.tpc-main-layout    { grid-area: main; }

/* ── MAIN LAYOUT ── */
.tpc-main-layout {
  display: block;
  min-width: 0;
  overflow-x: hidden;
}
.tpc-main-col { 
  min-width: 0;
  width: 100%;
}

/* ── FEATURED CARD ── */
.tpc-featured-card {
  background: var(--tpc-white);
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  overflow: hidden;
  margin-bottom: 28px;
}
.tpc-featured-img {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg,#f0d6d6 0%,#e8c8c8 40%,#d4b0b0 100%);
  overflow: hidden;
}
.tpc-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tpc-featured-body  { padding: 22px 24px 24px; }
.tpc-featured-cats  {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tpc-red);
  margin-bottom: 10px;
  font-family: var(--tpc-font);
}
.tpc-featured-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--tpc-gray-dark);
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -.3px;
  font-family: var(--tpc-font);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.tpc-featured-card h2 a { text-decoration: none; color: inherit; }
.tpc-featured-card h2 a:hover { color: var(--tpc-blue-mid); }
.tpc-featured-card > .tpc-featured-body > p {
  color: var(--tpc-gray-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  margin-bottom: 14px;
}
.tpc-featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11.5px;
  color: #9ca3af;
  font-weight: 500;
  font-family: var(--tpc-font);
}
.tpc-featured-meta span { display: flex; align-items: center; gap: 5px; }
.tpc-featured-meta svg { width: 13px; height: 13px; fill: #9ca3af; }

/* ── FILTER TABS ── */
.tpc-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tpc-filter-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: var(--tpc-white);
  font-family: var(--tpc-font);
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .18s;
  line-height: 1;
}
.tpc-filter-btn:hover { border-color: var(--tpc-blue-mid); color: var(--tpc-blue-mid); }
.tpc-filter-btn.active { background: var(--tpc-red); border-color: var(--tpc-red); color: white; }

/* ── ARTICLES LIST ── */
.tpc-articles-list { display: flex; flex-direction: column; gap: 16px; min-height: 200px; }

/* ── ARTICLE CARD ── */
.tpc-article-card {
  background: var(--tpc-white);
  border-radius: 10px;
  box-shadow: 0 1px 10px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  padding: 16px;
  transition: box-shadow .2s;
}
.tpc-article-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.tpc-article-thumb {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg,#f0d6d6 0%,#dfc4c4 100%);
  overflow: hidden;
}
.tpc-article-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpc-article-body { padding: 0 0 0 16px; flex: 1; min-width: 0; }
.tpc-article-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 7px;
  font-family: var(--tpc-font);
}

/* Category colours — matches your WP category slugs */
.tpc-cat-urgent-care    { color: #d93025; }
.tpc-cat-mental-health  { color: #2196f3; }
.tpc-cat-wellness       { color: #4caf50; }
.tpc-cat-family-medicine{ color: #9c27b0; }
.tpc-cat-news           { color: #ff5722; }

.tpc-article-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--tpc-gray-dark);
  margin-bottom: 7px;
  line-height: 1.4;
  letter-spacing: -.2px;
  font-family: var(--tpc-font);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.tpc-article-body h3 a { text-decoration: none; color: inherit; }
.tpc-article-body h3 a:hover { color: var(--tpc-blue-mid); }
.tpc-article-body > p {
  color: var(--tpc-gray-text);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpc-article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  font-family: var(--tpc-font);
}
.tpc-article-meta span { display: flex; align-items: center; gap: 4px; }
.tpc-article-meta svg  { width: 12px; height: 12px; fill: #9ca3af; }

/* ── LOADING STATE ── */
.tpc-loading {
  text-align: center;
  padding: 40px;
  color: var(--tpc-gray-text);
  font-size: 13px;
  font-weight: 600;
}
.tpc-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--tpc-red);
  border-radius: 50%;
  animation: tpc-spin .7s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}
@keyframes tpc-spin { to { transform: rotate(360deg); } }

/* ── NO RESULTS ── */
.tpc-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--tpc-gray-text);
}
.tpc-no-results svg { width: 40px; height: 40px; fill: #d1d5db; display: block; margin: 0 auto 12px; }
.tpc-no-results p { font-size: 14px; font-weight: 600; font-family: var(--tpc-font); }

/* ── PAGINATION ── */
.tpc-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.tpc-page-btn {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  font-family: var(--tpc-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #374151;
  background: var(--tpc-white);
  text-decoration: none;
  transition: all .2s ease;
  padding: 0 8px;
  box-sizing: border-box;
  line-height: 1;
}
.tpc-page-btn:hover {
  background: #f3f4f6;
  border-color: var(--tpc-blue-mid);
  color: var(--tpc-blue-mid);
}
.tpc-page-btn.active { 
  background: var(--tpc-red);
  border-color: var(--tpc-red);
  color: white;
  box-shadow: 0 2px 8px rgba(217, 48, 37, 0.3);
}
.tpc-page-btn.tpc-page-nav {
  font-size: 20px;
  font-weight: 400;
  min-width: 40px;
}
.tpc-page-ellipsis {
  color: #9ca3af;
  font-size: 14px;
  font-weight: 700;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  font-family: var(--tpc-font);
  user-select: none;
}

/* ── SIDEBAR ── */
.tpc-sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 20px;
  align-self: start;
}

/* Search — no outer card, just the input row */
.tpc-search-box {
  background: transparent;
  border: none;
  padding: 0;
}
.tpc-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #ffffff;
  transition: border-color .18s;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.tpc-search-wrap:focus-within {
  border-color: var(--tpc-blue-mid);
}
.tpc-search-wrap svg {
  width: 15px;
  height: 15px;
  fill: #9ca3af;
  flex-shrink: 0;
}
.tpc-search-wrap input {
  border: none;
  background: transparent;
  font-family: var(--tpc-font);
  font-size: 13px;
  font-weight: 400;
  color: var(--tpc-gray-dark);
  outline: none;
  width: 100%;
  padding: 0;
  line-height: 1;
}
.tpc-search-wrap input::placeholder {
  color: #b0b7c3;
  font-weight: 400;
}

/* Sidebar Sections */
.tpc-sidebar-section {
  background: var(--tpc-white);
  border: 1px solid #ebebeb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.tpc-sidebar-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--tpc-gray-dark);
  padding: 18px 18px 14px;
  border-bottom: 1px solid #f3f4f6;
  letter-spacing: -.1px;
  font-family: var(--tpc-font);
  margin: 0;
}

/* Recent Posts */
.tpc-recent-list { list-style: none; padding: 4px 0; margin: 0; }
.tpc-recent-list li { padding: 12px 18px; border-bottom: 1px solid #f3f4f6; }
.tpc-recent-list li:last-child { border-bottom: none; }
.tpc-recent-list a {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--tpc-gray-dark);
  text-decoration: none;
  line-height: 1.45;
  margin-bottom: 4px;
  font-family: var(--tpc-font);
}
.tpc-recent-list a:hover { color: var(--tpc-blue-mid); }
.tpc-r-date { font-size: 11px; color: #9ca3af; font-weight: 500; }

/* Categories */
.tpc-cat-list { list-style: none; padding: 4px 0; margin: 0; }
.tpc-cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background .15s;
}
.tpc-cat-item:last-child { border-bottom: none; }
.tpc-cat-item:hover      { background: #f9fafb; }
.tpc-cat-item.active     { background: #fef2f2; }
.tpc-cat-item.active a   { color: var(--tpc-red); }
.tpc-cat-item a {
  font-size: 13px;
  font-weight: 600;
  color: var(--tpc-gray-dark);
  text-decoration: none;
  pointer-events: none;
  font-family: var(--tpc-font);
}
.tpc-cat-right  { display: flex; align-items: center; gap: 8px; }
.tpc-cat-count  {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
  font-family: var(--tpc-font);
}
.tpc-cat-item.active .tpc-cat-count { background: var(--tpc-red); color: white; }
.tpc-cat-arrow { color: #9ca3af; font-size: 16px; line-height: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .tpc-blog-wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "featured"
      "sidebar"
      "main";
    padding: 24px 16px 40px;
    gap: 0;
  }
  .tpc-sidebar { 
    position: static;
    margin-bottom: 24px;
  }
}

@media (max-width: 600px) {
  .tpc-blog-wrap { 
    padding: 20px 12px 32px;
  }
  
  /* Featured Card */
  .tpc-featured-card { 
    border-radius: 8px;
    margin-bottom: 20px;
  }
  .tpc-featured-img { height: 180px; }
  .tpc-featured-body { padding: 16px 18px 18px; }
  .tpc-featured-card h2 { 
    font-size: 18px;
    line-height: 1.4;
  }
  .tpc-featured-card > .tpc-featured-body > p {
    font-size: 12.5px;
    line-height: 1.6;
  }
  .tpc-featured-meta {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  /* Filter Tabs */
  .tpc-filter-bar {
    gap: 6px;
    margin-bottom: 16px;
    justify-content: center;
  }
  .tpc-filter-btn {
    padding: 6px 14px;
    font-size: 11.5px;
  }
  
  /* Article Cards */
  .tpc-article-card {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 8px;
  }
  .tpc-article-thumb {
    width: 100%;
    height: 160px;
    margin-bottom: 12px;
  }
  .tpc-article-body {
    padding: 0;
  }
  .tpc-article-body h3 {
    font-size: 15px;
    margin-bottom: 6px;
  }
  .tpc-article-body > p {
    font-size: 12px;
    margin-bottom: 8px;
  }
  .tpc-article-meta {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  /* Sidebar */
  .tpc-sidebar {
    gap: 16px;
  }
  .tpc-sidebar-section {
    border-radius: 8px;
  }
  .tpc-sidebar-section h3 {
    font-size: 14px;
    padding: 14px 16px 12px;
  }
  .tpc-recent-list li {
    padding: 10px 16px;
  }
  .tpc-recent-list a {
    font-size: 12.5px;
  }
  .tpc-cat-item {
    padding: 10px 16px;
  }
  .tpc-cat-item a {
    font-size: 12.5px;
  }
  
  /* Pagination */
  .tpc-pagination {
    margin-top: 24px;
    gap: 6px;
  }
  .tpc-page-btn {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
    padding: 0 6px;
  }
}

@media (max-width: 400px) {
  .tpc-blog-wrap {
    padding: 16px 10px 24px;
  }
  .tpc-featured-body { padding: 14px 16px 16px; }
  .tpc-featured-card h2 { font-size: 16px; }
  .tpc-article-thumb { height: 140px; }
  .tpc-filter-btn {
    padding: 5px 12px;
    font-size: 11px;
  }
}
