/* ==========================================================================
   PDFToolKit — Internal Linking Components
   Loaded only on singular post/page views (see inc/internal-linking.php).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Auto-linked tool keywords inside blog body
   -------------------------------------------------------------------------- */

.auto-tool-link {
    color: #E5322D;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.auto-tool-link:hover,
.auto-tool-link:focus {
    color: #c92622;
    text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------------------
   2. "Try this Tool Free" CTA box (after blog content)
   -------------------------------------------------------------------------- */

.tool-cta-box {
    margin: 32px 0;
    padding: 24px;
    background: linear-gradient(135deg, var(--cta-from, #E5322D), var(--cta-to, #FF6B6B));
    border-radius: 12px;
    color: white;
    text-align: center;
}

.tool-cta-box__title {
    margin: 0 0 8px;
    color: white;
    font-size: 1.5rem;
}

.tool-cta-box__desc {
    margin: 0 0 16px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
}

.tool-cta-box__btn {
    display: inline-block;
    padding: 12px 32px;
    background: white;
    color: var(--cta-text, #E5322D);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tool-cta-box__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   3. "Try Our PDF Tools" grid (4 tools after CTA on blog posts)
   -------------------------------------------------------------------------- */

.related-tools--in-blog {
    margin: 32px 0;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
}

.related-tools-blog__title {
    margin: 0 0 16px;
    font-size: 1.5rem;
    color: #1a1a2e;
}

.related-tools-blog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.related-tools-blog__card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: #1a1a2e;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.related-tools-blog__card:hover {
    transform: translateY(-2px);
    border-color: var(--card-color, #E5322D);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.related-tools-blog__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.related-tools-blog__icon img {
    filter: brightness(0) invert(1);
}

.related-tools-blog__name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.related-tools-blog__desc {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   4. "Related Articles" section (on tool pages)
   -------------------------------------------------------------------------- */

.related-articles {
    padding: 40px 0;
    background: #f9fafb;
}

.related-articles__title {
    font-size: 1.75rem;
    margin: 0 0 24px;
    text-align: center;
    color: #1a1a2e;
}

.related-articles__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.related-article-card {
    display: block;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.related-article-card__image img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.related-article-card__body {
    padding: 16px;
}

.related-article-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
    color: #1a1a2e;
}

.related-article-card__excerpt {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.4;
}

.related-article-card__date {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* --------------------------------------------------------------------------
   5. Mobile adjustments
   -------------------------------------------------------------------------- */

@media (max-width: 639px) {
    .tool-cta-box {
        padding: 20px;
    }

    .tool-cta-box__title {
        font-size: 1.25rem;
    }

    .related-tools--in-blog {
        padding: 16px;
    }

    .related-tools-blog__grid,
    .related-articles__grid {
        grid-template-columns: 1fr;
    }

    .related-articles {
        padding: 32px 0;
    }

    .related-articles__title {
        font-size: 1.5rem;
    }
}
