html {
    font-size: 16px;
}
@font-face {
    font-family: 'Fz The Moritza';
    src: url('../fonts/FzTheMoritza.woff2');
}
@font-face {
    font-family: 'MJ-Gastie-Regular';
    src: url('../fonts/MJ-Gastie-Regular.ttf');
}

@font-face {
    font-family: 'Hurricane Regular';
    src: url('../fonts/Hurricane-Regular.ttf');
}
@font-face {
    font-family: 'FONGLAB VH0009';
    src: url('../fonts/FONGLAB-VH0009.ttf');
}

@font-face {
    font-family: 'Fz Madinah Authentic';
    src: url('../fonts/FzMadinahAuthentic.woff2');
}

@font-face {
    font-family: 'Fz The Handwritten Watermark';
    src: url('../fonts/FzTheHandwrittenWatermark.woff2');
}
/* --- SVN GILROY FAMILY --- */

/* Extra Light Italic */
@font-face {
    font-family: 'SVN Gilroy';
    src: url('../fonts/SVN-Gilroy Light Italic.otf');
    font-weight: 200;
    font-style: italic;
}

/* Light */
@font-face {
    font-family: 'SVN Gilroy';
    src: url('../fonts/SVN-Gilroy Light.otf');
    font-weight: 300;
    font-style: normal;
}

/* Light Italic */
@font-face {
    font-family: 'SVN Gilroy';
    src: url('../fonts/SVN-Gilroy Light Italic.otf');
    font-weight: 300;
    font-style: italic;
}

/* Regular */
@font-face {
    font-family: 'SVN Gilroy';
    src: url('../fonts/SVN-Gilroy Regular.otf');
    font-weight: 400;
    font-style: normal;
}

/* Regular Italic (Nếu bạn có file Italic riêng) */
@font-face {
    font-family: 'SVN Gilroy';
    src: url('../fonts/SVN-Gilroy Italic.otf');
    font-weight: 400;
    font-style: italic;
}

/* SemiBold */
@font-face {
    font-family: 'SVN Gilroy';
    src: url('../fonts/SVN-Gilroy SemiBold.otf');
    font-weight: 600;
    font-style: normal;
}

:root {

    --font-philosopher: "Philosopher", sans-serif;
    --font-moritza: "Fz The Moritza";
    --font-madinah: "Fz Madinah Authentic";
    --font-handwritten: "Fz The Handwritten Watermark";
    --font-hurricance-regular: "Hurricane Regular";
    --font-svn-regular: "SVN Gilroy Regular";
    --font-svn-semibold: "SVN Gilroy Semibold";
    --font-mj: "MJ-Gastie-Regular";
    --font-fong: "FONGLAB VH0009";
    --Primary-Vivid: #111111;
    --Primary-Light: #ffffff;
    --Secondary-Light: #BAC2B3;
    --Secondary-Neutral: #97A291;
    --Secondary-Vidid: #E29276;
    --Primary-Neutral: #dec3ad;
    --Gray-Asparagus: #F1EAE3;
    --Accent-Light: #ffffff;
    --Dolphin-Gray: #838F77;
    --Accent-Neutral: #BB9837;
    --System-Light: #F6F6F4;
    --System-Yellow: #EBF1E7;
    --System-Alert: #B50000;
    --System-Disabled: #EDEDED;
    --Dark-Silver: #FAF5F0;
    --Backgrounds-Primary: #FFF;
    --door-speed: 1.5s; /* Tăng tốc độ cửa một chút cho mượt */
    --train-speed: 1.5s; /* Tăng tốc độ cửa một chút cho mượt */
    --Primary-Vivid-rgb: 51, 88, 6;     /* #335806 */
    --Secondary-Vidid-rgb: 75, 88, 70; /* #4B5846 */
    --card-width: 125px;
    --card-height: 174px;
}

* {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}
body {
    color: var(--Primary-Vivid);
    font-size: 1rem;
    font-weight: 400;
    line-height: 128%;
    font-family: 'SVN Gilroy', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

p {
    line-height: 128%;
}

h3 {
    color: var(--Primary-Vivid);
    font-size: 3.75rem !important;
    font-family: var(--font-moritza);
    line-height: 120%;
    min-width: max-content;
}

.text-large {
    color: var(--Primary-Vivid);
    font-size: 4.5rem !important;
    font-family: var(--font-moritza);
    line-height: 120%;
}
.text-semilarge {
    color: var(--Primary-Vivid);
    font-size: 4rem !important;
    font-family: var(--font-moritza);
    line-height: 120%;
}

.text-medium {
    color: var(--Primary-Vivid);
    font-size: 3.75rem !important;
    font-family: var(--font-moritza);
    line-height: 120%;
    min-width: max-content;
}

.text-small {
    color: var(--Primary-Vivid);
    font-size: 3.25rem !important;
    font-family: var(--font-moritza);
    line-height: 120%;
    letter-spacing: -0.13rem;
}

.font-madinah {
    font-family: var(--font-madinah);
}

.font-svn-regular {
    font-family: 'SVN Gilroy', sans-serif;
}

.--font-svn-semibold {
    font-family: var(--font-svn-semibold);
}

.layout-image {
    background-image: url("../images/layout.webp");
    background-size: contain;
    background-repeat: repeat;
}

.text-stroke {
    color: var(--Accent-Light);
    text-align: center;
    -webkit-text-stroke-width: 0.10000000149011612;
    -webkit-text-stroke-color: var(--Accent-Light);
    font-family: var(--font-hurricance-regular);
    font-size: 3rem;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
    letter-spacing: 0.04rem;
}

.section-story .swiper-pagination-bullets {
    bottom: 0 !important;
    /*display: none;*/
}

.section-story .swiper-pagination-bullet {
    width: 1.9375rem;
    height: 0.09375rem;
    opacity: 1;
    border-radius: 0;
    margin: 0 !important;
    background-color: var(--Primary-Neutral);
}

.section-story .swiper-pagination-bullet-active {
    background-color: var(--Primary-Light);
}

.section-respon .respon-none-active {
    border-color: var(--Primary-Neutral);
}

.section-respon .respon-none-active img {
    display: none;
}

.section-respon .respon-none-active p {
    color: var(--Primary-Neutral);
}

.section-respon .respon-active {
    border-color: var(--Accent-Neutral);
}

.section-respon .respon-active p {
    color: var(--Accent-Neutral);
}

.section-respon .respon-active img {
    display: block;
}

::-webkit-scrollbar {
    display:none;
}


.popup-bottom {
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    max-height: 0;
}

.popup-bottom.open {
    max-height: 100dvh;
    transition: max-height 0.5s ease-in;
}

.text-stroke-handwritten {
    color: var(--Accent-Light);
    -webkit-text-stroke-width: 0.25px;
    -webkit-text-stroke-color: var(--Accent-Light);
    font-family: var(--font-hurricance-regular);
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
}
.text-mj-handwritten {
    color: var(--Accent-Light);
    -webkit-text-stroke-width: 0.25px;
    -webkit-text-stroke-color: var(--Accent-Light);
    font-family: var(--font-mj);
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
}

input::placeholder, textarea::placeholder {
    color: var(--Primary-Light) !important;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 120%; /* 1.2rem */
    text-transform: uppercase;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    text-indent: 1px;
    text-overflow: '';
}

select:required:invalid {
    color: var(--Primary-Light, #CED7C7);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
    text-transform: uppercase;
}
option[value=""][disabled] {
    display: none;
}
option {
    color: var(--Accent-Neutral, #BB9837);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
}

input:disabled {
    background: var(--System-Disabled) !important;
}
@keyframes pulse {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.2); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.icon-pulse {
    animation: pulse 1s infinite ease-in-out;
}

.layout-image * {
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
}

.layout-image {
    overflow-y: hidden; /* Mặc định ẩn khi chưa mở thiệp */
    -webkit-overflow-scrolling: touch; /* Giúp cuộn mượt trên iOS */
    position: relative;
    height: 100dvh;
}

.layout-image.is-open {
    overflow-y: auto !important; /* Hiện lại khi đã click Mở Bài */
}

/* Đảm bảo nội dung bên trong có layout rõ ràng */
/*.content-page {*/
/*    width: 100%;*/
/*    position: relative;*/
/*}*/
.fade-up {
    will-change: transform, opacity; /* Ép render bằng card đồ họa */
    backface-visibility: hidden; /* Chống nháy (flicker) */
    -webkit-backface-visibility: hidden;
    transform: translateZ(0); /* Một mẹo khác để kích hoạt GPU */
}
.page {
    display: none; /* Hidden by default */
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow-y: auto; /* Allow scroll inside page if content is long */
    padding-bottom: 40px;
}

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

/* --- CONTAINER CHÍNH --- */
.invitation-container {
    position: relative;
    height: 90dvh;
    background-color: #F7F0EB;
    border-radius: 5px;
    overflow: hidden;
}

/*.layout-image.is-open .envelope-layer {*/
/*    opacity: 0;*/
/*    visibility: hidden;*/
/*    pointer-events: none;*/
/*}*/

/*.layout-image.is-open .content-page {*/
/*    opacity: 1;*/
/*    visibility: visible;*/
/*}*/

.content-page {
    opacity: 0;
    visibility: hidden;
    transition: opacity 2s ease 0.5s;
    display: block;
    width: 100%;
}
.invitation-container {
    overflow: visible !important;
}

.section-banner {
    background-image: url('../images/bg-home.webp');

    background-position: center center;
    background-repeat: no-repeat;

    background-size: cover;

    min-height: 90vh;
    width: 100%;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.section-banner > * {
    position: relative;
    z-index: 2;
}

.section-banner-end {
    background-image: url('../anhcuoi/12.HPC01495.webp');

    background-position: center center;
    background-repeat: no-repeat;

    background-size: cover;

    min-height: 90vh;
    width: 100%;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-banner-end::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.section-banner-end > * {
    position: relative;
    z-index: 2;
}

.section-wedding {
    background-color: #5C1824;
}

.section-calendar {
    background-color: #dec3ad;
    min-height: 80dvh;
}

.section-invitaion {
    background-color: #FDF8F0;
    min-height: 80dvh;
}
.section-host {
    background-color: #ffffff;
    min-height: 85dvh;
}
.section-story-1 {
    background-color: #ffffff;
    min-height: 48dvh;
}
.section-story-2 {
    background-color: #ffffff;
    min-height: 82dvh;
}
.section-story-3 {
    background-color: #ffffff;
    min-height: 80dvh;
}
.section-story-4 {
    background-color: #ffffff;
    min-height: 80dvh;
}
.section-story-5 {
    background-color: #ffffff;
    min-height: 80dvh;
}
.section-story-6 {
    background-color: #ffffff;
    min-height: 80dvh;
}

.tm-intro-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 0.75;
    margin: 0 auto 0em;
    background-color: #fff;
    border: 0.4em solid #fff;
    box-shadow: 0 0.2em 0.6em 0.1em rgb(0 0 0 / 30%);
}

.tm-host-item:nth-of-type(2) .tm-host-item-img {
    order: 2;
}

.tm-host-item:nth-of-type(2) .tm-host-item-name-wrapper {
    order: 1;
}

.tm-host-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tm-host-item-img {
    position: relative;
    width: 50%;
    filter: drop-shadow(0 0.2em 0.4em rgb(0 0 0 / 30%));
}

.tm-host-item-img-inner {
    position: relative;
    z-index: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 4362/5998;
    overflow: hidden;
}

.tm-host-item-img-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-host-item-name-wrapper {
    width: 50%;
    text-align: right;
}

.tm-host-item-title {
    font-size: 13px;
    color: #5C1824;
    margin-bottom: 0.5em;
    font-style: italic;
}
.tm-host-item-sub-title {
    font-size: 10px;
    color: #5C1824;
}

.tm-host-item-name {
    margin-bottom: 0.2em;
    font-size: 17px;
    font-weight: 600;
    color: #5C1824;
    font-family: var(--font-mj);
}

.tm-host-item-text {
    text-align: center;
}

.calendar {
    width: 100%;
    padding: 12px;
    font-family: 'Inter', system-ui, sans-serif;
    color: #2f2a25;
}

.cal-header {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: #7a4a2e;
    margin-bottom: 12px;
}

.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.15em;
    margin-bottom: 14px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 18px 0;
    text-align: center;
}

.day {
    font-size: 18px;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.highlight {
    background: #8b4a2b;
    color: #fff;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    margin: auto;
}

.empty {
    visibility: hidden;
}
.card-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-wrapper {
    perspective: 1500px;
    margin-bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.card-main {
    width: 300px;
    height: 415.5px;

    position: relative;
    transform-style: preserve-3d;
    border-radius: 12px;
    background-color: #fff;
    /*box-shadow:*/
    /*        0 8px 15px -5px rgba(0, 0, 0, 0.3),*/
    /*        0 4px 6px -2px rgba(0, 0, 0, 0.05);*/
}

.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    /*border: 1px solid rgba(0,0,0,0.08);*/
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Nút Mở Bài */
.open-card-btn {
    background-color: #5C1824;
    color: white;
    padding: 12px 30px 10px 30px;
    font-weight: 500;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'SVN Gilroy', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10;
    transition: all 0.3s ease;
}

.open-card-btn:hover {
    transform: scale(1.05);
    background-color: #802424;
}

.co-dau {
    background-color: #5C1824;
}

.co-dau .tm-host-item-name-wrapper {
    text-align: left;
}

.co-dau .tm-host-item-name {
    color: #fff;
}
.co-dau .tm-host-item-title {
    color: #fff;
}
.co-dau .tm-host-item-sub-title {
    color: #fff;
}
/* Lưới hiển thị 3 cột như ảnh mẫu */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.card {
    width: var(--card-width);
    height: var(--card-height);
    perspective: 1000px; /* Tạo độ sâu cho hiệu ứng 3D */
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 15px;
}

/* Hiệu ứng lật khi di chuột vào hoặc click */
.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Ẩn mặt sau khi lật */
    border-radius: 15px;
    overflow: hidden;
    background: white;
}

.card-back {
    /* Mặt sau mặc định hiện ra trước */
    z-index: 2;
}

.card-front {
    /* Mặt trước nội dung nằm sẵn phía sau và xoay 180 độ */
    transform: rotateY(180deg);
    z-index: 1;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.css-groom {
    position: absolute;
    z-index: 10;
    top: 50px;
    width: 110px;
    height: 175px;
    left: 45px;
}
.css-codau {
    position: absolute;
    z-index: 10;
    top: 50px;
    width: 110px;
    height: 175px;
    left: 45px;
}

@media (min-width: 768px) {
    .css-groom {
        position: absolute;
        z-index: 10;
        top: 45px;
        width: 100px;
        height: 160px;
        left: 40px;
    }
    .css-codau {
        position: absolute;
        z-index: 10;
        top: 45px;
        width: 100px;
        height: 160px;
        left: 40px;
    }
}


@media (min-width: 640px) {
    .section-banner {
        min-height: 100dvh;
    }

    .section-banner-end {
        min-height: 100dvh;
    }

    .section-host {
        min-height: 92dvh;
    }
    .card {
        width: 110px;
        height: 152px;
    }
}
