/* ==========================================================
   Author Header & Page Filters
   ========================================================== */

/* ==========================================================
   Archive Page Title Styling
   ========================================================== */

/* Style the main h1 to be a flex container */
h1 {
    display: flex;
    flex-direction: column; /* Stack the prefix on top of the title */
    align-items: center;   /* Center-align both lines */
    gap: 0.25em;           /* Add a small gap between the lines */
    margin-bottom: 20px;   /* Keep the space below the title */
}

/* Style the new prefix span */
.h1-prefix {
    font-size: 0.5em;      /* Make the prefix text smaller */
    font-weight: 400;      /* Make it a lighter weight than the main title */
    color: #6c757d;        /* A softer, secondary color */
    text-transform: uppercase; /* Optional: Makes it look clean */
    letter-spacing: 0.5px;   /* Optional: Adds a bit of breathing room */
}


.author-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 20px;
}

.author-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-right: 20px;
}

.author-details {
    text-align: left;
    flex: 1;
    max-width: 600px;
    line-height: 22px;
    margin-top: 17px;
}

.author-details h1 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
	align-items:flex-start;
}

.author-details p {
    font-size: 16px;
    margin-bottom: 20px;
}

.author-social {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.author-social a {
    margin: 0 10px;
    color: #000;
    font-size: 22px;
    transition: color 0.3s ease;
}

.author-social a:hover {
    color: #0073aa;
}

#filters {
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.filter-form {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.filter-form select,
.filter-form input {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#toggle-view {
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #000;
    color: #fff;
    transition: background-color 0.3s ease;
}

#toggle-view:hover {
    background-color: #333;
}


/* ==========================================================
   POST GRID - HIGHLY SPECIFIC & CORRECTED STYLES
   ========================================================== */

/* --- The Grid Container --- */
#post-grid {
    display: grid;
    gap: 20px;
    /* This rule now correctly creates a 2-column layout on mobile */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* --- The Post Item Card (Scoped with #post-grid) --- */
#post-grid .post-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
    /* Resetting any conflicting properties from style.css */
    width: auto;
    min-width: 0;
    margin-left: 0;
}

#post-grid .post-item:hover {
    transform: translateY(-4px);
}

/* --- Post Thumbnail (Scoped) --- */
#post-grid .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1 / 1.1;
    object-fit: cover;
}

/* --- Post Details (Scoped) --- */
#post-grid .post-details {
    padding: 12px;
}

#post-grid .post-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#post-grid .post-title a {
    text-decoration: none;
    color: #333;
}

#post-grid .post-author {
    font-size: 0.85rem;
    color: #6c757d;
}

/* --- Labels (Scoped) --- */
#post-grid .duration, 
#post-grid .featured-label {
    position: absolute;
    top: 8px;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: bold;
}
#post-grid .duration { right: 8px; background-color: rgba(0, 0, 0, 0.7); color: #fff; }
#post-grid .featured-label { left: 8px; background-color: gold; color: #333; display: flex; align-items: center; }
#post-grid .featured-label i { margin-right: 4px; }


/* ==========================================================
   List View & Loading Indicators
   ========================================================== */
#post-list-view ul { list-style: none; padding: 0; margin: 0; }
.post-list-item { padding: 10px; border-bottom: 1px solid #eee; }
.post-list-item a { text-decoration: none; color: #333; }
.post-list-item:hover { background-color: #f8f9fa; }
.loading-indicator { display: none; text-align: center; margin: 20px 0; grid-column: 1 / -1; }
.loading-indicator::before { content: ''; display: inline-block; width: 40px; height: 40px; border: 4px solid #ddd; border-top-color: #333; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.end-of-content { padding: 20px; text-align: center; font-size: 14px; color: #555; background-color: #f9f9f9; border: 1px solid #ddd; margin-top: 20px; grid-column: 1 / -1; }


/* ==========================================================
   Responsive Breakpoints
   ========================================================== */
@media (min-width: 768px) {
    #post-grid {
        /* On desktop, allow columns to be wider */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .author-header { flex-direction: column; align-items: center; }
    .author-image { margin-right: 0; margin-bottom: 10px; }
    .author-details { text-align: center; margin-left: 15px;
        text-align: justify;}
    .author-social { justify-content: center; }
    #filters, .filter-form { flex-direction: column; gap: 10px; width: 100%; }
    .filter-form select, .filter-form input, #toggle-view { width: 100%; }
	.author-details h1 {align-items:center;}
}
