/* ========= Font Definitions ========= */
/* Cabin Sketch font classes */
.cabin-sketch-regular {
    font-family: "Cabin Sketch", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.cabin-sketch-bold {
    font-family: "Cabin Sketch", sans-serif;
    font-weight: 700;
    font-style: normal;
}

/* Hina Mincho font classes */
.hina-mincho-regular {
    font-family: "Hina Mincho", serif;
    font-weight: 400;
    font-style: normal;
}

/* ZCOOL XiaoWei font classes */
.zcool-xiaowei-regular {
    font-family: "ZCOOL XiaoWei", sans-serif;
    font-weight: 400;
    font-style: normal;
}
  
:root {
    --title-color: #211623;
    /* Dark brown for title */
    --nav-color: #211623;
    /* Dark brown for navigation */
    --nav-hover: #775984;
    /* Purple for hover states */
    --bg-light: #f8f9fa;
    /* Light background */
    --sidebar-bg: #e4e2f7;
    /* Light purple sidebar */
}

::-webkit-scrollbar-track {
    background: #e4e2f7; 
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #aaa5ac; 
    border-radius: 5px;
    border: 2px solid #e4e2f7; 
    min-height: 40px; 
    max-height: 100px;
}


::-webkit-scrollbar-thumb:hover {
    background: #aaa5ac; 
}


/* =========  Base ========= */

html, body {
    height: 100%;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;

}
html {
    scrollbar-width: thin;
    scrollbar-color: #aba5bd #e4e2f7; 
    overflow-y: overlay;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Cabin Sketch", cursive;
    font-weight: 400;
    background-image: url(../image/Primitive_Lifebg.jpg)!important;
    background-attachment: scroll!important;
    background-repeat: no-repeat!important;
    background-size: cover!important;
    background-position: center center!important;
    overflow-x: hidden!important;
    overflow-y: auto;
    overflow-y: overlay;
    position: relative;
}  

body::before,
body::after {
    z-index: -1;
}

body.lang-ja,
[lang="ja"] {
    font-family: "Hina Mincho", serif;
    /* line-height: 1.6; */
}

body.lang-zh,
[lang="zh"] {
    font-family: "ZCOOL XiaoWei", serif;
    /* letter-spacing: 0.05em; */
}

h1,h2,h3,.site-title h1 {
    color: var(--title-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

[data-i18n] {
    font-family: inherit;
}

/* ========= Sidebar Navigation (Left Nav) ========= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    padding: 1rem;
    z-index: 100;
}

.sidebar .site-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    line-height: 0.7;
}

.nav-menu li {
    margin: 1rem 0;
}

.nav-menu a {
    color: var(--nav-color);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.nav-link,
.nav-link:visited {
    color: var(--nav-color);
}

.nav-link:focus,
.nav-link:active {
    color: var(--nav-color);
    outline: none;
    box-shadow: none;
}

.nav-menu a:visited,
.nav-menu a:focus,
.nav-menu a:active {
    color: var(--nav-color);
    background: transparent;
    outline: none;
}

.nav-menu a:hover {
    color: var(--nav-hover);
}

/* ========= Offcanvas (Mobile Nav) ========= */
.btn-open {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 120;
    background: none;
    border: none;
}

.offcanvas-header,
.offcanvas-body {
    background-color: var(--sidebar-bg);
}

/* offcanvas links */
.offcanvas-body .nav-item .nav-link {
    color: var(--nav-color) !important;
    text-decoration: none !important;
    padding: 0.5rem 1rem;
}

.offcanvas-body .nav-item .nav-link:hover {
    color: var(--nav-hover) !important;
}

.offcanvas-body .nav-item .nav-link:focus,
.offcanvas-body .nav-item .nav-link:active {
    color: var(--nav-color) !important;
    background: transparent !important;
    outline: none;
}

/* ========= Main Content ========= */

.main-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: auto;
    max-height: none;
    margin-left: 260px;
    padding: 2rem;
    max-width: calc(100vw - 260px);
    box-sizing: border-box;
    overflow-y: visible;
    padding-bottom: 160px;
}

/* ========= Gallery ========= */
.gallery {
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}


.gallery.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -4px;
}

.gallery.col-sm-6 {
    padding: 4px;
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
    box-sizing: border-box;
}

.gallery img {
    width: 100%;
    max-height: 50vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* some shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    filter: brightness(1.05);
}

/* img-wrapper
.img-wrapper {
    max-height: 40vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; 
    margin-bottom: 1rem;
  }
  
  .img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
  } */

/* ========= Footer ========= */
.footer {
    min-height: 120px;
    background-color: rgb(243, 235, 251);
    background-attachment: fixed;
    padding: 1.5rem 1rem;
    text-align: center;
    margin-top: auto;
    position: relative;
    margin-bottom: 0;
    margin-left: 0;
    max-width: 100%;
    box-sizing: border-box;
    bottom: 0;
    font-family: "Cabin Sketch", sans-serif !important;
}

.footer-sns a {
    color: var(--nav-color);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s;
}

.footer-sns a:hover {
    color: var(--nav-hover);
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--nav-color);
}



/* =====  Language Switcher ===== */
.lang-switcher {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.lang-switcher button {
    margin: 0.25rem;
    padding: 6px 12px;
    font-size: 0.85rem;
    border: none;
    background-color: #dcd4f3;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    color: var(--nav-color);
    text-decoration: none;
}

.lang-switcher button:hover {
    background-color: #c4b6c8;
}

/* ========= Loading Bar ========= */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(33, 22, 35, 0.1);
    overflow: hidden;
    z-index: 9999;
    pointer-events: none;
}

.loading-bar__inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #775984, #211623);
    animation: loadingFlow 1.2s ease-in-out infinite;
}

.loading-bar.done {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.loading-bar.done .loading-bar__inner {
    animation: none;
    width: 100%;
}

@keyframes loadingFlow {
    0% {
        width: 0%;
        transform: translateX(-20%);
    }
    50% {
        width: 70%;
        transform: translateX(10%);
    }
    100% {
        width: 100%;
        transform: translateX(20%);
    }
}

/* ========= About Page ========= */
.about-page {
    margin-left: 260px;
    padding: 3rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: calc(100vw - 260px);
    box-sizing: border-box;
}

.about-hero {
    background: rgba(228, 226, 247, 0.8);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.about-hero h2 {
    margin: 0;
    font-size: 2rem;
}

.about-hero p {
    margin: 0.35rem 0;
    font-family: "Hina Mincho", serif;
}

.about-portrait {
    width: 220px;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-left: 1rem;
    border-left: 2px solid #775984;
}

.timeline-item {
    position: relative;
    padding-left: 1rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.2rem;
    top: 0.4rem;
    width: 10px;
    height: 10px;
    background: #775984;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(119, 89, 132, 0.25);
}

.timeline-year {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--title-color);
}

.timeline-text {
    margin: 0;
    font-family: "Hina Mincho", serif;
}

.about-extra {
    background: rgba(228, 226, 247, 0.75);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border: 1px solid rgba(119, 89, 132, 0.18);
}

/* ========= Mobile Topbar ========= */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(228, 226, 247, 0.9);
    padding: 0.9rem 1rem;
    z-index: 115;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    position: relative;
}

.mobile-topbar .topbar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.mobile-topbar .title {
    font-size: 1.6rem;
    margin: 0;
}

.mobile-topbar .subtitle {
    margin: 0;
    font-size: 0.95rem;
}

.mobile-lang-switcher {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.mobile-lang-switcher button {
    padding: 6px 12px;
    border: none;
    background: #dcd4f3;
    color: var(--nav-color);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.mobile-lang-switcher button:hover {
    background: #c4b6c8;
}

.mobile-quick-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    justify-content: center;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.mobile-quick-nav a {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: #e4e2f7;
    color: var(--nav-color);
    text-decoration: none;
    border: 1px solid rgba(119,89,132,0.25);
    font-size: 0.95rem;
}

.mobile-quick-nav a:hover {
    color: var(--nav-hover);
}

.mobile-quick-nav::-webkit-scrollbar {
    display: none;
}

.mobile-quick-nav.hide-nav {
    display: none;
}

.btn-open.show {
    display: inline !important;
}

/* ========= Responsive ========= */
@media screen and (max-width: 850px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
        max-width: 100%;
        min-height: 100vh;
        padding-bottom: 200px;
    }

    .about-page {
        margin-left: 0;
        max-width: 100%;
        padding: 1.5rem 1rem 2.5rem;
    }

    .lang-switcher button {
        color: var(--nav-color);
        text-decoration: none;
        background-color: #dcd4f3;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.3s;
    }


    .sidebar {
        display: none;
        
    }

    .mobile-topbar {
        display: block;
    }

    .mobile-quick-nav {
        justify-content: center;
    }

    .main-content {
        margin-top: 0.5rem;
    }

    .footer {
        position: relative!important;
        bottom: auto!important;
        width: 100%;
        min-height: 140px;
        margin-left: 0;
        margin-right: 0;
        margin-top: auto;
        box-sizing: border-box;
        padding: 1.5rem 1rem 2rem;
    }
}

@media screen and (max-width: 768px) {
    .body {
        background-image: url(../image/Primitive_Lifebg.webp)!important;
        background-attachment: scroll!important;
        background-repeat: no-repeat!important;
        background-size: cover!important;
        background-position: center center!important;
        overflow-x: hidden!important;
        overflow-y: auto!important;
        font-family: "Cabin Sketch", sans-serif !important;
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .lang-switcher button {
        color: var(--nav-color);
        text-decoration: none;
        background-color: #dcd4f3;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .gallery row {
        display: flex;
        flex-wrap: wrap;
        margin: 0 -4px;
    }

    .gallery.col-sm-6 {
        padding: 4px;
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    .footer {
        width: 100%;
        height: 100px;
        position: relative;
        bottom: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 576px) {
    /* .gallery .col-sm-6 {
      padding: 3px; 
    } */

    .gallery .row {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    .gallery img {
      box-shadow: 0 1px 4px rgba(0,0,0,0.1); 
    }
    .footer {
        width: 100%;
        height: 100px;
        position: relative;
        bottom: 0;
        margin-left: 0;
        margin-right: 0;
    }
  }

@media screen and (max-width: 480px) {

    .body {
        background-image: url(../image/Primitive_Lifebg.jpg)!important;
        background-attachment: scroll!important;
        background-repeat: no-repeat!important;
        background-size: cover!important;
        background-position: center center!important;
        overflow-x: hidden!important;
        overflow-y: auto!important;
    }

    .lang-switcher button {
        color: var(--nav-color);
        text-decoration: none;
        background-color: #dcd4f3;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .gallery .row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* .gallery .col-sm-6 {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
        padding: 3px;
    } */

    .footer {
        position: relative; 
        width: 100%;
        height: 100px;
        bottom: 0;
        margin-left: 0;
        margin-right: 0;
    }
}

@media screen and (max-width: 520px) {
    .mobile-quick-nav {
        display: none;
    }

    .btn-open {
        display: inline;
    }

    .mobile-lang-switcher {
        margin-top: 0.9rem;
    }
}
