/**
 * CodeScriptum Blog – Additional Theme Styles
 * Supplements main style.css with extra components
 *
 * @package CodeScriptum_Blog
 */

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */
#readingProgress {
    background: linear-gradient(90deg, var(--primary) 0%, var(--neon-blue) 50%, var(--secondary) 100%);
    box-shadow: 0 0 10px rgba(124,58,237,0.5);
}

/* ==========================================================================
   COPY CODE BUTTON HOVER
   ========================================================================== */
.copy-code-btn:hover {
    background: rgba(255,255,255,0.2) !important;
    color: var(--white) !important;
}

/* ==========================================================================
   POST CONTENT ENHANCEMENTS
   ========================================================================== */

/* Smooth image loading */
.post-card__image img {
    opacity: 0;
    transition: opacity 0.4s ease;
    object-position: left;
}

.post-card__image img[src] {
    opacity: 1;
}

/* Highlighted text in posts */
.post-content__body mark {
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(6,182,212,0.1));
    padding: 2px 6px;
    border-radius: 4px;
}

/* Horizontal rule */
.post-content__body hr {
    border: none;
    height: 1px;
    background: var(--light-300);
    margin: 40px 0;
}

/* Figure & figcaption */
.post-content__body figure {
    margin: 32px 0;
}

.post-content__body figcaption {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* ==========================================================================
   WORDPRESS-SPECIFIC CLASSES
   ========================================================================== */

/* Alignments */
.alignleft {
    float: left;
    margin: 0 24px 16px 0;
}

.alignright {
    float: right;
    margin: 0 0 16px 24px;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    margin-left: -5%;
    margin-right: -5%;
    width: 110%;
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.gallery-item {
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.gallery-item img {
    width: 100%;
    height: auto;
    transition: transform var(--ease);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Caption */
.wp-caption {
    max-width: 100%;
    margin: 24px 0;
}

.wp-caption-text {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==========================================================================
   ADMIN BAR OFFSET
   ========================================================================== */
.admin-bar .header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .header {
        top: 46px;
    }
}

/* ==========================================================================
   CATEGORY BADGE COLORS (auto via nth-child for variety)
   ========================================================================== */
.post-card:nth-child(4n+1) .post-card__category { background: rgba(124,58,237,0.9); }
.post-card:nth-child(4n+2) .post-card__category { background: rgba(6,182,212,0.9); }
.post-card:nth-child(4n+3) .post-card__category { background: rgba(59,130,246,0.9); }
.post-card:nth-child(4n+4) .post-card__category { background: rgba(236,72,153,0.9); }

/* ==========================================================================
   RELATED SERVICES — ONSITE SEO LINKS
   ========================================================================== */
.related-services {
    margin: 40px 0;
    padding: 32px;
    background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(6,182,212,0.04));
    border: 1px solid var(--light-300);
    border-radius: var(--radius);
}

.related-services__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-services__title i {
    color: var(--primary);
    font-size: 0.95rem;
}

.related-services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-services__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--light-200);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    text-decoration: none;
}

.related-services__card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(124,58,237,0.1);
    transform: translateY(-2px);
}

.related-services__card i {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.related-services__card strong {
    font-size: 0.92rem;
    color: var(--text);
}

.related-services__card span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .related-services__grid {
        grid-template-columns: 1fr;
    }
    .related-services {
        padding: 24px 20px;
    }
}

/* ==========================================================================
   ONSITE LINKS STYLING (auto-inserted by onsite-links.php)
   ========================================================================== */
.post-content__body a[href*="codescriptum.pl"] {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(124,58,237,0.3);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.post-content__body a[href*="codescriptum.pl"]:hover {
    color: var(--primary-dark);
    text-decoration-color: var(--primary);
}

.post-content__body h2 a[href*="codescriptum.pl"] {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 3px;
}

.post-content__body h2 a[href*="codescriptum.pl"]:hover {
    color: var(--primary);
}

/* ==========================================================================
   SIDEBAR WIDGET SPACING FIX
   ========================================================================== */
.sidebar__widget:last-child {
    margin-bottom: 0;
    margin-top:24px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .header,
    .footer,
    .sidebar,
    .cta-inline,
    .cta-floating,
    .cta-between,
    .sidebar-cta,
    .post-navigation,
    .related-posts,
    .blog-hero,
    .toc {
        display: none !important;
    }

    .blog-layout {
        grid-template-columns: 1fr !important;
    }

    .post-content__body {
        font-size: 12pt;
        line-height: 1.6;
    }

    a[href]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }
}

/* ==========================================================================
   ACCESSIBILITY FOCUS STYLES
   ========================================================================== */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    z-index: 10000;
    transition: top 0.3s;
    font-weight: 600;
}

.skip-to-content:focus {
    top: 12px;
    color: var(--white);
}




.footer__brand-name
{
	display:none;
}

/* ==========================================================================
   NEWSLETTER AJAX FORM
   ========================================================================== */
.newsletter-ajax-form {
    position: relative;
}

.newsletter-ajax-form__msg {
    width: 100%;
    margin-top: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
    animation: nlMsgFadeIn 0.3s ease;
}

.newsletter-ajax-form__msg--success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.newsletter-ajax-form__msg--error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.newsletter-ajax-form__loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.newsletter-ajax-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@keyframes nlMsgFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}