/* Base & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #57379c;
    --secondary-color: #0E6CBA;
    --accent-color: #db1d81;
    --bg-light: #d5eaef;
    --text-main: #333333;
    --text-muted: #666666;
    --font-family: 'Noto Sans TC', sans-serif;
    --transition-speed: 0.3s;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: 1.6;
    background-color: #FFFFFF;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Reduce width for specific sections */
.highlights .container,
.video .container,
.news .container,
.readmore .container {
    max-width: 1040px;
}

.bg-light-blue {
    background-color: var(--bg-light);
}

/* Loading Screen */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFFFFF;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px; /* Increased from 15px per user request */
}

.loading-text {
    font-size: 0.9rem; /* Not too big */
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    animation: ripple 2.4s cubic-bezier(0.1, 0.5, 0.3, 1) infinite;
    box-sizing: border-box;
    opacity: 0;
}

.spinner span:nth-child(1) {
    animation-delay: 0s;
}

.spinner span:nth-child(2) {
    border-color: var(--accent-color); /* 第二層桃紅色 */
    animation-delay: 0.8s;
}

.spinner span:nth-child(3) {
    animation-delay: 1.6s;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: all 0.3s ease;
    padding-top: 20px;
}

.header.scrolled {
    /* No white background or padding change */
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 30px;
    max-width: 100%;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 25px;
    transition: opacity 0.3s ease;
}

.header.scrolled .logo {
    opacity: 0;
    pointer-events: none;
}

.logo img {
    height: 35px;
    width: auto;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 1001;
    background-color: var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 24px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.hamburger.active {
    background-color: var(--accent-color);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 360px;
    max-width: 100%;
    height: 100vh;
    background-color: var(--primary-color);
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding-top: 120px;
    padding-left: 40px;
    padding-right: 40px;
    overflow: hidden;
}

.mobile-menu::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px; /* Increased slightly per user request */
    background-image: url('../images/hero_visual_11.svg');
    background-size: auto 100%; /* Maintain aspect ratio, match container height */
    background-repeat: repeat-x; /* Repeat horizontally */
    background-position: bottom left; /* Start repeating from the left */
    opacity: 0.15; /* Subtle and elegant */
    z-index: -1;
    pointer-events: none;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu ul li {
    overflow: hidden;
    margin-bottom: 20px;
}

.mobile-menu ul li a {
    display: flex;
    align-items: center;
    font-size: 1.15rem; /* Reduced further from 1.35rem */
    font-weight: 500; /* Lighter font weight */
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    transform: translateY(100%);
    padding: 5px 0;
}

.mobile-menu.active ul li a {
    transform: translateY(0);
    color: rgba(255, 255, 255, 0.9);
}

.mobile-menu.active ul li:nth-child(1) a { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s, color 0.3s; }
.mobile-menu.active ul li:nth-child(2) a { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s, color 0.3s; }
.mobile-menu.active ul li:nth-child(3) a { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s, color 0.3s; }
.mobile-menu.active ul li:nth-child(4) a { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s, color 0.3s; }
.mobile-menu.active ul li:nth-child(5) a { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s, color 0.3s; }
.mobile-menu.active ul li:nth-child(6) a { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.45s, color 0.3s; }

.mobile-menu ul li a::before {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    background-color: var(--accent-color);
    margin-right: 0;
    transition: width 0.3s ease, margin-right 0.3s ease;
    border-radius: 2px;
}

.mobile-menu ul li a:hover {
    color: #ffffff;
}

.mobile-menu ul li a:hover::before {
    width: 30px;
    margin-right: 15px;
}

/* Sections Common */
section {
    padding: 90px 0;
}

.section-title-wrap {
    text-align: center;
    margin-bottom: 50px;
}

.en-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 50px; /* Standardize distance for all sections */
}

.section-title-wrap .section-title {
    margin-bottom: 0; /* Prevent double spacing */
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    transform: translateY(-1px); /* Precise optical alignment with icons */
}

.section-title img {
    height: 30px;
}

/* 01. Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px; /* offset for header */
}

.hero-visuals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-left {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40.5%; /* Reduced by 10% */
    max-height: 65vh; /* Reduced from 75vh to leave more safe distance on top */
    z-index: 1;
    object-fit: contain;
    object-position: bottom left;
    animation: slideInLeft 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-bg-right {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30.15%; /* Reduced by 10% from 33.5% */
    max-height: 65vh; /* Reduced from 75vh to leave more safe distance on top */
    z-index: 1;
    object-fit: contain;
    object-position: bottom right;
    animation: slideInRight 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-bg-mid-left {
    position: absolute;
    bottom: calc(-2% + 70px); /* Moved up 70px */
    left: calc(53% + 40px); /* Moved right 40px */
    margin-left: -10.5%; /* Shifted slightly to the right (was -12%) to overlap or close transparent gap */
    width: 13%;
    max-width: 160px;
    z-index: 1;
    opacity: 0;
    animation: fadeUpIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.3s;
}

.hero-bg-mid-right {
    position: absolute;
    bottom: -2%;
    left: calc(53% + 25px); /* Moved right 25px */
    margin-left: 0; /* Starts exactly at the anchor to touch the left SVG */
    width: 13%;
    max-width: 160px;
    z-index: 1;
    opacity: 0;
    animation: fadeUpIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.5s;
}

.hero-bg-tr-1 {
    position: absolute;
    top: 15%;
    right: 28%;
    width: 5%;
    max-width: 70px;
    z-index: 0;
    opacity: 0.03; /* Matches 0% of pulseOpacity to prevent jump */
    animation: floatShape 6s ease-in-out infinite, pulseOpacity 5s ease-in-out infinite;
}

.hero-bg-tr-2 {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 7%;
    max-width: 100px;
    z-index: 0;
    opacity: 0.03; /* Matches 0% of pulseOpacity to prevent jump */
    animation: floatShape 7s ease-in-out infinite 1s, pulseOpacity 6s ease-in-out infinite 2s;
}

.hero-bg-mobile {
    display: none;
}

@keyframes slideInLeft {
    0% { transform: translateX(-50px) translateY(20px); opacity: 0; }
    100% { transform: translateX(0) translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    0% { transform: translateX(50px) translateY(20px); opacity: 0; }
    100% { transform: translateX(0) translateY(0); opacity: 1; }
}

@keyframes fadeUpIn {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0.8; }
}

/* Pause animations until loading is complete */
body:not(.loaded) .hero-bg-left,
body:not(.loaded) .hero-bg-right,
body:not(.loaded) .hero-bg-mid-left,
body:not(.loaded) .hero-bg-mid-right,
body:not(.loaded) .hero-bg-tr-1,
body:not(.loaded) .hero-bg-tr-2 {
    animation-play-state: paused !important;
}

@keyframes floatShape {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulseOpacity {
    0% { opacity: 0.03; }
    50% { opacity: 0.15; }
    100% { opacity: 0.03; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px; /* slight padding for mobile sides */
    transform: translateY(-10px); /* Moved down 50px from -60px */
}

.hero-subtitle {
    color: #e42283; /* Updated per user request */
    font-size: clamp(1.2rem, 2.2vw, 1.65rem); /* Scaled up ~10% */
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: 3px;
}

.hero-year {
    font-family: 'Oswald', sans-serif;
    letter-spacing: 2px;
}

.hero-title {
    color: #5b3c9a; /* Updated per user request */
    font-size: clamp(3.1rem, 6.6vw, 5.3rem); /* Scaled up ~10% */
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 4px 15px rgba(255,255,255,0.8);
    position: relative;
    z-index: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-decoration: none;
    position: relative;
    z-index: 10;
    height: 70px; /* Provides space for the line */
}

.scroll-indicator:hover {
    opacity: 0.7;
}

.scroll-line {
    width: 2px;
    height: 100%;
    background: rgba(87, 55, 156, 0.15); /* Light transparent track */
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.scroll-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    animation: stretchLine 2s cubic-bezier(0.8, 0, 0.2, 1) infinite;
    transform-origin: top;
}

@keyframes stretchLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    50.1% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* 02. About Section */
.about {
    position: relative;
    overflow: hidden;
}

.about .bg-left {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    z-index: 0;
    max-width: 23%;
}

.about .bg-right {
    position: absolute;
    right: 0;
    top: calc(50% + 60px);
    transform: translateY(-50%);
    opacity: 1;
    z-index: 0;
    max-width: 16%;
}

.about-text {
    max-width: 640px;
    margin: 0 auto 60px;
    text-align: justify;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 2;
    color: var(--text-main);
    position: relative;
    z-index: 1;
}

.about-text p {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    position: relative;
    z-index: 1;
    max-width: 840px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    padding: 10px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.en-title {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 700;
    white-space: nowrap;
}

.stat-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: baseline;
    white-space: nowrap;
}

.stat-value .counter {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
}

.stat-value .unit {
    font-size: 1.2rem;
    margin-left: 5px;
    color: var(--primary-color);
    font-weight: 700;
}

/* 03. Highlights Section */
.highlights {
    position: relative;
    overflow: hidden;
    padding-bottom: 100px;
}

.highlights .bg-left {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 15%;
    z-index: 0;
}

.highlights .bg-right {
    position: absolute;
    right: 0;
    bottom: 0;
    max-width: 15%;
    z-index: 0;
}

.flip-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    max-width: 357px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Fix for iOS Safari: Prevent z-indexed children from bleeding through */
.flip-card-front *, .flip-card-back *,
.flip-card-front::before, .flip-card-front::after,
.flip-card-back::before, .flip-card-back::after {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-front {
    background-color: #FFFFFF;
    color: var(--primary-color);
    position: relative;
    -webkit-transform: rotateY(0deg) translateZ(1px);
    transform: rotateY(0deg) translateZ(1px);
}

.flip-card-front::before, .flip-card-front::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.flip-card-front::before {
    top: 15px; right: 15px; bottom: 15px; left: 15px;
    border: 1.5px dashed var(--primary-color);
}

.flip-card-front::after {
    top: 30px; right: 30px; bottom: 30px; left: 30px;
    border: 1px solid rgba(87, 55, 156, 0.3);
}


.card-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.card-icon img {
    max-width: 100%;
    max-height: 100%;
}

.flip-card-front h3 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

.flip-card-front h4 {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-main);
    position: relative;
    z-index: 1;
}

.card-arrow {
    margin-top: 15px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.flip-card-back {
    background: var(--primary-color);
    color: white;
    -webkit-transform: rotateY(180deg) translateZ(1px);
    transform: rotateY(180deg) translateZ(1px);
}

.flip-card-back p {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
}

/* 04. Article Section */
.article {
    position: relative;
    overflow: hidden;
    padding-bottom: 80px;
}

.article .bg-left {
    position: absolute;
    left: 0;
    top: 0;
    max-width: 15%;
    z-index: 0;
}

.article .bg-right {
    position: absolute;
    right: 0;
    top: 0;
    max-width: 15%;
    z-index: 0;
}

.article-swiper {
    padding-bottom: 60px;
    padding-left: 10px;
    padding-right: 10px;
}

.article-card {
    display: block;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    transition: transform 0.3s;
    height: 100%;
}

.article-card:hover {
    /* No translateY, just image scale handled below */
}

.article-card .img-wrapper {
    width: 100%;
    padding-top: 60%; /* Aspect Ratio */
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px; /* Exact spacing above the line */
}

.article-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.article-card h3 {
    padding: 0;
    padding-top: 15px; /* Exact spacing below the line */
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    line-height: 1.6;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

/* Progress Separator (Top) */
.article-card h3::before {
    content: '';
    position: absolute;
    top: 3px; /* Shifted down slightly to compensate for text line-height (Optical alignment) */
    left: 0;
    width: 100%;
    height: 1px;
    background-color: transparent; /* Removed gray track */
    background-image: linear-gradient(90deg, var(--accent-color), var(--accent-color)); /* Pink progress fill */
    background-size: 20% 1px; /* Starts at 20% width */
    background-repeat: no-repeat;
    transition: background-size 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.article-card:hover h3::before {
    background-size: 100% 1px;
}

/* Swiper Pagination & Navigation Customization */
.swiper-pagination-bullet {
    background-color: var(--secondary-color);
    opacity: 0.5;
}
.swiper-pagination-bullet-active {
    background-color: var(--primary-color);
    opacity: 1;
}

.article .swiper-button-next, .article .swiper-button-prev,
.focus .swiper-button-next, .focus .swiper-button-prev {
    color: var(--primary-color);
    background: white;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    margin-top: -27px;
    transition: all 0.3s ease;
}

.article .swiper-button-next:hover, .article .swiper-button-prev:hover,
.focus .swiper-button-next:hover, .focus .swiper-button-prev:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(87, 55, 156, 0.3);
}

.article .swiper-button-next::after, .article .swiper-button-prev::after,
.focus .swiper-button-next::after, .focus .swiper-button-prev::after {
    font-size: 1.2rem;
}

.article .swiper-button-prev, .focus .swiper-button-prev { left: -10px; }
.article .swiper-button-next, .focus .swiper-button-next { right: -10px; }

@media (min-width: 1300px) {
    .article .swiper-button-prev, .focus .swiper-button-prev {
        left: -60px;
    }
    .article .swiper-button-next, .focus .swiper-button-next {
        right: -60px;
    }
}

/* 05. Video Section */
.video {
    position: relative;
    overflow: hidden; 
}

/* Ensure the main content sits above */
.video .container {
    position: relative;
    z-index: 1;
}

.video .bg-right {
    position: absolute;
    right: 0;
    bottom: 0;
    max-width: 15%;
    z-index: 0;
}

.video-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.video-card {
    display: block;
    flex: 1 1 400px; /* Take up available space, min width 400px */
    max-width: 550px; /* Standard cap for when there are 2 videos */
}

/* Smart layout: If there is only one video, make it larger and more impactful */
.video-card:only-child {
    max-width: 700px; /* Reduced from 850px to make it less overwhelming */
}

.video-thumbnail {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.video-thumbnail > img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px; /* Reduced by 20% from 80px */
    height: 64px; /* Reduced by 20% from 80px */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
}

.play-btn img {
    width: 100%;
    height: auto;
}

.video-card h3 {
    font-size: 1.1rem; /* Matches article */
    font-weight: 500;
    color: var(--primary-color);
    line-height: 1.6; /* Matches article */
    margin-top: 15px;
    display: flex;
    align-items: flex-start; /* Better alignment for multi-line text */
    gap: 10px;
}

/* Enlarge title if it's the only video */
.video-card:only-child h3 {
    font-size: 1.1rem; /* Kept same as article, no enlargement */
    margin-top: 15px;
}

.video-card h3 .title-text {
    line-height: 1.6;
}

/* Featured Badge inside Title */
.video-badge {
    display: inline-block;
    background-color: var(--accent-color); /* Pink brand color */
    color: #ffffff;
    padding: 3px 12px;
    border-radius: 20px; /* Pill shape */
    font-size: 0.95rem;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 3px;
    vertical-align: middle;
    transform: translateY(-2px); /* Optical alignment with text */
    letter-spacing: normal;
}

.video-card h3 .slashes {
    display: inline-flex;
    letter-spacing: -2px;
    font-weight: 300;
    margin-top: 0;
    transform: translateY(-2px); /* Precise optical lift */
}

.video-card h3 .slashes span {
    color: #999;
    transition: color 0.3s ease;
}

/* Sequential pink highlight on hover */
.video-card:hover h3 .slashes span:nth-child(1) {
    color: var(--accent-color);
    transition-delay: 0s;
}

.video-card:hover h3 .slashes span:nth-child(2) {
    color: var(--accent-color);
    transition-delay: 0.1s;
}

.video-card:hover h3 .slashes span:nth-child(3) {
    color: var(--accent-color);
    transition-delay: 0.2s;
}

.video-card:hover .video-thumbnail > img {
    transform: scale(1.02); /* Reduced from 1.05 for a subtler effect */
}

.video-card:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.05); /* Reduced from 1.1 */
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 900px;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    font-size: 0; /* Hide the HTML times character */
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background-color: var(--primary-color);
    transition: background-color 0.3s ease;
}

.lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.lightbox-close:hover {
    background-color: var(--primary-color);
    transform: rotate(90deg);
}

.lightbox-close:hover::before,
.lightbox-close:hover::after {
    background-color: white;
}

.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 06. Focus Section */
.focus {
    position: relative;
    padding-bottom: 80px;
}

.focus .bg-left {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 15%;
    z-index: 0;
}

.focus .bg-right {
    position: absolute;
    right: 0;
    top: 0;
    max-width: 15%;
    z-index: 0;
}

.focus-swiper {
    padding-bottom: 60px;
    padding-left: 10px;
    padding-right: 10px;
}

.focus-card {
    display: block;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06); /* Wider, softer, more premium shadow */
    border: 1px solid rgba(87, 55, 156, 0.2); /* Clearer, brand-tinted border (#57379c at 20%) */
    
    /* Safari Fix: Prevents border-radius from disappearing when child image scales */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.focus-card img {
    width: 100%;
    display: block;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); /* Smoother, premium easing */
}

.focus-card:hover img {
    transform: scale(1.03); /* More subtle scale (3% instead of 5%) */
}

/* 07. News Section */
.news {
    position: relative;
    padding-bottom: 100px;
}

.news .bg-left {
    position: absolute;
    left: 0;
    top: 0;
    max-width: 15%;
    z-index: 0;
}

.news .bg-right {
    position: absolute;
    right: 0;
    bottom: 0;
    max-width: 15%;
    z-index: 0;
}

.news-single-wrapper {
    width: 100%;
    margin: 0 auto;
    padding-bottom: 20px;
}

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card .img-wrapper {
    width: 100%;
    padding-top: 55%;
    position: relative;
    border-radius: 10px; /* Matched with readmore */
    overflow: hidden;
}

.news-card .img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .img-wrapper img {
    transform: scale(1.05);
}

.news-content {
    padding: 25px 0 0 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-content h3 {
    font-size: 1.5rem; /* Reduced from 1.7rem */
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px; /* Increased separation */
    padding-bottom: 20px;
    line-height: 1.4;
    position: relative;
}

.news-content h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background-color: var(--accent-color); /* Small decorative line */
    border-radius: 2px;
}

.news-content .intro-text {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(87, 55, 156, 0.1);
}

.news-content .feature-list {
    margin-bottom: 25px;
    padding-left: 0;
}

.news-content .feature-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.5;
}

.news-content .feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-color);
    font-weight: 900;
}

.more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #5d3d95;
    background-color: #5d3d95; /* Default color requested */
    border-radius: 5px;
    padding: 12px 15px;
    line-height: 1;
    color: #ffffff; /* White text */
    font-size: 1.05rem;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: auto;
    position: relative;
    overflow: hidden; /* Required for slide effect */
    z-index: 1;
}

.more-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #3174ba; /* Updated hover color */
    transition: width 0.3s ease;
    z-index: 0;
}

.more-btn span {
    position: relative;
    top: -2px;
    z-index: 2;
}

.more-btn img {
    width: 20px; 
    display: block;
    position: relative;
    top: 1px; 
    transition: transform 0.3s ease;
    z-index: 2;
    filter: brightness(0) invert(1); /* Ensure arrow is white on dark background */
}

.news-card:hover .more-btn {
    border-color: #3174ba;
    color: #ffffff;
}

.news-card:hover .more-btn::before {
    width: 100%;
}

.news-card:hover .more-btn img {
    animation: arrowBounceX 1s infinite ease-in-out;
}

@keyframes arrowBounceX {
    0% { transform: translateX(0); }
    50% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* 08. Read More */
.readmore {
    padding: 0;
    margin: 60px 0 30px; /* Reduced top and bottom margins */
}

.readmore-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.readmore-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.btn-readmore {
    position: relative;
    background: var(--primary-color);
    color: #FFFFFF;
    padding: 20px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.4s ease;
    overflow: hidden;
}

.btn-readmore::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    z-index: 1;
}

.btn-readmore > * {
    position: relative;
    z-index: 2;
}

.btn-readmore span {
    top: -1px;
}

.btn-readmore:hover {
    background: var(--secondary-color);
}

.btn-readmore:hover::before {
    left: 150%;
}

.btn-readmore .icon-home {
    background: #FFFFFF;
    border-radius: 50%;
    height: 28px;
    width: 28px;
    position: relative;
    top: 1px;
    flex-shrink: 0;
}

.btn-readmore .icon-home::after {
    content: "";
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    background-color: var(--primary-color);
    -webkit-mask: url('../images/readmore_home.svg') no-repeat center / contain;
    mask: url('../images/readmore_home.svg') no-repeat center / contain;
    transition: background-color 0.4s ease;
}

.btn-readmore:hover .icon-home::after {
    background-color: var(--secondary-color);
}

.btn-readmore .icon-arrow {
    height: 20px;
    transition: transform 0.3s;
    filter: brightness(0) invert(1);
    position: relative;
    top: 0;
}

.btn-readmore:hover .icon-arrow {
    transform: translateX(5px);
}

/* 09. Footer */
.footer {
    position: relative;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
}

.footer-top {
    padding: 40px 20px; /* Reduced top padding */
    display: flex;
    justify-content: center;
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.footer-logos img {
    height: 45px; /* Adjust size based on layout, Chubb and GVM logos */
    object-fit: contain;
}

.footer-visual-container {
    width: 100%;
    display: block;
}

.footer-visual {
    width: 100%;
    display: block;
}

.footer-bottom {
    padding: 30px 20px;
    text-align: center;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* -------------------------------- */
/* Back to Top Button               */
/* -------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 992px) {
    section { padding: 70px 0; }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .flip-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 760px;
        margin: 0 auto;
    }
    
    /* Center the 3rd card in a 2-column grid */
    .flip-card:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
    }
    
    .video-grid { grid-template-columns: repeat(2, 1fr); }

    .hero-title { font-size: clamp(3.5rem, 6.6vw, 4.5rem); }
    .hero-subtitle { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
}

@media (max-width: 768px) {
    section { padding: 50px 0; }
    
    .hero {
        padding-top: 50px;
    }
    
    .hero-content {
        transform: translateY(-15px); /* Moved down further from -40px */
    }
    
    /* Mobile Header Adjustments */
    .header {
        padding-top: 0; /* Move header to the very top */
    }
    
    .header .container {
        padding: 5px 15px; /* Move logo left and hamburger right */
    }
    
    .logo {
        gap: 15px;
    }
    
    .logo img {
        height: 26px; /* Shrink logo */
    }
    
    .hamburger {
        width: 50px;
        height: 50px;
    }
    
    .hero-title { font-size: clamp(3.1rem, 12vw, 3.8rem); } /* Increased by 10% */
    .hero-subtitle { font-size: clamp(1.1rem, 4vw, 1.3rem); } /* Increased by 10% */
    
    /* Hide desktop main graphics on mobile, but keep floating shapes */
    .hero-bg-left, .hero-bg-right, .hero-bg-mid-left, .hero-bg-mid-right {
        display: none !important;
    }
    
    /* Adjust floating shapes for mobile */
    .hero-bg-tr-1 {
        width: 13.5vw; /* Reduced by 10% from 15vw */
        max-width: 63px; /* Reduced by 10% from 70px */
        top: calc(20% - 20px); /* Moved up exactly 20px */
        right: 8%;
    }
    
    .hero-bg-tr-2 {
        width: 19.8vw; /* Reduced by 10% from 22vw */
        max-width: 99px; /* Reduced by 10% from 110px */
        top: calc(16% - 20px); /* Moved up exactly 20px */
        right: 22%;
        left: auto;
    }
    
    /* Show mobile visual */
    .hero-bg-mobile {
        display: block;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 100%; /* Reverted to 100% to prevent side gaps */
        object-fit: contain;
        object-position: bottom center;
        z-index: 1;
        opacity: 0.8;
        animation: fadeUpIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
    
    .about-text {
        padding: 0 20px; /* Prevent text from being too full-width on mobile */
        font-size: 1.05rem;
    }
    
    /* Adjust About section background visuals for mobile */
    .about .bg-left {
        max-width: 45%;
        top: 0; /* Moved further up */
        left: -5%;
        transform: none;
        opacity: 0.4;
    }
    
    .about .bg-right {
        max-width: 35%;
        top: auto;
        bottom: 5%;
        right: -5%;
        transform: none;
        opacity: 0.4;
    }
    
    /* Adjust all other section background visuals for mobile */
    .highlights .bg-left, .highlights .bg-right,
    .article .bg-left, .article .bg-right,
    .video .bg-left, .video .bg-right,
    .focus .bg-left, .focus .bg-right,
    .news .bg-left, .news .bg-right {
        max-width: 35%;
        opacity: 0.4;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .stat-label { font-size: 0.95rem; }
    .stat-value { font-size: 2.2rem; }
    .stat-value .unit { font-size: 1rem; }
    
    .flip-cards {
        grid-template-columns: repeat(1, 1fr);
        max-width: 350px;
    }
    
    .flip-card:nth-child(3) {
        grid-column: auto;
    }
    
    .flip-card {
        max-width: 300px;
    }
    
    .card-icon { 
        width: 60px; 
        height: 60px; 
    }
    
    /* Hide swiper arrows, rely on pagination for mobile */
    .article-btn-next, .article-btn-prev, 
    .focus-btn-next, .focus-btn-prev {
        display: none !important;
    }
    
    /* Hide back-to-top button on mobile */
    .back-to-top {
        display: none !important;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
    }
    
    .news, .article, .focus, .video {
        padding-bottom: 50px; /* Make top and bottom padding equal (50px) */
    }
    
    .video-card h3 {
        align-items: flex-start; /* Align icon to the top if text wraps */
    }
    
    .section-title h2 {
        font-size: 1.6rem;
    }
    
    .readmore-box {
        min-height: 200px;
    }
    .btn-readmore {
        font-size: 1rem;
        padding: 12px 25px;
    }
    
    .footer-logos {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-logos img {
        height: 32px; /* Shrink logos on mobile */
    }
    
    .copyright {
        font-size: 0.75rem; /* Shrink copyright text on mobile */
    }
    
    .footer-visual-container {
        overflow: hidden; /* Prevent horizontal scroll */
    }
    
    .footer-visual {
        width: 150%; /* Scale up visual */
        max-width: 150%;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Adjust Top Button size and spacing */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Adjustments specifically for wide mobile/tablet portrait (prevents Hero overlap) */
@media (min-width: 550px) and (max-width: 768px) {
    .hero-content {
        transform: translateY(-60px); /* Push title block UP */
    }
    
    .hero-bg-mobile {
        bottom: -10vw; /* Push visual graphic DOWN (clips bottom slightly but creates perfect space in the middle) */
    }
}

/* Custom Desktop Layout for Single News Card */
@media (min-width: 768px) {
    .news-single-wrapper {
        width: 100%;
        padding: 0;
    }
    
    .news-card.single-news {
        flex-direction: row;
        background: #ffffff;
        border-radius: 10px; /* Matched with readmore */
    }
    
    .news-card.single-news .img-wrapper {
        width: 50%;
        padding-top: 0;
        min-height: 350px; /* Enforce height */
        border-radius: 10px 0 0 10px; /* Matched with readmore */
    }
    
    .news-card.single-news .news-content {
        width: 50%;
        padding: 40px 50px;
        justify-content: center; /* Center content vertically */
    }
    
    .news-card.single-news h3 {
        font-size: 1.5rem; /* Reduced from 1.7rem */
        margin-bottom: 10px;
    }
}
