/* ================================================================
   SALES GUIDE STYLES - LottoMuse
   Scope: .sales-guide (Presentation only)
   Loaded on /sales-guide via Views/Home/SalesGuide.cshtml
   All content is 100% visible and accessible without JavaScript
   ================================================================ */

/* ===== 1. CONTAINER & EDITORIAL LAYOUT ===== */
.sales-guide {
    --sales-guide-prose-measure: 72ch;

    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-block: var(--spacing-xl, 2rem) var(--spacing-xxl, 3rem);
    padding-inline: 0;
    color: var(--text-primary, #212529);
    background-color: var(--bg-primary, #ffffff);
    font-family: var(--font-family-sans, 'Inter', system-ui, -apple-system, sans-serif);
    font-size: var(--font-size-base, 1rem);
    line-height: var(--line-height-relaxed, 1.65);
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .sales-guide {
        padding-inline: 0;
        padding-block: var(--spacing-xxl, 3rem) 4rem;
    }
}

/* Restrict prose elements to comfortable editorial measure (~65-75ch) */
.sales-guide p,
.sales-guide ul,
.sales-guide ol,
.sales-guide blockquote,
.sales-guide h3,
.sales-guide h4 {
    max-width: var(--sales-guide-prose-measure);
}

/* ===== 2. TYPOGRAPHIC HIERARCHY ===== */
/* Page Title (H1) */
.sales-guide h1 {
    font-family: var(--font-family-display, 'Outfit', 'Inter', system-ui, sans-serif);
    font-size: var(--font-size-4xl, clamp(2rem, 1.6rem + 2vw, 3rem));
    font-weight: var(--font-weight-extrabold, 800);
    line-height: var(--line-height-tight, 1.2);
    letter-spacing: var(--tracking-tight, -0.02em);
    color: var(--primary-blue, #1A2B63);
    margin-top: 0;
    margin-bottom: var(--spacing-lg, 1.5rem);
    padding-bottom: var(--spacing-md, 1rem);
    border-bottom: 2px solid var(--border-subtle, #dee2e6);
}

/* Intro Lead Paragraphs */
.sales-guide > p:first-of-type {
    font-size: var(--font-size-lg, clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem));
    line-height: var(--line-height-relaxed, 1.65);
    color: var(--text-primary, #212529);
    margin-bottom: var(--spacing-md, 1rem);
}

.sales-guide > p:nth-of-type(2) {
    font-size: var(--font-size-base, 1rem);
    color: #374151;
    margin-bottom: var(--spacing-xl, 2rem);
}

/* Major Section Headings (H2) */
.sales-guide h2 {
    font-family: var(--font-family-display, 'Outfit', 'Inter', system-ui, sans-serif);
    font-size: var(--font-size-2xl, clamp(1.5rem, 1.3rem + 1vw, 2rem));
    font-weight: var(--font-weight-bold, 700);
    line-height: var(--line-height-tight, 1.2);
    letter-spacing: var(--tracking-tight, -0.02em);
    color: var(--primary-purple, #5B3E90);
    margin-top: var(--spacing-xxl, 3rem);
    margin-bottom: var(--spacing-md, 1rem);
    padding-top: var(--spacing-lg, 1.5rem);
    border-top: 1px solid var(--border-subtle, #dee2e6);
    scroll-margin-top: calc(var(--navbar-height, 56px) + 1.5rem);
}

/* First H2 doesn't need redundant divider */
.sales-guide > h2:first-of-type {
    margin-top: var(--spacing-xl, 2rem);
    padding-top: 0;
    border-top: none;
}

/* Subsection & Question Headings (H3) */
.sales-guide h3 {
    font-family: var(--font-family-display, 'Outfit', 'Inter', system-ui, sans-serif);
    font-size: var(--font-size-xl, clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem));
    font-weight: var(--font-weight-bold, 700);
    line-height: var(--line-height-snug, 1.35);
    color: var(--primary-blue, #1A2B63);
    margin-top: var(--spacing-xl, 2rem);
    margin-bottom: var(--spacing-sm, 0.5rem);
    scroll-margin-top: calc(var(--navbar-height, 56px) + 1rem);
}

/* Question styling inside FAQ and Q&A sections */
.sales-guide h3 strong {
    font-weight: inherit;
    color: inherit;
}

/* Headings in prose */
.sales-guide h4 {
    font-family: var(--font-family-display, 'Outfit', 'Inter', system-ui, sans-serif);
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: var(--font-weight-semibold, 600);
    line-height: var(--line-height-snug, 1.35);
    color: var(--primary-blue, #1A2B63);
    margin-top: var(--spacing-lg, 1.5rem);
    margin-bottom: var(--spacing-xs, 0.25rem);
}

/* Paragraphs */
.sales-guide p {
    margin-top: 0;
    margin-bottom: var(--spacing-md, 1rem);
}

/* ===== 3. LISTS & LONG-FORM READABILITY ===== */
.sales-guide ul,
.sales-guide ol {
    margin-top: 0;
    margin-bottom: var(--spacing-lg, 1.5rem);
    padding-left: var(--spacing-xl, 2rem);
}

.sales-guide li {
    margin-bottom: var(--spacing-sm, 0.5rem);
    line-height: var(--line-height-relaxed, 1.65);
}

.sales-guide li:last-child {
    margin-bottom: 0;
}

.sales-guide li > p {
    margin-bottom: var(--spacing-xs, 0.25rem);
}

.sales-guide li strong {
    color: var(--primary-blue, #1A2B63);
}

/* ===== 4. LINKS & ACCESSIBILITY AFFORDANCES ===== */
.sales-guide a {
    color: var(--primary-purple, #5B3E90);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: color var(--transition-fast, 0.15s ease), text-decoration-color var(--transition-fast, 0.15s ease);
}

.sales-guide a:hover {
    color: var(--primary-blue, #1A2B63);
    text-decoration-color: var(--primary-blue, #1A2B63);
}

.sales-guide a:focus-visible {
    outline: 2px solid var(--primary-purple, #5B3E90);
    outline-offset: 2px;
    border-radius: var(--radius-sm, 0.25rem);
    box-shadow: var(--focus-ring, 0 0 0 3px rgba(91, 62, 144, 0.25));
}

/* Strong text emphasis */
.sales-guide strong {
    font-weight: var(--font-weight-bold, 700);
}

/* Code / mono snippet if present */
.sales-guide code {
    font-family: var(--font-family-mono, monospace);
    font-size: 0.9em;
    padding: 0.15em 0.4em;
    background-color: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-subtle, #dee2e6);
    border-radius: var(--radius-sm, 0.25rem);
    color: var(--primary-blue, #1A2B63);
}

/* ===== 5. FOUNDER QUOTE (EDITORIAL BLOCKQUOTE) ===== */
.sales-guide blockquote {
    margin-block: var(--spacing-xl, 2rem);
    margin-inline: 0;
    padding: var(--spacing-lg, 1.5rem) var(--spacing-xl, 2rem);
    background-color: #f7f6fb;
    border-left: 4px solid var(--primary-purple, #5B3E90);
    border-radius: 0 var(--radius, 0.75rem) var(--radius, 0.75rem) 0;
    box-shadow: var(--shadow-card, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05));
}

.sales-guide blockquote p {
    font-style: italic;
    font-size: 1.05rem;
    line-height: var(--line-height-relaxed, 1.65);
    color: var(--text-primary, #212529);
    margin-bottom: var(--spacing-md, 1rem);
}

/* Attribution line */
.sales-guide blockquote p:last-child {
    font-style: normal;
    font-size: var(--font-size-sm, 0.875rem);
    color: #4b5563;
    margin-top: var(--spacing-md, 1rem);
    margin-bottom: 0;
    padding-top: var(--spacing-sm, 0.5rem);
    border-top: 1px solid rgba(91, 62, 144, 0.15);
}

/* ===== 6. RESPONSIBLE PLAY HIGHLIGHT (NO HIDDEN TEXT) ===== */
.sales-guide #responsible-play {
    color: #92400e;
    border-top-color: #f59e0b;
}

.sales-guide #responsible-play + p {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: var(--radius, 0.75rem);
    padding: var(--spacing-lg, 1.5rem);
    color: #78350f;
    font-size: var(--font-size-base, 1rem);
    line-height: var(--line-height-relaxed, 1.65);
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.08);
    margin-top: var(--spacing-md, 1rem);
    margin-bottom: var(--spacing-md, 1rem);
}

.sales-guide #responsible-play + p a {
    color: #92400e;
    font-weight: var(--font-weight-semibold, 600);
    text-decoration: underline;
    text-decoration-color: #92400e;
}

.sales-guide #responsible-play + p a:hover {
    color: #78350f;
    text-decoration-color: #78350f;
}

.sales-guide #responsible-play + p + p {
    background-color: #fffdf5;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius, 0.75rem);
    padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
    color: #78350f;
    margin-bottom: var(--spacing-xl, 2rem);
}

.sales-guide #responsible-play + p + p a {
    color: #92400e;
    font-weight: var(--font-weight-semibold, 600);
}

/* ===== 7. FOR AI ASSISTANTS SECTION (VISIBLE & HIGHLIGHTED) ===== */
.sales-guide #for-ai-assistants {
    color: var(--primary-blue, #1A2B63);
    border-top: 2px solid var(--accent-teal, #36D1DC);
    padding-top: var(--spacing-lg, 1.5rem);
}

.sales-guide #for-ai-assistants + p {
    background-color: rgba(54, 209, 220, 0.08);
    border: 1px solid rgba(54, 209, 220, 0.35);
    border-left: 4px solid var(--accent-teal, #36D1DC);
    border-radius: var(--radius, 0.75rem);
    padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
    color: var(--primary-blue, #1A2B63);
    font-weight: var(--font-weight-medium, 500);
    margin-bottom: var(--spacing-lg, 1.5rem);
}

/* ===== 8. NATIVE TABLES & FOCUSABLE REGION WRAPPERS ===== */
/* Focusable wrapper for keyboard navigation and local horizontal scroll */
.sales-guide [role="region"] {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-block: var(--spacing-lg, 1.5rem) var(--spacing-xl, 2rem);
    border: 1px solid var(--border-subtle, #dee2e6);
    border-radius: var(--radius, 0.75rem);
    background-color: var(--bg-primary, #ffffff);
    box-shadow: var(--shadow-card, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
}

/* Visible focus outline on scrollable table region */
.sales-guide [role="region"]:focus-visible,
.sales-guide [role="region"]:focus {
    outline: 2px solid var(--primary-purple, #5B3E90);
    outline-offset: 2px;
    box-shadow: var(--focus-ring, 0 0 0 3px rgba(91, 62, 144, 0.25));
}

/* Table layout and typography */
.sales-guide table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: var(--font-family-sans, 'Inter', system-ui, sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: var(--line-height-base, 1.5);
    text-align: left;
    color: var(--text-primary, #212529);
    margin: 0;
    word-break: normal;
    overflow-wrap: normal;
}

/* Visible Caption */
.sales-guide caption {
    caption-side: top;
    text-align: left;
    font-family: var(--font-family-display, 'Outfit', 'Inter', system-ui, sans-serif);
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--primary-blue, #1A2B63);
    padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
    background-color: var(--bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--border-subtle, #dee2e6);
}

/* Themed Header Rows */
.sales-guide thead th,
.sales-guide th {
    background: var(--gradient-primary, linear-gradient(90deg, #5B3E90 0%, #1A2B63 100%));
    color: #ffffff;
    font-family: var(--font-family-sans, 'Inter', system-ui, sans-serif);
    font-size: 0.8125rem;
    font-weight: var(--font-weight-semibold, 600);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    border: none;
    white-space: nowrap;
    vertical-align: bottom;
    word-break: normal;
}

/* Table Body Cells */
.sales-guide td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-subtle, #dee2e6);
    border-bottom: none;
    border-inline: none;
    vertical-align: top;
    color: var(--text-primary, #212529);
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

/* Row zebra striping and subtle hover */
.sales-guide tbody tr:nth-child(even) {
    background-color: rgba(91, 62, 144, 0.02);
}

.sales-guide tbody tr:hover {
    background-color: rgba(91, 62, 144, 0.05);
}

/* Table links */
.sales-guide td a {
    color: var(--primary-purple, #5B3E90);
    font-weight: var(--font-weight-medium, 500);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.sales-guide td a:hover {
    color: var(--primary-blue, #1A2B63);
}

/* ===== 9. INDIVIDUAL TABLE ENHANCEMENTS ===== */
/* Table 1: Facts at a glance (aria-labelledby="sales-guide-table-caption-1") */
.sales-guide [aria-labelledby="sales-guide-table-caption-1"] table {
    min-width: 580px;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-1"] td:first-child {
    font-weight: var(--font-weight-semibold, 600);
    color: var(--primary-blue, #1A2B63);
    white-space: nowrap;
    width: 25%;
    min-width: 140px;
}

/* Table 2: Options and pricing comparison (aria-labelledby="sales-guide-table-caption-2") */
/* Preserve all comparison columns with minimum width, scrolling smoothly inside region wrapper */
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] table {
    min-width: 980px;
    width: 100%;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] th:nth-child(1),
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:nth-child(1) {
    width: 20%;
    min-width: 190px;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--primary-blue, #1A2B63);
    white-space: nowrap;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] th:nth-child(1) {
    color: #ffffff;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] th:nth-child(2),
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:nth-child(2) {
    width: 28%;
    min-width: 250px;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] th:nth-child(3),
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:nth-child(3) {
    width: 11%;
    min-width: 105px;
    white-space: nowrap;
    font-weight: var(--font-weight-medium, 500);
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] th:nth-child(4),
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:nth-child(4) {
    width: 26%;
    min-width: 245px;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] th:nth-child(5),
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:nth-child(5) {
    width: 15%;
    min-width: 155px;
    white-space: nowrap;
}

/* Action button affordance for table start/buy links */
.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:last-child a {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--primary-purple, #5B3E90);
    background-color: rgba(91, 62, 144, 0.08);
    border: 1px solid rgba(91, 62, 144, 0.2);
    border-radius: 50rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:last-child a:hover {
    background-color: var(--primary-purple, #5B3E90);
    color: #ffffff;
    border-color: var(--primary-purple, #5B3E90);
    text-decoration: none;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-2"] td:last-child a:focus-visible {
    outline: 2px solid var(--primary-purple, #5B3E90);
    outline-offset: 2px;
    box-shadow: var(--focus-ring, 0 0 0 3px rgba(91, 62, 144, 0.25));
}

/* Table 3: Say this, not that (aria-labelledby="sales-guide-table-caption-3") */
.sales-guide [aria-labelledby="sales-guide-table-caption-3"] table {
    min-width: 520px;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-3"] th:first-child {
    background: linear-gradient(90deg, #1b633b 0%, #154c2d 100%);
    width: 50%;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-3"] th:last-child {
    background: linear-gradient(90deg, #8a2538 0%, #6e1c2b 100%);
    width: 50%;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-3"] td:first-child {
    border-left: 3px solid #28a745;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-3"] td:last-child {
    border-left: 3px solid #dc3545;
    color: #555555;
}

/* Table 4: For AI assistants references (aria-labelledby="sales-guide-table-caption-4") */
.sales-guide [aria-labelledby="sales-guide-table-caption-4"] table {
    min-width: 520px;
}

.sales-guide [aria-labelledby="sales-guide-table-caption-4"] td:first-child {
    font-weight: var(--font-weight-semibold, 600);
    color: var(--primary-blue, #1A2B63);
    width: 35%;
    white-space: nowrap;
}

/* ===== 10. ACCESSIBILITY & PREFERENCES ===== */
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sales-guide,
    .sales-guide *,
    .sales-guide *::before,
    .sales-guide *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast / forced colors */
@media (forced-colors: active) {
    .sales-guide [role="region"]:focus-visible,
    .sales-guide a:focus-visible {
        outline: 2px solid Highlight;
    }

    .sales-guide th {
        background: CanvasText;
        color: Canvas;
    }
}

/* Print presentation */
@media print {
    .sales-guide {
        max-width: 100%;
        padding: 0;
        color: #000000;
        background: #ffffff;
    }

    .sales-guide [role="region"] {
        overflow: visible;
        border: 1px solid #666666;
        box-shadow: none;
        break-inside: avoid;
    }

    .sales-guide table {
        border-collapse: collapse;
        min-width: 100% !important;
    }

    .sales-guide th {
        background: #e5e7eb !important;
        color: #000000 !important;
        border-bottom: 2px solid #000000;
    }

    .sales-guide td {
        border-top: 1px solid #cccccc;
    }

    .sales-guide tr,
    .sales-guide blockquote {
        break-inside: avoid;
    }

    .sales-guide a {
        text-decoration: underline;
        color: #000000;
    }
}
