/*
 * /genres landing — uses cubase-core CSS variables and matches the site's
 * dark theme. Reuses existing token system (--bg, --bg-card, --primary,
 * --text, --border-light, --ease-spring) and existing .btn-primary class.
 */

/* ======================== HERO ========================
 * Uses the site's global section.hero rules (full-width, --bg) from
 * cubase-core.css. We add the per-page H1 gradient + the "Full project
 * templates" highlight pill + the action-row continuation that sits
 * visually inside the hero band.
 *
 * Each section is full-bleed via the calc(50% - 50vw) pattern — the
 * category admin layout is 2columns-left so the .columns wrapper
 * constrains content to a fixed max-width and a centered column.main.
 * We break out of that to make the hero, action strip, intro band, and
 * grid section span the full viewport.
 */

.wmdm-genres-landing-fullbleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden;
}

section.hero.wmdm-genres-hero,
.wmdm-genres-hero__actions,
.wmdm-genres-intro,
.wmdm-genres-landing,
.wmdm-genres-all,
.wmdm-xlink,
.wmdm-faq {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Override the homepage's min-height — our hero is meant to fit above
 * the fold with the action row visible, not fill the whole viewport. */
section.hero.wmdm-genres-hero {
    min-height: auto;
    padding: 80px 24px 32px;
}

.wmdm-genres-hero h1 {
    font-family: var(--font-display, inherit);
    font-size: clamp(42px, 7vw, 86px);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -3px;
    margin: 0 auto 24px;
    color: var(--text);
    max-width: 1100px;
    text-align: center;
}

.wmdm-genres-hero h1 .line {
    display: block;
}

.wmdm-genres-hero h1 .gradient {
    background: linear-gradient(135deg, var(--cyan-dark, #006874), var(--violet, #7c3aed), var(--pink, #c2185b));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    background-size: 200% 200%;
    animation: wmdm-genres-gradient-shift 6s ease-in-out infinite;
}

@keyframes wmdm-genres-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.wmdm-genres-hero .hero-sub {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-60);
    line-height: 1.6;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

/* "Full project templates" emphasis inside the sub copy. */
.wmdm-genres-hero__highlight {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    padding: 1px 9px;
    border-radius: 4px;
    margin: 0 2px;
    white-space: nowrap;
    letter-spacing: -0.01em;
    box-shadow: 0 1px 3px var(--primary-glow);
}

/* Action row sits IMMEDIATELY after section.hero and continues the same
 * dark bg so it reads as the bottom of the hero, not a separate band. */
.wmdm-genres-hero__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 24px 72px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}

/* Primary action — reuses the .btn-primary token shape from cubase-core */
.wmdm-genres-hero__play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border: 0;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring, ease), box-shadow 0.3s ease;
    text-decoration: none;
}

.wmdm-genres-hero__play:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--primary-glow);
    color: #fff;
}

.wmdm-genres-hero__play .play-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
}

/* Secondary action — outlined */
.wmdm-genres-hero__browse {
    display: inline-flex;
    align-items: center;
    padding: 14px 24px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wmdm-genres-hero__browse:hover {
    background: var(--bg-elevated);
    border-color: var(--text-60);
    color: var(--text);
    text-decoration: none;
}

/* ======================== INTRO ======================== */

.wmdm-genres-intro {
    background: var(--bg-tint);
    padding: 48px 24px;
    color: var(--text-80);
}

.wmdm-genres-intro p {
    max-width: 720px;
    margin: 0 auto 18px;
    font-size: 17px;
    line-height: 1.6;
    text-align: center;
}

.wmdm-genres-intro p:last-child {
    margin-bottom: 0;
    color: var(--text);
    font-weight: 500;
}

/* ======================== TILE GRID ======================== */

.wmdm-genres-landing {
    background: var(--bg);
    padding: 64px 24px 80px;
}

.wmdm-genres-landing__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.wmdm-genres-landing__heading {
    font-family: var(--font-display, inherit);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 400;
    letter-spacing: -0.5px;
    color: var(--text);
    margin: 0 0 32px;
    text-align: center;
}

.wmdm-genres-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.wmdm-genres-grid__item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--primary) 12%, var(--bg-card)) 0%,
            var(--bg-card) 100%);
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s var(--ease-spring, ease),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

.wmdm-genres-grid__item:hover,
.wmdm-genres-grid__item:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5),
                0 0 0 1px color-mix(in srgb, var(--primary) 35%, var(--border-light));
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border-light));
}

.wmdm-genres-tile {
    display: block;
    position: absolute;
    inset: 0;
    text-decoration: none;
    color: var(--text);
}

.wmdm-genres-tile:hover {
    text-decoration: none;
    color: var(--text);
}

.wmdm-genres-tile__cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--bg-card);
}

.wmdm-genres-tile__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wmdm-genres-tile__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        to bottom,
        rgba(15, 13, 13, 0) 0%,
        rgba(15, 13, 13, 0) 35%,
        rgba(15, 13, 13, 0.65) 70%,
        rgba(15, 13, 13, 0.95) 100%
    );
}

.wmdm-genres-tile__meta {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wmdm-genres-tile__name {
    font-family: var(--font-display, inherit);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.2;
    color: #fff;
    letter-spacing: -0.2px;
}

.wmdm-genres-tile__count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Hover-revealed Preview button — uses same shape as .btn-primary */
.wmdm-genres-tile__preview {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.wmdm-genres-grid__item:hover .wmdm-genres-tile__preview,
.wmdm-genres-grid__item:focus-within .wmdm-genres-tile__preview {
    opacity: 1;
    transform: translateY(0);
}

.wmdm-genres-tile__preview:hover {
    box-shadow: 0 4px 16px var(--primary-glow);
}

@media (hover: none) {
    .wmdm-genres-tile__preview {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================== ALL-GENRES LIST ======================== */

.wmdm-genres-all {
    background: var(--bg);
    padding: 56px 24px 80px;
    border-top: 1px solid var(--border-light);
}

.wmdm-genres-all__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.wmdm-genres-all__heading {
    font-family: var(--font-display, inherit);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 400;
    color: var(--text);
    margin: 0 0 24px;
    text-align: center;
}

.wmdm-genres-all__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 24px;
}

.wmdm-genres-all__list a {
    display: block;
    padding: 10px 0;
    color: var(--text-60);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.18s ease, border-color 0.18s ease;
}

.wmdm-genres-all__list a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* ======================== CROSSLINK SECTION ========================
 * "Templates by DAW" link strip on /genres. Same styling as the parallel
 * "Templates by genre" strip on /brands — kept duplicated for now;
 * refactor candidate.
 */

.wmdm-xlink {
    background: var(--bg);
    padding: 56px 24px 64px;
    border-top: 1px solid var(--border-light);
}

.wmdm-xlink__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.wmdm-xlink__heading {
    font-family: var(--font-display, inherit);
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 400;
    color: var(--text);
    margin: 0 0 8px;
    text-align: center;
}

.wmdm-xlink__sub {
    color: var(--text-60);
    text-align: center;
    margin: 0 0 28px;
    font-size: 15px;
}

.wmdm-xlink__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
    justify-content: center;
    gap: 16px;
}

.wmdm-xlink__list--genre {
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
}

.wmdm-xlink__item { margin: 0; }

.wmdm-xlink__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 22px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-spring, ease);
}

.wmdm-xlink__link:hover {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border-light));
    background: var(--bg-elevated);
    color: var(--text);
    text-decoration: none;
    transform: translateY(-1px);
}

.wmdm-xlink__logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wmdm-xlink__logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.wmdm-xlink__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.wmdm-xlink__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
}

.wmdm-xlink__count {
    font-size: 11px;
    color: var(--text-60);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ======================== FAQ ======================== */

.wmdm-faq {
    background: var(--bg-tint);
    padding: 64px 24px 80px;
    border-top: 1px solid var(--border-light);
}

.wmdm-faq__inner {
    max-width: 880px;
    margin: 0 auto;
}

.wmdm-faq__heading {
    font-family: var(--font-display, inherit);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 400;
    color: var(--text);
    text-align: center;
    margin: 0 0 32px;
}

.wmdm-faq__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wmdm-faq__item {
    border-bottom: 1px solid var(--border-light);
}

.wmdm-faq details {
    margin: 0;
}

.wmdm-faq__q {
    cursor: pointer;
    padding: 20px 32px 20px 0;
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    list-style: none;
    position: relative;
    transition: color 0.2s ease;
}

.wmdm-faq__q:hover {
    color: var(--primary);
}

.wmdm-faq__q::-webkit-details-marker {
    display: none;
}

.wmdm-faq__q::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--text-60);
    border-bottom: 2px solid var(--text-60);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.wmdm-faq details[open] .wmdm-faq__q::after {
    transform: translateY(-30%) rotate(-135deg);
    border-color: var(--primary);
}

.wmdm-faq__a {
    padding: 0 0 24px;
    color: var(--text-80);
    line-height: 1.65;
    font-size: 16px;
    max-width: 680px;
}

/* ======================== RESPONSIVE ======================== */

@media (max-width: 768px) {
    .wmdm-genres-hero { padding: 56px 16px 40px; }
    .wmdm-genres-hero__actions { padding: 0 16px 40px; flex-direction: column; }
    .wmdm-genres-hero__play,
    .wmdm-genres-hero__browse { width: 100%; max-width: 320px; justify-content: center; }
    .wmdm-genres-intro { padding: 40px 16px; }
    .wmdm-genres-intro p { font-size: 15px; }
    .wmdm-genres-landing { padding: 40px 16px 56px; }
    .wmdm-genres-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .wmdm-genres-tile__name { font-size: 1rem; }
    .wmdm-genres-tile__count { font-size: 0.7rem; }
    .wmdm-genres-tile__preview {
        opacity: 1;
        transform: translateY(0);
        padding: 6px 10px;
        font-size: 11px;
    }
    .wmdm-genres-all { padding: 40px 16px 56px; }
    .wmdm-genres-all__list { grid-template-columns: repeat(2, 1fr); }
    .wmdm-faq { padding: 40px 16px 56px; }
    .wmdm-faq__q { font-size: 15px; padding-right: 28px; }
}
