﻿/* ============================================
   BLOG STYLES — Cambria Mortgage / iMortgageJoe
   Link AFTER css/style.css on blog pages only.

   Upload to: css/blog.css
   Listing page:  <link rel="stylesheet" href="css/blog.css?v=4">
   Article pages: <link rel="stylesheet" href="../css/blog.css?v=4">
   ============================================ */

.blog-intro {
    max-width: 760px;
    margin: 0 auto 40px;
    text-align: center;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    rotate: none !important;
}

.blog-intro h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.blog-intro p {
    font-size: 1.125rem;
    color: var(--text-gray);
    line-height: 1.7;
}

.blog-listing {
    background: var(--bg-gray);
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.blog-filter {
    appearance: none;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-filter:hover {
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.blog-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.blog-filter:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

@media (min-width: 700px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.blog-card-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.8125rem;
    color: var(--text-gray);
}

.blog-card-category {
    display: inline-block;
    background: rgba(197, 150, 23, 0.12);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.blog-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: var(--primary-color);
}

.blog-card-excerpt {
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.blog-card-read {
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.blog-card-read:hover {
    text-decoration: underline;
}

.blog-empty {
    display: none;
    text-align: center;
    color: var(--text-gray);
    padding: 40px 20px;
}

.blog-empty.visible {
    display: block;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 960px) {
    .article-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 56px;
        align-items: start;
    }
}

.article-body {
    max-width: 760px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: var(--text-gray);
    font-size: 0.9375rem;
    margin-bottom: 28px;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 36px 0 14px;
    line-height: 1.3;
    color: var(--text-dark);
    border-left: 4px solid var(--primary-color);
    padding-left: 14px;
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--text-dark);
}

.article-body p {
    margin-bottom: 16px;
    line-height: 1.75;
    color: #374151;
    font-size: 1.0625rem;
}

.article-body > h2:first-of-type + p {
    font-size: 1.2rem;
    color: #1f2937;
    line-height: 1.7;
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--text-dark);
}

.article-body p {
    margin-bottom: 16px;
    line-height: 1.75;
    color: #374151;
    font-size: 1.0625rem;
}

.article-body ul,
.article-body ol {
    margin: 0 0 20px;
    padding-left: 1.5rem;
    color: #374151;
    line-height: 1.75;
}

.article-body ul {
    list-style: disc !important;
}

.article-body ol {
    list-style: decimal !important;
}

.article-body li {
    margin-bottom: 8px;
    padding-left: 0.25rem;
}

.article-body a {
    color: var(--primary-dark);
    font-weight: 600;
}

.article-body a:hover {
    text-decoration: underline;
}

.article-callout {
    background: rgba(197, 150, 23, 0.08);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 20px 22px;
    margin: 28px 0;
}

.article-callout p {
    margin: 0;
}

.article-table-wrap {
    overflow-x: auto;
    margin: 24px 0 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    min-width: 480px;
}

.article-table th,
.article-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.article-table th {
    background: rgba(197, 150, 23, 0.12);
    font-weight: 700;
    color: var(--text-dark);
}

.article-table tr:last-child td {
    border-bottom: none;
}

.article-disclaimer {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    line-height: 1.6;
}

.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 960px) {
    .article-sidebar {
        position: sticky;
        top: 96px;
    }
}

.article-sidebar .sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.article-sidebar .sidebar-card h3 {
    font-size: 1.0625rem;
    margin-bottom: 12px;
    text-align: left;
}

.article-sidebar .sidebar-card p {
    font-size: 0.9375rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 14px;
}

.sidebar-author {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
}

.sidebar-author img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(197, 150, 23, 0.35);
}

.sidebar-author strong {
    font-size: 1.05rem;
}

.sidebar-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-related a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.sidebar-related a:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-related a:hover {
    color: var(--primary-color);
}

.article-cta-box {
    background: linear-gradient(135deg, #c59617 0%, #a07d13 100%);
    color: #fff;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    margin-top: 40px;
    text-align: center;
}

.article-cta-box h2 {
    color: #fff;
    margin: 0 0 10px;
    font-size: 1.65rem;
}

.article-cta-box p {
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 24px;
    font-size: 1.05rem;
}

.article-cta-box .button-primary {
    background: #fff;
    color: var(--primary-dark);
    border-color: #fff;
}

.article-cta-box .button-primary:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.article-cta-box .button-secondary {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.article-cta-box .button-secondary:hover {
    background: #fff;
    color: var(--primary-dark);
}

.article-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.article-cta-row .button {
    min-height: 48px;
}

@media (max-width: 700px) {
    .article-cta-row .button {
        width: 100%;
    }
}

.blog-page main,
.article-page main {
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .blog-page main,
    .article-page main {
        padding-bottom: 0;
    }
}
