/* Shared mobile-first styles for PersonaTalk static pages */

/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-start: #f5f7fa;
    --bg-end: #c3cfe2;
    --accent: #3498db;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    /* Force a plain, high-contrast background for readability on all devices */
    background: #ffffff;
    /* Safe-area padding for iPhone notch and home indicator */
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-right: calc(16px + env(safe-area-inset-right));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    padding-left: calc(16px + env(safe-area-inset-left));
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Theming per page */
/* Keep accent variable support but avoid themed page backgrounds */
body.theme-privacy { --accent: #3498db; }
body.theme-support { --accent: #f5576c; }
body.theme-terms { --accent: #667eea; }

.container {
    max-width: 860px;
    margin: 0 auto;
    background: #ffffff;
    padding: clamp(24px, 4vw, 40px);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

h1 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: clamp(1.8rem, 5vw, 2.4rem);
}

h2 {
    color: #34495e;
    margin-top: 28px;
    margin-bottom: 14px;
    font-size: clamp(1.2rem, 3.8vw, 1.5rem);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 6px;
}

h3 {
    color: #555;
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: clamp(1.05rem, 3.4vw, 1.2rem);
}

p {
    margin-bottom: 14px;
}

ul,
ol {
    margin-left: 20px;
    margin-bottom: 14px;
}

li {
    margin-bottom: 8px;
}

strong {
    color: #2c3e50;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
}

hr {
    border: none;
    border-top: 1px solid #e1e5ea;
}

/* Utility and page-specific blocks (used by existing HTML) */
.effective-date {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 24px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.contact {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin-top: 24px;
}

.important {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 18px 0;
}

.contact-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 26px;
    border-radius: 12px;
    margin: 24px 0;
    text-align: center;
}

.contact-card h3 {
    color: #fff;
    margin-top: 0;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.contact-card a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

.faq-item {
    background: #f8f9fa;
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.faq-item h3 {
    color: var(--accent);
    margin-top: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.feature-card {
    background: #ecf0f1;
    padding: 18px;
    border-radius: 8px;
    text-align: center;
}

.feature-card h4 {
    color: #2c3e50;
    margin-bottom: 8px;
}

.icon {
    font-size: 2.2em;
    margin-bottom: 8px;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

.inline-icon {
    width: 44px;
    height: 44px;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

/* iPhone Safari bottom spacing for sticky CTA-like buttons (if any) */
.footer-note {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 18px;
}

/* Tables (opt-in via class to avoid impacting legacy pages) */
.pt-table-wrap {
    margin: 14px 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(44, 62, 80, 0.14);
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pt-table-wrap--narrow {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

table.pt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.98rem;
    min-width: 540px; /* allow horizontal scroll on narrow screens */
}

table.pt-table thead th {
    background: rgba(52, 152, 219, 0.08);
    color: #2c3e50;
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(44, 62, 80, 0.14);
    white-space: nowrap;
}

/* Theme-specific fallbacks (for browsers that don't support color-mix) */
body.theme-support table.pt-table thead th {
    background: rgba(245, 87, 108, 0.12);
}

body.theme-terms table.pt-table thead th {
    background: rgba(102, 126, 234, 0.12);
}

/* Use accent on headers if theme defines one (support/terms/privacy) */
body[class*="theme-"] table.pt-table thead th {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
}

table.pt-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(44, 62, 80, 0.10);
    vertical-align: top;
}

table.pt-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

table.pt-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.03);
}

body.theme-support table.pt-table tbody tr:hover td {
    background: rgba(245, 87, 108, 0.08);
}

body.theme-terms table.pt-table tbody tr:hover td {
    background: rgba(102, 126, 234, 0.08);
}

/* Prefer accent hover when supported */
table.pt-table tbody tr:hover td {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

table.pt-table tbody tr:last-child td {
    border-bottom: none;
}

table.pt-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Stick to the same plain light appearance in dark mode for legal readability */
    body { color: #333; background: #ffffff; }
    .container {
        background: #ffffff;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    }
    a { color: #1e60d3; }
    hr { border-top-color: #e1e5ea; }
    .contact { background: #ecf0f1; }
    .faq-item { background: #f8f9fa; border-left-color: var(--accent); }
    .feature-card { background: #ecf0f1; }
    .pt-table-wrap {
        background: #ffffff;
        border-color: rgba(44, 62, 80, 0.14);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    }
    table.pt-table thead th {
        color: #2c3e50;
        border-bottom-color: rgba(44, 62, 80, 0.14);
    }
    table.pt-table tbody td { border-bottom-color: rgba(44, 62, 80, 0.10); }
    table.pt-table tbody tr:nth-child(even) td { background: rgba(0, 0, 0, 0.02); }
}
