/* ─── PAGE WRAPPER ─── */
.custom-frontpage {
    margin-top: 30px;
    max-width: 1000px;
}

/* ─── CARD ─── */
.custom-post-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden; /* clips the image to card corners */
}

/* ─── DESKTOP: FLEX ROW ─── */
.post-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

/* ─── IMAGE ─── */
.post-image {
    flex: 0 0 280px;   /* fixed width on desktop — smaller than before */
    width: 280px;
    max-height: 190px;
    overflow: hidden;
}

.post-image a {
    display: block;
    height: 100%;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0; /* no inner radius — card overflow:hidden handles it */
}

/* ─── CONTENT ─── */
.post-content {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ─── TITLE ─── */
.post-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.post-title a {
    text-decoration: none;
    color: #1a1a1a;
}

/* ─── CATEGORY BADGE ─── */
.post-category {
    margin-bottom: 10px;
}

.post-category a {
    text-decoration: none;
}

.post-category span {
    display: inline-block;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    border-radius: 6px;
}

/* ─── EXCERPT ─── */
.post-excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ═══════════════════════════════════════════
   MOBILE  ≤ 768px
   Card becomes stacked:
   - Image fills full width, flush to top/left/right of card
   - NO separate frame or padding around image
   - Content sits below with padding
═══════════════════════════════════════════ */
@media (max-width: 768px) {

    .custom-post-card {
        border-radius: 14px;
        margin-bottom: 20px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    }

    /* Stack vertically */
    .post-inner {
        flex-direction: column;
        gap: 0;
    }

    /* Image: full width, flush, no padding, no border-radius of its own */
    .post-image {
        flex: none;
        width: 100%;
        max-height: none;
        height: auto;
        border-radius: 0;  /* card's overflow:hidden + border-radius clips top corners */
    }

    .post-image a {
        display: block;
        width: 100%;
    }

    .post-image img {
        width: 100%;
        height: auto;       /* natural aspect ratio — no cropping on mobile */
        object-fit: cover;
        border-radius: 0;
        display: block;
    }

    /* Content below image */
    .post-content {
        padding: 18px 18px 22px;
    }

    .post-title {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 10px;
    }

    .post-excerpt {
        font-size: 16px;
        line-height: 1.65;
    }
}












/* ─── PAGE WRAPPER ─── */
.custom-category-page {
    margin-top: 30px;
}

/* ─── ITEM ROW ─── */
.category-item {
    padding: 25px 0;
    border-bottom: 1px solid #e5e5e5;
}

.category-item:first-child {
    padding-top: 10px;
}

/* ─── DESKTOP FLEX ─── */
.category-inner {
    display: flex;
    flex-direction: row;
    gap: 25px;
    align-items: flex-start; /* align to top */
}

/* ─── IMAGE ─── */
.cat-image {
    flex: 0 0 260px;
    width: 260px;
}

.cat-image a {
    display: block;
}

.cat-image img {
    width: 100%;
    height: 175px;          /* consistent card height */
    object-fit: cover;      /* crop cleanly */
    border-radius: 6px;
    display: block;
}

/* ─── CONTENT ─── */
.cat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ─── TITLE ─── */
.cat-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.cat-title a {
    text-decoration: none;
    color: #1a1a1a;
}

/* ─── EXCERPT ─── */
.cat-excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ─── BUTTON ─── */
.cat-btn {
    display: inline-block;
    padding: 9px 18px;
    border: 1.5px solid #3b6edc;
    color: #3b6edc;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.cat-btn:hover {
    background: #3b6edc;
    color: #fff;
}

/* ═══════════════════════════════════════════
   MOBILE ≤ 768px
   Side-by-side: small image left, title + button right
   No excerpt on mobile
═══════════════════════════════════════════ */
@media (max-width: 768px) {

    .custom-category-page {
        margin-top: 16px;
    }

    .category-item {
        padding: 18px 0;
        border-bottom: 1px solid #e5e5e5;
    }

    .category-inner {
        display: flex;
        flex-direction: row;
        gap: 14px;
        align-items: flex-start;
    }

    /* IMAGE: fixed width, auto height — sizes to match content naturally */
    .cat-image {
        flex: 0 0 145px;
        width: 145px;
    }

    .cat-image img {
        width: 100%;
        height: auto;           /* natural height — no forced crop */
        object-fit: cover;
        border-radius: 6px;
        display: block;
    }

    /* CONTENT */
    .cat-content {
        flex: 1;
        padding-top: 2px;
    }

    /* TITLE */
    .cat-title {
        font-size: 17px;
        font-weight: 700;
        line-height: 1.35;
        margin-bottom: 10px;
    }

    /* HIDE EXCERPT */
    .cat-excerpt {
        display: none !important;
    }

    /* BUTTON */
    .cat-btn {
        display: inline-block;
        font-size: 13px;
        padding: 7px 14px;
        border-radius: 6px;
        border: 1.5px solid #3b6edc;
        color: #3b6edc;
        background: transparent;
        font-weight: 500;
    }

    .cat-btn:hover {
        background: #3b6edc;
        color: #fff;
    }
}



















/* ══════════════════════════════════════
   CENTERED WRAPPER
══════════════════════════════════════ */
.single-post-wrapper {
    max-width: 820px;
    margin: 0 auto;
    padding: 44px 24px 80px;
}

/* ══════════════════════════════════════
   POST TITLE
══════════════════════════════════════ */
.single-post-title {
    font-size: 34px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.25;
    margin: 0 0 32px 0;
    letter-spacing: -0.3px;
}

/* ══════════════════════════════════════
   CONTENT BODY
══════════════════════════════════════ */
.single-post-content {
    font-size: 17px;
    color: #444;
    line-height: 1.8;
}

.single-post-content p       { margin: 0 0 28px 0; }

.single-post-content h2 {
    font-size: 24px; font-weight: 700; color: #1a1a1a;
    margin: 44px 0 14px; line-height: 1.3;
}
.single-post-content h3 {
    font-size: 20px; font-weight: 700; color: #1a1a1a;
    margin: 36px 0 12px; line-height: 1.3;
}
.single-post-content h4 {
    font-size: 18px; font-weight: 700; color: #1a1a1a;
    margin: 28px 0 10px;
}

.single-post-content ol {
    list-style: decimal; padding-left: 20px; margin: 0 0 28px 0;
}
.single-post-content ol li {
    margin-bottom: 16px; line-height: 1.75; color: #444; padding-left: 4px;
}
.single-post-content ul {
    list-style: disc; padding-left: 20px; margin: 0 0 28px 0;
}
.single-post-content ul li {
    margin-bottom: 12px; line-height: 1.75; color: #444; padding-left: 4px;
}

.single-post-content li strong,
.single-post-content li b,
.single-post-content strong,
.single-post-content b      { color: #1a1a1a; font-weight: 700; }

.single-post-content a      { color: #3b6edc; text-decoration: underline; text-underline-offset: 2px; }
.single-post-content a:hover { color: #2a55b0; }

.single-post-content blockquote {
    border-left: 4px solid #3b6edc; background: #eef2fb;
    margin: 30px 0; padding: 18px 22px; border-radius: 0 6px 6px 0;
    color: #333; font-style: italic; font-size: 17px; line-height: 1.7;
}
.single-post-content blockquote p { margin: 0; }

.single-post-content img {
    max-width: 100%; height: auto; border-radius: 6px; margin: 10px 0 20px;
}

.single-post-content table {
    width: 100%; border-collapse: collapse; margin-bottom: 28px; font-size: 15px;
}
.single-post-content th {
    background: #1a1a1a; color: #fff; padding: 10px 14px;
    text-align: left; font-weight: 600;
}
.single-post-content td {
    padding: 10px 14px; border-bottom: 1px solid #e0e0e0; color: #444;
}
.single-post-content tr:nth-child(even) td { background: #f7f8fa; }

/* ══════════════════════════════════════
   INLINE RELATED POSTS
   Color is driven by inline style from PHP.
   CSS handles layout, transitions, and
   the elements that don't need dynamic color.
══════════════════════════════════════ */
.inline-related-posts {
    margin: 4px 0 36px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.irp-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border-width: 1.5px;
    border-style: solid;
    border-radius: 12px;
    padding: 12px 16px;
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow 0.18s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

/* Subtle left accent stripe derived from border color */
.irp-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0;
    border-radius: 12px 0 0 12px;
    transition: opacity 0.18s;
}

.irp-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* Square thumbnail */
.irp-thumb {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
    border: 2px solid transparent; /* border-color set inline */
}

.irp-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

.irp-thumb-placeholder {
    width: 100%; height: 100%;
}

.irp-text {
    flex: 1;
    min-width: 0;
}

/* Category label — color set inline */
.irp-cat {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* Post title */
.irp-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
}

/* Arrow icon — color set inline */
.irp-arrow {
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.15s, opacity 0.15s;
}

.irp-card:hover .irp-arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* ══════════════════════════════════════
   BOTTOM RELATED — Still Searching?
══════════════════════════════════════ */
.related-posts-section   { margin-top: 56px; }

.related-posts-heading {
    font-size: 22px; font-weight: 700; color: #1a1a1a; margin: 0 0 20px 0;
}

.related-posts-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}

.related-post-card { background: transparent; }

.related-post-img-wrap {
    display: block; width: 100%; border-radius: 8px; overflow: hidden;
}
.related-post-img-wrap img {
    width: 100%; height: auto; display: block; object-fit: cover;
}

.related-post-body { padding: 12px 0 0; }

.related-post-title {
    font-size: 18px; font-weight: 700; color: #1a1a1a;
    margin: 0 0 10px 0; line-height: 1.35;
}
.related-post-title a      { text-decoration: none; color: #1a1a1a; }
.related-post-title a:hover { color: #3b6edc; }

.related-post-excerpt {
    font-size: 15px; color: #555; line-height: 1.6; margin: 0;
}

/* ══════════════════════════════════════
   MOBILE ≤ 768px
══════════════════════════════════════ */
@media (max-width: 768px) {

    .single-post-wrapper { padding: 24px 16px 56px; }

    .single-post-title { font-size: 24px; margin-bottom: 22px; }

    .single-post-content { font-size: 16px; line-height: 1.75; }
    .single-post-content h2 { font-size: 20px; margin-top: 34px; }
    .single-post-content h3 { font-size: 18px; margin-top: 28px; }

    .irp-thumb { flex: 0 0 60px; width: 60px; height: 60px; }
    .irp-title { font-size: 13.5px; }
    .irp-arrow { display: none; }

    .related-posts-grid    { grid-template-columns: 1fr; gap: 28px; }
    .related-posts-heading { font-size: 18px; }
    .related-post-title    { font-size: 16px; }
}

