/* ==========================================================================
   blog.css — listing, article and sidebar styling.
   Palette is taken from the existing theme: navy #00366f, red #df1212.
   ========================================================================== */

:root {
    --blog-navy: #00366f;
    --blog-red: #df1212;
    --blog-ink: #1e2430;
    --blog-muted: #5c6675;
    --blog-line: #e3e7ee;
    --blog-bg: #f6f8fb;
}

/* --------------------------------------------------------------------------
   Listing
   -------------------------------------------------------------------------- */

.blog-listing {
    padding: 70px 0 90px;
}

.blog-intro {
    max-width: 720px;
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--blog-muted);
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 36px;
}

.blog-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid var(--blog-line);
    border-radius: 999px;
    background: #fff;
    color: var(--blog-navy);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-chip:hover,
.blog-chip:focus {
    background: var(--blog-navy);
    border-color: var(--blog-navy);
    color: #fff;
    text-decoration: none;
}

.blog-chip.is-active {
    background: var(--blog-navy);
    border-color: var(--blog-navy);
    color: #fff;
}

.blog-chip__count {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 54, 111, 0.1);
    font-size: 12px;
}

.blog-chip:hover .blog-chip__count,
.blog-chip:focus .blog-chip__count,
.blog-chip.is-active .blog-chip__count {
    background: rgba(255, 255, 255, 0.22);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--blog-line);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 54, 111, 0.14);
}

.blog-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--blog-bg);
}

.blog-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card__media img {
    transform: scale(1.04);
}

.blog-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 24px;
}

.blog-card__meta,
.blog-post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--blog-muted);
}

.blog-card__cat {
    padding: 4px 10px;
    border-radius: 3px;
    background: rgba(223, 18, 18, 0.1);
    color: var(--blog-red);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.blog-card__title {
    margin: 0 0 12px;
    font-size: 21px;
    line-height: 1.35;
    font-weight: 700;
}

.blog-card__title a {
    color: var(--blog-navy);
    text-decoration: none;
}

.blog-card__title a:hover,
.blog-card__title a:focus {
    color: var(--blog-red);
}

.blog-card__excerpt {
    flex: 1 1 auto;
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--blog-muted);
}

.blog-card__more {
    font-size: 14px;
    font-weight: 700;
    color: var(--blog-red);
}

/* --------------------------------------------------------------------------
   Listing call to action
   -------------------------------------------------------------------------- */

.blog-cta {
    margin-top: 50px;
    padding: 36px;
    border-radius: 6px;
    border-left: 4px solid var(--blog-red);
    background: var(--blog-bg);
}

.blog-cta h2 {
    margin: 0 0 12px;
    font-size: 24px;
    color: var(--blog-navy);
}

.blog-cta p {
    max-width: 700px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--blog-muted);
}

.blog-cta__secondary {
    display: inline-block;
    margin-left: 18px;
    font-weight: 600;
    color: var(--blog-navy);
}

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */

/* The article banner reuses the site's .page-banner component so an article
   looks like the rest of the site. The overlay keeps the theme's hue and
   left-to-right direction but stops short of full transparency: article
   headlines run much longer than "About Us", so the text reaches the pale end
   of the original gradient and needs the contrast. */
.blog-post__banner::before {
    background-image: linear-gradient(to right, rgba(0, 18, 52, 0.95) 0%, rgba(0, 18, 52, 0.45) 100%);
}

/* Long headlines: scale down rather than overflow the banner. */
.blog-post__banner h1 {
    max-width: 900px;
    font-size: clamp(26px, 3.4vw, 44px);
}

.blog-post__meta {
    padding: 26px 0 0;
}

.blog-post__header {
    padding: 60px 0 28px;
    background: var(--blog-bg);
}

/* The theme styles .bread-crumb for the dark page banner, where the items sit
   inline. On this light header they inherit block layout and stack, so lay
   them out explicitly here. */
.blog-post__crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.blog-post__crumbs li {
    display: inline-flex;
    align-items: center;
    float: none;
    margin: 0;
    padding: 0;
    color: var(--blog-muted);
    font-size: 14px;
    line-height: 1.6;
}

.blog-post__crumbs li::before,
.blog-post__crumbs li::after {
    content: none;
}

.blog-post__crumbs li + li::before {
    content: "\203A";
    content: "\203A" / "";
    margin-right: 8px;
    color: var(--blog-line);
}

.blog-post__crumbs li a {
    color: var(--blog-muted);
    font-size: 14px;
    text-decoration: none;
}

.blog-post__crumbs li a:hover,
.blog-post__crumbs li a:focus {
    color: var(--blog-red);
    text-decoration: underline;
}

.blog-post__header h1 {
    max-width: 900px;
    margin: 0 0 16px;
    font-size: 40px;
    line-height: 1.22;
    color: var(--blog-navy);
}

.blog-post__hero {
    max-width: 1170px;
    margin: 0 auto 44px;
    padding: 0 15px;
}

.blog-post__hero img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 6px;
}

.blog-post__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 50px;
    align-items: start;
}

/* Grid and flex items default to min-width:auto, which lets wide content —
   here the composition tables — stretch the track past the viewport instead
   of scrolling inside their own container. min-width:0 restores the intended
   behaviour. Without it the article text is clipped on narrow phones. */
.blog-post__layout > * {
    min-width: 0;
}

/* --- Article typography ------------------------------------------------- */

.blog-post__body {
    max-width: 76ch;   /* comfortable measure for long-form reading */
    font-size: 17px;
    line-height: 1.75;
    color: var(--blog-ink);
}

.blog-post__body .table-responsive-wrap {
    max-width: 100%;
}

.blog-post__body p {
    margin: 0 0 1.35em;
}

.blog-post__body .lead {
    font-size: 20px;
    line-height: 1.6;
    color: var(--blog-navy);
    font-weight: 500;
    padding-bottom: 0.6em;
    border-bottom: 1px solid var(--blog-line);
    margin-bottom: 1.6em;
}

.blog-post__body h2 {
    margin: 2em 0 0.7em;
    font-size: 27px;
    line-height: 1.3;
    color: var(--blog-navy);
    font-weight: 700;
}

.blog-post__body h3 {
    margin: 1.7em 0 0.55em;
    font-size: 20px;
    line-height: 1.35;
    color: var(--blog-ink);
    font-weight: 700;
}

.blog-post__body ul,
.blog-post__body ol {
    margin: 0 0 1.35em;
    padding-left: 1.4em;
}

.blog-post__body li {
    margin-bottom: 0.6em;
    padding-left: 0.2em;
}

.blog-post__body a {
    color: var(--blog-red);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-post__body a:hover,
.blog-post__body a:focus {
    color: var(--blog-navy);
}

.blog-post__body strong {
    color: var(--blog-navy);
}

.blog-post__body table {
    width: 100%;
    margin-bottom: 0.6em;
    border-collapse: collapse;
    font-size: 15px;
    background: #fff;
}

.blog-post__body table caption {
    caption-side: bottom;
    padding-top: 10px;
    font-size: 13px;
    color: var(--blog-muted);
    text-align: left;
}

.blog-post__body th,
.blog-post__body td {
    padding: 11px 14px;
    border: 1px solid var(--blog-line);
    text-align: left;
    vertical-align: top;
}

.blog-post__body thead th {
    background: var(--blog-navy);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.blog-post__body tbody tr:nth-child(even) {
    background: var(--blog-bg);
}

/* --- FAQ ----------------------------------------------------------------- */

.blog-faq {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 1px solid var(--blog-line);
}

.blog-faq h2 {
    margin-top: 0;
}

.blog-faq__item {
    margin-bottom: 10px;
    border: 1px solid var(--blog-line);
    border-radius: 5px;
    background: #fff;
}

.blog-faq__item summary {
    padding: 15px 18px;
    cursor: pointer;
    font-weight: 600;
    color: var(--blog-navy);
    list-style: none;
    position: relative;
    padding-right: 46px;
}

.blog-faq__item summary::-webkit-details-marker {
    display: none;
}

.blog-faq__item summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 21px;
    line-height: 1;
    color: var(--blog-red);
}

.blog-faq__item[open] summary::after {
    content: "\2013";
}

.blog-faq__answer {
    padding: 0 18px 16px;
    font-size: 16px;
}

.blog-faq__answer p {
    margin: 0;
}

/* --- Article call to action ---------------------------------------------- */

.blog-post__cta {
    margin-top: 2.5em;
    padding: 30px;
    border-radius: 6px;
    background: var(--blog-navy);
    color: #fff;
}

.blog-post__cta h2 {
    margin: 0 0 12px;
    font-size: 23px;
    color: #fff;
}

.blog-post__cta p {
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Product page FAQ (rendered by footer.php)
   -------------------------------------------------------------------------- */

.product-faq {
    padding: 70px 0;
    background: var(--blog-bg);
}

.product-faq__list {
    max-width: 860px;
}

.product-faq .blog-faq__item {
    margin-bottom: 12px;
}

.product-faq .blog-faq__item summary {
    font-size: 17px;
    padding: 18px 46px 18px 20px;
}

.product-faq .blog-faq__answer {
    padding: 0 20px 18px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--blog-ink);
}

.product-faq__cta {
    max-width: 860px;
    margin-top: 26px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--blog-muted);
}

.product-faq__cta a {
    color: var(--blog-red);
    font-weight: 700;
}

@media screen and (max-width: 767px) {
    .product-faq {
        padding: 45px 0;
    }
    .product-faq .blog-faq__item summary {
        font-size: 16px;
    }
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.blog-post__sidebar {
    position: sticky;
    top: 24px;
}

.blog-widget {
    margin-bottom: 26px;
    padding: 24px;
    border: 1px solid var(--blog-line);
    border-radius: 6px;
    background: #fff;
}

.blog-widget h2 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--blog-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.blog-widget__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-widget__list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--blog-line);
    font-size: 15px;
}

.blog-widget__list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.blog-widget__list a {
    color: var(--blog-ink);
    font-weight: 600;
    text-decoration: none;
}

.blog-widget__list a:hover,
.blog-widget__list a:focus {
    color: var(--blog-red);
}

.blog-widget__list--posts a {
    display: block;
    line-height: 1.45;
    margin-bottom: 4px;
}

.blog-widget__date {
    font-size: 13px;
    color: var(--blog-muted);
}

.blog-widget--accent {
    background: var(--blog-bg);
    border-left: 4px solid var(--blog-red);
}

.blog-widget--accent p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--blog-muted);
}

.blog-widget--accent a {
    font-weight: 700;
    color: var(--blog-navy);
}

.blog-post__footer-nav {
    margin: 40px 0 70px;
    padding-top: 24px;
    border-top: 1px solid var(--blog-line);
}

.blog-post__footer-nav a {
    font-weight: 700;
    color: var(--blog-navy);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media screen and (max-width: 991px) {
    .blog-post__layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .blog-post__sidebar {
        position: static;
    }
    .blog-post__header h1 {
        font-size: 32px;
    }
}

@media screen and (max-width: 767px) {
    .blog-listing {
        padding: 45px 0 60px;
    }
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .blog-post__header {
        padding: 40px 0 22px;
    }
    .blog-post__header h1 {
        font-size: 27px;
    }
    .blog-post__body {
        font-size: 16px;
    }
    .blog-post__body .lead {
        font-size: 18px;
    }
    .blog-post__body h2 {
        font-size: 23px;
    }
    .blog-post__body h3 {
        font-size: 18px;
    }
    .blog-cta,
    .blog-post__cta {
        padding: 24px;
    }
    .blog-cta__secondary {
        display: block;
        margin: 14px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card__media img {
        transition: none;
    }
    .blog-card:hover {
        transform: none;
    }
    .blog-card:hover .blog-card__media img {
        transform: none;
    }
}
