/**
 * O4M Article Gate Styles
 */

/* Hide/show based on login state - using existing site CSS classes */
.o4m-article-gate .logged-in-only {
    display: none !important;
}

.o4m-article-gate .logged-out-only {
    display: block !important;
}

body.patient-logged-in .o4m-article-gate .logged-in-only {
    display: block !important;
}

body.patient-logged-in .o4m-article-gate .logged-out-only {
    display: none !important;
}

/* Article preview container */
.o4m-article-preview {
    position: relative;
    overflow: hidden;
}

/* Main content wrapper */
.o4m-article-gate .o4m-gated-content {
    max-width: 1376px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Gradient fade overlay */
.o4m-content-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 338px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 15%,
        rgba(255, 255, 255, 0.3) 30%,
        rgba(255, 255, 255, 0.5) 45%,
        rgba(255, 255, 255, 0.7) 60%,
        rgba(255, 255, 255, 0.85) 75%,
        rgba(255, 255, 255, 0.95) 90%,
        rgba(255, 255, 255, 1) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Gate overlay container */
.o4m-article-gate .o4m-gate-overlay {
    padding: 60px 20px 40px;
    background: #ffffff;
    margin-top: -150px; /* Overlap with fade */
    position: relative;
    z-index: 2;
}

.o4m-article-gate .o4m-gate-overlay-content {
    max-width: 792px;
    margin: 0 auto;
    text-align: center;
}

/* Headline */
.o4m-gate-headline {
    font-size: 29.75px;
    font-weight: 400;
    line-height: 125%;
    letter-spacing: -0.6px;
    color: #000000;
    margin: 0 0 16px 0;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Body text */
.o4m-gate-body {
    font-size: 17.5px;
    font-weight: 400;
    line-height: 150%;
    letter-spacing: 0px;
    color: #4b5563;
    margin: 0 0 24px 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Primary CTA button */
.o4m-article-gate .o4m-gate-cta-primary {
    display: flex;
    background: #162937;
    color: #FFFFFF !important;
    padding: 12px 26px;
    border-radius: 100px;
    width: 300px;
    max-width: 300px;
    height: 56px;
    font-size: 19px;
    font-weight: 500;
    line-height: 100%;
    letter-spacing: 0px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0 auto 20px auto;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.o4m-article-gate .o4m-gate-cta-primary:hover {
    background: #1f3a4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 41, 55, 0.25);
}

/* Login link */
.o4m-article-gate .o4m-gate-login-link {
    font-size: 17.5px;
    font-weight: 400;
    line-height: 150%;
    letter-spacing: 0px;
    color: #6b7280;
    margin: 20px auto 0 auto;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    max-width: 696.67px;
    height: 26px;
}

.o4m-article-gate .o4m-gate-login-link a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 400;
}

.o4m-article-gate .o4m-gate-login-link a:hover {
    text-decoration: underline;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .o4m-article-gate .o4m-gate-overlay {
        padding: 30px 16px;
    }

    .o4m-gate-headline {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .o4m-gate-body {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .o4m-article-gate .o4m-gate-cta-primary {
        font-size: 15px;
        padding: 12px 40px;
        width: 100%;
        max-width: 280px;
        min-width: unset;
    }

    .o4m-content-fade {
        height: 180px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .o4m-gate-headline {
        font-size: 22px;
    }

    .o4m-gate-body {
        font-size: 14px;
    }

    .o4m-article-gate .o4m-gate-cta-primary {
        font-size: 14px;
        padding: 12px 32px;
    }
}

/* Debug mode styles */
.o4m-gate-debug {
    background: #ffeb3b;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #fbc02d;
    font-family: monospace;
    font-size: 12px;
}

/* Ensure proper display in flex containers */
.o4m-article-gate .logged-in-only-flex {
    display: none !important;
}

.o4m-article-gate .logged-out-only-flex {
    display: flex !important;
}

body.patient-logged-in .o4m-article-gate .logged-in-only-flex {
    display: flex !important;
}

body.patient-logged-in .o4m-article-gate .logged-out-only-flex {
    display: none !important;
}

/* Additional spacing for article content */
.o4m-article-gate .o4m-gated-content {
    position: relative;
}

/* Ensure smooth transitions */
.o4m-article-gate .o4m-gate-overlay,
.o4m-content-fade {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .o4m-article-gate .o4m-gate-overlay,
    .o4m-content-fade {
        display: none !important;
    }
}
.o4m-article-gate .o4m-gate-truncated{ position: relative; }

.o4m-article-gate{display:block; width:100%;}


/* In-App (mobile app / desktop view) => show full content, hide gate */
body.patient-in-app .o4m-article-gate .logged-in-only{display:block !important;}
body.patient-in-app .o4m-article-gate .logged-out-only{display:none !important;}
/* Optional: globally hide 'hide-in-app' elements when in app */
body.patient-in-app .hide-in-app{display:none !important;}
