/* Homer Patuach Grid - General Styles */
body {
    direction: rtl; /* Ensure RTL layout */
}

#hpg-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Filters Bar */
#hpg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
}

.hpg-filter-item {
    flex: 1 1 200px;
}

.hpg-search-item {
    flex: 2 1 300px;
    position: relative;
    display: flex;
    align-items: center;
}

#hpg-filters input[type="search"] {
     width: 100%;
     border-radius: 50px;
     padding-right: 25px;
}

#hpg-clear-filters {
    background: none;
    border: none;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    position: absolute;
    left: 20px; /* Adjusted for RTL */
    padding: 5px;
}

#hpg-clear-filters:hover {
    color: #d9534f;
}

#hpg-filters select:focus,
#hpg-filters input[type="search"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
    outline: none;
}


/* Results Container & Grid */
#hpg-results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    position: relative;
    min-height: 200px;
}

/* Post Card */
.hpg-card {
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.hpg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.hpg-card a.hpg-card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.hpg-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.hpg-card-content {
    padding: 15px 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.hpg-card-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hpg-card-date {
    font-size: 13px;
    color: #888;
}

.hpg-card-subject-tag-content {
    font-size: 13px;
    font-weight: bold;
    color: #d9534f; /* Example color */
}

.hpg-card-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    flex-grow: 1;
}

.hpg-card-footer {
    display: flex;
    justify-content: flex-end; /* Aligns items to the left in RTL */
    gap: 20px;
    padding: 10px 20px;
    border-top: 1px solid #f0f0f0;
    color: #777;
    align-items: center;
}

.hpg-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.hpg-meta-item svg {
    fill: #999;
}

.hpg-like-btn {
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

.hpg-like-btn:hover {
    color: #e74c3c;
}
.hpg-like-btn:hover svg {
    fill: #e74c3c;
}
.hpg-like-btn.liked svg {
    fill: #e74c3c;
    animation: like-pop 0.3s ease-in-out;
}

@keyframes like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}


/* Loader */
#hpg-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hpg-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #777;
} 