/* =========================================================================
   Facebook Hírfolyam - Reszponzív Stíluslap (Makói Könyvtár)
   ========================================================================= */

.fb-feed-grid {
    display: grid;
    /* Alapértelmezett: Asztali nézetben szigorúan 4 oszlop */
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin: 15px 0;
    box-sizing: border-box;
}

.fb-card {
    background-color: #2c221e;
    color: #f3f0ea;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 3px 8px rgba(44, 34, 30, 0.08);
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(212, 175, 55, 0.15);
    width: 100%;
    overflow: hidden;
}

.fb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(44, 34, 30, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 6px;
}

.profile-pic-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.profile-pic-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-name {
    font-weight: 600;
    font-size: 11.5px;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-date {
    font-size: 9px;
    color: #d4af37;
    background-color: rgba(212, 175, 55, 0.12);
    padding: 1px 5px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 1px;
    width: fit-content;
    font-weight: 500;
}

.card-content p {
    font-size: 11.5px;
    line-height: 1.35;
    color: #e6e2db;
    margin: 0 0 8px 0;
    word-break: break-word;
}

.read-more {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: opacity 0.2s;
}

.read-more:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.card-image {
    margin: 6px -12px 8px -12px;
    overflow: hidden;
    background-color: #1a1412;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 80px; /* Kompakt képmagasság asztali 4 oszlophoz */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.fb-card:hover .card-image img {
    transform: scale(1.02);
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 6px;
    color: #d1cbc1;
}

.stats-left {
    display: flex;
    gap: 6px;
    font-weight: 500;
}

.share-btn {
    color: #f3f0ea;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 10px;
    transition: background-color 0.2s;
}

.share-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

/* Modal (Felugró ablak) */
.fb-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 15, 13, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.fb-modal {
    background-color: #2c221e;
    color: #f3f0ea;
    border-radius: 16px;
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.fb-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f3f0ea;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fb-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================================================
   MOBIL ÉS TABLET NÉZETEK OPTIMALIZÁLÁSA
   ========================================================================= */

@media (max-width: 1100px) {
    .fb-feed-grid {
        grid-template-columns: repeat(2, 1fr); /* Tablet / közepes képernyő: 2 oszlop */
    }
    .card-image img {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .fb-feed-grid {
        grid-template-columns: 1fr; /* Mobil: 1 oszlop, de kulturált méretekkel */
        gap: 12px;
    }
    .fb-card {
        padding: 14px;
    }
    .card-image img {
        height: 160px; /* Mobilon kicsit magasabb kép, hogy jól látszódjon, de nem óriási */
    }
    .card-content p, .page-name {
        font-size: 13px; /* Mobilon könnyebben olvasható betűméret */
    }
}