/* ==========================================
   PÁGINA DO PROJETO PIRATE (pirate.html)
   Os estilos compartilhados ficam em css/global.css
   e a apresentação de vídeo em css/video-presentation.css.
   ========================================== */

/* ==========================================
   APRESENTAÇÃO DO PROJETO
   ========================================== */

.detail-hero-image {
    position: relative;
    min-height: 450px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    isolation: isolate;
}

/* Slideshow do topo (componente em css/global.css) */
.detail-hero-image .slideshow-slide {
    object-position: center 45%;
}

.detail-image-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 11, 10, 0.4),
        transparent 35%,
        rgba(10, 11, 10, 0.9)
    );
}

.detail-hero-label {
    position: absolute;
    top: 24px;
    left: 25px;
    color: var(--text);
}

.detail-hero-title {
    position: absolute;
    right: 30px;
    bottom: 30px;
    left: 30px;
}

.detail-hero-title p {
    color: var(--accent);
}

.detail-hero-title h1 {
    margin-top: 5px;
    font-size: clamp(64px, 12vw, 120px);
    line-height: 0.95;
    letter-spacing: -7px;
}

.detail-hero-title h1 span {
    color: var(--accent);
}

.detail-intro {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 65px;
    padding: 65px 0;
    border-bottom: 1px solid var(--border);
}

.detail-description h2 {
    max-width: 620px;
    margin-bottom: 23px;
    font-size: clamp(30px, 4vw, 43px);
    line-height: 1.15;
    letter-spacing: -1.8px;
}

.detail-description > p:not(.section-label) {
    max-width: 680px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.95;
}

.detail-play {
    margin-top: 24px;
}

.detail-description > p + p {
    margin-top: 16px;
}

.detail-facts {
    align-self: start;
    border-top: 1px solid var(--border);
}

.detail-facts > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 17px 0;
    border-bottom: 1px solid var(--border);
}

.detail-facts .mono {
    color: var(--accent);
    font-size: 9px;
}

.detail-facts strong {
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================
   SEÇÕES DA PÁGINA
   ========================================== */

.detail-section {
    padding: 75px 0;
    border-bottom: 1px solid var(--border);
}

.detail-section .section-heading {
    margin-bottom: 30px;
}

/* ==========================================
   VÍDEO DE GAMEPLAY
   ========================================== */

.video-frame {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    overflow: hidden;
}

.video-frame video {
    display: block;
    width: 100%;
    max-height: 720px;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: var(--bg-deep);
}

/* Legenda abaixo do player */

.video-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

/* ==========================================
   ALÉM DO CURSO
   ========================================== */

.case-study,
.case-card {
    border: 1px solid var(--border);
    background: var(--surface);
}

.case-study {
    padding: clamp(24px, 4vw, 40px);
    border-color: var(--accent-strong);
}

.case-study h3 {
    max-width: 640px;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.15;
    letter-spacing: -1px;
}

.case-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 44px;
    margin-top: 30px;
    list-style: none;
}

.case-steps span {
    display: block;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 1.5px;
}

.case-steps p,
.case-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.case-card {
    margin-top: 14px;
    padding: clamp(22px, 3vw, 30px) clamp(24px, 4vw, 40px);
}

.case-card h3 {
    margin-bottom: 10px;
    font-size: 19px;
    letter-spacing: -0.5px;
}

@media (max-width: 800px) {
    .case-steps {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}

/* ==========================================
   PRÓXIMOS PASSOS
   ========================================== */

.detail-tech {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 55px;
    align-items: start;
}

.detail-tech h2 {
    max-width: 400px;
    font-size: clamp(32px, 4vw, 43px);
    line-height: 1.1;
    letter-spacing: -2px;
}

.detail-tech-content > p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.detail-tech-content .tags {
    margin-top: 22px;
}

/* ==========================================
   RESPONSIVIDADE DA PÁGINA
   ========================================== */

@media (max-width: 800px) {
    .detail-intro {
        grid-template-columns: 1fr;
        gap: 35px;
        padding: 45px 0;
    }

    .detail-facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 24px;
    }

    .detail-tech {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .detail-hero-image {
        min-height: 380px;
    }
}

@media (max-width: 600px) {
    .detail-hero-image {
        min-height: 300px;
    }

    .detail-hero-label {
        top: 17px;
        left: 16px;
        font-size: 9px;
    }

    .detail-hero-title {
        right: 18px;
        bottom: 20px;
        left: 18px;
    }

    .detail-hero-title h1 {
        font-size: 68px;
        letter-spacing: -4px;
    }

    .detail-intro {
        gap: 28px;
        padding: 38px 0;
    }

    .detail-description h2 {
        font-size: 32px;
    }

    .detail-facts {
        grid-template-columns: 1fr;
    }

    .detail-section {
        padding: 55px 0;
    }

    /* PLAYER E LEGENDA EM TELAS PEQUENAS */

    .video-caption {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 15px;
    }
}

/* ==========================================
   ELEMENTOS INTERATIVOS DO JOGO
   ========================================== */

.elements-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.element-card {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--sans);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.element-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-strong);
}

.element-card.is-active {
    border-color: var(--accent);
}

.element-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.element-image {
    position: relative;
    display: block;
    height: 210px;
    overflow: hidden;
    background: var(--surface-light);
    isolation: isolate;
}

.element-image::after {
    content: "";
    position: absolute;
    inset: 30% 0 0;
    background: linear-gradient(
        transparent,
        rgba(8, 9, 8, 0.55)
    );
    pointer-events: none;
}

.element-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.element-card:hover .element-image img {
    transform: scale(1.05);
}

.element-number {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 13px;
    color: var(--text);
    font-size: 10px;
}

.element-play {
    position: absolute;
    z-index: 1;
    right: 12px;
    bottom: 12px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(241, 240, 233, 0.55);
    background: rgba(16, 17, 16, 0.55);
    color: var(--text);
    transition: background 0.2s, color 0.2s;
}

.element-card.is-active .element-play,
.element-card:hover .element-play {
    background: var(--accent);
    color: var(--bg);
}

.element-card-title {
    display: block;
    padding: 17px 16px 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}

.element-card-hint {
    display: block;
    padding: 7px 16px 17px;
    color: var(--muted);
    font-size: 9px;
}

.element-card.is-active .element-card-hint {
    color: var(--accent);
}

/* ==========================================
   DETALHES DO ELEMENTO SELECIONADO
   ========================================== */

.element-detail {
    margin-top: 24px;
    padding: 30px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    animation: elementReveal 0.25s ease;
}

.element-detail-heading {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.element-detail-heading .section-label {
    margin: 0;
}

.element-detail-index {
    color: var(--muted);
    font-size: 10px;
}

.element-detail h3 {
    margin-top: 20px;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -1px;
}

.element-detail > p {
    max-width: 760px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.element-detail-media {
    display: grid;
    min-height: 100px;
    margin-top: 24px;
    place-items: center;
    border: 1px dashed var(--accent-muted);
    background:
        linear-gradient(
            var(--accent-faint) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            var(--accent-faint) 1px,
            transparent 1px
        ),
        var(--bg);
    background-size: 22px 22px;
}

.element-detail-media span {
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

@keyframes elementReveal {
    from {
        opacity: 0.6;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   RESPONSIVIDADE DOS ELEMENTOS
   ========================================== */

@media (max-width: 800px) {
    .elements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .element-image {
        height: 190px;
    }
}

@media (max-width: 480px) {
    .elements-grid {
        gap: 10px;
    }

    .element-image {
        height: 145px;
    }

    .element-card-title {
        padding: 13px 11px 4px;
        font-size: 14px;
    }

    .element-card-hint {
        padding: 7px 11px 13px;
        font-size: 8px;
    }

    .element-detail {
        padding: 20px;
    }

    .element-detail h3 {
        font-size: 24px;
    }
}

/* ==========================================
   SISTEMAS — CARDS DOS VÍDEOS
   ========================================== */

.system-videos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    padding: 8px 0;
}

.system-video-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.system-video-card:hover {
    border-color: var(--accent-strong);
    transform: translateY(-3px);
}

.system-video-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.system-video-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 14px;
}

.system-video-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--accent);
    font-size: 12px;
}

.system-video-title {
    margin: 0 0 5px;
    font-size: 16px;
    line-height: 1.4;
}

.system-video-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    line-height: 1.6;
}

.system-video-player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-deep);
    object-fit: contain;
}

.system-video-footer {
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    letter-spacing: 1px;
}

/* ==========================================
   RESPONSIVIDADE DOS CARDS DE VÍDEO
   ========================================== */

@media (max-width: 600px) {
    .system-videos {
        grid-template-columns: minmax(0, 1fr);
    }

    .system-video-card:last-child:nth-child(odd) {
        grid-column: auto;
    }
}