/* ==========================================================================
   PTI COMPONENT LIBRARY - C2 "Hardened"
   Version: 3.0.0

   Content components restyled to the C2 design system (c2-base.css tokens).
   CLASS CONTRACT: 329 published posts emit these pti-* class names.
   Restyle only - NEVER rename or remove a class.

   Loads after c2-base.css (which owns tokens + .pti-content table base
   styles + the table buy-button rules). This file covers the component
   wrappers and the .entry-content legacy container variants.

   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
   ========================================================================== */

/* ==========================================================================
   SHARED TABLE STYLES
   C2 treatment: 3px anvil frame, soot head, signal mono headers, zebra rows.
   (c2-base.css section 9 styles bare .pti-content tables; these rules cover
   the component-wrapped tables in any container.)
   ========================================================================== */

.pti-quick-pick table,
.pti-comparison table,
.pti-spec-table table,
.pti-buy-links table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: var(--border-heavy);
    border-radius: var(--r);
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.5;
    font-family: var(--font-body);
}

.pti-quick-pick thead th,
.pti-comparison thead th,
.pti-spec-table thead th,
.pti-buy-links thead th {
    background: var(--soot);
    color: var(--signal);
    padding: 13px 16px;
    text-align: left;
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: none;
}

.pti-quick-pick tbody td,
.pti-comparison tbody td,
.pti-spec-table tbody td,
.pti-buy-links tbody td {
    padding: 14px 16px;
    border-top: 2px solid var(--cement);
    color: var(--forge);
    vertical-align: middle;
    background: var(--white);
}

.pti-quick-pick tbody tr:nth-child(even) td,
.pti-comparison tbody tr:nth-child(even) td,
.pti-buy-links tbody tr:nth-child(even) td {
    background: var(--concrete);
}

.pti-quick-pick tbody tr:hover td,
.pti-comparison tbody tr:hover td,
.pti-buy-links tbody tr:hover td {
    background: var(--signal-faint);
}

/* Scrollable tables on mobile */
.pti-quick-pick,
.pti-comparison,
.pti-buy-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   1. QUICK-PICK TABLE
   ========================================================================== */

.pti-quick-pick table {
    min-width: 650px;
    margin: var(--sp-7) 0;
}

.pti-quick-pick tbody td:first-child {
    font-weight: 700;
    white-space: nowrap;
}

.pti-quick-pick tbody td:first-child strong {
    color: var(--signal-dark);
    font-family: var(--font-data);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   2. PROS / CONS BOX
   C2 assessment-panel treatment. Markers are clip-path shapes, NOT
   content: glyphs (fixes the unquoted content bug class entirely).
   ========================================================================== */

.pti-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    margin: var(--sp-6) 0;
}

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

.pti-pros,
.pti-cons {
    padding: var(--sp-5);
    border-radius: var(--r);
    border: 2px solid;
}

.pti-pros {
    background: var(--pass-bg);
    border-color: var(--pass-border);
}

.pti-cons {
    background: var(--warn-bg);
    border-color: var(--warn-border);
}

.pti-pros h4,
.pti-cons h4 {
    font-family: var(--font-data);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 var(--sp-3) 0;
    padding: 0;
    border: none;
}

.pti-pros h4 { color: var(--pass); }
.pti-cons h4 { color: var(--warn); }

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

.pti-pros li,
.pti-cons li {
    position: relative;
    padding: 3px 0 3px 20px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--forge);
    font-family: var(--font-body);
    list-style: none;
}

/* Check mark - clip-path shape (was unquoted content glyph bug) */
.pti-pros li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 12px;
    height: 12px;
    background: var(--pass);
    clip-path: polygon(20% 45%, 5% 65%, 40% 95%, 95% 20%, 75% 5%, 38% 70%);
}

/* Cross mark - clip-path shape (was unquoted content glyph bug) */
.pti-cons li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 9px;
    width: 10px;
    height: 10px;
    background: var(--warn);
    clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%);
}

/* ==========================================================================
   3. SPEC TABLE (Per-Product)
   ========================================================================== */

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

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

.pti-spec-table tbody td:first-child {
    font-weight: 700;
    color: var(--steel);
    white-space: nowrap;
    width: 40%;
    font-family: var(--font-data);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pti-spec-table tbody td:last-child {
    color: var(--soot);
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 0.82rem;
}

/* ==========================================================================
   4. COMPARISON TABLE (Full-Width)
   ========================================================================== */

.pti-comparison table {
    min-width: 700px;
    margin: var(--sp-7) 0;
}

.pti-comparison tbody td:first-child {
    font-weight: 700;
    white-space: nowrap;
    color: var(--soot);
}

.pti-comparison + p em {
    font-size: 0.75rem;
    color: var(--steel);
    font-style: italic;
}

/* ==========================================================================
   5. FAQ SECTION
   ========================================================================== */

.pti-faq {
    margin: var(--sp-10) 0;
    border: var(--border-card);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--white);
}

.pti-faq h2 {
    background: var(--soot) !important;
    color: var(--signal) !important;
    margin: 0 !important;
    padding: 14px 24px !important;
    border: none !important;
    font-family: var(--font-data) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
}

.pti-faq h3 {
    margin: 0 !important;
    padding: 16px 24px 4px;
    font-family: var(--font-head) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-top: 2px solid var(--cement);
    background: transparent;
    color: var(--soot);
    text-transform: none;
    letter-spacing: 0;
}

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

.pti-faq p {
    padding: 0 24px;
    margin: 0.5rem 0 1.25rem !important;
    font-family: var(--font-head);
    font-size: 0.92rem;
    color: var(--iron);
    line-height: 1.7;
}

.pti-faq a {
    color: var(--signal-dark);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(180, 74, 24, 0.35);
    text-underline-offset: 3px;
}

.pti-faq a:hover {
    color: var(--signal);
    text-decoration-color: var(--signal);
}

/* ==========================================================================
   6. WHERE-TO-BUY TABLE + CTA BUTTONS (the revenue elements)
   ========================================================================== */

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

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

.pti-buy-links tbody td:first-child {
    font-weight: 700;
    width: 30%;
    font-family: var(--font-data);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--soot);
}

/* CTA buttons for all retailer links.
   REVENUE FIX (build plan A4): the old selectors only matched
   .entry-content table a (never used in v2 - body container is .pti-content)
   and only styled Amazon table links inside the print query. Both containers
   and all four retailers are now covered on screen. c2-base.css section 8
   carries the .pti-content table rules; the rules below cover .pti-buy-links
   and the legacy .entry-content container. */
.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"],
.pti-buy-links a[href*="walmart.com"],
.entry-content table a[href*="amazon.com"],
.entry-content table a[href*="tag="],
.entry-content table a[href*="homedepot.com"],
.entry-content table a[href*="lowes.com"],
.entry-content table a[href*="walmart.com"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--signal);
    color: #ffffff !important;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 9px 18px;
    border-radius: var(--r-sm);
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    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,
.pti-buy-links a[href*="walmart.com"]:hover,
.entry-content table a[href*="amazon.com"]:hover,
.entry-content table a[href*="tag="]:hover,
.entry-content table a[href*="homedepot.com"]:hover,
.entry-content table a[href*="lowes.com"]:hover,
.entry-content table a[href*="walmart.com"]:hover {
    background: var(--signal-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(212, 91, 32, 0.25);
}

/* Standalone CTA paragraph links (a CTA alone in its own <p>) */
.pti-content > p > a[href*="amazon.com"]:only-child,
.pti-content > p > a[href*="homedepot.com"]:only-child,
.pti-content > p > a[href*="lowes.com"]:only-child,
.pti-content > p > a[href*="walmart.com"]:only-child,
.entry-content > p > a[href*="amazon.com"]:only-child,
.entry-content > p > a[href*="homedepot.com"]:only-child,
.entry-content > p > a[href*="lowes.com"]:only-child,
.entry-content > p > a[href*="walmart.com"]:only-child {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--signal);
    color: #ffffff !important;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--r-sm);
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    margin: 1.25rem 0;
}

.pti-content > p > a[href*="amazon.com"]:only-child:hover,
.pti-content > p > a[href*="homedepot.com"]:only-child:hover,
.pti-content > p > a[href*="lowes.com"]:only-child:hover,
.pti-content > p > a[href*="walmart.com"]:only-child:hover,
.entry-content > p > a[href*="amazon.com"]:only-child:hover,
.entry-content > p > a[href*="homedepot.com"]:only-child:hover,
.entry-content > p > a[href*="lowes.com"]:only-child:hover,
.entry-content > p > a[href*="walmart.com"]:only-child:hover {
    background: var(--signal-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(212, 91, 32, 0.25);
}

/* Arrow on standalone CTAs - clip-path shape (was unquoted content glyph bug) */
.pti-content > p > a[href*="amazon.com"]:only-child::after,
.pti-content > p > a[href*="homedepot.com"]:only-child::after,
.pti-content > p > a[href*="lowes.com"]:only-child::after,
.pti-content > p > a[href*="walmart.com"]:only-child::after,
.entry-content > p > a[href*="amazon.com"]:only-child::after,
.entry-content > p > a[href*="homedepot.com"]:only-child::after,
.entry-content > p > a[href*="lowes.com"]:only-child::after,
.entry-content > p > a[href*="walmart.com"]:only-child::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: currentColor;
    clip-path: polygon(0% 42%, 60% 42%, 60% 20%, 100% 50%, 60% 80%, 60% 58%, 0% 58%);
    flex-shrink: 0;
}

/* ==========================================================================
   7. AFFILIATE DISCLOSURE
   ========================================================================== */

.pti-disclosure {
    margin: var(--sp-8) 0 var(--sp-5);
    padding: var(--sp-4) var(--sp-5);
    background: var(--cement);
    border: var(--border-hairline);
    border-radius: var(--r);
    font-size: 0.78rem;
    color: var(--steel);
    line-height: 1.6;
}

.pti-disclosure p {
    margin: 0 !important;
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--steel);
}

.pti-disclosure a {
    color: var(--steel);
    text-decoration: underline;
}

.pti-disclosure a:hover {
    color: var(--signal-dark);
}

/* ==========================================================================
   8. RELATED ARTICLES
   ========================================================================== */

.pti-related {
    margin: var(--sp-8) 0;
    padding: var(--sp-6) var(--sp-7);
    background: var(--white);
    border: var(--border-card);
    border-radius: var(--r);
}

.pti-related h3 {
    font-family: var(--font-data) !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
    color: var(--steel) !important;
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    border: none !important;
}

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

.pti-related li {
    margin: 0;
    padding: 5px 0;
    list-style: none;
}

.pti-related a {
    color: var(--forge);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: color 0.15s;
}

/* Signal dash marker - was an unquoted arrow glyph (content bug) */
.pti-related a::before {
    content: '';
    display: block;
    width: 18px;
    height: 2px;
    background: var(--signal);
    flex-shrink: 0;
}

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

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

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

    .pti-faq h2 {
        padding: 12px 16px !important;
    }

    .pti-faq h3 {
        padding: 14px 16px 2px;
        font-size: 0.9rem !important;
    }

    .pti-faq p {
        padding: 0 16px;
        font-size: 0.85rem;
    }

    .pti-related {
        padding: var(--sp-5);
    }

    .pti-disclosure {
        font-size: 0.72rem;
        padding: var(--sp-3) var(--sp-4);
    }

    .pti-pros,
    .pti-cons {
        padding: var(--sp-4);
    }
}

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

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

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

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