/* Ciphers Blog Grid — Frontend Styles */

.cbg-grid-wrapper {
    font-family: var(--cbg-font-body, system-ui, sans-serif);
}

/* GRID */
.cbg-grid {
    display: grid;
    grid-template-columns: 1.75fr 1fr 1fr;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--cbg-radius, 10px);
    overflow: hidden;
}

/* CARDS */
.cbg-card {
    position: relative;
    overflow: hidden;
    background: var(--cbg-card-bg, #111d0e);
    text-decoration: none;
    display: block;
}
.cbg-card-hero { min-height: 520px; }
.cbg-card-side  { min-height: 260px; }

.cbg-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--cbg-card-bg, #111d0e);
    transition: transform 0.55s cubic-bezier(0.25,0.46,0.45,0.94);
}
.cbg-card:hover .cbg-thumb { transform: scale(1.05); }

/* Stronger gradient — readable over any photo */
.cbg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5,10,3,0.97)  0%,
        rgba(5,10,3,0.88)  25%,
        rgba(5,10,3,0.55)  55%,
        rgba(5,10,3,0.18)  80%,
        rgba(5,10,3,0.0)   100%
    );
    z-index: 1;
}

/* BADGE */
.cbg-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    background: #3d5c28;
    border: 0.5px solid #5a8a3a;
    padding: 4px 11px;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cbg-accent-h, #a8c882);
    font-family: var(--cbg-font-body, system-ui, sans-serif);
    opacity: 1;
}

/* NUMBER WATERMARK */
.cbg-num {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 3;
    font-family: var(--cbg-font-heading, Georgia, serif);
    font-size: 11px;
    font-style: italic;
    color: rgba(240,236,227,0.18);
}

/* CONTENT */
.cbg-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 28px 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.cbg-content-sm { padding: 20px 22px 20px; }

/* Hero inner block — all text sits at the bottom inside the overlay */
.cbg-hero-bottom {
    display: flex;
    flex-direction: column;
}

/* TAG */
.cbg-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cbg-tag, #7a9e5a);
    margin-bottom: 9px;
    font-family: var(--cbg-font-body, system-ui, sans-serif);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* RULE */
.cbg-rule {
    width: 28px;
    height: 1px;
    background: rgba(122,158,90,0.5);
    margin-bottom: 12px;
}

/* TITLES — font var + layered text-shadow for photo legibility */
.cbg-title-lg {
    font-family: var(--cbg-font-heading, Georgia, serif);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.25;
    color: #ffffff;
    margin: 0 0 11px;
    letter-spacing: -0.005em;
    text-shadow:
        0 1px 3px rgba(0,0,0,0.7),
        0 2px 12px rgba(0,0,0,0.5),
        0 4px 24px rgba(0,0,0,0.3);
}
.cbg-title-md {
    font-family: var(--cbg-font-heading, Georgia, serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    color: #ffffff;
    margin: 0 0 9px;
    text-shadow:
        0 1px 3px rgba(0,0,0,0.7),
        0 2px 10px rgba(0,0,0,0.45);
}

/* EXCERPT */
.cbg-excerpt {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255,255,255,0.72);
    margin: 0 0 18px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    font-family: var(--cbg-font-body, system-ui, sans-serif);
}

/* META ROW */
.cbg-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.cbg-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    font-family: var(--cbg-font-body, system-ui, sans-serif);
}
.cbg-dot {
    width: 2.5px;
    height: 2.5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

/* ARROW */
.cbg-arrow {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cbg-accent, #7a9e5a);
    opacity: 0.85;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    font-family: var(--cbg-font-body, system-ui, sans-serif);
}
.cbg-card:hover .cbg-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* SIDE COLUMN */
.cbg-col-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* NO POSTS */
.cbg-no-posts {
    padding: 24px;
    font-family: var(--cbg-font-body, system-ui, sans-serif);
    color: #666;
    font-style: italic;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .cbg-grid { grid-template-columns: 1fr 1fr; }
    .cbg-card-hero { grid-column: 1 / 3; min-height: 416px; }
    .cbg-col-side { gap: 2px; }
}

@media (max-width: 600px) {
    .cbg-grid { grid-template-columns: 1fr; background: none; gap: 8px; }
    .cbg-card-hero { grid-column: auto; min-height: 364px; }
    .cbg-col-side { gap: 8px; }
}
