/* ===== Home post video ===== */
/* ===== Video Container ===== */

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 50px auto;
    transition: all .3s ease;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Caption */

.video-caption {
    padding: 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    text-align: center;
}

/* ===== Popup Mode ===== */

.video-container.popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    max-width: 90vw;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 5px 20px rgba(0,0,0,.25);
}

.video-container.popup .video-caption {
    padding: 8px;
    font-size: 13px;
    background: #fff;
}

/* ===== Close Button ===== */

.video-close {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.8);
    color: #fff;
    font-size: 20px;
    line-height: 30px;
    cursor: pointer;
    z-index: 10000;
}

.video-container.popup .video-close {
    display: block;
}

.video-close:hover {
    background: #000;
}

/* Hidden after close */

.video-container.hidden {
    display: none !important;
}

/* ===== Video post ===== */
/* =====  ===== */

  /* Video grid */
    .video-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
    }

    .video-card {
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.1);
      overflow: hidden;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .video-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    .video-card iframe {
      width: 100%;
      height: 200px;
      border: none;
    }

    .video-content {
      padding: 15px;
    }

    .video-content h3 {
      margin: 0 0 10px;
      font-size: 18px;
      color: #006d77;
    }

    .video-content p {
      font-size: 14px;
      color: #555;
    }


/* Overlay explanation video */
    #videoOverlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); 
    justify-content: center; 
    align-items: center;
    z-index: 9999;
    }

    /* Popup box */
    #videoPopup {
    background: #000;
    padding: 10px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    }

    #videoPopup iframe {
    width: 100%;
    height: 450px;
    border: none;
    }

    .closeBtn {
    color: #fff;
    background-color: red;
    font-size: 24px;
    position: absolute;
    top: 20px;
    right: 30px;
    cursor: pointer;
    border-radius: 50px;
    }

    /* ===== Mobile ===== */

@media (max-width:768px) {

    .video-container.popup {
        width: 85%;
        right: 10px;
        bottom: 10px;
    }

    .video-caption {
        font-size: 14px;
    }
}