/**
 * THE HALDANKAR METHOD - AMBIENT PROMOTION COMPONENT
 * Dark-mode obsidian styling with APCA L_c > 75 contrast.
 * Converts to slim bottom bar on mobile to comply with Google interstitial guidelines.
 */

:root {
    --promo-bg-surface: #09090b;
    --promo-border: #27272a;
    --promo-border-gold: rgba(198, 162, 39, 0.4);
    --promo-gold: #c6a227;
    --promo-gold-hover: #d4af37;
    --promo-text-primary: #f4f4f5;
    --promo-text-secondary: #d4d4d8;
    --promo-text-muted: #a1a1aa;
    --promo-font-serif: 'Playfair Display', Georgia, serif;
    --promo-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --promo-font-mono: 'JetBrains Mono', monospace;
}

/* Container Capsule */
.thm-promo-capsule {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 390px;
    max-width: calc(100vw - 3rem);
    background-color: var(--promo-bg-surface);
    border: 1px solid var(--promo-border);
    border-top: 2px solid var(--promo-gold);
    border-radius: 2px;
    padding: 1rem 1.15rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
    z-index: 9999;
    font-family: var(--promo-font-sans);
    color: var(--promo-text-secondary);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.thm-promo-capsule.thm-promo--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header & Eyebrow */
.thm-promo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.thm-promo-eyebrow {
    font-family: var(--promo-font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--promo-gold);
}

/* Close Button (44x44px Accessible Touch Target) */
.thm-promo-close {
    background: transparent;
    border: none;
    color: var(--promo-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    margin: -10px -10px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: color 0.15s, background-color 0.15s;
}

.thm-promo-close:hover,
.thm-promo-close:focus-visible {
    color: var(--promo-text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    outline: none;
}

/* Flex Body with Thumbnail */
.thm-promo-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.thm-promo-thumb {
    width: 64px;
    height: auto;
    aspect-ratio: 864 / 1232;
    flex-shrink: 0;
    border: 1px solid var(--promo-border);
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: block;
}

.thm-promo-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Title & Description */
.thm-promo-title {
    font-family: var(--promo-font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--promo-text-primary);
    line-height: 1.2;
    margin: 0 0 0.3rem 0;
}

.thm-promo-desc {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--promo-text-muted);
    margin: 0 0 0.65rem 0;
}

/* CTA Action */
.thm-promo-action {
    display: flex;
    justify-content: flex-start;
}

.thm-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #000000;
    background-color: var(--promo-gold);
    border: 1px solid var(--promo-gold);
    border-radius: 2px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.thm-promo-btn:hover,
.thm-promo-btn:focus-visible {
    background-color: var(--promo-gold-hover);
    border-color: var(--promo-gold-hover);
    outline: 2px solid var(--promo-gold-hover);
    outline-offset: 2px;
}

/* Mobile Adaptation (< 768px: Slim Bottom Bar) */
@media (max-width: 768px) {
    .thm-promo-capsule {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
        border-right: none;
        border-left: none;
        border-bottom: none;
        padding: 0.75rem 1rem;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.9);
    }
    .thm-promo-thumb {
        display: none; /* Hide thumbnail on mobile to maintain slim height <= 110px */
    }
    .thm-promo-title {
        font-size: 0.95rem;
    }
    .thm-promo-desc {
        display: none; /* Hide description on mobile */
    }
}
