/* ==========================================================================
   PTI COMPONENT LIBRARY - Content Styling
   Version: 1.0.0

   Extends the base pti-theme styles with standardized component classes.
   All classes use the `pti-` prefix for relational find-and-replace.

   Components:
   1. pti-quick-pick     — Top-pick comparison table
   2. pti-pros-cons      — Two-column pros/cons box
   3. pti-spec-table     — Per-product 2-column spec table
   4. pti-comparison     — Full product comparison table
   5. pti-faq            — FAQ section wrapper
   6. pti-buy-links      — Where-to-buy retailer table
   7. pti-disclosure     — Affiliate disclosure box
   8. pti-related        — Related articles section
   ========================================================================== */

/* ==========================================================================
   1. QUICK-PICK TABLE
   Inherits base table styles from theme. Adds striped rows via class.
   ========================================================================== */

.pti-quick-pick table {
    min-width: 600px;
}

.pti-quick-pick tbody tr:nth-child(even) td {
    background: var(--pti-gray-50);
}

.pti-quick-pick td:first-child {
    font-weight: 600;
    white-space: nowrap;
    color: var(--pti-gray-900);
}

/* Award badge in first column */
.pti-quick-pick td:first-child strong {
    color: var(--pti-accent);
}

/* ==========================================================================
   2. PROS / CONS BOX
   Two-column layout with green/red accents. Stacks on mobile.
   ========================================================================== */

.pti-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    border-radius: var(--pti-radius-lg);
    overflow: hidden;
    box-shadow: var(--pti-shadow);
}

@media (max-width: 600px) {
    .pti-pros-cons {
        grid-template-columns: 1fr;
    }
}

.pti-pros,
.pti-cons {
    padding: 1.25rem;
}

.pti-pros {
    background: #f0fdf4;
    border-top: 3px solid var(--pti-success);
}

.pti-cons {
    background: #fef2f2;
    border-top: 3px solid #ef4444;
}

.pti-pros h4,
.pti-cons h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem 0;
    padding: 0;
}

.pti-pros h4 {
    color: #16a34a;
}

.pti-cons h4 {
    color: #dc2626;
}

.pti-pros ul,
.pti-cons ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pti-pros li,
.pti-cons li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.pti-pros li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--pti-success);
    font-weight: 700;
}

.pti-cons li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: 700;
}

/* ==========================================================================
   3. SPEC TABLE (Per-Product)
   Compact 2-column table for individual product specs.
   ========================================================================== */

.pti-spec-table {
    margin: 1rem 0 1.5rem !important;
}

.pti-spec-table table {
    max-width: 400px;
    font-size: 0.85rem !important;
}

.pti-spec-table td:first-child {
    font-weight: 600;
    color: var(--pti-gray-700);
    white-space: nowrap;
    width: 40%;
}

.pti-spec-table td:last-child {
    color: var(--pti-gray-900);
}

/* ==========================================================================
   4. COMPARISON TABLE (Full-Width)
   Extended styling for multi-product comparison.
   ========================================================================== */

.pti-comparison table {
    min-width: 700px;
}

.pti-comparison td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.pti-comparison + p em {
    font-size: 0.8rem;
    color: var(--pti-gray-500);
}

/* ==========================================================================
   5. FAQ SECTION
   Styled accordion-like FAQ with visual separation.
   ========================================================================== */

.pti-faq {
    margin: 2rem 0;
    border: 1px solid var(--pti-gray-200);
    border-radius: var(--pti-radius-lg);
    overflow: hidden;
}

.pti-faq h2 {
    background: var(--pti-gray-50);
    margin: 0 !important;
    padding: 1.25rem 1.5rem !important;
    border-top: none !important;
    border-bottom: 1px solid var(--pti-gray-200);
    font-size: 1.25rem !important;
}

.pti-faq h3 {
    margin: 0 !important;
    padding: 1rem 1.5rem;
    font-size: 1rem !important;
    cursor: default;
    border-top: 1px solid var(--pti-gray-200);
    background: var(--pti-white);
    color: var(--pti-gray-900);
}

.pti-faq h3:first-of-type {
    border-top: none;
}

.pti-faq p {
    padding: 0 1.5rem;
    margin: 0.5rem 0 1rem !important;
    font-size: 0.95rem;
    color: var(--pti-gray-700);
    line-height: 1.7;
}

.pti-faq a {
    color: var(--pti-accent);
    font-weight: 500;
}

/* ==========================================================================
   6. WHERE-TO-BUY TABLE
   Retailer comparison with buy buttons.
   ========================================================================== */

.pti-buy-links {
    margin: 1rem 0 1.5rem !important;
}

.pti-buy-links table {
    max-width: 500px;
}

.pti-buy-links td:first-child {
    font-weight: 600;
    width: 30%;
}

/* Style all retailer affiliate links as buttons */
.pti-buy-links a[href*="amazon.com"],
.pti-buy-links a[href*="tag="],
.pti-buy-links a[href*="homedepot.com"],
.pti-buy-links a[href*="lowes.com"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pti-accent);
    color: var(--pti-white) !important;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: var(--pti-radius);
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.15s ease;
    min-height: 36px;
}

.pti-buy-links a[href*="amazon.com"]:hover,
.pti-buy-links a[href*="tag="]:hover,
.pti-buy-links a[href*="homedepot.com"]:hover,
.pti-buy-links a[href*="lowes.com"]:hover {
    background: var(--pti-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--pti-shadow);
}

/* ==========================================================================
   7. AFFILIATE DISCLOSURE
   Subtle, trust-building disclosure box at bottom of post.
   ========================================================================== */

.pti-disclosure {
    margin: 2.5rem 0 1rem;
    padding: 1rem 1.25rem;
    background: var(--pti-gray-50);
    border: 1px solid var(--pti-gray-200);
    border-radius: var(--pti-radius);
    font-size: 0.85rem;
    color: var(--pti-gray-600);
    line-height: 1.6;
}

.pti-disclosure p {
    margin: 0 !important;
}

/* ==========================================================================
   8. RELATED ARTICLES
   Internal links section near bottom of post.
   ========================================================================== */

.pti-related {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--pti-gray-50);
    border-radius: var(--pti-radius-lg);
    border: 1px solid var(--pti-gray-200);
}

.pti-related h3 {
    font-size: 1rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pti-gray-700);
    margin: 0 0 0.75rem 0 !important;
}

.pti-related ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pti-related li {
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
}

.pti-related li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--pti-accent);
    font-weight: 600;
}

.pti-related a {
    color: var(--pti-gray-900);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.pti-related a:hover {
    color: var(--pti-accent);
}

/* ==========================================================================
   UTILITY: Home Depot + Lowe's affiliate link buttons
   Extends base theme which only targets amazon.com/tag= links.
   ========================================================================== */

.entry-content table a[href*="homedepot.com"],
.entry-content table a[href*="lowes.com"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pti-accent);
    color: var(--pti-white) !important;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: var(--pti-radius);
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.15s ease;
    min-height: 36px;
}

.entry-content table a[href*="homedepot.com"]:hover,
.entry-content table a[href*="lowes.com"]:hover {
    background: var(--pti-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--pti-shadow);
}

/* Standalone HD/Lowe's CTA buttons */
.entry-content > p > a[href*="homedepot.com"]:only-child,
.entry-content > p > a[href*="lowes.com"]:only-child {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--pti-accent);
    color: var(--pti-white) !important;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--pti-radius);
    text-decoration: none !important;
    transition: all 0.15s ease;
    margin: 1rem 0;
}

.entry-content > p > a[href*="homedepot.com"]:only-child::after,
.entry-content > p > a[href*="lowes.com"]:only-child::after {
    content: '→';
    font-size: 1.1rem;
}

.entry-content > p > a[href*="homedepot.com"]:only-child:hover,
.entry-content > p > a[href*="lowes.com"]:only-child:hover {
    background: var(--pti-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--pti-shadow-md);
}

/* Inline HD/Lowe's links in paragraphs */
.entry-content p a[href*="homedepot.com"],
.entry-content li a[href*="homedepot.com"],
.entry-content p a[href*="lowes.com"],
.entry-content li a[href*="lowes.com"] {
    color: var(--pti-accent);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(255, 107, 53, 0.3);
    text-underline-offset: 2px;
}

/* ==========================================================================
   DARK THEME OVERRIDES (pti-theme redesign compatibility)
   Light-theme vars (--pti-gray-*) need dark equivalents here.
   ========================================================================== */

.pti-quick-pick tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.04);
}

.pti-quick-pick td:first-child {
    color: #E8E8EC;
}

.pti-quick-pick td:first-child strong {
    color: var(--pti-safety-yellow, #FFD700);
}

.pti-spec-table td:first-child {
    color: #ADAEB4;
}

.pti-spec-table td:last-child {
    color: #D8D8DC;
}

.pti-comparison td:first-child {
    color: #E8E8EC;
}

/* Pros/Cons — dark-adapted backgrounds */
.pti-pros {
    background: rgba(0, 208, 132, 0.08);
    border-top-color: #00D084;
}

.pti-cons {
    background: rgba(239, 68, 68, 0.08);
    border-top-color: #ef4444;
}

.pti-pros h4 {
    color: #34D399;
}

.pti-cons h4 {
    color: #F87171;
}

.pti-pros li,
.pti-cons li {
    color: #D8D8DC;
}

.pti-pros li::before {
    color: #34D399;
}

.pti-cons li::before {
    color: #F87171;
}

/* FAQ — dark-adapted */
.pti-faq {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--pti-steel, #2D3142);
}

.pti-faq h2 {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: var(--pti-safety-yellow, #FFD700);
}

.pti-faq h3 {
    background: transparent;
    border-top-color: rgba(255, 255, 255, 0.06);
    color: #E8E8EC;
}

.pti-faq p {
    color: #ADAEB4;
}

.pti-faq a {
    color: #0A84FF;
}

/* Disclosure — dark-adapted */
.pti-disclosure {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #8B8D94;
}

/* Related articles — dark-adapted */
.pti-related {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.pti-related h3 {
    color: #ADAEB4;
}

.pti-related a {
    color: #D8D8DC;
}

.pti-related a:hover {
    color: var(--pti-safety-yellow, #FFD700);
}

.pti-related li::before {
    color: var(--pti-safety-yellow, #FFD700);
}

/* ==========================================================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================================================== */

@media (max-width: 600px) {
    .pti-spec-table table {
        max-width: 100%;
    }

    .pti-buy-links table {
        max-width: 100%;
    }

    .pti-faq h3 {
        padding: 0.875rem 1rem;
        font-size: 0.95rem !important;
    }

    .pti-faq p {
        padding: 0 1rem;
        font-size: 0.9rem;
    }

    .pti-related {
        padding: 1rem;
    }

    .pti-disclosure {
        font-size: 0.8rem;
        padding: 0.875rem 1rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .pti-pros-cons {
        grid-template-columns: 1fr 1fr;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .pti-disclosure {
        border: 1px solid #ccc;
        background: #f5f5f5;
    }

    .pti-buy-links a,
    .entry-content table a[href*="amazon.com"],
    .entry-content table a[href*="tag="] {
        background: none !important;
        color: #333 !important;
        text-decoration: underline !important;
    }
}
