/**
 * Modern single post / article layout (style 1 only): soft hero glow + primary-color accents.
 * Relies on :root vars from inc/css.php (--ahura-theme-primary, --ahura-theme-primary-rgb, glow tokens).
 */

body.single-post .site-container.ahura-post-single:has(.single-post-template-1) {
    position: relative;
    isolation: isolate;
}

/* Ambient glow: single soft circular halo behind the article (top-centered, not a full-height strip) */
body.single-post .site-container.ahura-post-single:has(.single-post-template-1)::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -36%);
    width: min(92vw, 840px);
    height: min(92vw, 840px);
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(
        circle at 50% 50%,
        var(--ahura-theme-glow-strong) 0%,
        var(--ahura-theme-glow-mid) 24%,
        var(--ahura-theme-glow-soft) 48%,
        transparent 64%
    );
    filter: blur(40px);
    opacity: 0.9;
}

body.single-post .ahura-post-single .wrapper.single-post-template-1,
body.single-post .ahura-post-single .single-post-template-1 .post-box.content {
    position: relative;
    z-index: 1;
}

/* Main article card */
body.single-post .ahura-post-single .single-post-template-1 article.post-entry.post-entry-custom:not(.ah-post-comments-wrap) {
    position: relative;
    border-radius: 16px;
    padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 36px);
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.22);
    background:
        linear-gradient(155deg,
            var(--ahura-c-bg-primary) 0%,
            rgba(var(--ahura-theme-primary-rgb), 0.04) 45%,
            var(--ahura-c-bg-primary) 100%);
    box-shadow:
        0 0 0 1px rgba(var(--ahura-theme-primary-rgb), 0.08),
        0 4px 24px rgba(var(--ahura-theme-primary-rgb), 0.1),
        0 0 80px -12px var(--ahura-theme-glow-soft);
    overflow: visible;
}

body.single-post .ahura-post-single .single-post-template-1 article.post-entry.post-entry-custom:not(.ah-post-comments-wrap)::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        var(--ahura-theme-glow-strong),
        rgba(var(--ahura-theme-primary-rgb), 0.08) 40%,
        var(--ahura-theme-glow-mid)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.55;
}

/* Title */
body.single-post .ahura-post-single .single-post-template-1 .post-title h1 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    background: linear-gradient(
        90deg,
        var(--ahura-c-text-primary) 0%,
        rgba(var(--ahura-theme-primary-rgb), 0.92) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    line-height: 1.35;
}

body.single-post .ahura-post-single .single-post-template-1 .post-title::after {
    content: "";
    display: block;
    width: 60%;
    height: 3px;
    margin-top: 10px;
    margin-bottom: 1.25rem;
    max-width: none;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--ahura-theme-primary),
        rgba(var(--ahura-theme-primary-rgb), 0.25)
    );
    box-shadow: 0 0 18px var(--ahura-theme-glow-mid);
}

body.rtl.single-post .ahura-post-single .single-post-template-1 .post-title::after {
    background: linear-gradient(
        270deg,
        var(--ahura-theme-primary),
        rgba(var(--ahura-theme-primary-rgb), 0.25)
    );
}

/* Meta pills */
body.single-post .ahura-post-single .single-post-template-1 ul.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 1.25rem;
    padding: 0;
}

body.single-post .ahura-post-single .single-post-template-1 .post-meta li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--ahura-c-text-secondary);
    background: var(--ahura-theme-surface);
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.18);
    border-radius: 999px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

body.single-post .ahura-post-single .single-post-template-1 .post-meta li:hover {
    border-color: rgba(var(--ahura-theme-primary-rgb), 0.45);
    box-shadow: 0 0 20px var(--ahura-theme-glow-soft);
    background: var(--ahura-theme-surface-deep);
}

body.single-post .ahura-post-single .single-post-template-1 .post-meta li a {
    color: inherit;
}

/* Featured image */
body.single-post .ahura-post-single .single-post-template-1 .single-post-thumbnail {
    margin-bottom: 1.5rem;
}

body.single-post .ahura-post-single .single-post-template-1 .single-post-thumbnail img {
    border-radius: 14px;
    box-shadow:
        0 12px 40px rgba(var(--ahura-theme-primary-rgb), 0.18),
        0 0 0 1px rgba(var(--ahura-theme-primary-rgb), 0.12);
}

/* Post body: no panel background or border on .post-content-wrap */
body.single-post .ahura-post-single .single-post-template-1 .post-content-wrap {
    position: static;
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

body.single-post .ahura-post-single .single-post-template-1 .post-entry blockquote {
    border-inline-start: 3px solid var(--ahura-theme-primary);
    background: var(--ahura-theme-surface);
    box-shadow: 0 0 24px var(--ahura-theme-glow-soft);
}

/* Author box */
body.single-post .ahura-post-single .single-post-template-1 .authorbox {
    margin-top: 2rem;
    padding: clamp(16px, 2.5vw, 22px);
    border-radius: 14px;
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.2);
    background: linear-gradient(
        160deg,
        var(--ahura-c-bg-primary),
        var(--ahura-theme-surface)
    );
    box-shadow:
        0 8px 32px rgba(var(--ahura-theme-primary-rgb), 0.1),
        0 0 0 1px rgba(var(--ahura-theme-primary-rgb), 0.06);
}

body.single-post .ahura-post-single .single-post-template-1 .authorimg img {
    box-shadow: 0 0 0 3px rgba(var(--ahura-theme-primary-rgb), 0.25), 0 12px 28px rgba(var(--ahura-theme-primary-rgb), 0.2);
}

body.single-post .ahura-post-single .single-post-template-1 .authorabout span a:not(a.author-link) {
    display: inline-block;
    margin-inline-start: 0.35rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    border-radius: 999px;
    background: var(--ahura-theme-primary);
    color: var(--ahura-c-bg-primary);
    box-shadow: 0 0 16px var(--ahura-theme-glow-soft);
}

/* Tags */
body.single-post .ahura-post-single .single-post-template-1 #tags {
    margin-top: 1.5rem;
}

body.single-post .ahura-post-single .single-post-template-1 #tags a {
    display: inline-block;
    padding: 5px 11px;
    margin: 4px 2px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.35);
    background: var(--ahura-theme-surface);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

body.single-post .ahura-post-single .single-post-template-1 #tags a:hover {
    border-color: var(--ahura-theme-primary);
    box-shadow: 0 0 18px var(--ahura-theme-glow-mid);
}

/* Comments block */
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap {
    border-radius: 16px;
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.18);
    box-shadow: 0 8px 36px rgba(var(--ahura-theme-primary-rgb), 0.08);
    margin-top: 1.5rem;
}

/* Related articles — same boxed treatment as comments */
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-related-posts-wrap {
    border-radius: 16px;
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.18);
    box-shadow: 0 8px 36px rgba(var(--ahura-theme-primary-rgb), 0.08);
    margin-top: 1.5rem;
}

/* Tighter gaps between related article cards (grid gutters + stacked rows) */
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-related-posts-wrap .related-posts > .row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

/* Section title: accent line (match main article title bar); card titles stay plain below */
body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .related-posts-title {
    padding-bottom: 0;
}

body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .related-posts-title::after {
    content: "";
    display: block;
    height: 3px;
    margin-top: 10px;
    margin-bottom: 1rem;
    max-width: 120px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--ahura-theme-primary),
        rgba(var(--ahura-theme-primary-rgb), 0.25)
    );
    box-shadow: 0 0 18px var(--ahura-theme-glow-mid);
}

/* Remove lines / pseudo decorations under individual related post titles */
body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .related-post-card__title,
body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .post-item :is(.post-title, h1, h2, h3, h4).post-title,
body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .related-posts-3 .post-title {
    border: none !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    box-shadow: none !important;
}

body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .related-post-card__title::after,
body.single-post .ahura-post-single .single-post-template-1 .ah-related-posts-wrap .post-item .post-title::after {
    display: none !important;
    content: none !important;
}

/* Comments — gradient line under “Leave a reply” (override legacy .comments-area h3 border) */
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .comments-area .comment-reply-title {
    border-bottom: none !important;
    padding-bottom: 0;
    margin-bottom: 0;
}

body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .comments-area .comment-reply-title::after {
    content: "";
    display: block;
    height: 3px;
    margin-top: 10px;
    margin-bottom: 1.25rem;
    max-width: 120px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--ahura-theme-primary),
        rgba(var(--ahura-theme-primary-rgb), 0.25)
    );
    box-shadow: 0 0 18px var(--ahura-theme-glow-mid);
}

/* Comment form — submit as primary CTA (equal specificity w/ #commentform so Customizer colors can still win) */
:where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform .form-submit {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

:where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform input[type="submit"],
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .ah-comments-template-2 #commentform input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10.5rem;
    width: auto;
    padding: 0.65rem 1.85rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-align: center;
    color: #fff;
    background-color: var(--ahura-theme-primary);
    background-image: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.14) 0%,
        transparent 52%
    );
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.35);
    border-radius: 999px;
    box-shadow:
        0 2px 10px rgba(var(--ahura-theme-primary-rgb), 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

:where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform input[type="submit"]:hover,
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .ah-comments-template-2 #commentform input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow:
        0 6px 22px rgba(var(--ahura-theme-primary-rgb), 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.16) inset;
    border-color: rgba(var(--ahura-theme-primary-rgb), 0.55);
}

:where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform input[type="submit"]:active,
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .ah-comments-template-2 #commentform input[type="submit"]:active {
    transform: translateY(0);
    box-shadow:
        0 1px 6px rgba(var(--ahura-theme-primary-rgb), 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

:where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform input[type="submit"]:focus-visible,
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .ah-comments-template-2 #commentform input[type="submit"]:focus-visible {
    outline: 2px solid var(--ahura-theme-primary);
    outline-offset: 3px;
}

:where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform input[type="submit"]:disabled,
body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .ah-comments-template-2 #commentform input[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

body.single-post .single-post-template-3 .post-title h1 {
    color: var(--ahura-c-text-primary);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: currentColor;
}

/* Solid title on dark themes for readability */
:root.ahura-dark-theme body.single-post .ahura-post-single .single-post-template-1 .post-title h1,
:root.ahura-black-theme body.single-post .ahura-post-single .single-post-template-1 .post-title h1 {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    color: var(--ahura-c-text-primary);
}

@media (prefers-reduced-motion: reduce) {
    body.single-post .ahura-post-single .single-post-template-1 .post-meta li,
    body.single-post .ahura-post-single .single-post-template-1 #tags a {
        transition: none;
    }

    :where(body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap) #commentform input[type="submit"]:hover,
    body.single-post .ahura-post-single .single-post-template-1 .post-entry.ah-post-comments-wrap .ah-comments-template-2 #commentform input[type="submit"]:hover {
        transform: none;
    }
}
