/* --- Core Setup & Variables --- */
:root {
    --bg: #0d0d0d;
    --card: #1a1a1a;
    --text: #e0e0e0; /* Primary text: Off-white for high contrast */
    --accent-yellow: #ffd700; /* Secondary color: Yellow for links and highlights */
    --title-gray: #bdbdbd; /* Title color: Grayish to distinguish from main text */
    --border: #333;
    --selected-text: #000;
}

/* --- General Body & Typography --- */
body {
    font-family: 'Courier New', monospace;
    background-color: var(--bg) !important;
    color: var(--text);
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    line-height: 1.6;
}

h1, h2, h3 {
    color: var(--title-gray); /* MODIFIED: Using grayish color for titles */
    margin: 0.5em 0;
}

h1 {
    text-align: center;
    font-size: 2rem;
}

h2 {
    font-size: 1.2rem;
}

a {
    color: var(--accent-yellow); /* MODIFIED: Using yellow for links */
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
    text-decoration: none;
}

/* --- Layout & Sections --- */
section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    transition: opacity 0.5s, max-height 0.5s;
    overflow: hidden;
}

.section-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

/* --- Tag Filtering --- */
#filter-tags {
    margin: 1rem 0;
    padding: 0.8rem;
    background: var(--card);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.tag {
    display: inline-block;
    background: #333;
    color: var(--text);
    padding: 0.3em 0.6em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tag.active {
    background: var(--accent-yellow);
    color: var(--selected-text);
    font-weight: bold;
}

/* --- Resources Table --- */
.resource-table {
    width: 100%;
    border-collapse: collapse;
}

#resources-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.desc-toggle {
    cursor: pointer;
    color: var(--accent-yellow);
    font-weight: bold;
    user-select: none;
    display: inline-block;
    width: 20px;
    text-align: center;
}

/* --- Content Section Styling --- */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-item {
    background: var(--card);
    padding: 1rem;
    border-left: 3px solid var(--accent-yellow);
}

.content-item-body {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.content-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0; /* Prevents image from shrinking */
}

.content-text {
    flex-grow: 1;
}

.content-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.content-title {
    font-size: 1.1rem;
    margin: 0;
    /* The color is inherited from the h3 style */
}

.content-date {
    font-size: 0.8rem;
    color: #888; /* A darker gray for less important info */
    margin-left: 1rem;
    white-space: nowrap;
}

.toggle-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-yellow);
    user-select: none;
}

.content-description {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--text); /* Using main text color */
    transition: max-height 0.5s ease-in-out;
    overflow: hidden;
    position: relative;
}

.content-description.collapsed {
    max-height: 65px; /* Adjust to control initial visible height (~3 lines) */
}

/* Creates a fade-out effect on truncated text */
.content-description.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(to top, var(--card) 0%, transparent 100%);
}

.content-item .tags {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #888;
}

/* --- Gallery Section --- */
.content-imgs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.gallery-item {
    position: relative;
    width: 120px;
    height: 120px;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border);
}

/* --- Utility & State Classes --- */
section.collapsed, tr.collapsed {
    display: none;
}

.arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

#neocities-badge {
    display: block;
    text-align: center;
    margin-top: 2rem;
}

/* --- Responsive Adjustments --- */
/* On screens wider than 800px, use a two-column grid for content */
@media screen and (min-width: 800px) {
    .content-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}