/* ================================
   Commercials Mobile
   Horizontal card swiper matching
   the home page mobile overlay style
   ================================ */

/* ---------- Main swiper container ---------- */

.cm-swiper {
    position: fixed;
    top: 100px;                                          /* start below header */
    left: 0;
    width: 100%;
    height: calc(100dvh - 100px - env(safe-area-inset-bottom) - 12px); /* 12px bottom gap */
    z-index: 1;
    overflow: visible !important;                        /* allow adjacent cards to peek */
}

/* ---------- Each project card ---------- */

.cm-slide {
    position: relative;
    width: calc(100% - 36px) !important;               /* ~18px peek on each side */
    height: 100% !important;                            /* fill the swiper container */
    background: black;
    border: 2px solid white;
    overflow: hidden;
}

/* ---------- Video / poster fills card ---------- */

.cm-poster,
.cm-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-video {
    display: none;
}

.cm-video.loaded {
    display: block;
}

/* Gradient scrim so title is readable */
.cm-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* ---------- Project title overlay ---------- */

.cm-info {
    position: absolute;
    bottom: calc(62px + 18px);
    left: 20px;
    right: 20px;
    z-index: 3;
}

.cm-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-size: 0.8em;
    text-transform: lowercase;
    margin-bottom: 4px;
}

.cm-client {
    color: white;
    font-family: "greycliff-cf", sans-serif;
    font-weight: 600;
    font-size: 1.4em;
    text-transform: lowercase;
    line-height: 1.1;
}

/* ---------- Card action bar (inside card) ---------- */

.cm-card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    display: flex;
    z-index: 3;
    border-top: 2px solid white;                        /* matches card perimeter */
}

.cm-card-btn {
    flex: 1;
    height: 100%;
    background: none;
    border: none;
    color: white;
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-size: 0.9em;
    text-transform: lowercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.cm-card-btn:first-child {
    border-right: 2px solid white;                      /* matches card perimeter */
}

/* ---------- Drawers (slide up within the card) ---------- */

.cm-drawer {
    position: absolute;
    inset: 0;
    background: black;
    z-index: 10;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    /* Matches home page overlay animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.cm-drawer.open {
    transform: translateY(0);
}

/* ---------- Details drawer body ---------- */

.cm-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 20px 16px;
    -webkit-overflow-scrolling: touch;
}

.cm-drawer-client {
    color: white;
    font-family: "greycliff-cf", sans-serif;
    font-weight: 600;
    font-size: 1.3em;
    text-transform: lowercase;
    margin-bottom: 5px;
}

.cm-drawer-title {
    color: rgba(255, 255, 255, 0.5);
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-size: 0.8em;
    text-transform: lowercase;
    margin-bottom: 24px;
}

.cm-credit {
    color: rgba(255, 255, 255, 0.85);
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-size: 0.88em;
    line-height: 2;
}

/* ---------- Close button — full width of card, at bottom ---------- */

.cm-drawer-close {
    width: 100%;
    height: 62px;
    flex-shrink: 0;
    background: none;
    border: none;
    border-top: 2px solid white;                        /* matches card perimeter */
    color: rgba(255, 255, 255, 0.7);
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-style: italic;
    font-size: 0.9em;
    text-transform: lowercase;
    cursor: pointer;
}

/* ---------- Gallery drawer — vertical scroll ---------- */

.cm-gallery-swiper {
    flex: 1;
    overflow: hidden;
}

.cm-gallery-swiper .swiper-slide {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.cm-gallery-swiper .swiper-slide img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ---------- Slide counter ---------- */

.cm-counter {
    position: fixed;
    bottom: 4px;
    right: 24px;
    color: rgba(255, 255, 255, 0.4);
    font-family: "greycliff-cf", sans-serif;
    font-weight: 200;
    font-size: 0.7em;
    letter-spacing: 0.05em;
    z-index: 5;
    pointer-events: none;
}
