/* Mobile-First Responsive Styles */

/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Skip to Content Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #06c;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus Visible Styles (Keyboard Navigation) */
*:focus-visible {
    outline: 2px solid #06c;
    outline-offset: 2px;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
header {
    text-align: center;
    padding: 2rem 1rem;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    color: #06c;
}

/* Main Content */
main {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Subpage Cards */
.subpage-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #fafafa;
    transition: transform 0.2s, box-shadow 0.2s;
}

.subpage-card:hover,
.subpage-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
}

.subpage-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subpage-card h2 a {
    color: #06c;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    display: inline-block;
}

.subpage-card h2 a:hover,
.subpage-card h2 a:focus {
    text-decoration: underline;
    outline: 2px solid #06c;
    outline-offset: 2px;
}

.subpage-card p {
    color: #555;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subpage-card .meta {
    font-size: 0.875rem;
    color: #777;
}

/* Featured Subpage */
.subpage-card.featured {
    border: 2px solid #06c;
    background-color: #f0f8ff;
}

/* Tech Badges */
.tech-badge {
    display: inline-block;
    background-color: #06c;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: #777;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #777;
    font-size: 1.125rem;
}

/* Error State */
.error {
    background-color: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.error h2 {
    color: #c62828;
    margin-bottom: 1rem;
}

.error p {
    color: #d32f2f;
}

/* Tablet and Desktop (768px+) */
@media (width >= 768px) {
    header h1 {
        font-size: 3rem;
    }

    .subpage-card {
        padding: 2rem;
    }

    body {
        padding: 2rem;
    }
}
