/* =========================================================
   1. THEME VARIABLES (LIGHT + DARK)
   ========================================================= */

/* ===== DEFAULT (LIGHT) ===== */
:root {
  --bg: #ffffff;
  --text: #000;
  --text-color: #000000;
  --logout-text: #000000;
  --card-bg: #ffffff;
  --border-color: #ddd;
  --sidebar-hover-bg: #b04b4b; /* medium dark for light mode */
  --logout-bg: #ffeded;        /* light mode */
  --hamburger-bg: #111;     /* dark button */
  --hamburger-text: #fff;  /* light icon */

  --footer-bg: #948d8d;
  --footer-text: #000;
}

/* ===== DARK THEME ===== */
body.dark {
  --bg: #0f0f0f;
  --text: #eaeaea;
  --text-color: #eaeaea;
  --logout-text: #0c0c0c;

  --card-bg: #1a1a1a;
  --border-color: #333;
  --sidebar-hover-bg: #4da075; /* medium dark for dark mode */
  --logout-bg: #c49983c0;        /* dark mode */
  --hamburger-bg: #f5f5f5; /* light button */
  --hamburger-text: #111; /* dark icon */

  --footer-bg: #201d1d;
  --footer-text: #eaeaea;
}

/* ===== 2. FOOTER OVERRIDES ===== */
footer[data-mode="light"] {
  background: #948d8d;
  color: #000;
}

footer[data-mode="dark"] {
  background: #000;
  color: #eaeaea;
}




/* =====================
   GALLERY STYLES
   ===================== */


   /* ===============================
   3. BASE / RESET
   ================================== */

/* Base */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}


/* =======================================================
   4. PAGE LAYOUT (FOOTER SHRINK FIX)
   ======================================================= */

/* Flex to push footer down */
#page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#content {
  flex: 1; /* THIS is the key */
}

/* End of Flex to push footer down */


/* ====================================================
   5. TOP NAVBAR (DESKTOP)
   ==================================================== */

#top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  gap: 20px;
  z-index: 1000;
}

#top-navbar a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
}

/* ======================================
   6. PAGE HEADER
   ====================================== */

/* Gallery Page Header */

.page-header {
  text-align: center;
  margin: 40px 0 20px;
}

.page-header h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 2px;
}

.page-header p {
  margin-top: 6px;
  color: var(--text-color);
  opacity: 0.7;
}




/* ===============================================
   7. FILTER BUTTONS
   =============================================== */
/* Filters */ 

.filters {
  text-align: center;
  margin-bottom: 20px;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: inherit;
  padding: 6px 14px;
  margin: 4px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9em;
}

.filter-btn.active {
  background: var(--border-color);
}

/* End of Filters */

/* ======================================================
   8. FIXED TOP CONTROLS (ORDER MATTERS)
   ====================================================== */
/* Hamburger */
.hamburger {
  position: fixed;
  top: 15px;
  right: 15px;

  background: var(--hamburger-bg);
  color: var(--hamburger-text);
  border: 1px solid var(--border-color);

  padding: 10px 14px;
  border-radius: 6px;
  font-size: 18px;
  z-index: 1200;
  cursor: pointer;
}


.hamburger:hover {
  filter: brightness(0.95);
}

/* End of Hamburger */


/* Logout Button */
#logoutBtn {
  position: fixed;
  /*top: 70px; */ /* Original position */ /* old */

  top: calc(15px + 44px + 10px); /* Below hamburger */ /* new */
  /*15px → hamburger top
    44px → hamburger height (approx)
    10px → desired gap
  */
  
  right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--text-color);
  border-radius: 6px;
  background: var(--logout-bg);
  color: var(--logout-text);
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s, color 0.3s, transform 0.3s, opacity 0.3s;
}


/* Theme toggle */
#themeToggle {
  position: fixed;

  z-index: 1200;
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  padding: 8px 10px;
  cursor: pointer;
}


/* ===================================================
   9. SIDEBAR + SUBMENU + OVERLAY
   =================================================== */

/* Sidebar */
#sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 75%;
  max-width: 320px;
  height: 100%;
  background: var(--card-bg);
  border-left: 3px solid var(--border-color);
  font-family: var(--font3);
  padding-top: 80px;
  transition: right 0.3s ease;
  z-index: 1300;
}

#sidebar a {
  display: block;
  color: var(--text);
  opacity: 0.8;
  text-decoration: none;
  padding: 16px;
  text-align: center;
  font-size: 18px;
}

#sidebar a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--text);
}


/*End of Sidebar */


/* Submenu */
.has-submenu {
  width: 100%;
}

/* Normalize submenu button to match links */
.submenu-toggle {
  background: none;
  border: none;
  width: 100%;
  padding: 12px 0;          /* match <a> vertical spacing */
  font: inherit;
  color: inherit;
  text-align: center;       /* THIS fixes alignment */
  cursor: pointer;
  display: block;
}


.submenu {
  display: none;
  padding-left: 20px;
}

.submenu a {
  font-size: 0.95em;
  opacity: 0.85;
  font-family: fantasyc, cursive;
}


/* Open state */
.has-submenu.open .submenu {
  display: block;
}

.has-submenu.open .arrow {
  transform: rotate(180deg);
}

/* End of submenu */


/* Close button */
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-color); /* ✔ adapts to theme */
  font-size: 26px;
  cursor: pointer;
}


/* Overlay */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 1250;
}

/* =========================================================
   10. GALLERY GRID + FADE-IN 
   ========================================================= */

/* Gallery */
.gallery {
  /* column-count: 2; */ /* mobile */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px;
}

.gallery img {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;

  opacity: 0;                     /* ← IMPORTANT */
  transform: scale(0.98);         /* subtle settle-in */
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    box-shadow 0.3s ease;
}

.gallery img.loaded {
  opacity: 1;
  transform: scale(1);
}


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



/* =========================================================
   11. FOOTER (ALL KEPT)
   ========================================================= */

footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  font-family: "Montserrat", sans-serif;
  transition: background 0.3s, color 0.3s;
}



/* New footer Colour */ /* ===== FOOTER STYLES ===== */

.site-footer {
  
  text-align: center;
  padding: 30px 10px 20px;
  
  transition: background 0.3s ease, color 0.3s ease;
}



/* Toggle button */
#footerToggle {
  margin: 14px auto;
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  background: #444;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}



.footer-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.footer-icons a {
  color: inherit; /* ← THIS is the fix */
  font-size: 18px;
  text-decoration: none;
}

.footer-icons a:hover {
  opacity: 0.7;
}

.footer-text {
  font-size: 14px;
  margin: 0;
}

.footer-text a {
  color: #aaa;
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

/* ===============================================
   12. LIGHTBOX
   =============================================== */

/* ===== LIGHTBOX ===== */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

#lightbox img {
  max-width: 95%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

/* Prevent image drag ghost */
#lightbox img {
  user-select: none;
  -webkit-user-drag: none;
}

/* Show */
#lightbox.active {
  display: flex;
}


.lightbox-close {
  position: fixed;
  top: 20px;
  right: 25px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  user-select: none;

}

/* Counter */
#lightbox-counter {
  position: fixed;
  bottom: 25px;
  right: 25px;
  color: #fff;
  font-size: 14px;
  opacity: 0.8;
  font-family: monospace;
}


/* Lightbox navigation arrows */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  padding: 10px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}


/* Code is included below in RESponsive section */
/* Hide arrows on small screens (swipe instead) */
/*
@media (max-width: 768px) {
  .lightbox-nav {
    display: none;
  }
}
*/

/* Mobile friendly */
@media (max-width: 600px) {
  .lightbox-close {
    font-size: 28px;
  }
}



/* ================= MOBILE THEME TOGGLE (LEFT) ============= */
@media (max-width: 768px) {
  #themeToggle {
    position: fixed;
    top: 15px;
    left: 15px;   /* 👈 move to left */
    right: auto;  /* 👈 important: cancel right */
    
  }
}



/* =========================================================
   13. RESPONSIVE (VERY BOTTOM)
   ========================================================= */

/* ========== DESKTOP ======= */

@media (min-width: 769px) {
  #top-navbar { display: flex; }
  .hamburger, #sidebar, #overlay { display: none; }
  #content { padding-top: 60px; }
  #themeToggle { top: 12px; right: 20px; }
}


/*========== MOBILE STYLES ======== */
   
@media (max-width: 768px) {
  #top-navbar { display: none !important; } /* MOBILE: HIDE TOP NAVBAR */
  /*#themeToggle { left: 15px; right: auto; } */ /* WORKING TO SECTION ABOVE */
  .hamburger { display: block; } /* SHOW HAMBURGER ON MOBILE */ /* re edit needed */
  .lightbox-nav { display: none; } /* Hide arrows on small screens (swipe instead) */
}