/**
 * MotionFy Examples Page Styles
 * 
 * Design: Apple / Stripe / Notion — minimal, clean, large visuals.
 * No gradients, no shadows, no marketing fluff.
 * 
 * Depends on: create.css (brand tokens, header, footer)
 */

/* ============================================================
   Page Layout
   ============================================================ */
.ex-page {
    min-height: calc(100vh - 64px);
    background: var(--surface);
}

/* ============================================================
   Loading Spinner (centered, minimal)
   ============================================================ */
.ex-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-soft);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: ex-spin 0.7s linear infinite;
}

@keyframes ex-spin {
    to { transform: rotate(360deg); }
}

/* Video loading overlay */
.ex-card__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    z-index: 1;
    transition: opacity 0.3s ease;
}

.ex-card__loader.is-loaded {
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   Section Base
   ============================================================ */
.ex-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.ex-section--hero {
    padding-top: 72px;
    padding-bottom: 24px;
    text-align: center;
}

.ex-hero__cta {
    margin-top: 32px;
}

.ex-section--top-examples {
    padding-top: 0;
    padding-bottom: 56px;
}

.ex-section--top-examples .ex-heading {
    text-align: left;
}

.ex-section--top-examples .ex-subtext {
    text-align: left;
    max-width: 640px;
    margin-bottom: 10px;
}

.ex-subtext--secondary {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.ex-section--categories {
    padding-top: 56px;
    padding-bottom: 80px;
}

.ex-section--comparison {
    padding-top: 80px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ex-section--formats {
    padding-top: 60px;
    padding-bottom: 80px;
}

.ex-section--cta {
    padding-top: 80px;
    padding-bottom: 100px;
    text-align: center;
}

/* ============================================================
   Section Headings
   ============================================================ */
.ex-heading {
    font-family: var(--font-sans);
    font-size: 40px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 12px;
}

.ex-heading--hero {
    font-size: 46px;
    letter-spacing: -0.025em;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.ex-heading--comparison {
    font-size: 48px;
    letter-spacing: -0.025em;
}

.ex-subtext {
    font-family: var(--font-sans);
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

.ex-subtext--hero {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    font-size: 18px;
}

/* ============================================================
   Benefits Strip (compact inline divider)
   ============================================================ */
.ex-benefits-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 20px 0;
    border: none;
}

.ex-benefits-strip__item {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.ex-benefits-strip__sep {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.5;
}

/* ============================================================
   Scroll Animations
   ============================================================ */
.ex-animate {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.ex-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Category Block
   ============================================================ */
.ex-category {
    margin-bottom: 80px;
}

.ex-category:last-child {
    margin-bottom: 0;
}

.ex-category__title {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 24px;
}

/* ============================================================
   Example Grid
   ============================================================ */
.ex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ============================================================
   Example Card
   ============================================================ */
.ex-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    line-height: 0;
    font-size: 0;
    transition: transform 220ms ease;
    cursor: default;
}

.ex-card:hover {
    transform: scale(1.015);
}

.ex-card__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ex-card__label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-family: var(--font-sans);
    font-size: 11px;
    line-height: normal;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* ============================================================
   Comparison (Before / After)
   ============================================================ */
.ex-comparison {
    margin-bottom: 48px;
}

.ex-comparison:last-child {
    margin-bottom: 0;
}

.ex-comparison__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.ex-comparison__item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    line-height: 0;
    font-size: 0;
}

.ex-comparison__media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ex-comparison__label {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: var(--font-sans);
    font-size: 11px;
    line-height: normal;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.ex-comparison__arrow {
    display: none;
}

/* ============================================================
   Aspect Ratio Section (Formats)
   ============================================================ */
.ex-formats {
    text-align: center;
}

.ex-formats__row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 40px;
}

.ex-format-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 380px;
}

.ex-format-cell__wrap {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    line-height: 0;
    font-size: 0;
}

.ex-format-cell__wrap--16x9 {
    aspect-ratio: 16 / 9;
}

.ex-format-cell__wrap--1x1 {
    aspect-ratio: 1 / 1;
}

.ex-format-cell__wrap--9x16 {
    aspect-ratio: 9 / 16;
}

.ex-format-cell__media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ex-format__label {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* ============================================================
   CTA Section
   ============================================================ */
.ex-cta__list {
    list-style: none;
    padding: 0;
    margin: 28px 0 36px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.ex-cta__list li {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ex-cta__list li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 50%;
    flex-shrink: 0;
}

.ex-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 28px;
    background: var(--brand-ink);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    letter-spacing: 0.01em;
}

.ex-cta__btn:hover {
    background: #1a2636;
}

.ex-cta__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ex-cta__link {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.ex-cta__link:hover {
    color: var(--text-secondary);
}

/* ============================================================
   Divider (subtle horizontal rule between sections)
   ============================================================ */
.ex-divider {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.ex-divider__line {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 0;
}

/* ============================================================
   Dark Mode
   ============================================================ */
html.theme-dark .ex-page,
body.theme-dark .ex-page {
    background: #141414;
}

html.theme-dark .ex-heading,
body.theme-dark .ex-heading {
    color: #f2f2f2;
}

html.theme-dark .ex-subtext,
body.theme-dark .ex-subtext {
    color: #b5b5b5;
}

html.theme-dark .ex-category__title,
body.theme-dark .ex-category__title {
    color: #8a8a8a;
}

html.theme-dark .ex-card,
body.theme-dark .ex-card {
    background: #000;
}

html.theme-dark .ex-card__loader,
body.theme-dark .ex-card__loader {
    background: #1c1c1c;
}

html.theme-dark .ex-comparison__item,
body.theme-dark .ex-comparison__item {
    background: #000;
}

html.theme-dark .ex-comparison__label,
body.theme-dark .ex-comparison__label {
    background: rgba(20, 20, 20, 0.85);
    color: #b5b5b5;
}

html.theme-dark .ex-format-cell__wrap,
body.theme-dark .ex-format-cell__wrap {
    background: #000;
}

html.theme-dark .ex-format__label,
body.theme-dark .ex-format__label {
    color: #8a8a8a;
}

html.theme-dark .ex-benefits-strip,
body.theme-dark .ex-benefits-strip {
    border: none;
}

html.theme-dark .ex-benefits-strip__item,
body.theme-dark .ex-benefits-strip__item {
    color: #8a8a8a;
}

html.theme-dark .ex-benefits-strip__sep,
body.theme-dark .ex-benefits-strip__sep {
    background: #8a8a8a;
}

html.theme-dark .ex-cta__list li,
body.theme-dark .ex-cta__list li {
    color: #b5b5b5;
}

html.theme-dark .ex-cta__btn,
body.theme-dark .ex-cta__btn {
    background: #f2f2f2;
    color: #141414;
}

html.theme-dark .ex-cta__btn:hover,
body.theme-dark .ex-cta__btn:hover {
    background: #ffffff;
}

html.theme-dark .ex-cta__link,
body.theme-dark .ex-cta__link {
    color: #8a8a8a;
}

html.theme-dark .ex-cta__link:hover,
body.theme-dark .ex-cta__link:hover {
    color: #b5b5b5;
}

html.theme-dark .ex-divider__line,
body.theme-dark .ex-divider__line {
    border-top-color: #2c2c2c;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .ex-heading--hero {
        font-size: 40px;
    }
    
    .ex-heading {
        font-size: 32px;
    }

    .ex-heading--comparison {
        font-size: 38px;
    }
    
    .ex-section--hero {
        padding-top: 60px;
        padding-bottom: 20px;
    }
    
    .ex-section--cta {
        padding-top: 64px;
        padding-bottom: 72px;
    }

    .ex-section--top-examples {
        padding-bottom: 48px;
    }

    .ex-formats__row {
        gap: 16px;
    }

    .ex-format-cell {
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .ex-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .ex-comparison__row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .ex-heading--hero {
        font-size: 34px;
    }
    
    .ex-heading {
        font-size: 26px;
    }

    .ex-heading--comparison {
        font-size: 30px;
    }
    
    .ex-section--hero {
        padding-top: 48px;
        padding-bottom: 16px;
    }
    
    .ex-subtext--hero {
        font-size: 16px;
    }
    
    .ex-section--categories {
        padding-top: 32px;
        padding-bottom: 56px;
    }
    
    .ex-section--comparison {
        padding-top: 56px;
        padding-bottom: 56px;
    }
    
    .ex-section--formats {
        padding-top: 40px;
        padding-bottom: 56px;
    }
    
    .ex-section--cta {
        padding-top: 48px;
        padding-bottom: 56px;
    }

    .ex-section--top-examples {
        padding-bottom: 40px;
    }
    
    .ex-category {
        margin-bottom: 56px;
    }

    .ex-formats__row {
        gap: 12px;
    }

    .ex-format-cell {
        max-width: 240px;
    }
}

@media (max-width: 540px) {
    .ex-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .ex-comparison__row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .ex-heading--hero {
        font-size: 30px;
    }
    
    .ex-heading {
        font-size: 24px;
    }

    .ex-heading--comparison {
        font-size: 26px;
    }
    
    .ex-section--hero {
        padding-top: 40px;
        padding-bottom: 32px;
    }
    
    .ex-formats__row {
        flex-wrap: wrap;
        gap: 16px;
    }

    .ex-format-cell {
        max-width: 260px;
    }

    .ex-section--top-examples {
        padding-bottom: 36px;
    }

    .ex-cta__list {
        flex-direction: column;
        align-items: flex-start;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        gap: 10px;
    }
}
