:root {
    --tom-bg:   #faf9f6;
    --tom-text: #2b2d30;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
    -webkit-text-size-adjust: 100%;
    font-variant-ligatures: none;
    -webkit-font-variant-ligatures: none;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
    user-select: none;
    -webkit-user-select: none;
    min-height: 100vh;
}

body {
    font-family: "Roboto Mono", monospace;
    color: inherit;
    font-size: 15px;
    line-height: 1.86;
    letter-spacing: 0.3px;
    font-weight: 400;
    font-style: normal;
}

.wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: stretch;
    z-index: 4;
    background: var(--tom-bg);
    transition: width 0.6s ease;
}

.wrapper.shifted {
    width: 60%;
    margin-left: 40%;
}

.main-image-container {
    position: relative;
    flex: 1;
    width: auto;
    height: calc(100vh - 80px);
    margin: 0 auto;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--tom-bg);
    padding-top: 90px;
}

.main-image-container img.main {
    max-width: 100%;
    max-height: 100%;
    height: 900px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
    cursor: none;
    margin: 0 auto;
    padding: 0;
    transition: opacity 0.4s ease;
}

.main-image-container img.main.fading {
    opacity: 0;
}

/* Custom cursor: PNG image — hidden on mobile via media query */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: none;
    transform: translate(-50%, -50%);
}

.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: capitalize;
    color: #555;
    z-index: 5;
    user-select: none;
    flex-shrink: 0;
    background: var(--tom-bg);
    cursor: auto;
}

.bottom-bar span {
    margin: 0 6px;
    transition: color 0.3s;
    cursor: pointer;
}

.bottom-bar span:hover {
    color: #000;
}

/* Gallery Overlay */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tom-bg);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-overlay.open {
    opacity: 1;
    pointer-events: auto;
    cursor: auto;
}

.gallery-bg-blocker {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tom-bg);
    z-index: -1;
}

.gallery-overlay.open .gallery-bg-blocker {
    display: block;
}

.gallery-header {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2020;
    background: var(--tom-bg);
}

.gallery-title,
.gallery-close {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
}

.gallery-close {
    background: none;
    border: none;
    cursor: pointer;
}

.gallery-header .seperator {
    margin: 0 10px;
}

.thumbs-grid {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    padding: 30px 30px 80px;
    margin: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    align-content: flex-start;
    justify-content: flex-start;
    list-style-type: none;
    gap: 15px;
}

.thumb-item {
    width: calc((100% - 150px) / 11);
    flex-shrink: 0;
    cursor: pointer;
    overflow: hidden;
}

.thumb-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.thumb-item img.loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.thumb-item:hover img {
    opacity: 0.7;
}

/* Sidebar */
.index-container {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 10;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: row;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.index-container.open {
    opacity: 1;
    pointer-events: auto;
}

.overlay-background {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: transparent;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.index-container.open .overlay-background {
    opacity: 1;
    pointer-events: auto;
}

.index-content-wrapper {
    position: fixed;
    z-index: 2;
    width: 40%;
    height: 100%;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    background-color: #fff;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    direction: rtl;
}

.index-content-wrapper.open {
    transform: translateX(0);
}

.index-nav,
.index-content,
.sidebar-close-mobile {
    direction: ltr;
}

.sidebar-close-mobile {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #2b2d30;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.index-nav {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 52px 52px 40px;
    z-index: 6;
    display: block;
    pointer-events: auto;
}

.sidebar-logo {
    display: block;
    margin-bottom: 10px;
}

.sidebar-logo img {
    max-width: 290px;
    width: 170px;
}

.index-nav .tab-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.index-nav button {
    font-size: 1.2rem;
    line-height: 2.08333;
    letter-spacing: 0;
    background: none;
    border: none;
    color: #2b2d30;
    cursor: pointer;
}

.index-nav button.active {
    font-weight: 500;
    text-decoration: underline;
}

.tab-pane {
    display: none;
}

.tab-pane.active,
.info-content.active {
    display: block;
}

.index-content {
    display: flex;
    flex-direction: row;
    padding: 0 52px 52px;
}

.index-list-wrapper {
    width: 100%;
}

.index-list-wrapper ul {
    list-style: none;
}

.index-list-wrapper ul li {
    margin-bottom: 12px;
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.index-list-wrapper ul li.visible {
    opacity: 1;
    transform: translateX(0);
}

.index-list-wrapper ul li:hover {
    transform: translateX(0) skewX(-10deg);
    cursor: pointer;
}

.index-list-wrapper ul li a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    color: #2b2d30;
    font-size: 1.2rem;
    line-height: 1.83333;
    letter-spacing: 0;
}

.index-list-wrapper ul li .index-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 6px;
}

.index-list-wrapper ul li .count {
    font-size: 1.2rem;
    line-height: 1.83333;
    flex-shrink: 0;
}

.info-content {
    flex-direction: column;
    user-select: text;
}

.info-content-wrapper p {
    font-size: 1.2rem;
    line-height: 1.66667;
    margin-bottom: 16px;
    max-width: 660px;
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.info-content.active .info-content-wrapper p {
    opacity: 1;
    transform: translateX(0);
}

.info-content.active .info-content-wrapper p:nth-child(1) { transition-delay: 0.1s; }
.info-content.active .info-content-wrapper p:nth-child(2) { transition-delay: 0.15s; }
.info-content.active .info-content-wrapper p:nth-child(3) { transition-delay: 0.2s; }

.info-content-wrapper a {
    text-decoration: underline;
    color: #000;
}

.info-content-wrapper strong {
    font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1400px) {
    .index-content-wrapper { width: 40%; }
}

@media (max-width: 1200px) {
    .index-content-wrapper { width: 40%; }
}

@media (max-width: 960px) {
    .thumb-item { width: calc((100% - 75px) / 6); }
    .index-content-wrapper { left: 0; transform: translateX(-100%); }
    .index-content-wrapper.open { transform: translateX(0); }
    .wrapper.shifted { width: 100%; margin-left: 0; }
    .sidebar-close-mobile { display: block; }
    .sidebar-logo img { width: 130px; }
    .index-container.open .overlay-background { background-color: rgba(0, 0, 0, 0.85); }
}

@media (max-width: 768px) {
    .thumb-item { width: calc((100% - 45px) / 4); }
    .sidebar-logo img { width: 120px; }
    .index-nav { padding: 40px 30px 30px; }
    .index-content { padding: 0 30px 30px; }
    .main-image-container { height: calc(100vh - 80px); }
}

@media (max-width: 600px) {
    .thumb-item { width: calc((100% - 30px) / 3); }
    .thumbs-grid { padding: 50px 15px 70px 15px; gap: 15px; }
    .gallery-header { bottom: 25px; }
    .gallery-title, .gallery-close { font-size: 13px; }
    .bottom-bar { height: 60px; font-size: 13px; }
    .main-image-container { height: calc(100vh - 60px); }
    .sidebar-logo img { width: 115px; }
    .index-nav { padding: 35px 25px 25px; }
    .index-content { padding: 20px 25px 30px; }
}

@media (max-width: 480px) {
    .thumb-item { width: calc((100% - 20px) / 3); }
    .thumbs-grid { padding: 60px 16px 80px 16px; gap: 10px; }
    .gallery-header { bottom: 20px; }
    .gallery-title, .gallery-close { font-size: 12px; }
    .bottom-bar { height: 60px; font-size: 12px; }
    .main-image-container { height: calc(100vh - 60px); }
    .sidebar-logo img { width: 110px; }
    .index-nav { padding: 30px 20px 20px; }
    .index-content { padding: 15px 20px 30px; }
    .index-nav button { font-size: 1rem; }
    .index-list-wrapper ul li a { font-size: 1rem; }
    .info-content-wrapper p { font-size: 1rem; }
}

@media (max-width: 360px) {
    html { font-size: 55%; }
    .thumb-item { width: calc((100% - 20px) / 3); }
    .thumbs-grid { padding: 50px 12px 70px 12px; gap: 10px; }
    .sidebar-logo img { width: 100px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .gallery-header { bottom: 15px; }
}

@media (max-width: 991px) {
    .sidebar-close-mobile { display: block; }
    .index-content-wrapper { width: 100%; left: 0; transform: translateX(-100%); }
    .index-content-wrapper.open { transform: translateX(0); }
    .index-nav { padding: 60px 20px 10px; }
    .index-content { flex-direction: column; padding: 20px; }
    .wrapper.shifted { transform: translateX(0); }
    .sidebar-logo img { width: 130px; }
}

@media (max-width: 850px) {
    .index-content-wrapper { width: 100%; }
}

/* ---- HIDE CUSTOM CURSOR ON MOBILE / TOUCH DEVICES ---- */
/* Original এর মতোই রাখা হয়েছে */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
    .custom-cursor { display: none !important; }
    body { cursor: auto !important; }
    .main-image-container img.main { cursor: auto !important; }
}
