html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
    font-family: 'EB Garamond', Georgia, serif;
    scroll-behavior: smooth;
    background-color: #FAF7F2;
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.8s ease-out forwards;
}

/* Staggered animations */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.3s;
}

.stagger-3 {
    animation-delay: 0.5s;
}

.stagger-4 {
    animation-delay: 0.7s;
}

/* Navbar — transparent over hero, frosted after scroll */
.home-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.home-nav.nav-scrolled {
    background: #8B1A1A;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.home-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 56px;
}

.home-nav li {
    display: flex;
    align-items: center;
}

.home-nav li a {
    display: block;
    color: #efefef;
    text-decoration: none;
    padding: 8px 20px;
    transition: color 0.2s ease;
    font-weight: 500;
    font-size: 1.1rem;
}

.home-nav li a:hover {
    color: rgb(241, 188, 88);
    text-decoration: underline;
}

.home {
    position: relative;
    height: 80vh;
    display: flex;
    width: 100%;
    overflow: hidden;
    background: url(../photos/IMG_20210306_194151.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(36, 33, 33, 0.5);
    z-index: 2;
}

@font-face {
    font-family: 'EB Garamond';
    src: url(../fonts/EBGaramond-VariableFont_wght.ttf) format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'chineseFont';
    font-display: block;
    src: url(../fonts/No.18-ShangShouJiFengShuFaTi-2.woff2) format('woff2'),
    url(../fonts/No.18-ShangShouJiFengShuFaTi-2.ttf);
}

.chinese {
    font-family: 'chineseFont';
}

.english {
    font-family: 'EB Garamond', Garamond, Georgia, serif;
    font-size: 1.5rem;
    color: #ffffff;
    letter-spacing: 0.04em;
}

.content {
    z-index: 2;
    padding-top: 5vh;
    padding-left: 20%;
    padding-bottom: 5vh;
}

.content .header-group {
    display: flex;
    gap: 1rem;
}

.content .subheader-group {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 0rem;
    line-height: .8;
}

.content h1 {
    color: rgb(255, 255, 255);
    font-size: 17vh;
    margin: 0.3rem 0;
    padding-top: 0.1%;
    writing-mode: vertical-rl;
    text-orientation: upright;
}

.content h2 {
    color: rgb(252, 252, 252);
    font-size: 11vh;
    margin: 1.5rem 0;
    padding-top: 4vh;
    writing-mode: vertical-rl;
    text-orientation: upright;
}

.content h3 {
    color: #f7f3f3;
    font-size: 4vh;
    margin: 0.5rem 0;
    text-align: center;
}

.content h4 {
    color: #f7f3f3;
    font-size: 3vh;
    margin: 0.5rem 0;
    text-align: center;
}

.home p {
    font-size: 1rem;
    margin: 0.3rem 0;
    line-height: 1.8;
}

.home a {
    color: rgb(255, 255, 255);
    /* Replace with your desired color */
    font-size: 4vh;
    text-decoration: none;
    /* Removes the underline, optional */
    font-weight: bold;
    /*Makes the text bold, optional*/
    line-height: 1.2;
    gap: 2;
}

.home a:hover {
    color:  rgb(241, 188, 88);
    /* Change color on hover, optional */
    text-decoration: underline;
    /* Add underline on hover, optional */


}

/* About us  */
.about-us {
    display: flex;
    height: 70vh;
    overflow: hidden;
}

.about-photo {
    flex: 1.5;
    background-color: #e6c0ac;
    padding: 3vmin;
    box-sizing: border-box;
}

.jiugongge {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 9px;
    width: 100%;
    height: 100%;
}

.jiugongge-cell {
    overflow: hidden;
}

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

.about-text {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem;
    background-color: #efddd3;
    color: #1C1008;
    /* box-shadow: -5px 0 10px rgba(0, 0, 0, 0.08); */
}

.about-text h2 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 4vh;
    font-weight: 500;
    margin-bottom: 0.75rem;
    text-align: center;
    color: #1C1008;
}

.about-text h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 2px;
    background: #8B1A1A;
    margin: 10px auto 0;
}

.about-text p {
    font-size: 2.5vh;
    line-height: 1.8;
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: #050404;
}

/* Contact section */

.info-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: left;
    padding: 2.5rem 0;
    margin: 0 auto;
    max-width: 70%;
    background-color: #FAF7F2;
    box-sizing: border-box;
    /* border-top: 2px solid #8B1A1A; */
}

.info-item {
    flex: 1 1 250px;
    box-sizing: border-box;
    text-align: center;
    padding: 2rem;
    padding-top: 10px;
    align-items: center;
    font-family: 'Times New Roman', Serif;
    border-radius: 8px;
    color: #0e0d0d;
}


.info-section h3 {
    color: #b01414;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 35px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.75rem;
}

.info-section p {
    color: #3D2B1F;
    font-size: 2vh;
    text-align: center;
    line-height: 1.2;
}

.info-item a {
    color: rgb(241, 149, 74);
    font-size: 2vh;
    font-weight: bold;
    line-height: 1.2;
    text-decoration: underline;
}

.info-item a:hover {
    color: rgb(161, 13, 13);
    text-decoration: underline;
}

.opening-hours {
    width: 100%;
    padding-left: 4rem;
    border-collapse: collapse;
}

.opening-hours td {
    text-align: left;
    white-space: nowrap;
    vertical-align: top;
    font-size: 2vh;
}

.opening-hours td:first-child {
    font-weight: bold;
    text-align: left;
    width: 100px;
}

.opening-hours td:last-child {
    text-align: right;
}


/* -- .reservation */
.reservation {
    min-height: 60vh;
    background-color: #efddd3;
    padding: 60px;
}

.reservation .title {
    text-align: center;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 500;
    color: #1C1008;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.reservation .title::after {
    content: '';
    display: block;
    width: 48px;
    height: 2px;
    background: #8B1A1A;
    margin: 10px auto 0;
}

.reservation .sub-title {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
    color: #3D2B1F;
    font-size: 1.1rem;
}

.reservation-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    color: rgba(22, 20, 20, 0.832);
    max-width: 960px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    width: 100%;
    gap: 1em;
    align-items: flex-start;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    align-items: center;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

form .input {
    margin-bottom: 1rem;
}

select {
    outline: none;
    border: 1px solid #8b7e6c;
    height: 52px;
    max-width: 400px;
    min-width: 200px;
    background-color: #FAF7F2;
    display: flex;
    align-items: center;
    border-radius: 6px;
    color: #a19c9c;
    width: 75%;
    box-sizing: border-box;
    font-size: 1.1rem;
    font-family: 'EB Garamond', Georgia, serif;
    padding: 0 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select option:disabled {
    color: grey;
}

input,
.input-i {
    outline: none;
    border: 1px solid #8b7e6c;
    height: 52px;
    max-width: 400px;
    min-width: 200px;
    background-color: #FAF7F2;
    display: flex;
    align-items: center;
    border-radius: 6px;
    color: #1C1008;
    width: 75%;
    box-sizing: border-box;
    padding: 0 14px;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
    border-color: #8B1A1A;
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.1);
}

::placeholder {
    color: #a19c9c;
}

select option {
    color: black;
}

select:valid {
    color: black;
}

.input-i input {
    border: none;
    padding-right: 0;
}


::-webkit-calendar-picker-indicator {
    cursor: pointer;
    background-color: #c0c0c0;
    padding: 5px;
    border-radius: 3px;
    border-color: white;
    align-items: center;

}


.submit-btn {
    background-color: #8B1A1A;
    border: none;
    color: #FAF7F2;
    font-size: 1.1rem;
    font-family: 'EB Garamond', Georgia, serif;
    letter-spacing: 0.08em;
    border-radius: 6px;
    cursor: pointer;
    width: 200px;
    height: 50px;
    display: block;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover {
    background-color: #6B1212;
}

.submit-btn:active {
    transform: translateY(1px);
}


body {
    background-color: #FAF7F2;
    color: #1C1008;
}


.grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.error-message {
    color: red;
    margin-bottom: 15px;
    font-weight: bold;
}

.footer {
    background-color: #641414;
    color: #d88511;
    text-align: center;
    padding: .5rem 0;
    /* border-top: 2px solid #8B1A1A; */
    font-size: 2vh;
}

.footer-chinese {
    font-family: 'chineseFont';
    font-size: 3vh;
    color: #f7eaea;
    margin-top: 1vh;
    letter-spacing: 0.01em;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 0 1rem; */
}

.social-links a {
    color: #f8f8f8;
    /* Matches text color */
    text-decoration: none;
    /* Removes underline */
    margin: 0 0.5rem;
    /* Adds space between links */
    transition: color 0.3s;
    /* Adds a hover effect */
}

.social-links a:hover {
    color: #bd0202;
    /* Highlight on hover (e.g., orange) */
}

/* reservation success*/
.success-page {
    position: relative;
    min-height: 100vh;
    /* Full viewport height */
    display: flex;
    width: 100%;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    /* Center horizontally */
    background: url(../photos/IMG_20210306_194151.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
    /* Add some padding */
    box-sizing: border-box;
}

.success-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(36, 33, 33, 0.5);
    z-index: 1;
}

.success-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    position: relative;
    /* Above the overlay */
    z-index: 2;
    color: #333;
    /* Ensure text is readable */
}

.success-message {
    text-align: center;
}

.success-title {
    color: #a10d0d;
    text-align: center;
    margin-bottom: 20px;
}

.reservation-details {
    margin: 30px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.label {
    font-weight: bold;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    margin: 0 10px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}

.btn-primary {
    background-color: #a10d0d;
    color: white;
}

.btn-secondary {
    background-color: #ddd;
    color: #333;
}


/* Responsive Adjustments */

@media (max-width: 768px) {

    .home {
        height: 80vh;
    }
    
    .content {
        padding-left: 5%;
        padding-right: 5%;
        padding-top: 10vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .content .header-group {
        gap: 0.5rem;
        /* Keep them closer together on mobile */
        justify-content: center;
    }

    /* Adjust Chinese character sizes for mobile */
    .content h1 {
        font-size: 12vh;
        /* Slightly smaller */
    }

    .content h2 {
        font-size: 8vh;
        padding-top: 1rem;
    }

    /* Center the English text group */
    .content .subheader-group {
        width: 100%;
        align-items: center;
        padding-left: 0;
    }

    /* Make nav more compact */
    .home-nav {
        top: 10px;
        right: 10px;
    }

    .home-nav li a {
        padding: 8px 15px;
        font-size: 16px;
    }

    /* Stack about section */
    .about-us {
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    .about-photo,
    .about-text {
        flex: 1;
        width: 100%;
    }

    .about-photo img {
        width: 100%;
        height: auto;
    }

    .about-text {
        padding: 2.5rem 2rem;
        font-size: 3vh;
    }

    /* Fix forms */
    input,
    select,
    .input-i {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        width: 100%;
    }

    /* Info section */
    .info-section {
        max-width: 100%;
        padding: 1.5rem 1.5rem;
    }

    .info-item {
        flex: 1 1 100%;
        padding: 1.5rem 1rem;
    }

    .opening-hours {
        padding-left: 0;
    }

    /* Reservation section */
    .reservation {
        padding: 48px 28px;
    }
}

@media (max-width: 480px) {
    .content h1 {
        font-size: 8vh;
    }

    .content h2 {
        font-size: 5vh;
    }

    .reservation {
        padding: 36px 24px;
    }
}