/* Skip link for keyboard accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px;
    background: var(--rh-red);
    color: white;
    z-index: 100;
    text-decoration: none;
    font-weight: bold;
}

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

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hidden utility (used by JS filtering) */
.hidden {
    display: none;
}

/* Filter select styling */
.filter-select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.filter-select:focus-visible {
    outline: 2px solid var(--rh-red);
}

:root {
    --rh-red: #EE0000;
    --rh-dark: #151515;
    --rh-gray: #f4f4f4;
    --rh-text: #333333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--rh-gray);
    color: var(--rh-text);
}

/* Header & Navigation */
header {
    background-color: var(--rh-dark);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    border-bottom: 5px solid var(--rh-red);
}

nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav a {
    text-decoration: none;
    color: var(--rh-dark);
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover,
nav a:focus-visible {
    color: var(--rh-red);
}

/* Main Content Area */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.intro {
    text-align: center;
    margin-bottom: 3rem;
}

.highlights-section {
    text-align: center;
    margin-bottom: 3rem;
}

.highlights-section h2 {
    margin-bottom: 2rem;
    color: var(--rh-dark);
}

/* Responsive Grid System */
.grid-container {
    display: grid;
    /* This automatically creates columns that are at least 300px wide */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Content Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-top: 4px solid var(--rh-red);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card h3 {
    margin-top: 0;
    color: var(--rh-dark);
}

.card a {
    display: inline-block;
    margin-top: 1rem;
    color: var(--rh-red);
    text-decoration: none;
    font-weight: bold;
}

.card a:hover,
.card a:focus-visible {
    text-decoration: underline;
    outline: 2px solid var(--rh-red);
    outline-offset: 2px;
}

/* Search Bar Styles */
.search-container {
    text-align: center;
    margin-bottom: 2rem;
}

#searchInput {
    width: 100%;
    max-width: 600px;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#searchInput:focus {
    border-color: var(--rh-red);
    box-shadow: 0 0 8px rgba(238, 0, 0, 0.2);
    outline: 2px solid var(--rh-red);
    outline-offset: 2px;
}

/* Tag Styles */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-difficulty {
    background-color: #ffe6e6;
    color: var(--rh-red);
    border: 1px solid var(--rh-red);
}

.tag-topic {
    background-color: #e6f2ff;
    color: #0066cc;
    border: 1px solid #0066cc;
}

.tag-type {
    background-color: #f2e6ff;
    color: #6600cc;
    border: 1px solid #6600cc;
}

/* Filter Styles */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-tag {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.2s;
}

.filter-tag:hover {
    opacity: 0.8;
}

.filter-tag.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
