/* Video Tutorials + Changelog — from design-preview §08.57 / §08.58 */

.support-page-hero {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
}

.support-page-hero h2 { margin-bottom: 16px; }
.support-page-hero .body-lg { color: var(--text-muted); margin: 0 auto; }

.bg-sand-section {
    background: var(--bg-sand-light);
}

/* Badges + gallery tabs */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-indigo { background: rgba(124, 124, 240, 0.12); color: var(--color-indigo-deep); }
.badge-green { background: rgba(16, 185, 129, 0.1); color: #065f46; }
.badge-amber { background: rgba(245, 158, 11, 0.1); color: #92400e; }
.badge-red { background: rgba(239, 68, 68, 0.1); color: #991b1b; }
.badge-dark { background: rgba(165, 165, 245, 0.15); color: var(--color-indigo-deep); }

.btn-sm {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.btn-dark {
    background: var(--color-indigo);
    color: #fff;
    border: none;
    box-shadow: 0 8px 16px -4px rgba(124, 124, 240, 0.45);
}

.gallery-tabs {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-tab {
    padding: 10px 22px;
    background: var(--bg-white);
    border: 1px solid var(--bg-sand-border);
    border-radius: var(--radius-pill);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-tab:hover {
    color: var(--text-heading);
    border-color: var(--color-indigo-light);
}

.gallery-tab.is-active {
    background: var(--color-indigo);
    border-color: var(--color-indigo);
    color: #fff;
}

/* ── Video tutorials ── */
.tutorial-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.tutorial-search {
    flex: 1;
    min-width: 220px;
    max-width: 360px;
    position: relative;
}

.tutorial-search input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--bg-sand-border);
    background: var(--bg-white);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--text-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tutorial-search input:focus {
    outline: none;
    border-color: var(--color-indigo);
    box-shadow: 0 0 0 3px rgba(124, 124, 240, 0.15);
}

.tutorial-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
}

.tutorial-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--bg-sand-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 48px;
    transition: all 0.3s ease;
}

.tutorial-featured:hover {
    border-color: var(--color-indigo-light);
    box-shadow: var(--shadow-lg);
}

.tutorial-featured-wrap:empty {
    display: none;
}

.tutorial-topics {
    background: var(--bg-white);
    border: 1px solid var(--bg-sand-border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 32px;
}

.tutorial-topics-head h3 {
    font-size: 1.15rem;
    margin: 6px 0 0;
}

.tutorial-topics-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 20px;
}

.tutorial-topics-list li {
    position: relative;
    padding-left: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.tutorial-topics-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-indigo);
}

.tutorial-loading,
.tutorial-error {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.tutorial-error {
    color: #b91c1c;
}

.tutorial-thumb.has-poster {
    background-size: cover;
    background-position: center;
}

.tutorial-thumb__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
    pointer-events: none;
}

.tutorial-thumb.is-playing .tutorial-thumb__img {
    display: none;
}

.tutorial-card-yt-link {
    color: var(--color-indigo, #4f46e5);
    font-weight: 700;
    text-decoration: none;
}

.tutorial-card-yt-link:hover {
    text-decoration: underline;
}

.tutorial-embed-fallback {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
}

.tutorial-embed-fallback p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    max-width: 280px;
}

.tutorial-embed-fallback-title {
    font-weight: 700;
    font-size: 0.9rem !important;
    color: #fff !important;
}

.tutorial-embed-fallback code {
    font-size: 0.75rem;
    color: #c7d2fe;
}

.tutorial-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-charcoal);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tutorial-thumb video,
.tutorial-thumb iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}

.tutorial-thumb.is-playing::after { display: none; }

.tutorial-thumb::after {
    content: "▶";
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.tutorial-thumb:hover::after { transform: scale(1.08); }

.tutorial-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.tutorial-featured .tutorial-meta h3 { margin-bottom: 10px; }

.tutorial-featured .tutorial-meta p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.tutorial-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tutorial-card {
    background: var(--bg-white);
    border: 1px solid var(--bg-sand-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-indigo-light);
}

.tutorial-card.is-hidden { display: none; }

.tutorial-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tutorial-card-body h4 { margin-bottom: 8px; font-size: 1rem; }

.tutorial-card-body p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.tutorial-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bg-sand-border);
    font-size: 0.75rem;
    color: var(--text-subtle);
    font-weight: 600;
}

.tutorial-playlist-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tutorial-playlist-header h3 { font-size: 1.25rem; }

.tutorial-playlist-section.is-hidden { display: none; }

@media (max-width: 900px) {
    .tutorial-topics-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .tutorial-topics-list { grid-template-columns: 1fr; }
}

.tutorial-cta-strip {
    background: var(--bg-charcoal);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.tutorial-cta-strip .flex { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Changelog ── */
.changelog-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.changelog-sidebar {
    position: sticky;
    top: 100px;
}

.changelog-sidebar h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.changelog-filter-list {
    list-style: none;
    margin-bottom: 28px;
    padding: 0;
}

.changelog-filter-list li { margin-bottom: 4px; }

.changelog-filter-list button {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.changelog-filter-list button:hover {
    background: var(--bg-sand);
    color: var(--text-heading);
}

.changelog-filter-list button.is-active {
    background: rgba(124, 124, 240, 0.10);
    color: var(--color-indigo-deep);
}

.changelog-version-jump {
    list-style: none;
    border-top: 1px solid var(--bg-sand-border);
    padding-top: 16px;
    margin: 0;
    padding-left: 0;
}

.changelog-version-jump a {
    display: block;
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.changelog-version-jump a:hover { color: var(--color-indigo); }

.changelog-entry {
    position: relative;
    padding-left: 28px;
    padding-bottom: 40px;
    border-left: 2px solid var(--bg-sand-border);
    margin-left: 8px;
}

.changelog-entry:last-child { padding-bottom: 0; }

.changelog-entry.is-hidden { display: none; }

.changelog-entry::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-sand-border);
    border: 2px solid var(--bg-white);
}

.changelog-entry.is-latest::before {
    background: var(--color-indigo);
    box-shadow: 0 0 0 4px rgba(124, 124, 240, 0.20);
}

.changelog-entry.is-latest {
    border-left-color: var(--color-indigo-light);
}

.changelog-entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.changelog-version {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.changelog-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-subtle);
    margin-left: auto;
}

.changelog-entry-card {
    background: var(--bg-white);
    border: 1px solid var(--bg-sand-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    transition: all 0.3s ease;
}

.changelog-entry.is-latest .changelog-entry-card {
    border-color: var(--color-indigo-light);
    box-shadow: 0 0 0 4px rgba(124, 124, 240, 0.08);
}

.changelog-group { margin-bottom: 20px; }
.changelog-group:last-child { margin-bottom: 0; }

.changelog-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.changelog-group-title.new { color: #065f46; }
.changelog-group-title.fix { color: #991b1b; }
.changelog-group-title.improve { color: var(--color-indigo-deep); }

.changelog-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.changelog-group li {
    position: relative;
    padding: 6px 0 6px 18px;
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.55;
    border-bottom: 1px solid var(--bg-sand-border);
}

.changelog-group li:last-child { border-bottom: none; }

.changelog-group li::before {
    content: "·";
    position: absolute;
    left: 4px;
    color: var(--text-subtle);
    font-weight: 900;
}

.changelog-group li code {
    font-size: 0.8rem;
    background: var(--bg-sand-light);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-indigo-deep);
}

.changelog-subscribe {
    background: linear-gradient(135deg, var(--bg-sand-light) 0%, var(--bg-white) 100%);
    border: 1px solid var(--bg-sand-border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.changelog-subscribe h4 { margin-bottom: 6px; }

.changelog-subscribe p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.changelog-email-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.changelog-email-form input {
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--bg-sand-border);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    min-width: 220px;
}

.changelog-email-form input:focus {
    outline: none;
    border-color: var(--color-indigo);
    box-shadow: 0 0 0 3px rgba(124, 124, 240, 0.15);
}

@media (max-width: 992px) {
    .tutorial-featured { grid-template-columns: 1fr; }
    .tutorial-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-tabs { justify-content: flex-start; }
}

@media (max-width: 768px) {
    .changelog-layout { grid-template-columns: 1fr; gap: 32px; }
    .changelog-sidebar { position: static; }
    .changelog-sidebar .changelog-filter-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 0;
    }
    .changelog-filter-list li { margin: 0; }
    .changelog-filter-list button { width: auto; }
    .changelog-version-jump { display: none; }
    .changelog-date { margin-left: 0; width: 100%; }
}

@media (max-width: 600px) {
    .tutorial-grid { grid-template-columns: 1fr; }
    .tutorial-toolbar { flex-direction: column; align-items: stretch; }
    .tutorial-search { max-width: none; }
}
