/* Blog refresh: card grid on the index, magazine layout for posts.
   Scoped to .blog-* classes (+ a gentle image polish inside legacy posts),
   loaded globally from base.html. */

/* ---------- index: card grid ---------- */

.blog-hero {
    text-align: center;
    padding: 3rem 1rem 1rem;
}

.blog-hero p {
    color: #8a8478;
    max-width: 560px;
    margin: 0.5rem auto 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
}

@media (max-width: 991px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e2d6;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(60, 50, 30, 0.12);
    text-decoration: none;
    color: inherit;
}

/* Full-bleed illustration covers (UI screenshots live inside the posts,
   not on the index — covers are brand-style SVG illustrations). */
.blog-card-img {
    aspect-ratio: 16 / 9;
    background: #f4efe6;
    overflow: hidden;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.blog-card-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.blog-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b08d57;
    background: rgba(176, 141, 87, 0.12);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.55rem;
}

/* Per-category tag hues (match the cover palettes) */
.blog-tag--rose  { color: #b95f54; background: rgba(185, 95, 84, 0.12); }
.blog-tag--sage  { color: #5f7d54; background: rgba(95, 125, 84, 0.12); }
.blog-tag--slate { color: #54718f; background: rgba(84, 113, 143, 0.12); }
.blog-tag--plum  { color: #84537e; background: rgba(132, 83, 126, 0.12); }
.blog-tag--clay  { color: #b3653f; background: rgba(179, 101, 63, 0.12); }
.blog-tag--teal  { color: #3f7d76; background: rgba(63, 125, 118, 0.12); }
.blog-tag--steel { color: #6e7b8a; background: rgba(110, 123, 138, 0.12); }

.blog-card h2 {
    font-size: 1.05rem;
    line-height: 1.4;
    margin: 0 0 0.45rem;
}

.blog-card p {
    font-size: 0.86rem;
    line-height: 1.55;
    color: #6f6a60;
    margin: 0;
}

/* ---------- single post: magazine layout ---------- */

.blog-post {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.blog-post .post-head {
    text-align: center;
    margin-bottom: 2.25rem;
}

.blog-post .post-head h1 {
    font-size: 2.1rem;
    line-height: 1.25;
    margin: 0.6rem 0 0.4rem;
}

.blog-post .post-date {
    color: #8a8478;
    font-size: 0.85rem;
}

.blog-post p, .blog-post li {
    font-size: 1.05rem;
    line-height: 1.75;
}

.blog-post .lead {
    font-size: 1.15rem;
    color: #5d5850;
}

.blog-post h2 {
    font-size: 1.45rem;
    margin: 2.4rem 0 0.9rem;
}

.blog-post img {
    width: 100%;
    border: 1px solid #e3dccd;
    border-radius: 10px;
    box-shadow: 0 8px 26px rgba(60, 50, 30, 0.12);
    margin: 0.6rem 0 1.6rem;
}

.blog-post .post-cta {
    background: rgba(176, 141, 87, 0.10);
    border: 1px solid rgba(176, 141, 87, 0.35);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    margin-top: 2.4rem;
}

/* ---------- post footer: share / prev-next / related ---------- */

.post-footer {
    margin-top: 3rem;
    border-top: 1px solid #e8e2d6;
    padding-top: 1.6rem;
}

.post-share {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.post-share-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8478;
    margin-right: 0.4rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid #b08d57;
    color: #b08d57;
    transition: background 0.15s ease, color 0.15s ease;
}

.share-btn:hover {
    background: #b08d57;
    color: #fff;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.8rem;
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid #e8e2d6;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-nav-link:hover {
    border-color: #b08d57;
    box-shadow: 0 6px 18px rgba(60, 50, 30, 0.10);
    text-decoration: none;
    color: inherit;
}

.post-nav-next { text-align: right; align-items: flex-end; }

.post-nav-dir {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b08d57;
}

.post-nav-title { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }

.post-related h3 {
    font-size: 1.2rem;
    margin: 2.4rem 0 1rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 767px) {
    .related-grid { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; align-items: flex-start; }
}

.related-grid .blog-card h2 { font-size: 0.92rem; margin: 0; }
.related-grid .blog-card-body { padding: 0.8rem 0.9rem 1rem; }
/* override the generic .blog-post img frame for cards inside related */
.blog-post .related-grid img { border: none; border-radius: 0; box-shadow: none; margin: 0; }

.dark-mode .post-footer { border-top-color: #3a3a42; }
.dark-mode .post-nav-link { border-color: #3a3a42; }
.dark-mode .post-nav-link:hover { border-color: #d8b98c; box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
.dark-mode .share-btn { border-color: #d8b98c; color: #d8b98c; }
.dark-mode .share-btn:hover { background: #d8b98c; color: #1a1a1e; }

/* Legacy post layout (blog_1..4, instructions, faq): match the new posts'
   reading width and image polish without touching their markup. */
section.resume .col-10.mx-auto {
    max-width: 760px;
    padding-left: 1.25rem;   /* match .blog-post — identical inner width */
    padding-right: 1.25rem;
}

section.resume article img,
section.resume .col-10 > img {
    border-radius: 10px;
    box-shadow: 0 8px 26px rgba(60, 50, 30, 0.12);
}

/* ---------- dark mode ---------- */

.dark-mode .blog-card { background: #1a1a1e; border-color: #3a3a42; }
.dark-mode .blog-card:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
.dark-mode .blog-card-img { background: #232328; }
.dark-mode .blog-card-img img { border-color: #3a3a42; }
.dark-mode .blog-card p { color: #a8a5a0; }
.dark-mode .blog-post .lead { color: #c5c1ba; }
.dark-mode .blog-post img { border-color: #3a3a42; }
.dark-mode .blog-hero p, .dark-mode .blog-post .post-date { color: #a8a5a0; }
.dark-mode .blog-post .post-cta { background: rgba(176, 141, 87, 0.12); }
