/*
 * SWM Post Layout — Shelly Wilson Ministries
 * Targets Composer's exact class structure confirmed from browser inspector:
 *   body.single-post > #main-wrapper > #wrapper > .newsection.single-blog-style1
 *     > .container > .single-blog > article > .entry-content > .swmpl-wrap
 *
 * The footer gap fix targets ONLY .single-post #main-wrapper — the exact
 * element confirmed to have padding-bottom: 969.967px from main.css line 10.
 * No !important, no broad selectors, no admin impact.
 */

/* ═══════════════════════════════════════════════════════
   FOOTER GAP FIX
   Composer's JS sets padding-bottom inline on #main-wrapper
   to the height of the sticky reveal footer. !important is
   required here — and safe here — because this selector only
   fires on body.single-post, never in admin or other pages.
═══════════════════════════════════════════════════════ */
body.single-post #main-wrapper {
    padding-bottom: 0 !important;
}

/* ═══════════════════════════════════════════════════════
   HIDE COMPOSER'S OWN SINGLE POST CHROME
   The theme still renders its title, categories, author
   block, and share icons above our layout. Hide them so
   our layout is the only thing showing. Scoped tightly
   to single-post + single-blog so nothing else is touched.
═══════════════════════════════════════════════════════ */
body.single-post .single-blog .move-up.heading,
body.single-post .single-blog .post-author,
body.single-post .single-blog .tags.style1,
body.single-post .single-blog .social-share,
body.single-post .single-blog .cats,
body.single-post .single-blog .media-con,
body.single-post .single-blog .related-post,
body.single-post .single-blog .blog-img {
    display: none;
}

/* ═══════════════════════════════════════════════════════
   LAYOUT VARIABLES
   Scoped to .swmpl-wrap — zero impact outside our plugin.
═══════════════════════════════════════════════════════ */
.swmpl-wrap {
    --swmpl-navy:    #2b3560;
    --swmpl-gold:    #b8973a;
    --swmpl-gold-dk: #9a7d2e;   /* darker gold, 4.5:1 contrast on white */
    --swmpl-cream:   #faf8f4;
    --swmpl-text:    #2e2e2e;
    --swmpl-muted:   #595959;   /* AA compliant on white */
    --swmpl-serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --swmpl-sans:    'Raleway', 'Helvetica Neue', Arial, sans-serif;
    --swmpl-radius:  4px;

    padding: 40px 0 0;
    color: var(--swmpl-text);
    font-family: var(--swmpl-sans);
    box-sizing: border-box;
}

/* ADA focus indicators */
.swmpl-wrap a:focus-visible,
.swmpl-wrap button:focus-visible {
    outline: 3px solid var(--swmpl-gold);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════
   HEADER ROW — square image left, meta right
═══════════════════════════════════════════════════════ */
.swmpl-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 44px;
}

/* Square image */
.swmpl-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--swmpl-radius);
    background: var(--swmpl-navy);
}
.swmpl-featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Meta column */
.swmpl-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 8px;
}

/* Breadcrumb */
.swmpl-breadcrumb { margin-bottom: 18px; }
.swmpl-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-family: var(--swmpl-sans);
    font-size: 11px;
    letter-spacing: .06em;
}
.swmpl-breadcrumb li {
    display: flex;
    align-items: center;
    color: var(--swmpl-muted);
}
.swmpl-breadcrumb li + li::before {
    content: '›';
    margin-right: 4px;
    color: #aaa;
}
.swmpl-breadcrumb a {
    color: var(--swmpl-gold-dk);
    text-decoration: none;
}
.swmpl-breadcrumb a:hover { text-decoration: underline; }

/* Category badges */
.swmpl-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.swmpl-cat-badge {
    background: var(--swmpl-navy);
    color: #fff;
    font-family: var(--swmpl-sans);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 4px 12px;
    text-decoration: none;
    border-radius: 2px;
    transition: background .2s;
}
.swmpl-cat-badge:hover { background: var(--swmpl-gold-dk); }

/* Post title */
.swmpl-title {
    font-family: var(--swmpl-serif);
    font-size: clamp(26px, 3.5vw, 42px);
    font-weight: 500;
    color: var(--swmpl-navy);
    line-height: 1.2;
    margin: 0 0 14px;
    text-transform: none;
    letter-spacing: 0;
}

/* Date + author */
.swmpl-byline {
    font-family: var(--swmpl-sans);
    font-size: 12px;
    color: var(--swmpl-muted);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.swmpl-byline-sep { color: #bbb; }

/* Tags */
.swmpl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}
.swmpl-tag {
    font-family: var(--swmpl-sans);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--swmpl-gold-dk);
    text-decoration: none;
    border: 1px solid var(--swmpl-gold);
    padding: 3px 10px;
    border-radius: 2px;
    transition: background .2s, color .2s;
}
.swmpl-tag:hover { background: var(--swmpl-gold); color: #fff; }

/* Gold rule */
.swmpl-rule {
    width: 52px;
    height: 2px;
    background: var(--swmpl-gold);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   CONTENT BODY
═══════════════════════════════════════════════════════ */
.swmpl-content {
    font-size: 17px;
    line-height: 1.85;
    color: var(--swmpl-text);
    margin-bottom: 48px;
    border-top: 1px solid #e8e3d9;
    padding-top: 36px;
    /* Override Composer's entry-content styles */
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-left: 0;
    padding-right: 0;
    min-height: 0;
}
.swmpl-content p { margin: 0 0 1.4em; }
.swmpl-content h2,
.swmpl-content h3,
.swmpl-content h4 {
    font-family: var(--swmpl-serif);
    color: var(--swmpl-navy);
    margin: 1.6em 0 .5em;
    text-transform: none;
    letter-spacing: 0;
}
.swmpl-content h2 { font-size: 30px; }
.swmpl-content h3 { font-size: 24px; }
.swmpl-content h4 { font-size: 20px; }
.swmpl-content a { color: var(--swmpl-gold-dk); text-decoration: underline; }
.swmpl-content a:hover { color: var(--swmpl-navy); }
.swmpl-content blockquote {
    border-left: 3px solid var(--swmpl-gold);
    border-top: none;
    border-right: none;
    border-bottom: none;
    margin: 1.6em 0;
    padding: 4px 0 4px 22px;
    font-family: var(--swmpl-serif);
    font-size: 21px;
    font-style: italic;
    color: var(--swmpl-navy);
    background: none;
}
.swmpl-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--swmpl-radius);
}
.swmpl-content ul,
.swmpl-content ol { padding-left: 1.5em; margin-bottom: 1.4em; }
.swmpl-content li { margin-bottom: .5em; }
.swmpl-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 16px;
}
.swmpl-content table th,
.swmpl-content table td {
    padding: 10px 14px;
    border: 1px solid #e5e1d8;
    color: var(--swmpl-navy);
    font-family: var(--swmpl-serif);
    font-style: italic;
}
.swmpl-content table th {
    background: var(--swmpl-cream);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   SHARE BAR
═══════════════════════════════════════════════════════ */
.swmpl-share {
    border-top: 1px solid #e8e3d9;
    border-bottom: 1px solid #e8e3d9;
    padding: 24px 0;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.swmpl-share-label {
    font-family: var(--swmpl-sans);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--swmpl-muted);
    margin: 0;
    white-space: nowrap;
}
.swmpl-share-links { display: flex; gap: 8px; flex-wrap: wrap; }
.swmpl-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--swmpl-sans);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    transition: background .2s, color .2s;
    white-space: nowrap;
    color: #fff;
}
.swmpl-share-fb { background: #1877f2; }
.swmpl-share-fb:hover { background: #0d5bb5; color: #fff; }
.swmpl-share-tw { background: #111; }
.swmpl-share-tw:hover { background: #333; color: #fff; }
.swmpl-share-li { background: #0a66c2; }
.swmpl-share-li:hover { background: #004899; color: #fff; }
.swmpl-share-em { background: var(--swmpl-navy); }
.swmpl-share-em:hover { background: var(--swmpl-gold-dk); color: #fff; }

/* ═══════════════════════════════════════════════════════
   RELATED POSTS
═══════════════════════════════════════════════════════ */
.swmpl-related { margin-bottom: 52px; }
.swmpl-related-title {
    font-family: var(--swmpl-serif);
    font-size: 28px;
    font-weight: 500;
    color: var(--swmpl-navy);
    text-transform: none;
    margin: 0 0 8px;
    letter-spacing: 0;
}
.swmpl-related-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--swmpl-gold);
    margin-top: 8px;
    margin-bottom: 24px;
}
.swmpl-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.swmpl-related-card {
    background: #fff;
    border-radius: var(--swmpl-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.swmpl-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.swmpl-related-img-link { display: block; line-height: 0; }
.swmpl-related-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--swmpl-navy);
}
.swmpl-related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}
.swmpl-related-card:hover .swmpl-related-img img { transform: scale(1.04); }
.swmpl-related-img--placeholder {
    background: linear-gradient(135deg, var(--swmpl-navy) 0%, #3d4f8a 100%);
}
.swmpl-related-body {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.swmpl-related-date {
    font-family: var(--swmpl-sans);
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--swmpl-muted);
    text-transform: uppercase;
    margin: 0 0 6px;
}
.swmpl-related-post-title {
    font-family: var(--swmpl-serif);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 8px;
    color: var(--swmpl-navy);
    text-transform: none;
    letter-spacing: 0;
}
.swmpl-related-post-title a { color: inherit; text-decoration: none; }
.swmpl-related-post-title a:hover { color: var(--swmpl-gold-dk); }
.swmpl-related-excerpt {
    font-size: 13px;
    line-height: 1.65;
    color: #555;
    margin: 0;
    flex: 1;
}

/* ═══════════════════════════════════════════════════════
   COMMENTS — style Composer's own comment output
   Scoped to body.single-post so admin is never touched
═══════════════════════════════════════════════════════ */
body.single-post .single-blog #comments,
body.single-post .single-blog .comments-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 26px;
    font-weight: 500;
    color: #2b3560;
    text-transform: none;
    letter-spacing: 0;
}
body.single-post .single-blog .comment-form #submit {
    background: #2b3560;
    color: #fff;
    border: none;
    padding: 10px 28px;
    font-family: 'Raleway', Arial, sans-serif;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: background .2s;
}
body.single-post .single-blog .comment-form #submit:hover {
    background: #9a7d2e;
}
body.single-post .single-blog .comment-author .fn {
    font-family: 'Raleway', Arial, sans-serif;
    color: #2b3560;
    font-style: normal;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 780px) {
    .swmpl-header {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .swmpl-image {
        max-width: 400px;
        margin: 0 auto;
    }
    .swmpl-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 560px) {
    .swmpl-related-grid {
        grid-template-columns: 1fr;
    }
    .swmpl-share {
        flex-direction: column;
        align-items: flex-start;
    }
}
