/* ---------- Base (Dark Mode) ---------- */
body {
    font-family: Arial, sans-serif;
    max-width: 1300px;
    margin: 40px auto;
    line-height: 1.6;
    background-color: #111;   /* dark background */
    color: #eee;              /* bright readable text */
    padding: 0 15px;
}

/* ---------- Post container ---------- */
.post {
    border: 1px solid #333;
    background: #1a1a1a;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

/* ---------- Headings ---------- */
h1, h2 {
    text-align: center;
    color: #fff;
}

.preview-post h2 {
    margin: 0;
    line-height: 1.1;
}

/* ---------- Links ---------- */
a,
a:visited,
a:hover,
a:active {
    color: #ffb61a;
    text-decoration: none;
} 
a:hover { text-decoration: underline; }

/* ---------- Grid wrapper (1–3 columns) ---------- */
.preview-grid {
    display: grid;
    row-gap: 0.3rem;
    column-gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    max-width: 1300px;
    margin: 0 auto;
}

/* ---------- Preview card ---------- */
.preview-post {
    display: flex;
    gap: 1rem;
    border: 1px solid #333;
    background: #1a1a1a;
    padding: 1rem;
    padding-bottom: 0;
    margin-bottom: 1rem;
    border-radius: 8px;
    align-items: flex-start;
}

/* Anchor wrapper inside flex */
.preview-post > a {
    display: block;
    flex: 0 0 auto;
}

/* ---------- Image styling ---------- */
.preview-post .preview-image {
    width: 120px;
    height: auto;
    object-fit: contain;
    object-position: bottom;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #444; /* darker border */
    background-color: #000; /* removes white borders on some formats */
}

/* ---------- Text area ---------- */
.preview-post .preview-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 16px;
    color: #ddd;
}


/* ======================================
   MOBILE RESPONSIVENESS
   ====================================== */

/* ---------- Collapse image + text to vertical stack ---------- */
@media (max-width: 600px) {
    .preview-post {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .preview-post .preview-image {
        width: 100%;
        max-width: 320px;
        margin-bottom: 0.5rem;
    }

    .preview-post .preview-text {
        text-align: left; /* or center if you prefer */
        width: 100%;
    }
}
