/**
 * Links Inventory — Chem Chemical Data Suite
 * Frontend Product Information Stylesheet
 *
 * @owner      Links Inventory (linksinventory.com)
 * @copyright  2026 Links Inventory. All rights reserved.
 *
 * PURPOSE
 * ───────
 * Styles the Product Information table on the WooCommerce single product page.
 * Designed to match the Astra theme — white background, clean typography,
 * with the Links Inventory cyan accent (#06b6d4) for the header and labels.
 * All selectors scoped to .ccds-chemical-data — zero bleed into theme styles.
 *
 * DESIGN DECISIONS
 * ────────────────
 * - Cyan left border on label column gives a "chemistry document" feel
 * - Monospace font only for technical values (SMILES, InChI, InChIKey)
 * - Long technical strings truncate on mobile — no horizontal scroll
 * - Missing values shown as a grey dash (—) not the word "NA"
 * - Storage text truncated in PHP to 180 chars before reaching CSS
 * - CAS number styled as a subtle external link to PubChem
 */

/* ── Container ──────────────────────────────────────────────────────────── */
.ccds-chemical-data {
    margin: 28px 0 20px;
    font-family: inherit; /* respect Astra's theme font */
}

/* ── Section header ─────────────────────────────────────────────────────── */
.ccds-table-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1a2e;
    padding-bottom: 10px;
    margin-bottom: 0;
    border-bottom: 2px solid #06b6d4;
}

.ccds-table-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: #06b6d4;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Table ──────────────────────────────────────────────────────────────── */
.ccds-chemical-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    line-height: 1.55;
    background: #fff;
}

.ccds-chemical-table tbody tr {
    border-bottom: 1px solid #f2f4f7;
    transition: background 0.12s ease;
}

.ccds-chemical-table tbody tr:last-child {
    border-bottom: none;
}

.ccds-chemical-table tbody tr:hover {
    background: #f8fbff;
}

/* ── Label column ───────────────────────────────────────────────────────── */
.ccds-field-label {
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #4a5568;
    letter-spacing: 0.02em;
    padding: 10px 16px 10px 12px;
    vertical-align: top;
    white-space: nowrap;
    width: 36%;
    border-left: 3px solid #06b6d4;
    text-align: left;
}

/* ── Value column ───────────────────────────────────────────────────────── */
.ccds-field-value {
    font-family: inherit;
    font-size: 13.5px;
    color: #1a202c;
    padding: 10px 8px 10px 0;
    vertical-align: top;
    word-break: break-word;
}

/* ── Technical values (SMILES, InChI, InChIKey) ─────────────────────────── */
.ccds-field-value.ccds-mono {
    font-family: 'SFMono-Regular', 'Fira Mono', Consolas, 'Liberation Mono', monospace;
    font-size: 11.5px;
    color: #2d3748;
    overflow-wrap: break-word;
    word-break: break-all;
    hyphens: auto;
    max-width: 0;        /* allows word-break to work in table cells */
    white-space: normal;
}

/* ── Molecular formula — chemical formatting ────────────────────────────── */
.ccds-formula sub {
    font-size: 0.78em;
    vertical-align: sub;
    line-height: 0;
}

/* ── CAS number link ────────────────────────────────────────────────────── */
.ccds-cas-link {
    color: #1a202c;
    text-decoration: none;
    border-bottom: 1px dotted #06b6d4;
    transition: color 0.15s, border-color 0.15s;
}

.ccds-cas-link:hover {
    color: #06b6d4;
    border-bottom-color: #06b6d4;
}

.ccds-cas-link::after {
    content: ' ↗';
    font-size: 10px;
    color: #06b6d4;
    vertical-align: super;
}

/* ── Missing value dash ─────────────────────────────────────────────────── */
.ccds-na {
    color: #cbd5e0;
    font-size: 15px;
    line-height: 1;
    user-select: none;
}

/* ── Storage row — slightly muted, normal font ──────────────────────────── */
.ccds-storage-value {
    font-size: 12.5px;
    color: #4a5568;
    line-height: 1.6;
}

/* ── Molecular weight unit ──────────────────────────────────────────────── */
.ccds-mw-unit {
    font-size: 11px;
    color: #718096;
    margin-left: 2px;
}

/* ── Responsive: tablet ─────────────────────────────────────────────────── */
@media ( max-width: 768px ) {
    .ccds-field-label {
        width: 42%;
        font-size: 12px;
        padding-right: 10px;
    }

    .ccds-field-value.ccds-mono {
        font-size: 10.5px;
    }
}

/* ── Responsive: mobile (≤ 480px) ──────────────────────────────────────── */
@media ( max-width: 480px ) {
    .ccds-chemical-table,
    .ccds-chemical-table tbody,
    .ccds-chemical-table tbody tr,
    .ccds-chemical-table th,
    .ccds-chemical-table td {
        display: block;
        width: 100%;
    }

    .ccds-chemical-table tbody tr {
        padding: 8px 0;
        border-bottom: 1px solid #f2f4f7;
    }

    .ccds-field-label {
        width: 100%;
        border-left: 3px solid #06b6d4;
        border-bottom: none;
        padding: 6px 0 2px 10px;
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #718096;
        white-space: normal;
    }

    .ccds-field-value {
        padding: 0 0 6px 12px;
        font-size: 13px;
    }

    .ccds-field-value.ccds-mono {
        font-size: 11px;
        padding-left: 12px;
    }
}
