
/* CITIZEN CHARTER PAGE */

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
}

/* BANNER */

.charter-banner {
    position: relative;
    height: 420px;
    width: 100%;
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;

    background: #14213d;
}

.charter-banner-bg {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            rgba(0,0,0,0.3),
            rgba(0,0,0,0.3)
        ),
        url('../images/1.png')
        center/cover no-repeat;

    animation: bannerZoom 8s ease-out both;
}

@keyframes bannerZoom {
    from {
        transform: scale(1.12);
    }
    to {
        transform: scale(1);
    }
}

.charter-banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 15px;
}

.charter-banner-content h1 {
    color: white;
    font-size: clamp(30px, 5.5vw, 75px);
    font-weight: 700;
    line-height: 1.5;
    margin: 0;

    animation: titleUp 1.2s ease both;
}

@keyframes titleUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* BREADCRUMB */

.charter-breadcrumb {
    position: absolute;
    bottom: 18px;
    left: 0;
    width: 100%;
    z-index: 3;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;

    color: #ebbe91;
    font-size: 15px;

    animation: titleUp 1.3s ease 0.2s both;
}

.charter-breadcrumb a {
    color: white;
    text-decoration: none;
}

.charter-breadcrumb i {
    color: white;
}

/* MAIN SECTION */

.charter-document-section {
    padding: 55px 3% 75px;
    background: white;
}

.charter-container {
    max-width: 1300px;
    margin: auto;
}

.charter-title {
    text-align: center;
    color: #14213d;
    font-size: 36px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.charter-divider {
    width: 90px;
    height: 4px;
    background: #dda66c;
    margin: 0 auto 35px;
}

/* FLIPBOOK WRAPPER */

.flipbook-wrapper {
    position: relative;
    background: #808080;

    padding: 20px 34px 65px;

    width: 100%;
    border-radius: 3px;

    box-shadow:
        0 10px 35px rgba(0,0,0,0.15);
}

.flipbook-wrapper:not(:last-child) {
    margin-bottom: 36px;
}

.flipbook-stage {
    position: relative;
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 350px;
}

.flipbook-viewport {
    width: 100%;
    min-width: 0;
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;
}

#flipbook,
.flipbook-element {
    margin: auto;
}

/* FLIPBOOK PAGES */

.flip-page {
    background: white;
    overflow: hidden;
}

.flip-page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

/* ARROWS */

.flip-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    z-index: 20;

    border: none;
    background: rgba(0,0,0,0.28);
    color: white;

    width: 38px;
    height: 65px;

    cursor: pointer;
    font-size: 23px;

    transition: background 0.3s ease;
}

.flip-arrow:hover {
    background: rgba(0,0,0,0.65);
}

.flip-prev {
    left: -25px;
}

.flip-next {
    right: -25px;
}

.flip-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* TOOLBAR */

.flipbook-toolbar {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    background: white;
    border-radius: 5px;

    padding: 12px 16px;

    box-shadow:
        0 3px 12px rgba(0,0,0,0.2);

    z-index: 25;
}

.flipbook-toolbar button,
.flipbook-toolbar a {
    border: none;
    background: transparent;
    color: #718096;

    font-size: 17px;
    cursor: pointer;

    text-decoration: none;

    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.flipbook-toolbar button:hover,
.flipbook-toolbar a:hover {
    color: #14213d;
    transform: scale(1.15);
}

#pageCounter,
.page-counter {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* THUMBNAILS */

.thumbnail-panel {
    position: relative;
    z-index: 30;

    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(90px, 1fr));

    gap: 15px;
    padding: 20px;

    background: #eeeeee;

    max-height: 260px;
    overflow-y: auto;
}

.thumbnail-panel[hidden] {
    display: none;
}

.thumbnail-item {
    padding: 5px;
    border: 2px solid transparent;
    background: white;
    cursor: pointer;
}

.thumbnail-item.active {
    border-color: #dda66c;
}

.thumbnail-item img {
    display: block;
    width: 100%;
    height: auto;
}

.thumbnail-item span {
    display: block;
    text-align: center;
    font-size: 12px;
    margin-top: 5px;
}

/* STATUS */

.book-status {
    text-align: center;
    color: white;
    font-size: 14px;
    margin: 10px 0 0;
}

.book-status:empty {
    display: none;
}

/* ZOOM */

.flipbook-viewport.zoomed {
    overflow: auto;
    justify-content: flex-start;
}

/* FULLSCREEN */

.flipbook-wrapper:fullscreen {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #777;
}

.flipbook-wrapper:fullscreen .flipbook-stage {
    flex: 1;
}

/* REVEAL */

.reveal {
    opacity: 0;
    transform: translateY(45px);

    transition:
        opacity 0.9s ease,
        transform 0.9s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* CONTACT */

.community {
    padding: 75px 20px;
    text-align: center;

    background:
        linear-gradient(
            rgba(20,33,61,0.85),
            rgba(20,33,61,0.85)
        ),
        url('../images/community-bg.jpg')
        center/cover;
}

.community-content h2 {
    color: white;
    font-size: 27px;
    line-height: 1.8;
}

.community .contact-btn {
    display: inline-block;
    padding: 14px 30px;
    margin-top: 20px;

    background: #ebbe91;
    color: #14213d;

    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;

    transition:
        transform 0.3s ease,
        background 0.3s ease;
}

.community .contact-btn:hover {
    background: white;
    transform: translateY(-5px);
}

/* BACK TO TOP */

#backToTop {
    position: fixed;
    bottom: 25px;
    right: 25px;

    width: 48px;
    height: 48px;

    background: #343a46;
    color: white;

    border: none;
    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);

    transition: all 0.3s ease;

    z-index: 999;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* RESPONSIVE */

@media (max-width: 768px) {

    .charter-banner {
        height: 290px;
    }

    .charter-title {
        font-size: 27px;
    }

    .flipbook-wrapper {
        padding: 15px 20px 65px;
    }

    .flip-arrow {
        width: 28px;
        height: 50px;
        font-size: 16px;
    }

    .flip-prev {
        left: -18px;
    }

    .flip-next {
        right: -18px;
    }

    .flipbook-toolbar {
        gap: 8px;
        padding: 10px;
    }
}

@media (max-width: 480px) {

    .charter-banner {
        height: 240px;
    }

    .charter-document-section {
        padding: 35px 10px 55px;
    }

    .flipbook-wrapper {
        padding: 12px 14px 70px;
    }

    .flipbook-toolbar {
        gap: 6px;
    }

    .flipbook-toolbar button,
    .flipbook-toolbar a {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .charter-banner-bg,
    .charter-banner-content h1,
    .charter-breadcrumb {
        animation: none !important;
    }

    .reveal,
    .reveal.active {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* REMOVE TITLE RECTANGLE BORDER */

.charter-title {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;

    text-align: center;
    color: #14213d;
    font-size: 38px;
    font-weight: 700;
    padding: 0;
    margin-bottom: 15px;
}

/* REMOVE PSEUDO-ELEMENT BORDERS IF PRESENT */

.charter-title::before {
    content: none !important;
}


/* REMOVE COMMUNITY SECTION RECTANGLE */

.community .community-content {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* REMOVE EXTRA RECTANGLE EFFECTS */

.community .community-content::before,
.community .community-content::after {
    content: none !important;
    display: none !important;
}

/* KEEP TEXT AND BUTTON CENTERED */

.community .community-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}
