:root {
    --bg-main: #0f1014;
    --bg-card: #1b1d24;
    --accent: #0064ff;
    --accent-glow: rgb(81, 117, 255);
    --text-primary: #c9d4e3;
    --text-secondary: #8f9bb3;
    --radius: 12px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
}

.container { max-width: 1200px; margin: 0 auto; }

/* Header */
header {
    margin-bottom: 30px;
}

h1 {
    font-weight: 700;
    margin: 0 0 15px 0;
    font-size: 2rem;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #0f1014;
    color: white;
    font-size: 1rem;
}
#search-input:focus {
    border-color: var(--accent);
    outline: none;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 50px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    user-select: none;
}

.chip:hover {
    border-color: var(--accent);
    color: #fff;
}

.chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid #2c303a;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    /* Standard card height logic handled by content, but we ensure consistency */
    position: relative;
}

.card:hover { 
    transform: translateY(-3px); 
    border-color: #444;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card h3 { 
    margin: 0 0 10px 0; 
    font-size: 1.25rem;
    color: #e2e8f0;
}

/* Description & Read More Logic */
.card-desc-container {
    flex-grow: 1;
    margin-bottom: 15px;
    position: relative;
}

.card-desc {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
    white-space: pre-wrap;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* State: Collapsed */
.card-desc.collapsed {
    max-height: 80px; /* Limits to approx 3-4 lines */
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* State: Expanded */
.card-desc.expanded {
    max-height: 500px; /* Arbitrary large number */
    mask-image: none;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-top: 5px;
    font-weight: 600;
    display: none; /* Hidden by default, shown via JS if needed */
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* Tags in Card */
.tags-container {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hashtag { 
    color: #c9d4e3; 
    background: rgba(255, 255, 255, 0.05); 
    padding: 3px 8px; 
    border-radius: 4px; 
    font-size: 0.8rem;
    cursor: pointer; 
}
.hashtag:hover { 
    background: rgba(81, 117, 255, 0.2);
    color: white;
}

/* Actions */
.card-actions { 
    margin-top: auto;
    padding-top: 15px; 
    border-top: 1px solid #2c303a; 
    display: flex; 
    justify-content: flex-end; 
}

.visit-btn {
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: filter 0.2s;
    text-align: center;
}
.visit-btn:hover { 
    filter: brightness(1.2); 
    box-shadow: 0 0 15px var(--accent-glow);
}