/* ============================================
   Frankie's Thought Box
   Engagement-driven editorial design

   Psychology principles applied:
   - Curiosity gap: truncated descriptions tease content
   - Progressive disclosure: "Read post" CTA slides in on hover
   - Micro-interaction rewards: delightful hover transitions
   - Visual hierarchy: featured first card, bold titles
   - Reduced commitment anxiety: reading time badges
   - Pattern interrupt: first card breaks the grid
   ============================================ */

/* ---- Global overflow fix ---- */
html, body {
    overflow-x: hidden;
}

/* ---- Hero ---- */
.tb-hero {
    padding: 2.5rem 0 1.25rem;
    background: var(--bg-white);
    text-align: center;
    position: relative;
    overflow: visible;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

/* Subtle dot grid background — adds texture/depth */
.tb-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--border-color) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
    pointer-events: none;
    clip-path: inset(0);
}

.tb-hero .container {
    position: relative;
    z-index: 10;
}

.tb-hero-badge {
    display: inline-block;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.tb-hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.tb-hero-highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tb-hero-tagline {
    font-size: 1.125rem;
    color: #4b5563;
    margin-bottom: 1.25rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ---- Search ---- */
.tb-search-wrap {
    max-width: 440px;
    margin: 0 auto;
    position: relative;
}

.tb-search {
    display: flex;
}

.tb-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--bg-white);
    color: #111827;
    outline: none;
    transition: border-color 0.2s;
}

.tb-search input::placeholder {
    color: #9ca3af;
}

.tb-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tb-search button {
    padding: 0 1rem;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0 0.5rem 0.5rem 0;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.tb-search button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Search Results Dropdown */
.tb-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 420px;
    overflow-y: auto;
}

.tb-search-results.open {
    display: block;
}

.tb-sr-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.tb-sr-item:last-child {
    border-bottom: none;
}

.tb-sr-item:hover {
    background: var(--bg-muted);
}

.tb-sr-img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.tb-sr-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tb-sr-text {
    flex: 1;
    min-width: 0;
}

.tb-sr-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-sr-meta {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}

.tb-sr-empty {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ---- Listing ---- */
.tb-listing {
    padding: 1.25rem 0 4rem;
    background: var(--bg-gray);
    min-height: 50vh;
}

/* ---- Tags Bar ---- */
/* ---- Word Cloud ---- */
.tb-cloud-wrap {
    position: relative;
    height: 100px;
    margin-bottom: 1rem;
    overflow: hidden;
    cursor: grab;
}
.tb-cloud-wrap.is-dragging { cursor: grabbing; }
.tb-cloud {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}
.tb-cloud-tag {
    position: absolute;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.3s, opacity 0.3s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 8px rgba(255,255,255,0.9);
}
.tb-cloud-tag:hover {
    color: var(--primary-color) !important;
    opacity: 1 !important;
    cursor: pointer;
}
.tb-cloud-tag.active {
    color: var(--primary-color) !important;
    opacity: 1 !important;
}

/* ---- Filter Info ---- */
.tb-filter-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: #374151;
    font-size: 0.9375rem;
}

.tb-clear-filter {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.tb-clear-filter:hover {
    text-decoration: underline;
}

/* ============================================
   POST CARDS — Engagement-Driven Design
   ============================================ */

.tb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tb-grid-related {
    margin-bottom: 0;
}

/* ---- Base Card ---- */
.tb-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Scroll-in animation start state */
    opacity: 0;
    transform: translateY(16px);
    /* Hover transitions */
    transition: transform 0.3s ease, box-shadow 0.35s ease, border-color 0.3s ease;
}

.tb-card.tb-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease, border-color 0.3s ease;
}

/* Hover: lift + glow + border accent */
.tb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.tb-card.tb-visible:hover {
    transform: translateY(-4px);
}

/* Top gradient accent for cards without images */
.tb-card:not(:has(.tb-card-image))::before,
.tb-card-no-image::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Post images */
.tb-card-image {
    height: 200px;
    overflow: hidden;
    background-color: var(--bg-gray);
}

.tb-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Card Body ---- */
.tb-card-body {
    padding: 1.375rem 1.5rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tb-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tb-card-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.tb-card-dot {
    font-size: 0.5rem;
}

/* Reading time badge — reduces commitment anxiety */
.tb-reading-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.07);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Title — bold, high contrast, the primary curiosity trigger */
.tb-card-title {
    font-size: 1.1875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.tb-card:hover .tb-card-title {
    color: var(--primary-color);
}

/* Description — truncated to create curiosity gap */
.tb-card-desc {
    font-size: 0.9375rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Card Footer ---- */
.tb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.tb-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tb-card-tag {
    font-size: 0.6875rem;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* "Read post" CTA — progressive disclosure */
.tb-card-cta {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tb-card-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.tb-card:hover .tb-card-cta {
    opacity: 1;
    transform: translateX(0);
}

.tb-card:hover .tb-card-arrow {
    transform: translateX(3px);
}

/* ============================================
   FEATURED FIRST CARD — Pattern Interrupt
   Breaks the scanning pattern, draws the eye
   ============================================ */

.tb-card-featured {
    grid-column: 1 / -1;
    flex-direction: row;
    border-width: 2px;
}

.tb-card-featured:not(:has(.tb-card-image))::before {
    display: none;
}

/* Side accent bar for featured card */
.tb-card-featured::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 0.75rem 0 0 0.75rem;
}

.tb-card-featured .tb-card-image {
    width: 45%;
    min-height: 260px;
    height: auto;
    flex-shrink: 0;
}

.tb-card-featured .tb-card-body {
    padding: 2rem;
}

.tb-card-featured .tb-card-title {
    font-size: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.tb-card-featured .tb-card-desc {
    font-size: 1rem;
    -webkit-line-clamp: 3;
    line-height: 1.65;
}

.tb-card-featured .tb-reading-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

/* Featured card CTA is always visible */
.tb-card-featured .tb-card-cta {
    opacity: 0.7;
    transform: translateX(0);
}

.tb-card-featured:hover .tb-card-cta {
    opacity: 1;
}

/* ---- Pagination ---- */
.tb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.tb-page-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    background: var(--bg-white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.tb-page-btn:hover {
    background: var(--primary-color);
    color: white;
}

.tb-page-info {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ---- Empty State ---- */
.tb-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #6b7280;
}

.tb-empty h1 {
    font-size: 2rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

.tb-empty .btn-primary {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* ============================================
   SINGLE POST
   ============================================ */

/* ---- Reading Progress Bar ---- */
.tb-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    z-index: 10000;
    transition: width 0.1s linear;
}

/* ---- Breadcrumb ---- */
.tb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-bottom: 2.5rem;
    padding-top: 6rem;
}

.tb-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.tb-breadcrumb a:hover {
    color: var(--primary-color);
}

.tb-breadcrumb span:last-child {
    color: #111827;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

/* ---- Post Header ---- */
.tb-post-header {
    max-width: 720px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.tb-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.tb-post-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.tb-post-subtitle {
    font-size: 1.1875rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.tb-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* ---- Post Hero Image ---- */
.tb-post-hero-image {
    max-width: 780px;
    margin: 0 auto 2.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tb-post-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- Post Content (Reading-Optimized Typography) ---- */
.tb-post-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #1f2937;
    overflow-wrap: break-word;
    word-break: break-word;
}

.tb-post-content h1,
.tb-post-content h2,
.tb-post-content h3,
.tb-post-content h4 {
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.tb-post-content h1 {
    font-size: 2rem;
    margin: 2.5rem 0 1rem;
    letter-spacing: -0.02em;
}

.tb-post-content h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 0.875rem;
    letter-spacing: -0.01em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tb-post-content h3 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
}

.tb-post-content h4 {
    font-size: 1.0625rem;
    margin: 1.75rem 0 0.5rem;
}

.tb-post-content p {
    margin-bottom: 1.375rem;
}

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

.tb-post-content a:hover {
    color: var(--primary-dark);
    text-decoration-thickness: 2px;
}

.tb-post-content strong {
    font-weight: 600;
    color: #111827;
}

.tb-post-content ul,
.tb-post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.375rem;
}

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

.tb-post-content li::marker {
    color: var(--primary-color);
}

.tb-post-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.75rem 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(16, 185, 129, 0.03));
    border-radius: 0 0.75rem 0.75rem 0;
    color: #374151;
    font-style: italic;
}

.tb-post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Inline code — pink tint for visibility */
.tb-post-content code {
    background: #f3f4f6;
    padding: 0.175rem 0.45rem;
    border-radius: 0.3rem;
    font-size: 0.85em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #be185d;
    border: 1px solid #e5e7eb;
}

/* Code blocks — dark with subtle border */
.tb-post-content pre {
    background: #0f172a;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.75rem 0;
    overflow-x: auto;
    border: 1px solid #1e293b;
}

.tb-post-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.875rem;
    color: #e2e8f0;
    line-height: 1.7;
}

.tb-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.75rem 0;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tb-post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2.5rem 0;
}

.tb-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.9375rem;
}

.tb-post-content th,
.tb-post-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
    color: #1f2937;
}

.tb-post-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #111827;
}

.tb-post-content tr:nth-child(even) td {
    background: #fafbfc;
}

/* ---- Post Footer ---- */
.tb-post-footer {
    max-width: 720px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ---- Share Buttons ---- */
.tb-share-blurb {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-white);
}

.tb-share-blurb-text {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
    user-select: all;
}

.tb-share-blurb-copy {
    padding: 10px 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.tb-share-blurb-copy:hover {
    background: var(--primary-color-dark, #1d4ed8);
}

.tb-share-blurb-copy.copied {
    background: #10b981;
}

.tb-share {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 2rem;
}

.tb-share-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    margin-right: 0.25rem;
}

.tb-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-white);
    color: #6b7280;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    font-size: 0;
}

.tb-share-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* ---- Reactions ---- */
.tb-reactions {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    margin: 1.5rem 0;
}
.tb-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tb-reaction-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}
.tb-reaction-btn.active {
    background: #eff6ff;
    border-color: var(--primary-color);
}
.tb-reaction-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.tb-reaction-btn.active .tb-reaction-count {
    color: var(--primary-color);
}
.tb-reaction-emoji {
    font-size: 1.125rem;
    line-height: 1;
}
@keyframes tb-reaction-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.tb-reaction-btn.pop .tb-reaction-emoji {
    animation: tb-reaction-pop 0.3s ease;
}

/* ---- Author Box ---- */
.tb-author-box {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tb-author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.tb-author-box strong {
    display: block;
    font-size: 1rem;
    color: #111827;
    margin-bottom: 0.25rem;
}

.tb-author-box p {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

/* ---- Related Posts ---- */
.tb-related {
    max-width: 720px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tb-related h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: #111827;
}

/* ---- CTA Section — Dark with glow accents ---- */
.tb-cta-services {
    max-width: 720px;
    margin: 3rem auto 4rem;
    text-align: center;
    padding: 3rem 2rem;
    background: #111827;
    border-radius: 1rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.tb-cta-services::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3), transparent 70%);
    pointer-events: none;
}

.tb-cta-services::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2), transparent 70%);
    pointer-events: none;
}

.tb-cta-services h2 {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.tb-cta-services p {
    color: #9ca3af;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.tb-cta-services .btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.25s;
    position: relative;
    z-index: 1;
}

.tb-cta-services .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

/* ---- Post Section ---- */
.tb-post-section {
    padding-bottom: 0;
    background: var(--bg-white);
    overflow-x: hidden;
}

/* ---- Active Nav Link ---- */
.nav-active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* ============================================
   SUBSCRIBE FORMS
   ============================================ */

/* ---- Shared Form Styles ---- */
.tb-subscribe-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    flex-wrap: wrap;
}

.tb-subscribe-form input[type="text"] {
    flex: 0 0 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-white);
    color: #111827;
    outline: none;
    transition: border-color 0.2s;
}

.tb-subscribe-form input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tb-subscribe-form input[type="email"] {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-white);
    color: #111827;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
    animation: tb-glow-pulse 3s ease-in-out infinite;
}

@keyframes tb-glow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
    50% { box-shadow: 0 0 18px 5px rgba(37, 99, 235, 0.45); }
}

.tb-subscribe-form input[type="email"]:focus {
    animation: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tb-subscribe-form input[type="email"]::placeholder {
    color: #9ca3af;
}

.tb-subscribe-form button {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    font-family: inherit;
}

.tb-subscribe-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tb-subscribe-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tb-subscribe-msg {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.tb-subscribe-msg.success { color: #059669; }
.tb-subscribe-msg.error { color: #dc2626; }
.tb-subscribe-msg.info { color: var(--primary-color); }

/* ---- 1. Inline Card in Grid ---- */
.tb-subscribe-inline {
    border: 2px dashed var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(16, 185, 129, 0.04)) !important;
    cursor: default;
    opacity: 1 !important;
    transform: none !important;
}

.tb-subscribe-inline:hover {
    transform: none !important;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.tb-subscribe-inline-body {
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.tb-subscribe-inline-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tb-subscribe-inline-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.375rem;
}

.tb-subscribe-inline-body p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tb-subscribe-inline .tb-subscribe-form {
    width: 100%;
    max-width: 320px;
}

/* ---- 2. After Post Content ---- */
.tb-subscribe-post {
    max-width: 720px;
    margin: 3rem auto 0;
}

.tb-subscribe-post-inner {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 0.75rem;
    text-align: center;
}

.tb-subscribe-post-inner h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.375rem;
}

.tb-subscribe-post-inner p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.tb-subscribe-post .tb-subscribe-form {
    margin: 0 auto;
}

/* ---- 3. Sticky Bottom Bar ---- */
.tb-subscribe-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #111827;
    color: white;
    padding: 0.75rem 1rem;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.tb-subscribe-sticky.visible {
    transform: translateY(0);
}

.tb-subscribe-sticky-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tb-subscribe-sticky-inner > span {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.tb-subscribe-form-sticky input[type="email"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.tb-subscribe-form-sticky input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tb-subscribe-form-sticky input[type="email"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.tb-subscribe-sticky .tb-subscribe-msg {
    margin-top: 0;
}

.tb-subscribe-sticky-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.tb-subscribe-sticky-close:hover {
    color: white;
}

/* ---- 4. Footer Subscribe Row ---- */
.tb-subscribe-footer {
    background: var(--bg-gray);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
}

.tb-subscribe-footer-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tb-subscribe-footer-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.tb-subscribe-form-footer {
    max-width: 340px;
}

/* ============================================
   COMMENTS
   ============================================ */

.tb-comments {
    max-width: 720px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tb-comments h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #111827;
}

.tb-comments-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9375rem;
}

/* ---- Comment List ---- */
.tb-comment {
    display: flex;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.tb-comment:last-child {
    border-bottom: none;
}

.tb-comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.tb-comment-content {
    flex: 1;
    min-width: 0;
}

.tb-comment-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.tb-comment-header strong {
    font-size: 0.875rem;
    color: #111827;
}

.tb-comment-header time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.tb-comment-content p {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
    word-wrap: break-word;
}

/* ---- Comment Form ---- */
.tb-comment-form {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-gray);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.tb-comment-form h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.tb-comment-field {
    margin-bottom: 0.75rem;
}

.tb-comment-field input,
.tb-comment-field textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-white);
    color: #111827;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tb-comment-field input:focus,
.tb-comment-field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.tb-comment-field textarea {
    resize: vertical;
    min-height: 80px;
}

.tb-comment-submit {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.tb-comment-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tb-comment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tb-comment-msg {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.tb-comment-msg.success { color: #059669; }
.tb-comment-msg.error { color: #dc2626; }

/* Comment subscribe nudge */
.tb-comment-subscribe {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(37, 99, 235, 0.04);
    border: 1px dashed rgba(37, 99, 235, 0.2);
    border-radius: 0.5rem;
    text-align: center;
}

.tb-comment-subscribe p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--text-gray);
}

.tb-subscribe-form-comment {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    max-width: 380px;
    margin: 0 auto;
}

.tb-subscribe-form-comment input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-family: inherit;
}

.tb-subscribe-form-comment button {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
    .tb-hero {
        padding: 2rem 0 1rem;
    }

    .tb-hero-title {
        font-size: 2.25rem;
    }

    .tb-post-title {
        font-size: 2.25rem;
    }

    .tb-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    /* Featured card goes vertical on tablet */
    .tb-card-featured {
        flex-direction: column;
    }

    .tb-card-featured .tb-card-image {
        width: 100%;
        min-height: 200px;
    }

    .tb-card-featured .tb-card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tb-hero {
        padding: 1.75rem 0 0.75rem;
    }

    .tb-hero-title {
        font-size: 1.875rem;
    }

    .tb-post-title {
        font-size: 1.875rem;
    }

    .tb-post-content {
        font-size: 1rem;
        line-height: 1.8;
    }

    .tb-breadcrumb {
        padding-top: 5rem;
    }

    .tb-cloud-wrap {
        height: 100px;
    }

    .tb-author-box {
        flex-direction: column;
        text-align: center;
    }

    .tb-share {
        flex-wrap: wrap;
    }

    .tb-filter-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Always show CTA on mobile (no hover) */
    .tb-card-cta {
        opacity: 0.7;
        transform: translateX(0);
    }

    .tb-card-featured {
        flex-direction: column;
    }

    .tb-card-featured .tb-card-image {
        width: 100%;
        min-height: 180px;
        height: 200px;
    }

    .tb-card-featured .tb-card-body {
        padding: 1.25rem;
    }

    .tb-card-featured .tb-card-title {
        font-size: 1.25rem;
    }

    .tb-card-featured::after {
        display: none;
    }

    .tb-subscribe-form {
        flex-direction: column;
        max-width: 100%;
    }

    .tb-subscribe-sticky-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .tb-subscribe-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .tb-subscribe-form-footer {
        max-width: 100%;
        width: 100%;
    }

    .tb-comment-header {
        flex-direction: column;
        gap: 0.125rem;
    }
}

@media (max-width: 480px) {
    .tb-hero-title {
        font-size: 1.625rem;
    }

    .tb-hero-tagline {
        font-size: 1rem;
    }

    .tb-post-title {
        font-size: 1.5rem;
    }

    .tb-grid {
        grid-template-columns: 1fr;
    }

    .tb-card-image {
        height: 160px;
    }

    .tb-post-content pre {
        border-radius: 0;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding: 1rem 1.5rem;
    }

    .tb-cta-services {
        padding: 2rem 1.5rem;
        border-radius: 0.75rem;
    }
}
