/* =========================================================
   Reveal.js Presentation Hub
   ========================================================= */

:root {
    --hub-bg: #f4f5f7;
    --hub-card-bg: #ffffff;
    --hub-text: #1c1c1c;
    --hub-muted: #6b7280;
    --hub-border: rgba(0, 0, 0, 0.08);
    --hub-shadow:
        0 12px 35px rgba(0, 0, 0, 0.08);

    --hub-radius: 18px;
    --hub-transition:
        180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}


/* =========================================================
   Main container
   ========================================================= */

.presentation-hub {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(0, 82, 147, 0.08),
            transparent 35%
        ),
        var(--hub-bg);

    color: var(--hub-text);

    padding:
        clamp(30px, 5vw, 80px)
        clamp(20px, 5vw, 80px);
}


/* =========================================================
   Header
   ========================================================= */

.presentation-hub-header {
    max-width: 1400px;
    margin: 0 auto 50px;
}

.presentation-hub-eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--hub-muted);
    margin-bottom: 12px;
}

.presentation-hub-title {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 5rem);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.presentation-hub-subtitle {
    margin: 20px 0 0;
    max-width: 700px;
    color: var(--hub-muted);
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    line-height: 1.5;
}


/* =========================================================
   Count
   ========================================================= */

.presentation-hub-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 24px;

    padding: 8px 14px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--hub-border);

    font-size: 0.9rem;
    color: var(--hub-muted);
}

.presentation-hub-count strong {
    color: var(--hub-text);
}


/* =========================================================
   Grid
   ========================================================= */

#presentation-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: block;
}

.presentation-hub-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                min(100%, 420px),
                1fr
            )
        );

    gap: 30px;
}


/* =========================================================
   Card
   ========================================================= */

.presentation-card {
    overflow: hidden;

    background: var(--hub-card-bg);

    border:
        1px solid
        var(--hub-border);

    border-radius:
        var(--hub-radius);

    box-shadow:
        var(--hub-shadow);

    transition:
        transform var(--hub-transition),
        box-shadow var(--hub-transition);
}

.presentation-card:hover {
    transform:
        translateY(-6px);

    box-shadow:
        0 22px 50px
        rgba(0, 0, 0, 0.14);
}


/* =========================================================
   Preview
   ========================================================= */

.presentation-preview {
    position: relative;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #e9edf2,
            #dce2e8
        );
}


/*
 * Reveal itself is 16:9, so the iframe fills the
 * complete preview area.
 */

.presentation-preview iframe {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;

    background: white;

    pointer-events: none;

    transform-origin: center;
}


/* =========================================================
   Preview loading
   ========================================================= */

.presentation-preview-loading {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    z-index: 2;

    background:
        linear-gradient(
            135deg,
            #eef1f4,
            #e1e6eb
        );

    transition:
        opacity 250ms ease;
}

.presentation-loaded
.presentation-preview-loading {
    opacity: 0;
    pointer-events: none;
}


/* =========================================================
   Hover overlay
   ========================================================= */

.presentation-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        rgba(0, 0, 0, 0);

    transition:
        background var(--hub-transition);

    pointer-events: none;
}

.presentation-card:hover
.presentation-overlay {
    background:
        rgba(0, 0, 0, 0.35);
}


.presentation-open {
    display: inline-flex;

    align-items: center;
    gap: 10px;

    padding: 12px 18px;

    border: 0;
    border-radius: 999px;

    background: white;

    color: #111;

    font: inherit;
    font-weight: 700;

    cursor: pointer;

    opacity: 0;

    transform:
        translateY(8px)
        scale(0.96);

    transition:
        opacity var(--hub-transition),
        transform var(--hub-transition);
}

.presentation-card:hover
.presentation-open {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}

.presentation-open-icon {
    font-size: 0.8rem;
}


/* =========================================================
   Card footer
   ========================================================= */

.presentation-card-footer {
    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 18px 20px 20px;
}

.presentation-card-footer h2 {
    margin: 2px 0 0;

    font-size: 1.15rem;

    line-height: 1.2;

    font-weight: 750;
}

.presentation-index {
    font-size: 0.7rem;

    font-weight: 700;

    letter-spacing: 0.12em;

    color: var(--hub-muted);
}


.presentation-direct-link {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #f2f3f5;

    color: var(--hub-text);

    text-decoration: none;

    font-size: 1.1rem;

    transition:
        background var(--hub-transition),
        transform var(--hub-transition);
}

.presentation-direct-link:hover {
    background: #e5e7eb;

    transform:
        translate(2px, -2px);
}


/* =========================================================
   Spinner
   ========================================================= */

.presentation-hub-spinner {
    width: 28px;
    height: 28px;

    border:
        3px solid
        rgba(0, 0, 0, 0.1);

    border-top-color:
        currentColor;

    border-radius: 50%;

    animation:
        presentation-hub-spin
        0.8s linear infinite;
}

@keyframes presentation-hub-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   Empty / error
   ========================================================= */

.presentation-hub-empty,
.presentation-hub-error {
    grid-column: 1 / -1;

    padding: 80px 30px;

    text-align: center;

    color: var(--hub-muted);
}

.presentation-hub-empty h2,
.presentation-hub-error h2 {
    color: var(--hub-text);
}

.presentation-hub-empty-icon,
.presentation-hub-error-icon {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;

    margin-bottom: 15px;

    border-radius: 50%;

    background: #e5e7eb;

    font-size: 1.5rem;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .presentation-hub {
        padding:
            30px 15px;
    }

    .presentation-hub-header {
        margin-bottom: 30px;
    }

    #presentation-grid {
        gap: 18px;
    }

    .presentation-card-footer {
        padding:
            14px 16px 16px;
    }

    .presentation-open {
        opacity: 1;
        transform: none;
    }
}

/* =========================================================
   Filters
   ========================================================= */

.presentation-hub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.presentation-hub-filter {
    appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: transparent;
    color: inherit;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.presentation-hub-filter:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.25);
}

.presentation-hub-filter.is-active {
    background: var(--hub-text);
    color: #ffffff;
    border-color: var(--hub-text);
    font-weight: 600;
}


/* =========================================================
   Grid
   ========================================================= */

.presentation-hub-grid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                420px,
                1fr
            )
        );

    gap: 2rem;
}


/* =========================================================
   Card metadata
   ========================================================= */

.presentation-card-content {

    min-width: 0;
}


.presentation-meta {

    margin-bottom: 0.5rem;
}


.presentation-category {

    display: inline-flex;

    align-items: center;

    padding: 0.25rem 0.65rem;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.06);

    font-size: 0.75rem;

    font-weight: 600;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.presentation-description {

    margin: 0.6rem 0 0;

    font-size: 0.9rem;

    line-height: 1.5;

    opacity: 0.7;
}


.presentation-author {

    margin-top: 0.8rem;

    font-size: 0.75rem;

    opacity: 0.5;
}


/* =========================================================
   Tags
   ========================================================= */

.presentation-tags {

    display: flex;

    flex-wrap: wrap;

    gap: 0.4rem;

    margin-top: 0.9rem;
}


.presentation-tag {

    font-size: 0.72rem;

    opacity: 0.65;

    white-space: nowrap;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {

    .presentation-hub-grid {

        grid-template-columns: 1fr;

    }

    .presentation-hub-filters {

        justify-content: flex-start;

        overflow-x: auto;

        flex-wrap: nowrap;

        padding-bottom: 0.5rem;

    }

    .presentation-hub-filter {

        flex-shrink: 0;

    }

}

/* =========================================================
   Presentation toolbar
   ========================================================= */

.presentation-hub-toolbar {

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    gap: 2rem;

    margin-bottom: 2rem;

    padding-bottom: 1rem;

    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}


.presentation-hub-count {

    flex-shrink: 0;

    font-size: 0.9rem;

    opacity: 0.65;
}


.presentation-hub-count strong {

    font-size: 1rem;

    opacity: 1;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {

    .presentation-hub-toolbar {

        align-items: flex-start;

        flex-direction: column;

        gap: 1rem;
    }


    .presentation-hub-filters {

        justify-content: flex-start;

        overflow-x: auto;

        flex-wrap: nowrap;

        width: 100%;

        padding-bottom: 0.4rem;
    }


    .presentation-hub-filter {

        flex-shrink: 0;
    }

}