/* =============================================================
   Home Review Carousel
   File: inc/home-review-carousel/home-review-carousel.css
   ============================================================= */

/* ── Wrapper ── */
#hrc-wrap {
    display: block;
    width: 100%;
    padding: 20px;
    margin: 20px 0;
}

/* ── Outer clip (hides overflow cards) ── */
#hrc-outer {
    width: 100%;
    overflow: hidden;         /* ตัด card ที่ 4 + shadow ออกทางขวา */
    padding-bottom: 12px;     /* สร้างพื้นที่ภายใน bounds ให้ shadow ด้านล่างแสดงโดยไม่โดน clip */
}

/* ── Inner track (slides horizontally) ── */
#hrc-inner {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
    will-change: transform;
}

/* =============================================================
   Review Card
   ============================================================= */
.hrc-card {
    flex: 0 0 100%; /* mobile: 1 card */
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-sizing: border-box;
}

/* Thumbnail background */
.hrc-card-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    height: 366px;
    width: 100%;
    cursor: pointer;
}

/* Play / link icon */
.hrc-play-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 48px;
    cursor: pointer;
    pointer-events: none; /* click handled by parent */
}

/* Card footer: photo + text */
.hrc-card-detail {
    padding: 15px;
    display: flex;
    align-items: center;
}

.hrc-card-photo {
    flex: 0 0 80px;
    text-align: center;
}

.hrc-card-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.hrc-card-info {
    flex-grow: 1;
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: "Line Seed", sans-serif;
}

.hrc-student-name {
    font-size: 16px;
    font-weight: 600;
}

.hrc-school-name {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.hrc-school-name img {
    width: 22px;
    vertical-align: middle;
    margin: 0 2px 3px 6px;
}

.hrc-visa-type {
    font-style: italic;
    color: #333;
    font-size: 14px;
}

/* =============================================================
   Carousel Controls
   ============================================================= */
.hrc-ctrl-btn {
    width: 100%;
    display: flex;
    justify-content: flex-end; /* align to right, same as original */
    pointer-events: none;      /* let clicks pass through the bar itself */
    margin-top: 10px;
    gap: 6px;
}

.hrc-ctrl-btn button {
    pointer-events: auto;
    background-color: #fff;
    border: 1px solid #ccc;
    color: #ccc;
    font-size: 18px;
    padding: 8px 14px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    line-height: 1;
}

.hrc-ctrl-btn button:hover {
    background-color: #f8f8f8;
    border-color: #bbb;
    color: #888;
}

/* =============================================================
   Overlay
   ============================================================= */
#hrc-overlay {
    display: none;
    position: fixed;
    inset: 0;                        /* top/right/bottom/left: 0 */
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1001;
}

/* =============================================================
   Popup — shared base
   ============================================================= */
.hrc-popup {
    display: none;
    position: fixed;
    z-index: 1002;

    /* Centered */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    overflow: hidden;

    /* Mobile-first: almost full viewport */
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Close button (top-right corner) */
.hrc-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 32px;
    height: 32px;
    background-color: #111;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.hrc-close-btn:hover {
    background-color: #444;
}

/* Popup inner body */
.hrc-popup-body {
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ── TikTok iframe ── */
#hrc-tiktok-iframe {
    /* TikTok embed is always 9:16 portrait */
    width: 100%;
    max-width: 340px;
    height: 700px;
    border: none;
    display: block;
}

/* ── Instagram container ── */
#hrc-instagram-container {
    width: 100%;
    max-width: 540px;
}

/* =============================================================
   Responsive — Tablet ≥ 768px
   ============================================================= */
@media (min-width: 768px) {
    .hrc-card {
        flex: 0 0 calc((100% - 20px) / 2);
    }

    .hrc-card-bg {
        height: 340px;
    }

    .hrc-card-photo img {
        width: 64px;
        height: 64px;
    }

    /* Popup: a comfortable centre modal */
    .hrc-popup {
        width: 72vw;
        max-width: 560px;
    }

    #hrc-tiktok-iframe {
        height: 650px;
    }
}

/* =============================================================
   Responsive — Desktop ≥ 1024px
   ============================================================= */
@media (min-width: 1024px) {
    .hrc-card {
        flex: 0 0 calc((100% - 40px) / 3);
    }

    .hrc-card-bg {
        height: 366px;
    }

    /* Popup: fixed comfortable width, not too narrow */
    .hrc-popup {
        width: 420px;    /* fixed px — prevents the old "25% = tiny" bug */
        max-width: 480px;
    }

    #hrc-tiktok-iframe {
        width: 340px;
        height: 700px;
    }
}