/* templates/blog.css
 *
 * Blog styling matched to valuedriven.io: Playfair Display headings, Montserrat
 * body, orange #FA6714 accent, slate #202f46 chrome. Self-contained; the fonts
 * load from Google Fonts (linked in header.php).
 */

:root {
    --vd-black: #161616;
    --vd-orange: #FA6714;
    --vd-gray: #EDEDED;
    --vd-slate-deep: #202f46;
    --vd-dark-bg: #161616;      /* header/footer band, matches the parent site */
    --vd-slate-mid: #233149;
    --vd-slate-label: #c5d4e8;
    --vd-text: #202f46;
    --vd-muted: #5b6b82;
    --headings-font: 'Playfair Display', Georgia, serif;
    --text-font: 'Montserrat', system-ui, sans-serif;
    --header-height: 74px;
    --maxw: 1140px;
    --radius: 10px;
    --transition: 0.25s ease;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--text-font);
    color: var(--vd-text);
    background: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--headings-font);
    color: var(--vd-slate-deep);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

a { color: var(--vd-orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--vd-slate-deep); }

.site-container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* --- Header ----------------------------------------------------------------
 * Slate background matches valuedriven.io and lets the two-tone logo (dark
 * "value" + white "driven") read in full. */
.site-header {
    height: var(--header-height);
    background: var(--vd-dark-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.site-logo { display: flex; align-items: center; }
.site-logo img { height: 34px; width: auto; display: block; }
.site-logo-text {
    font-family: var(--headings-font);
    font-weight: 700;
    font-size: 1.3rem;
    color: #ffffff;
}
.site-nav ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* 8 items must not overflow on narrow desktop widths */
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav a {
    /* Match the parent site's menu: uppercase, wide tracking */
    color: #eef2f8;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.site-nav a:hover { color: var(--vd-orange); }

/* --- Main ------------------------------------------------------------------ */
.site-main { padding: 48px 0 72px; min-height: 60vh; }

/* --- Blog index ------------------------------------------------------------ */
.blog-index > h1 {
    font-size: 2.6rem;
    margin-bottom: 32px;
}
.blog-index > h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    background: var(--vd-orange);
    margin-top: 12px;
    border-radius: 2px;
}
.blog-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}
.blog-item {
    border: 1px solid var(--vd-gray);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}
.blog-item:hover {
    box-shadow: 0 12px 30px rgba(32, 47, 70, 0.12);
    transform: translateY(-3px);
}
.blog-item-image {
    width: 100%;
    height: auto; /* neutralize the height attribute so aspect-ratio wins (attribute stays for CLS) */
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.blog-item-title {
    font-size: 1.35rem;
    margin: 20px 20px 8px;
}
.blog-item-title a { color: var(--vd-slate-deep); }
.blog-item-title a:hover { color: var(--vd-orange); }
.blog-item-meta {
    margin: 0 20px;
    color: var(--vd-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.blog-item-teaser {
    margin: 12px 20px 16px;
    color: var(--vd-text);
    font-size: 0.95rem;
}
.blog-item-readmore {
    display: inline-block;
    margin: 0 20px 24px;
    color: var(--vd-orange);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.blog-item-readmore:hover { text-decoration: underline; }
.blog-empty { color: var(--vd-muted); font-size: 1.1rem; }

/* --- Pagination ------------------------------------------------------------ */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 48px;
    font-size: 0.9rem;
}
.blog-pagination a {
    padding: 10px 20px;
    border: 1px solid var(--vd-orange);
    border-radius: 6px;
    color: var(--vd-orange);
    font-weight: 600;
}
.blog-pagination a:hover { background: var(--vd-orange); color: #fff; }
.page-status { color: var(--vd-muted); }

/* --- Single article -------------------------------------------------------- */
.article {
    max-width: 760px;
    margin: 0 auto;
}
.article > h1 {
    font-size: 2.6rem;
    margin-bottom: 16px;
}
.article-meta {
    color: var(--vd-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 28px;
}
.article-image {
    width: 100%;
    height: auto; /* keep aspect ratio when width/height attributes are set (no CLS distortion) */
    border-radius: var(--radius);
    margin-bottom: 32px;
    display: block;
}
.article-body { font-size: 1.06rem; color: #2a3646; }
.article-body p { margin: 0 0 1.25em; }
.article-body h2 { font-size: 1.7rem; margin: 1.6em 0 0.5em; }
.article-body h3 { font-size: 1.3rem; margin: 1.4em 0 0.4em; }
.article-body a { color: var(--vd-orange); text-decoration: underline; }
.article-body ul, .article-body ol { margin: 0 0 1.25em; padding-left: 1.4em; }
.article-body img { max-width: 100%; height: auto; border-radius: 6px; }
.article-body blockquote {
    border-left: 4px solid var(--vd-orange);
    margin: 1.5em 0;
    padding: 0.4em 0 0.4em 1.2em;
    color: var(--vd-slate-mid);
    font-style: italic;
}

/* --- 404 ------------------------------------------------------------------- */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 h1 { font-size: 2.2rem; }

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
    background: var(--vd-dark-bg);
    color: var(--vd-slate-label);
    padding: 28px 0;
    margin-top: 40px;
}
.site-footer-copy {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
    .site-nav { display: none; }         /* keep the header clean on mobile; logo links home */
    .blog-index > h1, .article > h1 { font-size: 2rem; }
    .site-main { padding: 32px 0 48px; }
}
