/**
 * Tutorials page (template-tutorials.php) — scoped styles reproducing
 * dylan-draft.com /getting-started.html. Everything is nested under
 * .tutorials-page so nothing leaks into the shared header/footer.
 */

.tutorials-page {
    --tut-red: #EB262A;
    --tut-blue: #307FE2;
    --tut-blue-dark: #1f5fb8;
    --tut-navy: #0d1f3c;
    --tut-ink: #1d1d1f;
    --tut-gray-1: #6e6e73;
    --tut-gray-2: #a1a1a6;
    --tut-hairline: rgba(0, 0, 0, 0.09);
    --tut-surface: #f5f5f7;
    --tut-surface-blue: #eef5ff;
    --tut-ease: cubic-bezier(0.16, 1, 0.3, 1);
    /* Height of the fixed site nav (#nav): 96px, 62px once scrolled. */
    --tut-nav-h: 96px;

    font-family: 'Work Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #fff;
    color: var(--tut-ink);
    -webkit-font-smoothing: antialiased;
    /* clip (not hidden) so the sticky sub-nav keeps working */
    overflow-x: clip;
}

#nav.scrolled ~ .tutorials-page {
    --tut-nav-h: 62px;
}

.tutorials-page *,
.tutorials-page *::before,
.tutorials-page *::after {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    .tutorials-page *,
    .tutorials-page *::before,
    .tutorials-page *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ── HERO ── */
.tut-hero {
    background: #fff;
    padding: 162px 24px 64px;
    text-align: center;
}

.tut-hero-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--tut-blue);
    margin: 0 0 10px;
    opacity: 0;
    animation: tut-fade-up 0.7s var(--tut-ease) forwards;
}

.tut-hero-title {
    font-size: clamp(38px, 6vw, 76px);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--tut-ink);
    line-height: 1.05;
    margin: 0 0 18px;
    opacity: 0;
    animation: tut-fade-up 0.7s 0.06s var(--tut-ease) forwards;
}

.tut-hero-sub {
    font-size: 20px;
    font-weight: 400;
    color: var(--tut-gray-1);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.5;
    opacity: 0;
    animation: tut-fade-up 0.7s 0.12s var(--tut-ease) forwards;
}

@keyframes tut-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── STICKY SUB NAV ── */
.tut-subnav-wrap {
    position: sticky;
    top: var(--tut-nav-h);
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--tut-hairline);
    /* track the nav's expand/contract so no gap opens while scrolled */
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tut-subnav {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 36px;
    padding: 13px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tut-subnav::-webkit-scrollbar {
    display: none;
}

.tut-subnav-link {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tut-gray-1);
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 3px;
    border-bottom: 1.5px solid transparent;
}

.tut-subnav-link:hover {
    color: var(--tut-blue);
}

.tut-subnav-link:focus-visible {
    outline: 2px solid var(--tut-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── CONTENT ── */
.tut-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 72px 24px 120px;
}

/* ── SECTION HEADING ── */
.tutorials-page .section-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--tut-hairline);
    margin-bottom: 4px;
    scroll-margin-top: calc(var(--tut-nav-h) + 64px);
}

.tutorials-page .steps-collapse,
.tutorials-page .sd-lookup {
    scroll-margin-top: calc(var(--tut-nav-h) + 64px);
}

.tutorials-page .steps-collapse:not(:first-of-type) {
    margin-top: 64px;
}

.tutorials-page .section-heading-row .heading {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tut-ink);
    margin: 0;
}

.tutorials-page .steps-collapse summary {
    list-style: none;
    cursor: pointer;
}

.tutorials-page .steps-collapse summary::-webkit-details-marker {
    display: none;
}

.tutorials-page .steps-collapse summary::marker {
    content: '';
}

.tutorials-page .steps-collapse summary:focus-visible {
    outline: 2px solid var(--tut-blue);
    outline-offset: 4px;
    border-radius: 6px;
}

.tutorials-page .steps-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tut-blue);
    white-space: nowrap;
}

.tutorials-page .steps-toggle svg {
    flex-shrink: 0;
    transition: transform 0.3s var(--tut-ease);
}

.tutorials-page .steps-collapse[open] .steps-toggle svg {
    transform: rotate(180deg);
}

.tutorials-page .steps-toggle .lbl-hide { display: inline; }
.tutorials-page .steps-toggle .lbl-show { display: none; }
.tutorials-page .steps-collapse:not([open]) .lbl-hide { display: none; }
.tutorials-page .steps-collapse:not([open]) .lbl-show { display: inline; }

/* ── STEPS LIST ── */
.tutorials-page .step-row {
    display: flex;
    gap: 24px;
    padding: 30px 0;
    border-bottom: 1px solid var(--tut-hairline);
    transition: opacity 0.6s var(--tut-ease), transform 0.6s var(--tut-ease);
}

.tutorials-page .step-row.reveal-pending {
    opacity: 0;
    transform: translateY(10px);
}

.tutorials-page .step-row.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tutorials-page .step-row:last-child {
    border-bottom: none;
    padding-bottom: 8px;
}

.tutorials-page .step-index {
    flex-shrink: 0;
    width: 44px;
    font-size: 26px;
    font-weight: 300;
    color: var(--tut-blue);
    opacity: 0.55;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
}

.tutorials-page .step-content {
    flex: 1;
    min-width: 0;
}

.tutorials-page .step-title {
    font-size: 18.5px;
    font-weight: 600;
    color: var(--tut-ink);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.tutorials-page .step-desc {
    font-size: 16px;
    color: var(--tut-gray-1);
    line-height: 1.6;
    margin: 0;
}

.tutorials-page .step-desc a {
    color: var(--tut-blue);
    font-weight: 500;
    text-decoration: none;
}

.tutorials-page .step-desc a:hover {
    text-decoration: underline;
}

.tutorials-page .step-desc strong {
    color: var(--tut-ink);
    font-weight: 600;
}

.tutorials-page .step-desc ul {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tutorials-page .step-desc ul li {
    position: relative;
    padding-left: 16px;
}

.tutorials-page .step-desc ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--tut-gray-2);
}

.tutorials-page .tier-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    background: var(--tut-surface-blue);
    color: var(--tut-blue-dark);
    padding: 3px 9px;
    border-radius: 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.tutorials-page .step-tip {
    margin-top: 16px;
    padding: 10px 14px;
    border-left: 2px solid var(--tut-blue);
    background: var(--tut-surface-blue);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--tut-blue-dark);
    line-height: 1.6;
}

.tutorials-page .step-tip strong {
    color: var(--tut-blue-dark);
}

/* ── SUPPORT / SALES CONTACT DROPDOWN ── */
.tutorials-page .support-wrap {
    position: relative;
    display: inline-block;
    margin-top: 16px;
}

.tutorials-page .support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 100px;
    background: var(--tut-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px -2px rgba(48, 127, 226, 0.35);
    transition: transform 0.2s var(--tut-ease), box-shadow 0.2s var(--tut-ease), background 0.2s ease;
}

.tutorials-page .support-btn:hover {
    background: var(--tut-blue-dark);
    box-shadow: 0 6px 18px -2px rgba(48, 127, 226, 0.42);
}

.tutorials-page .support-btn:active {
    transform: scale(0.97);
}

.tutorials-page .support-btn:focus-visible {
    outline: 2px solid var(--tut-navy);
    outline-offset: 2px;
}

.tutorials-page .support-btn svg {
    transition: transform 0.25s var(--tut-ease);
}

.tutorials-page .support-wrap.is-open .support-btn svg {
    transform: rotate(180deg);
}

.tutorials-page .support-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 260px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 16px 40px -12px rgba(0, 0, 0, 0.16);
    padding: 6px;
    z-index: 20;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s var(--tut-ease), transform 0.2s var(--tut-ease);
}

.tutorials-page .support-wrap.is-open .support-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tutorials-page .support-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
}

.tutorials-page .support-menu-item:hover {
    background: var(--tut-surface-blue);
}

.tutorials-page .support-menu-item:focus-visible {
    outline: 2px solid var(--tut-blue);
    outline-offset: 2px;
}

.tutorials-page .support-menu-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--tut-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorials-page .support-menu-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tut-ink);
}

.tutorials-page .support-menu-value {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--tut-blue);
    margin-top: 1px;
}

/* ── WALKTHROUGH VIDEO ── */
.tutorials-page .walkthrough {
    margin-bottom: 64px;
}

.tutorials-page .walkthrough-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tut-ink);
    margin: 0 0 8px;
}

.tutorials-page .walkthrough-sub {
    font-size: 16px;
    color: var(--tut-gray-1);
    line-height: 1.6;
    margin: 0 0 22px;
    max-width: 520px;
}

.tutorials-page .video-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--tut-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 20px 40px -16px rgba(0, 0, 0, 0.14);
}

.tutorials-page .video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--tut-surface);
}

/* Embedded player (e.g. Vimeo) filling the rounded 16:9 card */
.tutorials-page .video-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.tutorials-page .video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--tut-red);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px -4px rgba(235, 38, 42, 0.45);
    transition: transform 0.25s var(--tut-ease);
}

.tutorials-page .video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

.tutorials-page .video-play-btn:active {
    transform: translate(-50%, -50%) scale(0.96);
}

.tutorials-page .video-play-btn:focus-visible {
    outline: 2px solid var(--tut-blue);
    outline-offset: 4px;
}

.tutorials-page .video-play-btn svg {
    margin-left: 2px;
}

.tutorials-page .video-card.is-playing .video-play-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ── SD CARD POSITION LOOKUP ── */
.tutorials-page .sd-lookup {
    margin-top: 64px;
}

.tutorials-page .sd-lookup-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tut-ink);
    margin: 0 0 8px;
}

.tutorials-page .sd-lookup-sub {
    font-size: 16px;
    color: var(--tut-gray-1);
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 520px;
}

.tutorials-page .sd-lookup-select {
    display: block;
    width: 100%;
    max-width: 320px;
    padding: 11px 40px 11px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    border: 1px solid var(--tut-hairline);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--tut-ink);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.tutorials-page .sd-lookup-select:hover {
    border-color: rgba(0, 0, 0, 0.22);
}

.tutorials-page .sd-lookup-select:focus-visible {
    outline: 2px solid var(--tut-blue);
    outline-offset: 2px;
}

.tutorials-page .sd-lookup .step-tip {
    margin: 0 0 18px;
}

.tutorials-page .sd-lookup-image-wrap {
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--tut-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 20px 40px -16px rgba(0, 0, 0, 0.14);
}

.tutorials-page .sd-lookup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tutorials-page .sd-lookup-caption {
    margin-top: 12px;
    font-size: 13.5px;
    color: var(--tut-gray-1);
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    .tut-hero {
        padding-top: 140px;
    }

    .tut-subnav {
        justify-content: flex-start;
        gap: 24px;
    }
}
