/* Bảng màu chủ đề kỷ niệm */
:root {
    --anniversary-paper: #fffbef;
    --anniversary-blue: #245d88;
    --anniversary-gold: #efd097;
}

/* Nền giấy kem */
body {
    position: relative;
    isolation: isolate;
    background: var(--anniversary-paper);
    color: #24445c;
}

/* Tòa nhà in chìm */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background-image: url("../images/back.jpg");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: min(1400px, 110vw) auto;

    opacity: 0.06;
}

/* Header */
.header {
    background: rgba(255, 253, 246, 0.96);
    border-bottom-color: #e9dfbf;
}

/* Banner và khối giới thiệu đăng nhập */
.hero,
.auth-intro {
    background: rgba(245, 239, 216, 0.80);
    border: 1px solid #e9dfbf;
}

/* Thẻ sách, biểu mẫu và bảng lịch */
.book-card,
.auth-card,
.room-table-wrap {
    background: rgba(255, 254, 250, 0.96);
    border-color: #e9dfbf;
}

/* Nền khu vực bìa sách */
.book-cover-area,
.detail-cover-area {
    background: #f0ecdf;
}

/* Màu chữ nhấn */
.eyebrow,
.auth0eyebrow,
.hero h1 span {
    color: var(--anniversary-blue);
}

/* Các nút chính */
.search-box button,
.auth-submit,
.detail-primary,
.room-confirm {
    background: var(--anniversary-gold);
    color: #24445c;
}

.search-box button:hover,
.auth-submit:hover,
.detail-primary:hover:not(:disabled),
.room-confirm:hover {
    background: #e6c364;
}

/* Nhãn kỷ niệm trên trang chủ */
.anniversary-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 18px;
    padding: 10px 16px;

    border: 1px solid #dcc486;
    border-radius: 8px;
    background: #fff9e6;

    color: var(--anniversary-blue);
    font-size: 12px;
    line-height: 1.5;
}

.anniversary-label strong {
    font-family: "Literata", Georgia, serif;
    font-size: 32px;
    line-height: 1;
    color: #896719;
}

/* Điều chỉnh trên điện thoại */
@media (max-width: 600px) {
    body::before {
        background-size: 850px auto;
        background-position: 55% bottom;
        opacity: 0.04;
    }

    .anniversary-label {
        padding: 9px 12px;
        font-size: 11px;
    }
}

/* Ẩn nền trang trí khi in */
@media print {
    body::before {
        display: none;
    }
}


/* Bộ nhận diện */
.faculty-brand {
    width: min(100%, 560px);
    margin-bottom: 0;
}

.faculty-brand img {
    display: block;
    width: 100%;
    height: auto;
}

/* ===== Dịch ảnh nhận diện sang trái và lên trên ===== */
.faculty-brand {
  position: relative;
  left: -30px;
  top: -25px;
}

/* ===== Giảm độ dịch trên điện thoại ===== */
@media (max-width: 600px) {
  .faculty-brand {
    left: -10px;
    top: -15px;
  }
}

/* ===== Đồng bộ nền và tránh lộ nền khi kéo vượt mép ===== */
/* ===== Nền kem phủ toàn bộ trang ===== */
html {
  min-height: 100%;
  background: #fffbef;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fffbef;
  overscroll-behavior-y: none;
}

/* ===== Nền đặc cho thanh điều hướng cố định ===== */
.header {
  background: #fffdf6;
}

/* Căn giữa banner trong màn hình đầu; nội dung phía dưới vẫn cuộn được */
#home.page {
    box-sizing: border-box;
    display: block;
}

#home > .hero {
    min-height: calc(100dvh - 172px);
    align-content: center;
}
/* Giữ banner gọn trong chiều rộng màn hình */
.hero {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    row-gap: clamp(24px, 3vw, 38px);
    gap: clamp(16px, 3vw, 40px);
    padding: clamp(20px, 4vw, 48px);
}

.hero-headline {
    margin-top: 20px;
}

#home > .featured {
    margin-top: clamp(96px, 12vh, 140px);
}
.home-search {
    width: 100%;
    margin: -14px 0 0;
}

.search-hint em {
    font-style: italic !important;
}
.search-hint {
    text-align: left;
}
.hero-content,
.hero-art {
    min-width: 0;
}

.hero-content h1 {
    font-size: clamp(32px, 4.2vw, 56px);
    line-height: 1.2;
}

.faculty-brand {
    max-width: min(100%, 560px);
}

.hero-art .arch {
    transform: scale(clamp(0.75, 5vw, 1));
    transform-origin: center;
}

/* Xếp nội dung gọn hơn khi màn hình hẹp */
@media (max-width: 900px) {
    #home > .featured {
        margin-top: 96px;
    }
    #home > .hero {
        min-height: calc(100dvh - 190px);
    }
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-art {
        display: none;
    }
}

/* Giảm khoảng trống trên màn hình thấp */
@media (max-height: 850px) and (min-width: 901px) {
    .hero {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .faculty-brand {
        margin-bottom: 0;
    }

    .hero-content h1 {
        font-size: clamp(32px, 3.5vw, 46px);
    }
}

/* Menu hamburger partagé sur les écrans étroits */
.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid #d6cbb1;
    border-radius: 7px;
    background: #fffdf6;
    color: #245d88;
    cursor: pointer;
}
@media (max-width: 900px) {
    .header {
        position: sticky;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
    }

    .header > .brand {
        order: 1;
        margin-right: auto;
    }

    .header > .user-nav-group,
    .header > .login-button {
        order: 2;
        margin-left: 0;
    }

    .header > .mobile-nav-toggle {
        display: inline-flex;
        order: 3;
        flex: 0 0 auto;
    }

    .header > .navigation {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 16px;
        z-index: 1200;
        box-sizing: border-box;
        width: min(360px, calc(100vw - 32px));
        max-height: calc(100dvh - 120px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 8px;
        border: 1px solid #e5dcbf;
        border-radius: 10px;
        background: #fffdf6;
        box-shadow: 0 12px 28px rgba(36, 68, 92, 0.16);
    }

    .header > .navigation.is-open {
        display: flex;
    }

    .navigation > a,
    .navigation .nav-dropdown-trigger {
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        padding: 12px;
        text-align: left;
    }

    .navigation .nav-dropdown {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .navigation .nav-dropdown-menu {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        z-index: 1300;
        width: min(300px, calc(100vw - 80px));
        min-width: 0;
        max-height: calc(100dvh - 150px);
        overflow-y: auto;
        margin: 0;
        padding: 6px;
        transform: none;
        box-shadow: 0 10px 24px rgba(36, 68, 92, 0.14);
        pointer-events: auto;
    }

    .navigation .nav-dropdown-menu::before {
        display: none;
    }

    .navigation .nav-dropdown:focus-within .nav-dropdown-menu,
    .navigation .nav-dropdown:hover .nav-dropdown-menu,
    .navigation .nav-dropdown.is-active .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}
/* Căn giữa nội dung banner khi kệ sách được ẩn trên màn hình hẹp */
@media (max-width: 900px) {
    #home > .hero .hero-content {
        align-items: center;
        width: 100%;
        text-align: center;
    }

    #home > .hero .faculty-brand {
        left: 0;
        top: 0;
        width: min(100%, 560px);
        max-width: 100%;
        margin: 0 auto;
    }

    #home > .hero .home-search {
        width: min(100%, 560px);
        margin: 0 auto;
    }

    #home > .hero .search-hint {
        text-align: left;
    }

    #home > .hero .hero-headline {
        width: 100%;
        margin: 20px auto 0;
        text-align: center;
    }
}
/* Dịch vụ: danh sách văn bản gọn, giữ cả tiêu đề và mô tả */
.nav-dropdown-icon {
    display: none !important;
}

.navigation .nav-dropdown-item {
    display: block !important;
    padding: 10px 12px !important;
    border-radius: 5px;
}

.navigation .nav-dropdown-item + .nav-dropdown-item {
    margin-top: 2px;
    border-top: 1px solid #ece6d7;
}

.navigation .nav-dropdown-text {
    gap: 3px;
    text-align: left;
}

.navigation .nav-dropdown-title {
    display: block;
}

.navigation .nav-dropdown-desc {
    display: block;
    max-width: 240px;
}
/* Nổi bật mục điều hướng hiện tại và mục đang rê chuột */
.navigation > a,
.navigation > .nav-dropdown > .nav-dropdown-trigger {
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 12px;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.navigation > a:hover,
.navigation > a:focus-visible,
.navigation > a.active,
.navigation > a[aria-current="page"],
.navigation > .nav-dropdown:hover > .nav-dropdown-trigger,
.navigation > .nav-dropdown:focus-within > .nav-dropdown-trigger,
.navigation > .nav-dropdown.is-active > .nav-dropdown-trigger {
    color: #245d88 !important;
    border-color: #245d88;
    background: #f2f7fb;
    font-weight: 600;
}

.navigation .nav-dropdown-item:hover,
.navigation .nav-dropdown-item:focus-visible,
.navigation .nav-dropdown-item.active {
    color: #245d88 !important;
    background: #f2f7fb !important;
}
@media (max-width: 900px) {
    .header > .navigation > a,
    .header > .navigation > .nav-dropdown > .nav-dropdown-trigger {
        min-height: 44px;
        padding: 12px;
        border-radius: 8px;
    }
}
/* Nút đăng nhập đồng bộ kiểu bo viên thuốc với menu */
.header .login-button {
    border-radius: 999px;
}
.about-hero-actions .login-button {
    background: #fffdf6;
    color: #245d88;
    border-color: #d6cbb1;
    font-weight: 600;
}

.about-hero-actions .login-button:hover,
.about-hero-actions .login-button:focus-visible {
    background: #1e5c8c;
    color: #ffffff;
    border-color: #1e5c8c;
}