/**
 * PTA Knowledge Hub — Single Entry Styles
 *
 * Scoped under .ptk-single-wrap to prevent theme conflicts.
 */

.ptk-single-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Breadcrumb */
.ptk-single-wrap .ptk-single-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
}
.ptk-single-wrap .ptk-single-nav a {
    color: #2563eb;
    text-decoration: none;
}
.ptk-single-wrap .ptk-single-nav a:hover { text-decoration: underline; }
.ptk-single-wrap .ptk-single-nav .ptk-sep { color: #d1d5db; }

/* Category Badge */
.ptk-single-wrap .ptk-single-cat-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* Category badge colors */
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-howto    { background: #dbeafe; color: #1e40af; }
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-event    { background: #d1fae5; color: #065f46; }
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-faq      { background: #ede9fe; color: #5b21b6; }
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-resource  { background: #ffedd5; color: #9a3412; }
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-glossary  { background: #ccfbf1; color: #115e59; }
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-checklist { background: #dcfce7; color: #166534; }
.ptk-single-wrap .ptk-single-cat-badge.ptk-cat-policy    { background: #e2e8f0; color: #334155; }

/* Title */
.ptk-single-wrap .ptk-single-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 16px;
}

/* Meta */
.ptk-single-wrap .ptk-single-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Content */
.ptk-single-wrap .ptk-single-content {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
    max-width: 680px;
}
.ptk-single-wrap .ptk-single-content h2 {
    color: #111827;
    margin-top: 32px;
    font-size: 22px;
}
.ptk-single-wrap .ptk-single-content h3 {
    color: #111827;
    margin-top: 32px;
    font-size: 18px;
}
.ptk-single-wrap .ptk-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}
.ptk-single-wrap .ptk-single-content ul,
.ptk-single-wrap .ptk-single-content ol {
    margin-left: 24px;
}
.ptk-single-wrap .ptk-single-content li { margin-bottom: 6px; }

/* Tags */
.ptk-single-wrap .ptk-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 32px 0;
}
.ptk-single-wrap .ptk-single-tag {
    background: #f3f4f6;
    color: #4b5563;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
}

/* FAQ Copy Button */
.ptk-single-wrap .ptk-single-faq-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: background 0.15s;
}
.ptk-single-wrap .ptk-single-faq-copy:hover { background: #e5e7eb; }

/* Back Link */
.ptk-single-wrap .ptk-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 24px;
}
.ptk-single-wrap .ptk-back-link:hover { text-decoration: underline; }

/* Related Entries */
.ptk-single-wrap .ptk-related { margin-top: 48px; border-top: 1px solid #e5e7eb; padding-top: 32px; }
.ptk-single-wrap .ptk-related-title { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 16px; }
.ptk-single-wrap .ptk-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 600px) {
    .ptk-single-wrap .ptk-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .ptk-single-wrap .ptk-related-grid { grid-template-columns: repeat(3, 1fr); }
}
.ptk-single-wrap .ptk-related-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    text-decoration: none;
    transition: box-shadow 0.15s;
}
.ptk-single-wrap .ptk-related-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.ptk-single-wrap .ptk-related-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}
.ptk-single-wrap .ptk-related-card-excerpt {
    font-size: 14px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Focus Visible — Keyboard accessibility */
.ptk-single-wrap a:focus-visible,
.ptk-single-wrap button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.ptk-single-wrap .ptk-related-card:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ptk-single-wrap * { transition-duration: 0.01ms !important; }
}

/* Action Bar (holds print + FAQ copy buttons)
   On desktop, floats top-right of the title row for better discoverability.
   On mobile (< 600px) it stacks below the meta like before. */
.ptk-single-wrap .ptk-single-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
@media (min-width: 720px) {
    .ptk-single-wrap {
        position: relative;
    }
    .ptk-single-wrap .ptk-single-actions {
        position: absolute;
        top: 24px;
        right: 16px;
        margin-bottom: 0;
    }
}

/* Shared action button base — used by Print and FAQ Copy */
.ptk-single-wrap .ptk-print-btn,
.ptk-single-wrap .ptk-single-faq-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ptk-single-wrap .ptk-print-btn:hover,
.ptk-single-wrap .ptk-single-faq-copy:hover {
    background: #f9fafb;
    border-color: #c7d2fe;
    color: #2563eb;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08);
}
.ptk-single-wrap .ptk-print-btn:active,
.ptk-single-wrap .ptk-single-faq-copy:active {
    transform: translateY(1px);
    box-shadow: none;
}
.ptk-single-wrap .ptk-print-btn svg,
.ptk-single-wrap .ptk-single-faq-copy svg {
    opacity: 0.5;
    transition: opacity 0.15s;
}
.ptk-single-wrap .ptk-print-btn:hover svg,
.ptk-single-wrap .ptk-single-faq-copy:hover svg {
    opacity: 1;
}

/* ============================================
   Feedback Section — "Was This Helpful?"
   ============================================ */

.ptk-single-wrap .ptk-feedback {
    margin-top: 48px;
    padding: 28px 24px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    text-align: center;
}

.ptk-single-wrap .ptk-feedback-question {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px;
}

.ptk-single-wrap .ptk-feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.ptk-single-wrap .ptk-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 28px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Thumbs up hover */
.ptk-single-wrap .ptk-feedback-btn[data-helpful="1"]:hover {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.12);
    transform: translateY(-1px);
}

/* Thumbs down hover */
.ptk-single-wrap .ptk-feedback-btn[data-helpful="0"]:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.10);
    transform: translateY(-1px);
}

.ptk-single-wrap .ptk-feedback-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ptk-single-wrap .ptk-feedback-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ptk-single-wrap .ptk-feedback-btn svg {
    opacity: 0.4;
    transition: opacity 0.15s;
}
.ptk-single-wrap .ptk-feedback-btn:hover svg {
    opacity: 1;
}

.ptk-single-wrap .ptk-feedback-thanks {
    font-size: 15px;
    color: #059669;
    font-weight: 600;
    margin: 0;
}

.ptk-single-wrap .ptk-feedback-counts {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

@media (max-width: 480px) {
    .ptk-single-wrap .ptk-feedback-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .ptk-single-wrap .ptk-feedback-btn {
        justify-content: center;
        width: 100%;
    }
}

/* Role-restricted notice */
.ptk-single-wrap .ptk-role-restricted {
    text-align: center;
    max-width: 480px;
    margin: 60px auto;
    padding: 48px 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.ptk-single-wrap .ptk-role-restricted-icon { font-size: 48px; margin-bottom: 12px; }
.ptk-single-wrap .ptk-role-restricted h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}
.ptk-single-wrap .ptk-role-restricted p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Network sync banner (multisite) */
.ptk-single-wrap .ptk-network-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #1e40af;
}
.ptk-single-wrap .ptk-network-banner svg { flex-shrink: 0; }

/* Print-only footer (hidden on screen) */
.ptk-print-footer {
    display: none;
}

/* Print */
@media print {
    /* NUCLEAR: hide everything except .ptk-single-wrap first */
    body > *:not(.ptk-single-wrap):not(#page):not(.site):not(main):not(#content):not(.entry-content):not(article) {
        display: none !important;
    }

    /* Hide non-content plugin elements */
    .ptk-single-wrap .ptk-back-link,
    .ptk-single-wrap .ptk-single-nav,
    .ptk-single-wrap .ptk-single-actions,
    .ptk-single-wrap .ptk-single-faq-copy,
    .ptk-single-wrap .ptk-print-btn,
    .ptk-single-wrap .ptk-single-tags,
    .ptk-single-wrap .ptk-related,
    .ptk-single-wrap .ptk-feedback,
    .ptk-single-wrap .ptk-network-banner {
        display: none !important;
    }

    /* Aggressively hide ALL theme chrome — covers most WP themes */
    #wpadminbar,
    header, .site-header, #masthead, #site-header,
    nav, .site-nav, .main-navigation, .primary-navigation, #site-navigation,
    .navigation-top, .menu-toggle, .mobile-menu,
    footer, .site-footer, #colophon, .footer-wrap,
    .sidebar, #sidebar, #secondary, .widget-area,
    .comments-area, #comments,
    .post-navigation, .nav-links, .pagination,
    .breadcrumb, .breadcrumbs, .yoast-breadcrumb,
    .site-branding, .custom-logo-link,
    .fl-page-header, .fl-page-footer, .fl-page-nav,
    .uabb-header, .uabb-footer,
    .bb-header, .bb-footer,
    #cookie-notice, .cookie-bar,
    .screen-reader-text {
        display: none !important;
    }

    /* Clean layout for paper */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .ptk-single-wrap {
        max-width: 100%;
        padding: 0;
        margin: 0;
        font-size: 12pt;
    }

    .ptk-single-wrap .ptk-single-title {
        font-size: 22pt;
        margin-bottom: 8pt;
    }

    .ptk-single-wrap .ptk-single-cat-badge {
        border: 1px solid #999;
        background: none !important;
        color: #333 !important;
        font-size: 9pt;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .ptk-single-wrap .ptk-single-meta {
        font-size: 10pt;
        color: #666;
        margin-bottom: 16pt;
        border-bottom: 1px solid #ddd;
        padding-bottom: 8pt;
    }

    .ptk-single-wrap .ptk-single-content {
        max-width: 100%;
        font-size: 11pt;
        line-height: 1.6;
        color: #000;
    }

    .ptk-single-wrap .ptk-single-content img {
        max-width: 60%;
        break-inside: avoid;
    }

    .ptk-single-wrap .ptk-single-content h2,
    .ptk-single-wrap .ptk-single-content h3 {
        break-after: avoid;
        color: #000;
    }

    .ptk-single-wrap .ptk-single-content ul,
    .ptk-single-wrap .ptk-single-content ol {
        break-inside: avoid;
    }

    /* Show link URLs in print */
    .ptk-single-wrap .ptk-single-content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
        word-break: break-all;
    }

    /* Show the print-only footer */
    .ptk-print-footer {
        display: block !important;
        margin-top: 40pt;
        padding-top: 12pt;
        border-top: 1px solid #ccc;
        font-size: 9pt;
        color: #999;
        text-align: center;
    }

    /* Hide theme copyright text in print */
    .site-info,
    .footer-credits,
    .copyright,
    .site-footer,
    #colophon,
    .fl-page-footer-wrap,
    [class*="copyright"],
    [class*="footer-text"],
    [class*="site-info"] {
        display: none !important;
    }
}

/* Auto Table of Contents (v2.6.0; lighter chrome v2.7.0) */
html { scroll-behavior: smooth; }
.ptk-toc { border: 1px solid #e5e7eb; padding: 12px 16px; border-radius: 8px; margin: 24px 0; }
.ptk-toc summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #475569; list-style: none; }
.ptk-toc summary::-webkit-details-marker { display: none; }
.ptk-toc summary::before { content: "▸ "; display: inline-block; transition: transform 0.15s ease; color: #94a3b8; }
.ptk-toc[open] summary::before { transform: rotate(90deg); }
.ptk-toc[open] summary { margin-bottom: 8px; color: #1e293b; }
.ptk-toc ol { margin: 8px 0 0 24px; padding: 0; }
.ptk-toc li { margin: 4px 0; font-size: 14px; }
.ptk-toc a { color: #2563eb; text-decoration: none; }
.ptk-toc a:hover { text-decoration: underline; }

/* Suggest-a-topic CTA on single entries (v2.6.1; accent v2.7.0) */
.ptk-suggest-cta { margin: 32px 0 16px; padding: 16px 20px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; text-align: center; font-size: 14px; color: #075985; }
.ptk-suggest-cta a { color: #0369a1; font-weight: 600; text-decoration: none; }
.ptk-suggest-cta a:hover { text-decoration: underline; }

/* Suggest form (rendered via [ptk_suggest_form] shortcode) */
.ptk-suggest-form-wrap { max-width: 560px; margin: 32px auto; padding: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; }
.ptk-suggest-form-title { margin: 0 0 4px; font-size: 22px; }
.ptk-suggest-form-intro { margin: 0 0 16px; color: #6b7280; font-size: 14px; }
.ptk-suggest-form p { margin: 0 0 12px; }
.ptk-suggest-form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #374151; }
.ptk-suggest-form .ptk-optional { color: #9ca3af; font-weight: 400; }
.ptk-suggest-form input[type=text], .ptk-suggest-form input[type=email], .ptk-suggest-form textarea { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.ptk-suggest-form textarea { font-family: inherit; }
.ptk-suggest-submit { background: #2563eb; color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ptk-suggest-submit:disabled { opacity: .6; cursor: not-allowed; }
.ptk-suggest-status { margin-top: 8px; font-size: 13px; }
.ptk-suggest-error { color: #b91c1c; }
.ptk-suggest-thanks { color: #047857; font-weight: 600; }
.ptk-suggest-count { display: block; margin-top: 4px; font-size: 11px; color: #9ca3af; text-align: right; }
.ptk-suggest-count-warn { color: #b45309; font-weight: 600; }

/* "Copied!" confirmation on single-entry FAQ copy button (v2.8.0) */
.ptk-single-wrap .ptk-single-faq-copy .ptk-copied-icon { display: none; }
.ptk-single-wrap .ptk-single-faq-copy.ptk-copied {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}
.ptk-single-wrap .ptk-single-faq-copy.ptk-copied .ptk-copy-icon { display: none; }
.ptk-single-wrap .ptk-single-faq-copy.ptk-copied .ptk-copied-icon { display: inline-block; opacity: 1; }

/* Submit + filter press states + explicit transitions (v2.8.0) */
.ptk-single-wrap .ptk-print-btn,
.ptk-single-wrap .ptk-single-faq-copy {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ptk-single-wrap .ptk-feedback-btn {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
