/**
 * HireTheVeterans.com — CMS Public Page Styles
 * File: assets/css/cms.css
 *
 * Inherits all variables, resets, typography, cards, buttons,
 * container, and footer from style.css — do not redefine those here.
 *
 * Covers:
 *   - Page banner (shared across all templates)
 *   - Template: default  (terms, privacy, support pages)
 *   - Template: full_width
 *   - Template: sidebar
 *   - Template: landing
 *   - cms-body — TinyMCE output normalisation
 *   - 404 block
 */

/* ------------------------------------------------------------------
   Page Banner — navy header block used across all templates
------------------------------------------------------------------ */
.cms-page-banner {
    background: var(--navy);
    padding: 3rem 0 2.5rem;
    position: relative;
}

.cms-page-banner::after {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--red) 0%, var(--red) 50%, var(--blue) 50%, var(--blue) 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.cms-banner-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--white);
    margin: 0 0 0.25rem;
    line-height: 1.1;
}

.cms-banner-meta {
    font-family: 'Source Serif 4', serif;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
    margin: 0.5rem 0 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* ------------------------------------------------------------------
   Section wrapper
------------------------------------------------------------------ */
.cms-section {
    padding: 3rem 0 5rem;
}

/* ------------------------------------------------------------------
   Template: default — narrow centred column
------------------------------------------------------------------ */
.cms-default-layout {
    max-width: 820px;
    margin: 0 auto;
}

.cms-article {
    /* Extends .card from style.css */
}

.cms-card-body {
    padding: 2.5rem;
}

.cms-featured-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
}

/* ------------------------------------------------------------------
   Template: full_width — hero image + contained body
------------------------------------------------------------------ */
.cms-hero {
    position: relative;
    min-height: 320px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.cms-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(27,42,74,0.3), rgba(27,42,74,0.85));
    display: flex;
    align-items: flex-end;
    width: 100%;
    padding-bottom: 2.5rem;
}

.cms-hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--white);
    margin: 0;
    line-height: 1.1;
}

.cms-body--wide {
    max-width: 960px;
    margin: 0 auto;
}

/* ------------------------------------------------------------------
   Template: sidebar — two-column with sticky nav aside
------------------------------------------------------------------ */
.cms-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2rem;
    align-items: start;
}

.cms-main {
    min-width: 0;
}

.cms-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
}

.cms-sidebar-widget {
    /* Extends .card */
}

.cms-sidebar-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-dark);
    margin: 0 0 1rem;
}

.cms-sidebar-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cms-sidebar-links li {
    border-bottom: 1px solid var(--border-light);
}

.cms-sidebar-links li:last-child {
    border-bottom: none;
}

.cms-sidebar-links a {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--navy);
    text-decoration: none;
    transition: color var(--transition), padding-left var(--transition);
}

.cms-sidebar-links a:hover {
    color: var(--red);
    padding-left: 4px;
}

/* ------------------------------------------------------------------
   Template: landing — large hero, TinyMCE handles sections
------------------------------------------------------------------ */
.cms-landing-hero {
    min-height: 360px;
    background: var(--navy);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    position: relative;
}

.cms-landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(27,42,74,0.6);
}

.cms-landing-hero .container {
    position: relative;
    z-index: 1;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* ------------------------------------------------------------------
   TinyMCE body content normalisation
   Overrides global h1-h6 uppercase/condensed for prose readability.
   Headings inside .cms-body are treated as document headings, not
   site section titles, so we ease back the uppercase and weight.
------------------------------------------------------------------ */
.cms-body {
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-body);
}

.cms-body h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--navy-pale);
}

.cms-body h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--navy);
    margin: 2rem 0 0.6rem;
}

.cms-body h4 {
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 1.5rem 0 0.4rem;
    text-transform: none;
    letter-spacing: 0;
}

.cms-body p {
    margin: 0 0 1.25rem;
    font-family: 'Source Serif 4', serif;
    font-size: 1rem;
}

.cms-body ul,
.cms-body ol {
    margin: 0 0 1.25rem 1.5rem;
    padding: 0;
    font-family: 'Source Serif 4', serif;
}

.cms-body li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

.cms-body a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cms-body a:hover {
    color: var(--navy);
}

.cms-body strong,
.cms-body b {
    font-weight: 700;
    color: var(--text-dark);
}

.cms-body em,
.cms-body i {
    font-style: italic;
}

.cms-body blockquote {
    border-left: 4px solid var(--blue);
    margin: 1.75rem 0;
    padding: 1rem 1.5rem;
    background: var(--blue-pale);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.cms-body blockquote p {
    color: var(--navy);
    font-style: italic;
    margin: 0;
}

.cms-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    font-size: 0.95rem;
    font-family: 'Barlow', sans-serif;
}

.cms-body th {
    background: var(--navy);
    color: var(--white);
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cms-body td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-family: 'Barlow', sans-serif;
    color: var(--text-body);
}

.cms-body tr:nth-child(even) td {
    background: var(--surface-alt);
}

.cms-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
    margin: 1.5rem 0;
}

.cms-body hr {
    border: none;
    border-top: 2px solid var(--border-light);
    margin: 2.5rem 0;
}

/* Inline code */
.cms-body code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--navy-pale);
    color: var(--navy);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* Code block */
.cms-body pre {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.75rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.cms-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* ------------------------------------------------------------------
   404 block
------------------------------------------------------------------ */
.cms-404-section {
    padding: 5rem 0;
}

.cms-404-box {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.cms-404-body {
    padding: 3rem 2rem;
}

.cms-404-code {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 6rem;
    font-weight: 900;
    color: var(--navy-pale);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.cms-404-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--navy);
    margin: 0 0 1rem;
}

.cms-404-sub {
    font-family: 'Source Serif 4', serif;
    color: var(--text-muted);
    margin: 0 0 2rem;
    line-height: 1.6;
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 900px) {
    .cms-sidebar-layout {
        grid-template-columns: 1fr;
    }

    .cms-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .cms-banner-title {
        font-size: 1.9rem;
    }

    .cms-hero-title {
        font-size: 2.2rem;
    }

    .cms-card-body {
        padding: 1.5rem;
    }

    .cms-hero {
        min-height: 220px;
    }

    .cms-landing-hero {
        min-height: 260px;
    }

    .cms-body h2 {
        font-size: 1.35rem;
    }

    .cms-body h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .cms-banner-title {
        font-size: 1.6rem;
    }

    .cms-404-code {
        font-size: 4rem;
    }
}
