:root {
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text: #1f2937;
    --accent: #2563eb;
    --header-bg: #111827;
}

body { margin:0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); padding-top: 130px; /* Space for sticky header */ }

/* Header */
#sticky-header {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--header-bg); color: #fff;
    z-index: 1000; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.header-content { max-width: 1200px; margin: 0 auto; padding: 15px; }
h1 { margin: 0 0 10px 0; font-size: 1.5rem; letter-spacing: -0.5px; }
.badge { font-size: 0.7em; background: var(--accent); padding: 2px 6px; border-radius: 4px; vertical-align: middle; }

/* Nav */
#nav-cats { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
#nav-cats::-webkit-scrollbar { display: none; }
button {
    background: rgba(255,255,255,0.1); border: none; color: #ccc;
    padding: 8px 16px; border-radius: 20px; font-size: 14px; cursor: pointer; white-space: nowrap; transition: 0.2s;
}
button:hover { color: #fff; background: rgba(255,255,255,0.2); }
button.active { background: var(--accent); color: #fff; font-weight: 600; }

/* Grid */
#grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

/* Card Image */
.img-wrapper { position: relative; width: 100%; padding-top: 56.25%; /* 16:9 Aspect Ratio */ background: #eee; }
.card-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* Card Content */
.content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.meta { font-size: 0.75rem; color: #6b7280; margin-bottom: 8px; text-transform: uppercase; font-weight: 700; }
.card h3 { margin: 0; font-size: 1.1rem; line-height: 1.4; font-weight: 600; }
.card a { text-decoration: none; color: var(--text); }
.card a:visited { color: #4b5563; }
.card a:hover { color: var(--accent); }

/* Loader */
#loader { text-align: center; padding: 40px; }
.spinner {
    width: 40px; height: 40px; border: 4px solid #ddd;
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Footer */
footer { text-align: center; padding: 40px 20px; color: #6b7280; font-size: 0.9rem; border-top: 1px solid #e5e7eb; margin-top: 40px; }
.footer-links a { color: #6b7280; text-decoration: none; margin: 0 5px; }
.footer-links a:hover { text-decoration: underline; }

/* Mobile Tweaks */
@media (max-width: 600px) {
    body { padding-top: 110px; }
    #grid { padding: 15px; gap: 15px; }
    h1 { font-size: 1.2rem; }
}