/* =========================================
   Coreweb Rider Manuals — Frontend Styles
   Brand: #ffc603 | BG: #000000 | Card: #111111
   ========================================= */

.cwrm-wrap {
    background-color: #000000;
    color: #ffffff;
    padding: 40px 24px;
    font-family: inherit;
    box-sizing: border-box;
}

/* --- Page Title & Intro --- */
.cwrm-page-title {
    color: #ffffff;
    font-size: 3.3rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.cwrm-intro {
    color: #909090;
    font-size: 1.575rem;
    line-height: 1.6;
    margin: 0 0 36px 0;
    max-width: 780px;
}

/* --- Filter Bar --- */
.cwrm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 40px;
}

.cwrm-filter {
    background-color: #0a0a0a;
    color: #ffffff;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 1.65rem;
    cursor: pointer;
    min-width: 180px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffc603' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.cwrm-filter:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,198,3,0.3);
}

.cwrm-filter option {
    background-color: #0a0a0a;
    color: #ffffff;
}

.cwrm-clear-filters {
    background: transparent;
    color: #909090;
    border: none;
    padding: 10px 4px;
    font-size: 1.35rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cwrm-clear-filters:hover {
    color: #ffffff;
}

.cwrm-clear-filters:focus-visible {
    outline: 2px solid #ffc603;
    outline-offset: 3px;
    border-radius: 2px;
}

/* --- Series Groups --- */
.cwrm-group {
    margin-bottom: 56px;
}

.cwrm-group[data-hidden="true"] {
    display: none;
}

.cwrm-series-header {
    color: #ffc603;
    font-size: 2.7rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-left: 14px;
    border-left: 4px solid #ffc603;
    line-height: 1.2;
}

/* --- Cards Grid --- */
.cwrm-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}


/* --- Individual Card --- */
.cwrm-card {
    background-color: #111111;
    border: 1px solid #222222;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.cwrm-card:hover,
.cwrm-card:focus-within {
    transform: translateY(-3px);
    border-color: #333333;
    box-shadow: 0 8px 28px rgba(0,0,0,0.6);
}

.cwrm-card[data-hidden="true"] {
    display: none;
}

.cwrm-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #0a0a0a;
}

.cwrm-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cwrm-card__body {
    padding: 20px 20px 12px;
    flex: 1;
}

.cwrm-card__year {
    display: inline-block;
    background-color: #000000;
    color: #ffc603;
    font-size: 1.35rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ffc603;
    margin-bottom: 10px;
}

.cwrm-card__title {
    font-size: 1.95rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.cwrm-card__desc {
    font-size: 1.5rem;
    color: #909090;
    margin: 0;
    line-height: 1.5;
}

.cwrm-card__footer {
    padding: 14px 20px 18px;
}

/* --- CTA Button --- */
.cwrm-btn {
    display: inline-block;
    background-color: #ffc603;
    color: #111111;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: background-color 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.cwrm-btn:hover,
.cwrm-btn:focus {
    background-color: #e6b200;
    color: #111111;
    text-decoration: none;
    outline: none;
}

.cwrm-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(255,198,3,0.4);
}

/* --- Empty State --- */
.cwrm-empty {
    color: #909090;
    text-align: center;
    font-size: 1.5rem;
    padding: 40px 0;
    letter-spacing: 0.03em;
}

/* --- Section Wrapper & Header --- */
.cwrm-section {
    margin-top: 48px;
}

.cwrm-section-header {
    color: #ffc603;
    font-size: 2.7rem;
    font-weight: 700;
    margin: 0 0 24px 0;
    padding-left: 14px;
    border-left: 4px solid #ffc603;
    line-height: 1.2;
}

/* --- Guides shortcode layout --- */
.cwrm-guides-wrap {
    background-color: #000000;
    color: #ffffff;
    padding: 40px 24px;
    font-family: inherit;
    box-sizing: border-box;
}

.cwrm-guides-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    align-items: start;
}

/* No sidebar: videos fill the full width in a 2-up grid */
.cwrm-guides-layout--full {
    grid-template-columns: 1fr;
}

.cwrm-guides-layout .cwrm-section {
    margin-top: 0;
}

/* --- Download list (sidebar) --- */
.cwrm-download-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cwrm-download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #111111;
    border: 1px solid #222222;
    border-radius: 6px;
    padding: 14px 16px;
    color: #ffffff;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cwrm-download-item:hover,
.cwrm-download-item:focus {
    border-color: #ffc603;
    background-color: #181818;
    color: #ffc603;
    text-decoration: none;
    outline: none;
}

.cwrm-download-item:focus-visible {
    box-shadow: 0 0 0 2px rgba(255,198,3,0.4);
}

.cwrm-download-icon {
    flex-shrink: 0;
    color: #ffc603;
    display: flex;
    align-items: center;
}

.cwrm-download-label {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Both-mode type section headers --- */
.cwrm-type-section {
    margin-bottom: 56px;
}

.cwrm-type-header {
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 28px 0;
    padding: 16px 20px;
    background-color: #111111;
    border-left: 4px solid #ffc603;
    border-radius: 4px;
}

/* --- Videos Grid --- */
.cwrm-videos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

/* Full-width mode: 2-up video grid */
.cwrm-videos--wide {
    grid-template-columns: repeat(2, 1fr);
}

.cwrm-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    border-radius: 6px;
    overflow: hidden;
}

.cwrm-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cwrm-video-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 12px 0 0;
    line-height: 1.4;
}

/* --- Extra PDFs Row --- */
.cwrm-extra-pdfs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.cwrm-extra-pdfs .cwrm-btn {
    width: auto;
    display: inline-block;
}

/* --- Collapsible group toggle button --- */
.cwrm-group-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    border-left: 4px solid #ffc603;
    padding: 0 0 0 14px;
    margin: 0 0 20px 0;
    cursor: pointer;
    text-align: left;
    color: #ffc603;
    font-size: 2.7rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: inherit;
}

.cwrm-group-toggle:focus-visible {
    outline: 2px solid #ffc603;
    outline-offset: 3px;
    border-radius: 2px;
}

.cwrm-toggle-icon {
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.25s ease;
    color: #ffc603;
}

.cwrm-group[data-collapsed="true"] .cwrm-toggle-icon {
    transform: rotate(-90deg);
}

/* --- Collapsible cards panel --- */
.cwrm-cards-collapsible {
    overflow: hidden;
    max-height: 3000px;
    transition: max-height 0.35s ease;
}

.cwrm-group[data-collapsed="true"] .cwrm-cards-collapsible {
    max-height: 0;
}

/* =========================================
   Mobile — ≤900px
   ========================================= */
@media (max-width: 900px) {
    .cwrm-wrap,
    .cwrm-guides-wrap {
        padding: 32px 20px;
    }
    .cwrm-page-title {
        font-size: 2.4rem;
    }
    .cwrm-series-header,
    .cwrm-section-header {
        font-size: 2rem;
    }
    .cwrm-type-header {
        font-size: 1.8rem;
    }
    .cwrm-guides-layout,
    .cwrm-guides-layout--full {
        grid-template-columns: 1fr;
        gap: 0px;
    }
    .cwrm-videos--wide {
        grid-template-columns: 1fr;
    }
    .cwrm-guides-layout .cwrm-section + .cwrm-section,
    .cwrm-guides-layout .cwrm-type-section + .cwrm-type-section {
        margin-top: 48px;
    }
}

/* =========================================
   Mobile — ≤560px
   ========================================= */
@media (max-width: 560px) {
    .cwrm-wrap,
    .cwrm-guides-wrap {
        padding: 24px 16px;
    }
    .cwrm-page-title {
        font-size: 2rem;
    }
    .cwrm-intro {
        font-size: 1.2rem;
    }
    .cwrm-series-header,
    .cwrm-section-header {
        font-size: 1.6rem;
    }
    .cwrm-type-header {
        font-size: 1.5rem;
    }
    .cwrm-card__title {
        font-size: 1.4rem;
    }
    .cwrm-cards {
        grid-template-columns: 1fr;
    }
    .cwrm-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .cwrm-filter {
        width: 100%;
    }
    .cwrm-section {
        margin-top: 40px;
    }
    .cwrm-extra-pdfs {
        flex-direction: column;
    }
    .cwrm-extra-pdfs .cwrm-btn {
        width: 100%;
        box-sizing: border-box;
    }
}
