/* =====================================================
   STB Blog Plugin — Public Frontend Styles
   Theme: Barlow Condensed / amber #f59e0b / navy #1a1a2e
   ===================================================== */

:root {
  --stb-primary:   #1a1a2e;
  --stb-accent:    #f59e0b;
  --stb-accent-dk: #d97706;
  --stb-text:      #111827;
  --stb-text-2:    #374151;
  --stb-muted:     #6b7280;
  --stb-border:    #e5e7eb;
  --stb-bg:        #f9fafb;
  --stb-white:     #ffffff;
  --stb-gold-bg:   #fffbeb;
  --stb-radius:    10px;
  --stb-shadow:    0 4px 20px rgba(0,0,0,0.07);
}

.stb-pub-wrap * { box-sizing: border-box; }

.stb-pub-wrap {
  font-family: 'Barlow', sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  color: var(--stb-text);
}

/* ────────────────────────────────────────────
   TOOLBAR
──────────────────────────────────────────── */
.stb-pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

/* Search */
.stb-pub-search-form { flex: 1; min-width: 200px; max-width: 380px; }
.stb-pub-search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.stb-search-icon {
  position: absolute;
  left: 14px;
  width: 16px; height: 16px;
  color: var(--stb-muted);
  pointer-events: none;
}
.stb-pub-search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--stb-border);
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  background: var(--stb-white);
  transition: border-color 0.15s;
}
.stb-pub-search-input:focus {
  border-color: var(--stb-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

/* Category pills */
.stb-pub-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.stb-cat-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--stb-muted);
  background: var(--stb-bg);
  border: 1.5px solid var(--stb-border);
  transition: all 0.15s;
}
.stb-cat-pill:hover,
.stb-cat-pill.active {
  background: var(--stb-accent);
  color: var(--stb-primary);
  border-color: var(--stb-accent);
}

/* Layout toggle */
.stb-layout-toggle {
  display: flex;
  gap: 4px;
  background: var(--stb-bg);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--stb-border);
}
.stb-layout-btn {
  width: 34px; height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--stb-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.stb-layout-btn svg { width: 16px; height: 16px; }
.stb-layout-btn.active,
.stb-layout-btn:hover {
  background: var(--stb-white);
  color: var(--stb-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Stats */
.stb-pub-stats {
  font-size: 13px;
  color: var(--stb-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

/* ────────────────────────────────────────────
   GRID LAYOUT
──────────────────────────────────────────── */
.stb-pub-grid.stb-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* ────────────────────────────────────────────
   LIST LAYOUT
──────────────────────────────────────────── */
.stb-pub-grid.stb-layout-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stb-pub-grid.stb-layout-list .stb-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-radius: var(--stb-radius);
}
.stb-pub-grid.stb-layout-list .stb-card-img-wrap {
  height: 100%;
  min-height: 160px;
}
.stb-pub-grid.stb-layout-list .stb-card-img {
  height: 100%;
  max-height: 200px;
}

/* ────────────────────────────────────────────
   CARD
──────────────────────────────────────────── */
.stb-card {
  background: var(--stb-white);
  border: 1px solid var(--stb-border);
  border-radius: var(--stb-radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.stb-card:hover {
  box-shadow: var(--stb-shadow);
  transform: translateY(-2px);
}

/* Featured */
.stb-card.stb-featured {
  border-left: 4px solid var(--stb-accent);
  background: var(--stb-gold-bg);
}

.stb-featured-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--stb-accent);
  color: var(--stb-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

/* Image */
.stb-card-img-wrap {
  display: block;
  overflow: hidden;
  height: 190px;
  background: var(--stb-bg);
  position: relative;
}
.stb-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}
.stb-card:hover .stb-card-img { transform: scale(1.03); }

/* Body */
.stb-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Categories */
.stb-card-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.stb-card-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stb-accent-dk);
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Title */
.stb-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--stb-primary);
  line-height: 1.3;
  margin: 0;
}
.stb-card-title a {
  color: inherit;
  text-decoration: none;
}
.stb-card-title a:hover { color: var(--stb-accent-dk); }

/* Excerpt */
.stb-card-excerpt {
  font-size: 14px;
  color: var(--stb-text-2);
  line-height: 1.55;
  margin: 0;
}

/* Meta */
.stb-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--stb-muted);
}

/* CTA */
.stb-card-cta {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--stb-accent-dk);
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.15s;
}
.stb-card-cta:hover { color: var(--stb-primary); }

/* ────────────────────────────────────────────
   EMPTY STATE
──────────────────────────────────────────── */
.stb-pub-empty {
  text-align: center;
  padding: 64px 32px;
  background: var(--stb-bg);
  border-radius: var(--stb-radius);
}
.stb-pub-empty-icon { font-size: 48px; margin-bottom: 12px; }
.stb-pub-empty h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  color: var(--stb-primary);
  margin: 0 0 8px;
}
.stb-pub-empty p { color: var(--stb-muted); margin: 0 0 20px; }

/* ────────────────────────────────────────────
   PAGINATION
──────────────────────────────────────────── */
.stb-pub-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.stb-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--stb-text-2);
  background: var(--stb-white);
  border: 1.5px solid var(--stb-border);
  transition: all 0.15s;
}
.stb-page-link.active { background: var(--stb-accent); color: var(--stb-primary); border-color: var(--stb-accent); }
.stb-page-link:hover  { border-color: var(--stb-accent); }

/* ────────────────────────────────────────────
   BUTTONS
──────────────────────────────────────────── */
.stb-pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  background: var(--stb-accent);
  color: var(--stb-primary);
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.stb-pub-btn:hover { background: var(--stb-accent-dk); color: var(--stb-primary); }

/* ────────────────────────────────────────────
   SINGLE POST
──────────────────────────────────────────── */
.stb-single-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  font-family: 'Barlow', sans-serif;
}
.stb-back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--stb-muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.15s;
}
.stb-back-link:hover { color: var(--stb-primary); }

.stb-single-cats { display: flex; gap: 6px; margin-bottom: 14px; }
.stb-single-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--stb-primary);
  line-height: 1.15;
  margin: 0 0 16px;
}
.stb-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--stb-muted);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--stb-border);
}
.stb-single-hero {
  border-radius: var(--stb-radius);
  overflow: hidden;
  margin-bottom: 32px;
}
.stb-single-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}
.stb-single-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--stb-text-2);
}
.stb-single-content h2,
.stb-single-content h3 {
  font-family: 'Barlow Condensed', sans-serif;
  color: var(--stb-primary);
}
.stb-single-content a { color: var(--stb-accent-dk); }
.stb-single-content img { max-width: 100%; border-radius: 8px; }
.stb-single-cta {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--stb-border);
}

/* ────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────── */
@media (max-width: 640px) {
  .stb-pub-grid.stb-layout-grid {
    grid-template-columns: 1fr;
  }
  .stb-pub-grid.stb-layout-list .stb-card {
    grid-template-columns: 1fr;
  }
  .stb-pub-grid.stb-layout-list .stb-card-img-wrap {
    height: 200px;
  }
  .stb-single-title { font-size: 1.8rem; }
  .stb-pub-toolbar { flex-direction: column; align-items: flex-start; }
  .stb-pub-search-form { max-width: 100%; width: 100%; }
}
