/* CHANGE: Theme-based hover states */
.vertical-content-containers:hover {
    border-left: 3px solid var(--vc-theme-light-hover-border);
    background: var(--vc-theme-light-hover-bg);
    cursor: pointer;
}

.vertical-content-container{
    max-width: 1912px;
    margin: 0 auto;
}

[data-theme="dark"] .vertical-content-containers:hover {
    border-left: 3px solid var(--vc-theme-dark-hover-border);
    background: var(--vc-theme-dark-hover-bg);
}

[data-theme="nline"] .vertical-content-containers:hover {
    border-left: 3px solid var(--vc-theme-nline-hover-border);
    background: var(--vc-theme-nline-hover-bg);
}

.vertical-content-containers {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: width 0.3s ease;
    padding: 16px 24px;
    max-width: 100%;
}

.vertical-content-media-expanded iframe,
.vertical-content-media-expanded video {
    pointer-events: auto !important;
    z-index: 2;
}

.icon-video-play-circle.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-thumbnail.playing .icon-video-play-circle {
    opacity: 0;
    pointer-events: none;
}

.vertical-content-buttons-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    z-index: 2;
    flex-direction: column;
    bottom: 0;
}

.vertical-content-description-for-small {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 16px;
}

.vertical-content-containers.expanded {
    width: 100%;
    border-left: 3px solid var(--vc-theme-light-active-border);
    background: var(--vc-theme-light-expanded-bg);
    position: relative;
    display: flex;
    gap: 16px 24px;
    align-self: stretch;
    height: 290px;
}

[data-theme="dark"] .vertical-content-containers.expanded {
    border-left: 3px solid var(--vc-theme-dark-active-border);
    background: var(--vc-theme-dark-expanded-bg);
}

[data-theme="nline"] .vertical-content-containers.expanded {
    border-left: 3px solid var(--vc-theme-nline-active-border);
    background: var(--vc-theme-nline-expanded-bg);
}

[data-theme="light"] .vertical-content-containers.expanded {
    border-left: 3px solid var(--vc-theme-dark-active-border);
    background: var(--vc-theme-light-expanded-bg);
}

[data-theme="dark"] .vertical-content-title,
[data-theme="dark"] .vertical-content-description,
[data-theme="dark"] .show-more-text,
[data-theme="dark"] .vertical-content-legal-link {
    color: var(--vc-theme-dark-text);
}

[data-theme="dark"] .icon-chevron-down::before,
[data-theme="dark"] .icon-chevron-up::before,
[data-theme="dark"] .icon-chevron-right::before {
    color: var(--vc-theme-dark-text);
}

.vertical-content-title {
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #000;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "HyundaiSansHead-Medium";
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 28px;
    cursor: pointer;
    width: 100%;
    justify-content: space-between;
    gap: 16px;
}

.vertical-content-title .vertical-content-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    flex: 1;
}

.vertical-content-containers.expanded .vertical-content-title {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: flex-start;
}

.vertical-content-containers.expanded
    .vertical-content-title
    > span:first-child {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.vertical-content-title::before {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.vertical-content-description {
    color: #000;
    font-family: "HyundaiSansText-Regular";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    position: relative;
    max-height: 150px;
    overflow: hidden;
}

.vertical-content-show-more .icon {
    vertical-align: middle; /* Align icon with the text */
}

.vertical-content-show-more {
    font-size: 14px;
    color: #0072ce;
    cursor: pointer;
    text-decoration: underline;
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    margin-left: auto;
}

.show-more-text {
    color: #002c5f;
    font-family: "HyundaiSansText-Medium";
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 18px;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-skip-ink: auto;
    text-decoration-thickness: auto;
    text-underline-offset: auto;
    text-underline-position: from-font;
}

.vertical-content-show-more .icon-chevron-right {
    width: 16px;
    height: 16px;
    color: #002c5f;
}

.vertical-content-legal-link {
    color: #002c5f;
    font-family: "HyundaiSansText-Medium";
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    text-underline-offset: auto;
    text-underline-position: from-font;
    text-decoration: underline;
    cursor: pointer;
    text-align: justify;
    padding: 4px;
}

.vertical-content-content-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vertical-content-description-block {
    position: relative;
}

.vertical-content-left {
    flex: 1;
    box-sizing: border-box;
    border-left: 1px solid #dad9d8;
    max-width: 50%;
}

.vertical-content-whole {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    padding: 64px 80px;
    justify-content: center;
}

/* [data-theme="dark"].vertical-content-whole {
    background: #000;
} */

.vertical-content-media {
    flex: 1;
    background: var(--vc-theme-light-expanded-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

[data-theme="dark"] .vertical-content-media {
    background: var(--vc-theme-dark-expanded-bg);
}

[data-theme="nline"] .vertical-content-media {
    background: var(--vc-theme-nline-expanded-bg);
}

.vertical-content-media-mobile {
    flex: 1;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vertical-content-media picture {
    width: 100%;
}

.vertical-content-media-video-wrapper {
    width: 100%;
}

.vertical-content-media-video-wrapper:has(iframe) {
    height: 100%;
}

.vertical-content-media-video-wrapper:has(video) {
    height: auto;
}

.vertical-content-media img {
    width: 100%;
    display: block;
}

.vertical-content-media iframe {
    width: 100%;
    height: 100%;
}

.vertical-content-media video {
    width: 100%;
}

/* CHANGE: Added video thumbnail styles to match HorizontalImageCarousel */
.vertical-content-media-video-wrapper .video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    pointer-events: auto;
    z-index: 2;
}

.vertical-content-media-video-wrapper .video-thumbnail video {
    height: 100%;
    cursor: pointer;
    pointer-events: auto;
    z-index: 2;
    background: #f6f3f2;
}

.vertical-content-media-video-wrapper .video-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
}

.vertical-content-media-video-wrapper .video-controls .icon-video-play-circle {
    font-size: 64px;
    color: rgba(255 255 255 90%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CHANGE: Hide play button when video is playing using :playing pseudo-class */
.vertical-content-media-video-wrapper
    .video-thumbnail
    video:playing
    ~ .video-controls,
.vertical-content-media-expanded
    .video-thumbnail
    video:playing
    ~ .video-controls {
    display: none;
}

/* CHANGE: Fallback for browsers that don't support :playing - use .playing class */
.vertical-content-media-video-wrapper .video-thumbnail.playing .video-controls,
.vertical-content-media-expanded .video-thumbnail.playing .video-controls {
    display: none;
}

[data-theme="nline"] .vertical-content-gradient {
    background: linear-gradient(
        180deg,
        rgba(223 235 245 / 0%) 0%,
        #DFEBF5 75.59%
    );
}

.vertical-content-gradient {
    position: absolute;
    bottom: 43px;
    left: 0;
    right: 0;
    height: 4em;
    background: linear-gradient(
        180deg,
        rgba(246 243 242 / 0%) 0%,
        rgba(246 243 242 / 80%) 50%,
        rgba(246 243 242 / 100%)
    );
    pointer-events: none;
    z-index: 0;
}

.vertical-content-title .icon-chevron-down,
.vertical-content-title .icon-chevron-up {
    margin-left: auto; /* Push icon to the extreme end */
    display: none; /* Default to hidden */
}

.vertical-content-media-expanded {
    display: none;
}

.vertical-content-main-media {
    display: none;
}

.vertical-content-desktop-desc {
    display: block;
}

.vertical-content-description-main {
    flex: 1;
}

/* CHANGE: Ensure video thumbnail is fully clickable on mobile/tablet */
@media (max-width: 1199px) {
    .vertical-content-media-video-wrapper .video-thumbnail {
        cursor: pointer;
    }

    .vertical-content-media-video-wrapper .video-controls {
        pointer-events: none !important;
    }

    .vertical-content-media-video-wrapper
        .video-controls
        .icon-video-play-circle {
        pointer-events: none !important;
    }

    /* CHANGE: Ensure video element doesn't block thumbnail clicks when controls are hidden */
    .vertical-content-media-video-wrapper
        .video-thumbnail
        video:not([controls]) {
        pointer-events: none;
    }
}

/* CHANGE: Ensure expanded media video behaves the same */
.vertical-content-media-expanded .video-thumbnail {
    cursor: pointer;
}

@media (max-width: 1199px) {
    .vertical-content-media-expanded .video-thumbnail video:not([controls]) {
        pointer-events: none;
    }
}

@media (max-width: 767px) {
    .vertical-content-description-block {
        padding: 16px;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .vertical-content-media-video-wrapper {
        height: 211px;
    }

    /* CHANGE: Added mobile video controls styling */
    .vertical-content-media-video-wrapper
        .video-controls
        .icon-video-play-circle {
        font-size: 48px;
        width: 48px;
        height: 48px;
    }

    .vertical-content-containers {
        padding: 12px 12px 12px 16px;
    }

    .vertical-content-containers.expanded {
        height: 100%;
    }

    .vertical-content-description-for-small {
        padding: 16px;
        justify-content: space-between;
        gap: 12px;
    }

    .vertical-content-description {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .vertical-content-gradient {
        display: none;
    }

    .vertical-content-show-more {
        display: none;
    }

    .vertical-content-description-main {
        background: #f6f3f2;
        display: flex;
        max-width: 100%;
        justify-content: space-between;
        flex-direction: column-reverse;
        flex: 1;
        min-height: auto;
        height: auto;
    }

    .vertical-content-main-media {
        display: flex;
        flex-direction: column-reverse;
    }

    .vertical-content-desktop-desc {
        display: none;
    }

    .vertical-content-whole {
        flex-direction: column;
        padding: 24px 16px;
    }

    .vertical-content-left,
    .vertical-content-media {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .vertical-content-title .icon-chevron-down {
        display: inline-block;
    }

    .vertical-content-title .icon-chevron-up {
        display: inline-block;
    }

    .vertical-content-media {
        display: none;
    }

    .vertical-content-media-expanded {
        flex: 1;
        background: black;
        display: flex;
        justify-content: center;
        overflow: hidden;
        max-height: 210px;
    }

    .vertical-content-media-expanded img {
        height: auto;
        width: 100%;
    }

    .vertical-content-media-expanded iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .vertical-content-media-expanded video {
        width: 100%;
        object-fit: cover;
    }

    .vertical-content-content-wrapper {
        height: auto; /* Allow wrapper to grow with content */
        display: flex;
        flex-direction: column;
    }

    .vertical-content-buttons-wrapper {
        margin-top: 16px; /* Add spacing from description */
        position: relative; /* Position relative to content */
    }
    
    [data-theme="dark"] .vertical-content-containers.expanded {
        background: var(--black);
    }

    [data-theme="dark"] .vertical-content-description-block {
        background: var(--vc-theme-dark-expanded-bg);
    }

    [data-theme="nline"] .vertical-content-containers.expanded {
        background: var(--vc-theme-nline-expanded-bg);
    }

    [data-theme="nline"] .vertical-content-description-block {
        background: var(--vc-theme-nline-expanded-bg);
    }
}

@media (min-width: 1200px) {
    .vertical-content-buttons-wrapper {
        position: absolute;
        width: 100%;
    }

    .vertical-content-whole {
        flex-direction: row;
        padding: 64px 80px;
    }

    .vertical-content-left {
        max-width: 50%;
        border-left: 1px solid #dad9d8;
    }

    .vertical-content-media {
        display: flex;
    }

    .vertical-content-media-expanded {
        display: none;
    }

    .vertical-content-desktop-desc {
        display: block;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    [data-theme="dark"] .vertical-content-containers.expanded {
        background: var(--black);
    }

    [data-theme="dark"] .vertical-content-description-block {
        background: var(--vc-theme-dark-expanded-bg);
    }

    [data-theme="nline"] .vertical-content-containers.expanded {
        background: var(--vc-theme-nline-expanded-bg);
    }

    [data-theme="nline"] .vertical-content-description-block {
        background: var(--vc-theme-nline-expanded-bg);
    }

    .vertical-content-gradient {
        height: 2em;
        bottom: 38px;
    }

    .vertical-content-description-block {
        padding: 24px;
        width: 50%;
    }

    .vertical-content-buttons-wrapper {
        position: absolute;
        bottom: 0;
        width: 100%;
        gap: 12px;
    }

    .vertical-content-containers {
        padding: 16px 16px 16px 24px;
    }

    .vertical-content-description-for-small {
        display: flex;
        min-height: 180px;
        max-height: 360px;
        padding: 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        flex: 1 0 0;
        justify-content: space-between;
    }

    .vertical-content-containers.expanded {
        background: #fff;
        height: 100%;
    }

    .vertical-content-description-main {
        background: #f6f3f2;
        display: flex;
        max-width: 100%;
        justify-content: space-between;
        min-height: 360px;
        max-height: 360px;
    }

    .vertical-content-description {
        max-height: 15em;
    }

    .vertical-content-main-media {
        display: flex;
        flex-direction: row;
    }

    .vertical-content-desktop-desc {
        display: none;
    }

    .vertical-content-whole {
        flex-direction: column;
        padding: 32px 40px;
    }

    .vertical-content-left,
    .vertical-content-media {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .vertical-content-title .icon-chevron-down {
        display: inline-block;
    }

    .vertical-content-title .icon-chevron-up {
        display: inline-block;
    }

    .vertical-content-media {
        display: none;
    }

    .vertical-content-media-expanded {
        flex: 1;
        background: black;
        display: flex;
        justify-content: center;
        overflow: hidden;
    }

    .vertical-content-media-expanded img {
        height: 100%;
        object-fit: cover;
    }

    .vertical-content-media-expanded iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .vertical-content-media-expanded video {
        width: 100%;
        object-fit: cover;
    }
}

.vertical-content-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0 0 0 / 60%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-content-modal {
    width: 800px;
    max-height: 768px;
    padding: 40px 32px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    position: relative;
    text-align: left;
}

.vertical-content-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.vertical-content-modal-title {
    margin-bottom: 1rem;
    color: #000;
    font-family: "HyundaiSansHead-Medium";
    font-size: 32px;
    font-style: normal;
    font-weight: 500;
    line-height: 40px;
}

.vertical-content-modal-description {
    color: #000;
    font-family: "HyundaiSansText-Regular";
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
}

.vertical-content-modal-description a {
    color: #002c5f;
    text-decoration: underline;
    text-underline-offset: auto;
    text-underline-position: from-font;
}

.vertical-content-modal-description a:hover {
    color: #0072ce;
    text-decoration: underline;
}

@media (min-width: 768px) and (max-width: 1024px) {
  .vertical-content-modal {
    width: 592px;                 /* fixed tablet width from spec */
    max-height: 90vh;
    padding: 40px 32px;           /* layout_D6GQVL.padding */
    display: flex;
    flex-direction: column;       /* layout_D6GQVL.mode */
    gap: 16px;                    /* layout_D6GQVL.gap */
    align-items: flex-start;
    background: #FFF;          /* fill_M8DYU3 */
  }

  .vertical-content-modal-title {
    /* style_VERJ06 */
    font-family: "Hyundai Sans Head","HyundaiSansHead-Medium",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.25em;          /* 40px */
    color: #000;               /* fill_XBIZ7L */
    margin: 0;
  }

  .vertical-content-modal-description {
    /* style_QQCC92 */
    font-family: "Hyundai Sans Text","HyundaiSansText-Regular",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.25em;          /* 20px */
    color: #000;               /* fill_XBIZ7L */
  }

  /* Close control sized/positioned per Figma */
  .vertical-content-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;                  /* layout_FPLDTY.dimensions.width */
    height: 48px;                 /* layout_FPLDTY.dimensions.height */
    padding: 20px 20px 0 0;       /* layout_6TXAAP.padding */
    background: transparent;
    border: none;
    color: #002C5F;               /* stroke_I9D9ZA */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 24px;              /* size of × glyph within 48x48 hit-area */
  }

  .vertical-content-modal-close:hover,
  .vertical-content-modal-close:focus-visible {
    outline: 2px solid #002C5F;   /* accessible affordance */
    outline-offset: 2px;
  }
}

