/*
 * 3 Patti Gold — assets/css/main.css
 * Supplemental styles loaded after style.css.
 * Adds print styles, pagination, scroll margin,
 * and any additional overrides.
 */

/* ============================================================
   SCROLL MARGIN FOR ANCHOR TARGETS
   (so sticky header doesn't obscure anchored sections)
   ============================================================ */
[id] {
    scroll-margin-top: 80px;
}

/* ============================================================
   SMOOTH PROGRESS INDICATOR (top loading bar)
   ============================================================ */
.page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--color-green);
    z-index: 10000;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ============================================================
   TABLE — HOVER STATE
   ============================================================ */
.app-info-table tr:hover {
    background-color: #f9fffe;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--color-green);
    color: #000;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 14px rgba(57,255,20,0.35);
    text-decoration: none;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #2ecc40;
    opacity: 1;
    box-shadow: 0 6px 20px rgba(57,255,20,0.5);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--color-hr);
    border-radius: 6px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--color-green);
    color: #000;
    border-color: var(--color-green);
}

/* ============================================================
   POST TAGS
   ============================================================ */
.post-tags a {
    color: var(--color-green);
    text-decoration: none;
    margin-right: 4px;
}

.post-tags a:hover {
    text-decoration: underline;
}

/* ============================================================
   SCREEN READER ONLY
   ============================================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ============================================================
   WYSIWYG CONTENT LINKS (front page intro/conclusion)
   ============================================================ */
.intro-description a,
.single-post-wrapper .post-content a,
.page-content a {
    color: var(--color-green);
    text-decoration: underline;
}

/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection {
    background: rgba(57, 255, 20, 0.25);
    color: var(--color-text);
}

::-moz-selection {
    background: rgba(57, 255, 20, 0.25);
    color: var(--color-text);
}

/* ============================================================
   CUSTOM SCROLLBAR (Webkit)
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f4f8;
}

::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* ============================================================
   FOCUS VISIBLE STYLES (accessibility)
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--color-green);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    #site-header,
    #site-footer,
    .hamburger-btn,
    .mobile-nav,
    .toc-box,
    .download-btn,
    .back-to-top,
    .page-progress-bar {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt !important;
    }

    .content-wrapper,
    .page-content-wrapper,
    .single-post-wrapper {
        box-shadow: none !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .section-bar {
        background: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

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

/* ============================================================
   EXTRA RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 400px) {
    .header-inner .site-logo {
        font-size: 1.2rem;
    }

    .footer-nav {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .footer-divider {
        width: 95%;
    }

    .toc-box {
        padding: 14px;
    }

    .back-to-top {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        right: 14px;
        bottom: 18px;
    }
}
