/*
 * AMA India — Single Post Template
 * Template: single.php
 * Class prefix: .ama-sp-
 */

/* ── Design tokens ──────────────────────────────────────────────────────────── */
.ama-sp-page {
    --sp-navy:   var(--ama-navy,   #1a2744);
    --sp-maroon: var(--ama-maroon, #8a3a2a);
    --sp-cream:  var(--ama-cream,  #f5f0e8);
    --sp-gold:   var(--e-global-color-accent, #c89b3c);
    --sp-muted:  #534c45;
    --sp-border: #e4ddd4;
    --sp-text:   #1a1a1a;
    --sp-body-max: 720px;
}

/* ════════════════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════════════════ */

.ama-sp-hero {
    position: relative;
    background-color: var(--sp-navy);
    /* Diagonal stripe overlay — same visual language as MEC placeholder */
    background-image:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, .04) 0,
            rgba(255, 255, 255, .04) 3px,
            transparent 3px,
            transparent 18px
        );
    overflow: hidden;
    color: #fff;
    padding: 60px 0 48px;
}

/* Accent bar at bottom of hero */
.ama-sp-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--sp-gold);
}

/* Featured image — soft overlay behind text */
.ama-sp-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .18;
    z-index: 0;
}

.ama-sp-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Top bar: category chip + meta ──────────────────────────────────────── */

.ama-sp-hero__topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 20px;
}

a.ama-sp-hero__cat {
    display: inline-block;
    background: var(--sp-gold);
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    text-decoration: none !important;
}

/* Same defect as the archive's Read More: the resting colour is --sp-gold,
   which is the Elementor Kit Accent, while this hover was the literal #a87e2e
   left over from when that Accent was gold. Not reported, but identical, and
   on the same token — so it would have turned orange the moment anyone
   hovered a category chip on a single post. */
a.ama-sp-hero__cat:hover {
    background: var(--sp-gold, var(--e-global-color-accent, #c89b3c));
    background: color-mix(in srgb, var(--sp-gold, var(--e-global-color-accent, #c89b3c)) 85%, #000);
    color: #fff !important;
    text-decoration: none !important;
}

.ama-sp-hero__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, .65);
}

.ama-sp-hero__meta-sep {
    opacity: .4;
}

/* ── Title ───────────────────────────────────────────────────────────────── */

h1.ama-sp-hero__title {
    font-family: var(--font-sans, inherit);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 28px;
    letter-spacing: -.01em;
}

/* ── Author strip ───────────────────────────────────────────────────────── */

.ama-sp-hero__author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.ama-sp-hero__avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sp-maroon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}

.ama-sp-hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hide the gravatar <img> when it is a default/blank avatar
   (real avatars have a src with the user's email hash) */
.ama-sp-hero__avatar img[src*="gravatar.com/avatar/00000000"] {
    display: none;
}

.ama-sp-hero__author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ama-sp-hero__author-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ama-sp-hero__author-bio {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, .55);
    line-height: 1.4;
    max-width: 480px;
}

/* ════════════════════════════════════════════════════════════════════════
   ARTICLE BODY
   ════════════════════════════════════════════════════════════════════════ */

.ama-sp-body {
    padding: 56px 24px 64px;
}

.ama-sp-content {
    max-width: var(--sp-body-max);
    margin: 0 auto;
}

/* ── Editorial typography ────────────────────────────────────────────────── */

.ama-sp-content p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--sp-text);
    margin: 0 0 1.4em;
}

.ama-sp-content h2 {
    font-family: var(--font-sans, inherit);
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    font-weight: 800;
    color: var(--sp-navy);
    margin: 2em 0 .6em;
    line-height: 1.25;
}

.ama-sp-content h3 {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    font-weight: 700;
    color: var(--sp-navy);
    margin: 1.6em 0 .5em;
}

.ama-sp-content h4,
.ama-sp-content h5,
.ama-sp-content h6 {
    font-weight: 700;
    color: var(--sp-navy);
    margin: 1.2em 0 .4em;
}

.ama-sp-content ul,
.ama-sp-content ol {
    margin: 0 0 1.4em 1.4em;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.ama-sp-content li {
    margin-bottom: .35em;
}

.ama-sp-content a {
    color: var(--sp-maroon);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ama-sp-content a:hover {
    color: var(--sp-navy);
}

.ama-sp-content strong {
    color: var(--sp-navy);
}

.ama-sp-content blockquote {
    margin: 2em 0;
    padding: 20px 24px 20px 28px;
    border-left: 4px solid var(--sp-gold);
    background: var(--sp-cream);
    border-radius: 0 6px 6px 0;
    font-size: 1.125rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--sp-navy);
}

.ama-sp-content blockquote p {
    font-size: inherit;
    margin: 0;
    color: inherit;
}

.ama-sp-content figure {
    margin: 2em 0;
    text-align: center;
}

.ama-sp-content figure img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.ama-sp-content figcaption {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--sp-muted);
    font-style: italic;
}

.ama-sp-content img {
    max-width: 100%;
    height: auto;
}

.ama-sp-content hr {
    border: none;
    border-top: 2px solid var(--sp-border);
    margin: 2.5em 0;
}

.ama-sp-content pre,
.ama-sp-content code {
    font-family: var(--font-body, 'Atkinson Hyperlegible', Arial, sans-serif);
    background: #f3f0eb;
    border-radius: 3px;
}

.ama-sp-content pre {
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1.4em;
}

.ama-sp-content code {
    font-size: .9em;
    padding: 2px 5px;
}

/* ── Elementor content inside single post ───────────────────────────────── */
.ama-sp-content .elementor {
    width: 100%;
}

/* ════════════════════════════════════════════════════════════════════════
   RELATED POSTS
   ════════════════════════════════════════════════════════════════════════ */

.ama-sp-related {
    background: var(--sp-cream);
    padding: 56px 24px 64px;
    border-top: 1px solid var(--sp-border);
}

.ama-sp-related__inner {
    max-width: 1160px;
    margin: 0 auto;
}

.ama-sp-related__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 28px;
}

.ama-sp-related__heading {
    font-family: var(--font-sans);
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 800;
    color: var(--sp-navy);
    margin: 0;
}

.ama-sp-related__heading span {
    color: var(--sp-maroon);
}

a.ama-sp-related__view-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1.5px solid var(--sp-navy);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--sp-navy) !important;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

a.ama-sp-related__view-all:hover {
    background: var(--sp-navy);
    color: #fff !important;
    text-decoration: none !important;
}

.ama-sp-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Reuse .ama-post-card styles from archive — override tokens to match */
.ama-sp-related .ama-post-card {
    --arc-navy:   var(--sp-navy);
    --arc-maroon: var(--sp-maroon);
    --arc-cream:  var(--sp-cream);
    --arc-border: var(--sp-border);
    --arc-muted:  var(--sp-muted);
    --arc-gold:   var(--sp-gold);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .ama-sp-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ama-sp-hero {
        padding: 40px 0 36px;
    }

    .ama-sp-hero__title {
        font-size: 1.7rem;
    }

    .ama-sp-body {
        padding: 36px 20px 48px;
    }

    .ama-sp-related {
        padding: 36px 20px 48px;
    }

    .ama-sp-related__grid {
        grid-template-columns: 1fr;
    }
}
