/* ==========================================================
   MeroRetirement Blog — layered on Bootstrap 5.3
   Tokens taken from meroretirement.com/css/style.css
   ========================================================== */
:root {
    --primary: #614fe9;
    --primary-dark: #2615a6;
    --dark: #3a3a3a;
    --ink: #141316;
    --muted: #526484;
    --light: #f4f6f8;
    --tint: #f2f2ff;
    --line: rgba(0, 0, 0, .1);
    --radius: 8px;
    --bs-primary: #614fe9;
    --bs-primary-rgb: 97, 79, 233;
    --bs-body-font-family: "Inter", system-ui, sans-serif;
    --bs-body-color: var(--ink);
    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--primary-dark);
}

body {
    font-size: 1rem;
    line-height: 1.4;
}

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

a {
    text-decoration: none;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
}

button {
    cursor: pointer;
    border-radius: 4px !important;
}

/* Accessibility helpers */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 3000;
    background: var(--ink);
    color: #fff;
    padding: .75rem 1rem;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/* Buttons */
.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-disabled-bg: var(--primary);
    font-weight: 600;
    border-radius: var(--radius);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary-dark);
    font-weight: 600;
    border-radius: var(--radius);
}

/* Header */
.top-bar {
    background: var(--primary);
    color: #fff;
    font-size: .875rem;
    padding: .35rem 0;
}

.top-bar a {
    color: #fff;
    text-decoration: underline;
}

.nav-wrap {
    background: #fff;
    box-shadow: 0 4px 4px rgba(0, 0, 0, .05);
    padding: .75rem 0;
}

.nav-wrap .nav-link {
    color: var(--ink);
    padding: .5rem 0;
}

.nav-wrap .nav-link:hover,
.nav-wrap .nav-link[aria-current="page"] {
    color: var(--primary);
}

.nav-wrap .navbar-brand img {
    height: 36px;
    width: auto;
}

.search-form .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
    border-color: #adb5bd;
    min-width: 0;
}

.search-form .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Hero (short, full-width media) */
.hero {
    position: relative;
    isolation: isolate;
    color: #fff;
    min-height: clamp(400px, 26vw, 500px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--dark);
}

.hero-media,
.hero-media video,
.hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .2);
    z-index: -1;
}

.hero h1 {
    color: #fff;
    font-size: clamp(1.35rem, 4vw, 2.5rem);
}

.hero p {
    max-width: 40rem;
    margin: .5rem 0 0;
}

.hero-pause {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    background: none;
    color: #fff;
    border: none;
    padding: .25rem .75rem;
    font-size: 1rem;
}

.hero-pause:hover {
    background: #000;
}

#sub-title {
    font-size: 1rem;
    margin: .5rem 0 0;
}

#highlight-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 1rem 0 0;
}

/* Topic chips */
.chip {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 40px;
    background: var(--tint);
    color: var(--primary-dark);
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

a.chip:hover,
a.chip[aria-current="true"] {
    background: var(--primary);
    color: #fff;
}

.chip-row {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .25rem;
    scrollbar-width: thin;
}

.chip-row .chip {
    white-space: nowrap;
}

.chip.active {
    background: var(--primary);
    color: #fff;
}

/* Section titles */
.section-title {
    font-size: 1.5rem;
    margin: 0 0 1.25rem;
}

.section-pad {
    padding: 3rem 0;
}

.light-bg {
    background: var(--light);
}

/* Post cards */
.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    transition: box-shadow .2s, filter 0.2s ease-in-out;
}

.post-card:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, .1);
    filter: drop-shadow(0 0 8px rgba(33, 150, 243, 0.4)) brightness(0.9);
}

.post-card img {
    width: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    display: block;
}

.post-card__body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}

.post-card h3 {
    font-size: 1.125rem;
    margin: 0;
}

.post-card h3 a {
    color: var(--ink);
}

.post-card h3 a:hover {
    color: var(--primary);
}

.post-card p {
    margin: 0;
    color: #3d4452;
    font-size: .9375rem;
}

.meta {
    color: var(--muted);
    font-size: .875rem;
}

/* Pinned (large) card */
.post-card--pinned img {
    aspect-ratio: 16 / 9;
}

.post-card--pinned h3 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.post-card--pinned p {
    font-size: 1.0625rem;
}

.pin-label {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: .875rem;
}

/* Compact (stacked) card */
.post-card--row {
    flex-direction: row;
    align-items: stretch;
}

.post-card--row img {
    width: 38%;
    aspect-ratio: auto;
    height: 100%;
    min-height: 110px;
    flex-shrink: 0;
}

.post-card--row .post-card__body {
    padding: .75rem 1rem;
    gap: .25rem;
    justify-content: center;
}

.post-card--row h3 {
    font-size: 1rem;
}

/* Newsletter */
.newsletter {
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
}

.newsletter h2 {
    color: #fff;
    font-size: 1.5rem;
}

.newsletter .form-control {
    height: 45px;
    border-radius: var(--radius);
}


/* ==================== Post page ==================== */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    background: var(--primary);
    z-index: 2000;
}

/* On desktop the header is position:fixed (see responsive.css). The post detail
   page starts with the breadcrumb (no hero), so offset its content to clear the
   fixed header — otherwise the breadcrumb sits hidden behind it. */
@media (min-width: 992px) {
    .post-detail-main {
        padding-top: 113px;
    }
}

.breadcrumb {
    font-size: .9375rem;
    margin: 0;
    --bs-breadcrumb-divider: '›';
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--muted, #6c757d);
    content: var(--bs-breadcrumb-divider, '›');
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumb a:hover {
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #3d4452;
}

.truncate-text {
    max-width: 14rem;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.post-header {
    max-width: 820px;
    margin: 0 auto;
}

.post-header h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    letter-spacing: -.01em;
}

.post-dek {
    font-size: 1.25rem;
    color: #3d4452;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.post-cover {
    max-width: 1140px;
    margin: 2rem auto 0;
}

.post-cover img {
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    border-radius: var(--radius);
}

.post-cover figcaption {
    color: var(--muted);
    font-size: .875rem;
    margin-top: .5rem;
}

.post-layout {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
}

.share-rail {
    position: sticky;
    top: 1.5rem;
    float: left;
    margin-left: -4.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    font-size: 1.125rem;
    transition: background .2s;
}

.share-btn:hover {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 991.98px) {
    .share-rail {
        display: none;
    }
}

.prose {
    font-size: 1.125rem;
    line-height: 1.8;
}

.prose p,
.prose ul,
.prose ol {
    margin-bottom: 1.5rem;
}

.prose p {
    font-size: 1rem;
}

/* Tables authored in the editor render with visible cell borders. */
.prose table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    font-size: 1rem;
}

.prose table th,
.prose table td {
    border: 1px solid var(--line, rgba(0, 0, 0, .15));
    padding: .625rem .875rem;
    text-align: left;
    vertical-align: top;
}

.prose table th {
    background: var(--tint, #f2f2ff);
    font-weight: 600;
}

.prose h2 {
    font-size: 1.625rem;
    margin: 2.5rem 0 1rem;
    scroll-margin-top: 1.5rem;
}

.prose blockquote {
    margin: 2rem 0;
    padding: .5rem 0 .5rem 1.5rem;
    border-left: 4px solid var(--primary);
    font-size: 1.375rem;
    line-height: 1.5;
    font-weight: 500;
}

.prose figure {
    margin: 2rem 0;
}

.prose figure img {
    width: 100%;
    border-radius: var(--radius);
}

.prose figcaption {
    color: var(--muted);
    font-size: .875rem;
    margin-top: .5rem;
}

/* TinyMCE image_caption output: <figure class="image"><img><figcaption></figcaption></figure>.
   Honor the author's chosen image width and center the figure + caption. */
.prose figure.image {
    display: table;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.prose figure.image img {
    width: auto;
    max-width: 100%;
    height: auto;
}

.prose figure.image figcaption {
    display: table-caption;
    caption-side: bottom;
    text-align: center;
}

.toc {
    background: var(--tint);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.toc h2 {
    font-size: 1rem;
    margin: 0 0 .5rem;
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.notice {
    border-left: 4px solid var(--primary);
    background: var(--light);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.author-box {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}


/* ==================== Category page ==================== */
.hero--minimal {
    min-height: clamp(220px, 18vw, 300px);
    justify-content: center;
    text-align: center;
}

.hero--minimal h1 {
    margin: 0;
}

.hero--minimal p {
    margin: .5rem auto 0;
}