/* ==========================================================================
   Central ICT Club Bangladesh
   Blog listing and article pages
   ========================================================================== */

/* ---- Listing grid ----------------------------------------------------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(20px, 2.5vw, 30px);
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-md);
}

/* gradient placeholder, swap for a real <img> any time */
.post-card__media {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--navy-800), var(--blue-600));
    color: rgba(255, 255, 255, 0.5);
}

.post-card:nth-child(3n + 2) .post-card__media {
    background: linear-gradient(135deg, var(--navy-700), var(--green-600));
}

.post-card:nth-child(3n + 3) .post-card__media {
    background: linear-gradient(135deg, var(--blue-600), var(--green-500));
}

.post-card__media svg {
    width: 40px;
    height: 40px;
}

.post-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 24px;
}

.post-card__cat {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--blue-600);
    margin-bottom: 9px;
}

.post-card__title {
    font-size: 1.2rem;
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--ink);
}

.post-card__excerpt {
    color: var(--slate-500);
    margin: 0 0 18px;
    flex-grow: 1;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--slate-400);
}

.post-card__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--slate-400);
}

/* ---- Featured post, spans the row on wide screens --------------------- */
.post-feature {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    overflow: hidden;
    margin-bottom: clamp(20px, 2.5vw, 30px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.post-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-md);
}

.post-feature__media {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 280px;
    background: var(--grad-brand);
    color: rgba(255, 255, 255, 0.55);
}

.post-feature__media svg {
    width: 48px;
    height: 48px;
}

.post-feature__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-feature__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(26px, 3.5vw, 44px);
}

.post-feature__title {
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
    line-height: 1.2;
    margin: 10px 0 14px;
}

.post-feature__excerpt {
    color: var(--slate-500);
    margin: 0 0 20px;
}

/* ---- Article reading column ------------------------------------------- */
.article {
    max-width: 720px;
    margin: 0 auto;
}

.article__lead {
    font-size: 1.18rem;
    line-height: 1.6;
    color: var(--slate-700);
    margin: 0 0 22px;
}

.article p {
    color: var(--slate-700);
    margin: 0 0 18px;
}

.article h2 {
    font-size: clamp(1.4rem, 1.2rem + 1vw, 1.7rem);
    margin: 36px 0 14px;
}

.article h3 {
    font-size: 1.2rem;
    margin: 28px 0 10px;
}

.article ul {
    list-style: disc;
    padding-left: 22px;
    color: var(--slate-700);
    margin: 0 0 18px;
}

.article li {
    line-height: 1.6;
    margin-bottom: 8px;
}

.article a {
    color: var(--blue-600);
    font-weight: 600;
}

.article a:hover {
    color: var(--green-600);
}

/* a pulled out quote */
.article blockquote {
    margin: 26px 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--green-500);
    font-size: 1.2rem;
    line-height: 1.5;
    font-style: italic;
    color: var(--ink);
}

/* byline under the article title */
.article__byline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.article__avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--grad-brand);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 700;
}

.article__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.article__author {
    display: block;
    font-weight: 600;
    color: var(--ink);
}

.article__role {
    font-size: 0.88rem;
    color: var(--slate-500);
}

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 720px) {
    .post-feature {
        grid-template-columns: 1fr;
    }

    .post-feature__media {
        min-height: 200px;
    }
}

/* ---- Search page reuses the post cards above -------------------------- */
.search-form {
    display: flex;
    gap: 10px;
    max-width: 560px;
    margin-top: 26px;
}

.search-form .field__input {
    flex: 1;
}

.search-form .btn {
    flex-shrink: 0;
}

.search-count {
    margin: 0 0 22px;
    color: var(--slate-500);
}

@media (max-width: 480px) {
    .search-form {
        flex-direction: column;
    }
}
