/* ============================================================
   Travel Suite Pro — Post Grid Block
   Includes: Grid layout, Featured Card + Sidebar layout
   CHANGE: Title now on TOP of featured card image
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@400;600;700&display=swap');

/* ── Font Variables ── */
.kpbg-font-bobby-jones { --kpbg-font: "Playfair Display", serif; }
.kpbg-font-georgia     { --kpbg-font: "Georgia", serif; }
.kpbg-font-inter       { --kpbg-font: "Inter", sans-serif; }
.kpbg-font-system,
.kpbg-section          { --kpbg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

/* ── Section wrapper ── */
.kpbg-section { margin: 0; }
.kpbg-section-title {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: #1a202c;
    letter-spacing: -.02em;
    font-family: var(--kpbg-font);
}

/* =============================================================
   LAYOUT A — GRID
   ============================================================= */
.kpbg-grid { display: grid; gap: 20px; }
.kpbg-grid.cols-1 { grid-template-columns: 1fr; }
.kpbg-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.kpbg-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpbg-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.kpbg-card {
    position: relative;
    display: block;
    height: 340px;
    overflow: hidden;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    transition: box-shadow .3s ease, transform .3s ease;
}
.kpbg-card:hover {
    box-shadow: 0 14px 44px rgba(0,0,0,.18);
    transform: translateY(-3px);
}

.kpbg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    transition: transform .65s cubic-bezier(.34,1.56,.64,1);
}
.kpbg-card:hover .kpbg-image { transform: scale(1.1); }
.kpbg-no-image { background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%); }

/* Overlay REMOVED from grid cards — .kpbg-overlay div no longer rendered */
.kpbg-overlay { display: none; }

/* Grid card content — title sits at TOP of the image */
.kpbg-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 26px 22px 22px;
}

/* Category badge — hidden (removed from grid) */
.kpbg-category { display: none; }

/* Grid card title — shares .kpbg-featured-title-top class; no separate rule needed */
.kpbg-content h2.kpbg-featured-title-top { /* inherits all styles from .kpbg-featured-title-top below */ }

/* =============================================================
   LAYOUT B — FEATURED CARD + SIDEBAR
   Left 50% · Right 50% — enforced at every level
   Left card auto-grows to match right-side post count height
   ============================================================= */

/* Outer wrapper: two equal columns, rows stretch to tallest child */
.kpbg-layout-featured-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    box-sizing: border-box;
}

/* ── Left column: the grid cell itself is a flex column so the
   featured card stretches to fill the full cell height  ── */
.kpbg-featured-card {
    display: flex;                   /* makes .kpbg-featured-link stretch to 100% height */
    flex-direction: column;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    min-height: 300px;               /* floor so 1-post right side still looks good */
    height: 100%;
    /* width is 100% of the grid cell — browser handles it */
}

/* The <a> fills the entire card height via flex-grow */
.kpbg-featured-link {
    display: block;
    flex: 1;                         /* grow to fill .kpbg-featured-card */
    position: relative;              /* needed so abs-pos children (image, title) work */
    text-decoration: none;
    color: #fff;
    border-radius: 14px;
    overflow: hidden;
    min-height: inherit;
    height: 100%;
}

/* Background image covers the full link area */
.kpbg-featured-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    transition: transform .8s cubic-bezier(.34,1.56,.64,1);
}
.kpbg-featured-link:hover .kpbg-featured-image { transform: scale(1.06); }
.kpbg-featured-image.kpbg-no-image {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

/* Overlay removed */
.kpbg-featured-overlay { display: none; }

/* Title pinned to top of the image */
.kpbg-featured-content--top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 18px 20px 0;
}

.kpbg-featured-title-top {
    margin: 0 !important;
    font-size: 18px !important;
    color: #353535 !important;
    text-shadow: none !important;
    display: inline !important;
    background: rgba(255, 255, 255, .92) !important;
    border-radius: 12px !important;
    -webkit-box-decoration-break: clone !important;
    box-decoration-break: clone !important;
    line-height: 1.65 !important;
    padding: 3px 12px !important;
    font-weight: 700;
    font-family: var(--kpbg-font);
}

/* ── Right column: sidebar panel
   Height is set by its content (posts + tags).
   Left card stretches to match via align-items:stretch on the grid. ── */
.kpbg-sidebar-panel {
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* 2-column grid of sidebar post items */
.kpbg-sidebar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    flex: 1;
    align-content: start;
    grid-auto-rows: minmax(82px, auto);
}

/* ── Each sidebar item: square thumbnail LEFT · title text RIGHT ──
   Layout matches the screenshot:
   [ img ]  TITLE TEXT HERE
            wrapping if needed
   No category badge, no date, clean minimal look                   */
.kpbg-sidebar-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;     /* image and text both anchor to top */
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 4px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    transition: opacity .2s ease;
    overflow: visible;
    min-height: 82px;
}
.kpbg-sidebar-item:hover { opacity: .82; }
.kpbg-sidebar-item:last-child { border-bottom: none; }

/* Square thumbnail — slightly wider for the 50% column */
.kpbg-sidebar-thumb {
    width: 110px;
    height: 82px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    position: relative;
}
.kpbg-sidebar-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
    border-radius: 8px;
}
.kpbg-sidebar-item:hover .kpbg-sidebar-thumb img { transform: scale(1.06); }
.kpbg-sidebar-thumb-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #cbd5e0 0%, #e2e8f0 100%);
    border-radius: 8px;
}

/* Text sits to the right of the image, anchored to top */
.kpbg-sidebar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
}

/* Category badge — hidden (removed per request) */
.kpbg-sidebar-cat { display: none; }

/* Title only — clean, dark, multi-line */
.kpbg-sidebar-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    color: #1a202c;
    font-family: var(--kpbg-font);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Date hidden */
.kpbg-sidebar-date { display: none; }

/* ── Tags Row ── */
.kpbg-tags-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e2e8f0; }
.kpbg-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.kpbg-tag-pill {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 5px 14px; border-radius: 24px; font-size: 12px;
    font-weight: 600; color: #374151; background: #f3f4f6;
    border: 1px solid #e5e7eb; text-decoration: none;
    transition: all .2s;
}
.kpbg-tag-pill:hover { background: #0073aa; color: #fff; border-color: #0073aa; transform: translateY(-1px); }
.kpbg-tag-hash { color: #9ca3af; font-size: 11px; transition: color .2s; }
.kpbg-tag-pill:hover .kpbg-tag-hash { color: rgba(255,255,255,.7); }

/* ── No posts ── */
.kpbg-no-posts { color: #6b7280; font-style: italic; padding: 20px; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .kpbg-layout-featured-sidebar { grid-template-columns: 1fr; gap: 16px; }
    .kpbg-featured-card { min-height: 260px; }
    .kpbg-sidebar-thumb { width: 88px; height: 66px; }
}
@media (max-width: 640px) {
    .kpbg-grid.cols-3, .kpbg-grid.cols-4 { grid-template-columns: 1fr 1fr; }
    .kpbg-sidebar-grid { grid-template-columns: 1fr; }
    .kpbg-card { height: 280px; }
    .kpbg-sidebar-thumb { width: 90px; height: 68px; }
}
@media (max-width: 420px) {
    .kpbg-grid.cols-2 { grid-template-columns: 1fr; }
    .kpbg-sidebar-thumb { width: 80px; height: 60px; }
    .kpbg-sidebar-title { font-size: 13px; }
}


/* Last modified date */
.kpbg-modified-date {
    display: block;
    font-family: var(--kpbg-font);
}

.kpbg-modified-date--overlay {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    color: #4b5563;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.kpbg-modified-date--sidebar {
    margin-top: 8px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}
