/* --- CONTROLS --- */
.essay-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch; /* Makes search and sort same height */
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #5a4a3a;
}

#essay-search {
    background-color: rgba(15, 10, 10, 0.8);
    border: 1px solid #5a4a3a;
    color: #d2c8b8;
    font-family: 'Baksheesh', sans-serif;
    padding: 10px 15px;
    font-size: 1em;
    width: 250px;
    text-transform: uppercase;
    outline: none;
}

#essay-search:focus {
    border-color: #d2c8b8;
    box-shadow: 0 0 10px rgba(90, 74, 58, 0.3);
}

/* NEW: Sort Group is now a block */
.sort-group {
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: rgba(15, 10, 10, 0.8); /* Dark background */
    border: 1px solid #5a4a3a; /* Border to match search */
    padding: 0 15px; /* Padding inside the block */
    font-size: 0.9em;
    color: #8c7a6b;
}

.sort-btn {
    background: none;
    border: none; /* Remove individual borders */
    color: #8c7a6b;
    cursor: pointer;
    font-family: 'Baksheesh', sans-serif;
    padding: 5px 10px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.sort-btn:hover {
    color: #d2c8b8;
}

/* The active button glows */
.sort-btn.active {
    color: #ffffff;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* --- ESSAY GRID LAYOUT --- */
/* Ensure this rule exists and is the only one controlling layout */
.essay-list {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 25px;
    
    /* Ensures the area stays open even if empty */
    min-height: 200px; 
    width: 100%;
}

/* --- HIGH CONTRAST CARD --- */
.essay-card {
    background-color: rgba(5, 3, 3, 0.9); 
    border: 1px solid #5a4a3a;
    /* border-left: 4px solid #5a4a3a; */
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);

    /* FIX: Uniform Height & Layout */
    min-height: 160px; /* Ensures all boxes are substantial */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes tags to the bottom */
}

.essay-card:hover {
    background-color: rgba(20, 15, 15, 0.95);
    border-color: #d2c8b8; 
    border-left-color: #d2c8b8;
    /*transform: translateY(-2px); */
    box-shadow: 0 8px 20px rgba(90, 74, 58, 0.2);
}

/* --- TYPOGRAPHY --- */
.essay-title {
    margin: 0 0 15px 0;
    color: #e8e0d5; 
    font-size: 1.4em;
    line-height: 1.3;
    font-family: 'Baksheesh', serif;
}

.essay-meta-top {
    font-size: 0.8em;
    color: #8c7a6b; 
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    font-family: 'Baksheesh', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tags: Cleaned up */
.essay-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag {
    font-size: 0.75em;
    color: #d2c8b8; /* Much brighter text */
    border: 1px solid rgba(90, 74, 58, 0.5); /* Very subtle border */
    padding: 3px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}