/* ═══════════════════════════════════════════════
   AT Health — Global Styles
   Prefix: ah-
   ═══════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    /* Primary palette — Purple */
    --ah-purple-50:  #f5f3ff;
    --ah-purple-100: #ede9fe;
    --ah-purple-200: #ddd6fe;
    --ah-purple-300: #c4b5fd;
    --ah-purple-400: #a89dd6;
    --ah-purple-500: #9b8fce;
    --ah-purple-600: #8e88d0;
    --ah-purple-700: #7d76ba;
    --ah-purple-800: #6d28d9;
    --ah-purple-900: #4c1d95;

    /* Indigo accent (hero headline) */
    --ah-indigo-500: #6366f1;

    /* Neutrals */
    --ah-cream:      #fdf8f3;
    --ah-lavender:   #f7f4f9;
    --ah-dark:       #0f1117;
    --ah-gray-50:    #f9fafb;
    --ah-gray-100:   #f3f4f6;
    --ah-gray-200:   #e5e7eb;
    --ah-gray-300:   #d1d5db;
    --ah-gray-400:   #9ca3af;
    --ah-gray-500:   #6b7280;
    --ah-gray-600:   #4b5563;
    --ah-gray-700:   #374151;
    --ah-gray-800:   #1f2937;
    --ah-gray-900:   #111827;

    /* Feedback */
    --ah-emerald-400: #34d399;
    --ah-amber-400:   #fbbf24;

    /* Typography */
    --ah-font-serif: 'DM Serif Display', serif;
    --ah-font-sans:  'Inter', sans-serif;

    /* Layout */
    --ah-container-max: 1400px;
    --ah-container-pad: 60px;
    --ah-container-pad-mobile: 24px;
}

/* ── Base ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--ah-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    color: var(--ah-gray-900);
    background: var(--ah-cream);
}

h1, h2, h3 {
    font-family: var(--ah-font-serif);
    font-weight: 400;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* ── Container System ── */
.ah-container {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: var(--ah-container-pad-mobile);
    padding-right: var(--ah-container-pad-mobile);
}

.ah-container-wide {
    max-width: var(--ah-container-max);
    margin: 0 auto;
    padding-left: var(--ah-container-pad-mobile);
    padding-right: var(--ah-container-pad-mobile);
}

@media (min-width: 768px) {
    .ah-container,
    .ah-container-wide {
        padding-left: var(--ah-container-pad);
        padding-right: var(--ah-container-pad);
    }
}

/* ── Shared Components ── */

/* Section badge (eyebrow with bar) */
.ah-section-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ah-section-badge__bar {
    width: 4px;
    height: 32px;
    background: var(--ah-purple-600);
    border-radius: 9999px;
}

.ah-section-badge__text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ah-purple-600);
}

/* CTA Button styles */
.ah-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--ah-gray-900);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 16px 36px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.ah-btn-primary:hover {
    background: var(--ah-gray-800);
    transform: translateY(-2px);
}

.ah-btn-purple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--ah-purple-600);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 16px 36px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.ah-btn-purple:hover {
    background: var(--ah-purple-700);
    transform: translateY(-2px);
}

.ah-btn-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    color: var(--ah-gray-900);
    font-size: 15px;
    font-weight: 600;
    padding: 16px 40px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
}

.ah-btn-white:hover {
    background: var(--ah-gray-100);
    transform: translateY(-2px);
}

/* Gradient text */
.ah-gradient-text {
    background: linear-gradient(135deg, var(--ah-purple-400), var(--ah-purple-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover lift utility */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* ── Hero CTA — brand-coloured with lavender glow on hover ── */
.ah-hero-cta {
    box-shadow: 0 4px 14px -4px rgba(142, 136, 208, 0.4);
}
.ah-hero-cta:hover {
    background: #7d76ba !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -10px rgba(142, 136, 208, 0.6);
}

/* ── Hero H1 italic emphasis (DM Serif Display Italic) ── */
.ah-hero-section h1 em {
    font-style: italic;
    font-weight: inherit;
}

/* ── Hero existing-patient login link ── */
.ah-hero-login a {
    text-decoration: none;
}
.ah-hero-login a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Purple utility classes (matching Tailwind config from HTML) */
.bg-purple-50  { background-color: var(--ah-purple-50); }
.bg-purple-600 { background-color: var(--ah-purple-600); }
.bg-purple-700 { background-color: var(--ah-purple-700); }
.text-purple-600 { color: var(--ah-purple-600); }
.text-purple-700 { color: var(--ah-purple-700); }
.hover\:text-purple-600:hover { color: var(--ah-purple-600); }
.hover\:bg-purple-50:hover  { background-color: var(--ah-purple-50); }
.hover\:bg-purple-700:hover { background-color: var(--ah-purple-700); }

/* ── Scroll Reveal System ── */
[data-reveal] {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal="left"] {
    opacity: 0;
    transform: translateX(-40px);
}

[data-reveal="right"] {
    opacity: 0;
    transform: translateX(40px);
}

[data-reveal="scale"] {
    opacity: 0;
    transform: scale(0.92);
}

[data-reveal].revealed {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
}

/* Stagger children */
[data-stagger] > [data-reveal] {
    transition-delay: calc(var(--stagger-index, 0) * 120ms);
}

/* ── Animations ── */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out forwards;
}

@keyframes line-grow {
    from { width: 0; }
    to   { width: 100%; }
}

.animate-line-grow {
    animation: line-grow 0.8s ease-out forwards;
}

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }

/* Count-up animation */
.count-up {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ── FAQ Accordion ── */
.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

/* ── Responsive Utilities ── */
@media (max-width: 1023px) {
    .hidden-mobile { display: none; }
}

@media (min-width: 1024px) {
    .hidden-desktop { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   SINGLE POST CONTENT — typography defaults for blog posts
   Scoped to .single-post .prose so it never affects other pages.
   ═══════════════════════════════════════════════════════════════ */
.single-post .prose {
    max-width: 740px;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--ah-gray-700);
}

.single-post .prose p {
    margin: 0 0 24px;
}

.single-post .prose p:last-child {
    margin-bottom: 0;
}

.single-post .prose h2 {
    font-family: 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ah-gray-900);
    margin: 48px 0 16px;
}

.single-post .prose h3 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ah-gray-900);
    margin: 32px 0 12px;
}

.single-post .prose h2:first-child,
.single-post .prose h3:first-child {
    margin-top: 0;
}

.single-post .prose strong,
.single-post .prose b {
    font-weight: 600;
    color: var(--ah-gray-900);
}

.single-post .prose a {
    color: var(--ah-purple-600);
    text-decoration: none;
    transition: text-decoration 0.2s ease, color 0.2s ease;
}

.single-post .prose a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.single-post .prose ul,
.single-post .prose ol {
    margin: 0 0 24px;
    padding-left: 24px;
}

.single-post .prose li {
    margin-bottom: 8px;
}

.single-post .prose blockquote {
    margin: 32px 0;
    padding: 4px 0 4px 24px;
    border-left: 3px solid var(--ah-purple-600);
    font-style: italic;
    color: var(--ah-gray-500);
}

.single-post .prose blockquote p {
    margin-bottom: 12px;
}

.single-post .prose blockquote p:last-child {
    margin-bottom: 0;
}

.single-post .prose img {
    border-radius: 12px;
    margin: 32px 0;
    max-width: 100%;
    height: auto;
}

/* ═══════════════════════════════════════════════════════════════
   HTML BLOCK / .tc-article WIDTH FIX
   Lets writers drop a full-width custom-HTML wrapper (.tc-article)
   inside a post and have it break out of the 740px content column.
   Scoped to .single body class so other page types are unaffected.
   ═══════════════════════════════════════════════════════════════ */

/* Author-supplied rules — let HTML blocks and tc-article fill 100% */
.single .wp-block-html,
.single .wp-block-html .tc-article {
    max-width: 100% !important;
    width: 100% !important;
}

.single .tc-article {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* Parent overrides — required for the author rules above to take effect.
   The post template wraps content in <div class="max-w-3xl"><div class="prose">
   which would otherwise clip tc-article at 740-768px regardless. Only fires
   when a .tc-article descendant is present. */
.single .prose:has(.tc-article) {
    max-width: none;
}
.single .max-w-3xl:has(.tc-article) {
    max-width: none;
}

/* ═══════════════════════════════════════════════════════════════
   CLINICAL REVIEW (EEAT) CARD — auto-injected at top of post content
   ═══════════════════════════════════════════════════════════════ */
.single-post .bp-review-card {
    max-width: 740px;
    margin: 0 auto 40px;
    background: #f7f8fc;
    border: 1px solid #e2e6f0;
    border-radius: 14px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}
.single-post .bp-review-header {
    background: linear-gradient(135deg, #2d3a8c 0%, #4a59b8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.single-post .bp-review-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 24px;
    background: #f7f8fc;
}
@media (min-width: 640px) {
    .single-post .bp-review-columns {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}
.single-post .bp-review-person {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.single-post .bp-review-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid #2d3a8c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.single-post .bp-review-avatar--verify {
    border-color: #10b981;
}
.single-post .bp-review-avatar--placeholder {
    background: #e5e7eb;
}
.single-post .bp-review-person > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.single-post .bp-review-label {
    font-size: 11px;
    font-weight: 700;
    color: #2d3a8c;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.single-post .bp-review-name {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.single-post .bp-review-title {
    font-size: 14px;
    color: #475569;
    line-height: 1.4;
}
.single-post .bp-review-links {
    margin-top: 8px;
}
.single-post .bp-review-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2d3a8c;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.single-post .bp-review-links a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.single-post .bp-review-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 14px 24px;
    background: #fff;
    border-top: 1px solid #e2e6f0;
}
.single-post .bp-review-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}
.single-post .bp-review-meta--check {
    color: #10b981;
}

/* ═══════════════════════════════════════════════════════════════
   TABLE OF CONTENTS — auto-injected after first paragraph
   ═══════════════════════════════════════════════════════════════ */
.single-post .bp-toc {
    max-width: 740px;
    margin: 0 auto 40px;
    background: #fff;
    border: 1px solid #e2e6f0;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}
.single-post .bp-toc-summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #2d3a8c;
    font-weight: 700;
    font-size: 15px;
}
.single-post .bp-toc-summary::-webkit-details-marker { display: none; }
.single-post .bp-toc-summary-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.single-post .bp-toc-chevron {
    transition: transform 0.2s ease;
}
.single-post .bp-toc-details[open] .bp-toc-chevron {
    transform: rotate(180deg);
}
.single-post .bp-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 24px 18px;
}
.single-post .bp-toc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}
.single-post .bp-toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef0fa;
    color: #2d3a8c;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.single-post .bp-toc-link {
    color: #2d3a8c;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s ease;
}
.single-post .bp-toc-link:hover {
    color: var(--ah-purple-600);
    text-decoration: underline;
    text-underline-offset: 3px;
}
/* Smooth-scroll target offset so anchor jumps don't hide under sticky nav */
.single-post .prose h2 {
    scroll-margin-top: 100px;
}
