/* Basic Clean Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* Header */
header {
    background-color: #fff;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    color: #222;
}

header p {
    font-size: 0.95rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Filter Nav */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

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

/* Card Style */
.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #eee;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
}

.card-thumb::after {
    /* Play icon overlay for videos */
    content: ""; /* Set by JS/CSS specific class */
}

.card.type-video .card-thumb::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    pointer-events: none;
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #888;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-video .badge { background: #fee; color: #d00; }
.type-article .badge { background: #eef; color: #00d; }

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #222;
}

.card-summary {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    font-size: 0.75rem;
    color: #666;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 100px;
}

/* Category Color Indicators (Optional - Border Top) */
.cat-tech { border-top: 4px solid #3498db; }
.cat-society { border-top: 4px solid #2ecc71; }
.cat-governance { border-top: 4px solid #f1c40f; }
.cat-civilization { border-top: 4px solid #9b59b6; }

.btn-action {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    background: #333;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
}

.btn-action:hover {
    background: #555;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #888;
    background: #fff;
    margin-top: 60px;
}

footer a {
    color: #333;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
}