/* Import Khmer fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Koulen&family=Bayon&family=Battambang&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ================================
   VARIABLES & RESET
================================ */
:root {
  /* Color palette */
  --primary: #034a6c;
  --secondary: #ff6e31;
  --accent: #27a9b3;
  --light-bg: #f5f8f9;
  --dark-text: #333;
  --light-text: #fff;
  --border-color: #e1e4e8;
  --success: #4caf50;
  --warning: #ff9800;
  --error: #f44336;
  
  /* Spacing */
  --spacing-xs: 0.25rem; /* 0.25 * 16 = 4px */
  --spacing-sm: 0.5rem;  /* 0.5 * 16 = 8px */
  --spacing-md: 1rem;    /* 1 * 16 = 16px */
  --spacing-lg: 1.5rem;  /* 1.5 * 16 = 24px */
  --spacing-xl: 2rem;    /* 2 * 16 = 32px */  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

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

/* ================================
   BASE STYLES
================================ */
body {
  font-family: 'Poppins', Arial, Verdana, Helvetica, 'Battambang', sans-serif;
  font-size: 0.9rem;
  color: var(--dark-text);
  line-height: 1.6;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Improved focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  //outline: 2px solid var(--secondary);
  //outline-offset: 2px;
}

/* ================================
   TYPOGRAPHY
================================ */
h1, h2, h3, h4, h5, h6 {
  //margin-bottom: var(--spacing-md);
  font-weight: 600;
  line-height: 1.3;
}

/* Apply to h3 in both the Sidebar and the Main content area */
#sidebar h3, 
#bandeau h3, 
#bandeau_2 h3, 
#main h3 {
    display: block;
    /* Increased margins for better space */
    margin-top: 15px !important; 
    margin-bottom: 15px !important;
    
    /* Ensure Khmer characters aren't cut off */
    line-height: 1.6; 
    padding-bottom: 5px;
    
    /* Typography */
    font-family: 'Koulen', 'Bayon', 'Battambang', sans-serif;
    font-size: 1.3rem; /* Slightly smaller for sidebar harmony */
    color: var(--primary);
    
    /* Optional: subtle bottom border for structure */
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

#intro h3 {
    /* Font Styling */
    font-family: 'Koulen', sans-serif;
    font-size: 1.6rem;
    color: var(--primary);
    line-height: 1.2;
    text-align: left;
    
    /* Compact Spacing */
    //margin: 15px 0 !important; /* Minimal space top/bottom */
    padding: 2px 0 2px 15px;    /* Space for the accent bar */
    
    /* The Left Accent Bar */
    border-left: 4px solid var(--secondary); /* Clean orange bar */
    
    /* Subtle Text Effect */
    letter-spacing: 0.5px;
    display: block;
}

/* Ensure the image container stays below the title */
#intro_bibli .p1 {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#intro_bibli {
  font-family: 'Koulen', 'Bayon', 'Battambang', Arial, Verdana, Helvetica, sans-serif;
  font-size: 1.25rem;
  //margin-bottom: var(--spacing-md);
}

#intro_bibli h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

#intro_bibli .p1 {
  font-size: 0.875rem;
  color: var(--dark-text);
}

/* ================================
   HEADER & FOOTER
================================ */
#header {
  background: linear-gradient(135deg, var(--primary) 0%, #006992 100%);
  color: var(--light-text);
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-lg);
}

#footer {
  background: var(--primary);
  color: var(--light-text);
  text-align: center;
  padding: var(--spacing-md);
  font-size: 0.9rem;
  border-top: 3px solid var(--secondary);
  margin-top: var(--spacing-xl);
}

#footer a {
  color: var(--light-text);
  font-weight: 500;
  margin: 0 var(--spacing-sm);
  text-decoration: none;
  transition: color var(--transition-fast);
}

#footer a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* ================================
   SIDEBAR COMPONENTS
================================ */
#sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* ================================
   LAYOUT
================================ */
#page,
#container {
  display: grid;
  grid-template-areas:
    "intro intro"
    "sidebar main";
  grid-template-columns: 250px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  align-items: start;
}

#intro   { grid-area: intro; min-height: 80px; }
#bandeau { grid-area: sidebar; }
#bandeau_2 { grid-area: sidebar; }
#main    { grid-area: main; }

#intro {
  grid-area: intro;
  padding: 15px;
  background: #ffff;
  font-weight: bold;
  font-size: 1rem;
}

#intro .p1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: flex-start;
}

#intro .p1 img {
  flex: 1 1 25%;         /* 4 images per row */
  max-width: 25%;        /* each exactly 25% width */
  height: auto;
  display: block;
}

#accueil img.center {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

/* Individual sidebar boxes */
#bandeau,
#bandeau_2 {
  background: #f5f8f9;
  margin-left: 15px;
  border-radius: 6px;
  box-sizing: border-box;
}

#accessibility,
#accueil,
#adresse, 
#bandeau_2,
#lvl1, #facette {
  padding: 15px 15px 0 15px;
}

#bandeau_2:empty {
  //display: none;
}

/* Login box */
/* Login box */
#connexion {
  background: linear-gradient(to bottom, var(--accent), #1d7e86);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--light-text);
  font-family: Arial, sans-serif;
  box-shadow: var(--shadow-md);
}

#connexion h3.login_invite {
  margin: 0 0 var(--spacing-md);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--light-text);
}

#connexion input[type="text"],
#connexion input[type="password"] {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: var(--spacing-md);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#connexion input[type="text"]:focus,
#connexion input[type="password"]:focus {
  border-color: var(--secondary);
  //border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(255, 110, 49, 0.2);
}

#connexion .myform-password-text-visually {
  display: flex;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

#connexion .myform-password-text-visually:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(255, 110, 49, 0.2);
}

#connexion .myform-password-text-visually input.password {
  border: none;
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  margin: 0;
  font-size: 0.95rem;
  background: transparent;
}

#connexion .myform-password-text-visually button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #666;
  padding: var(--spacing-sm);
  transition: color var(--transition-fast);
}

#connexion .myform-password-text-visually button:hover {
  color: var(--primary);
}

#password_visually, #myform-password-visually, #mypopupform-password-visually {
  position: absolute;
  top: 0px;
  right: 0px;
  cursor: pointer;
}

#connexion input.bouton {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary);
  color: var(--light-text);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  width: 100%;
}

#connexion input.bouton:hover {
  background-color: #006992;
  transform: translateY(-1px);
}

#connexion a.mdp_forgotten {
  display: block;
  margin-top: var(--spacing-md);
  font-size: 0.85rem;
  color: var(--light-text);
  text-decoration: underline;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

#connexion a.mdp_forgotten:hover {
  opacity: 1;
}

>
/* ==============================
   POPUP BASE
============================== */
body.popup {
  font-family: 'Poppins', Arial, Verdana, Helvetica, 'Battambang', sans-serif;
  font-size: 0.9rem;
  background: #f5f8f9;
  margin: 0;
  padding: 0;
}

body.popup #connexion {
  width: 100%;
  max-width: 400px;
  margin: 50px auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  position: relative;
}

/* ==============================
   FORM INPUTS
============================== */
body.popup input[type="text"],
body.popup input[type="password"] {
  width: 100%;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  box-sizing: border-box;
  border: 1px solid #ccc;
}

/* Submit button */
body.popup input[type="submit"] {
  width: 100%;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 4px;
  margin-top: 10px;
  background: #034a6c;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

body.popup input[type="submit"]:hover {
  background: #1d7e86;
  transform: translateY(-1px);
}

/* ==============================
   PASSWORD WRAPPER WITH EYE
============================== */
body.popup .myform-password-text-visually {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

body.popup .myform-password-text-visually input.password {
  flex: 1;
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  box-sizing: border-box;
}

/* Button reset */
#password_visually {
  all: unset;
  position: absolute;
  top: 40%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

/* Eye outline */
#password_visually::before {
  content: '';
  width: 18px;
  height: 10px;
  border: 2px solid #888;
  border-radius: 50% / 50%;
  position: relative;
  display: block;
}

/* Pupil */
#password_visually::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #888;
  border-radius: 50%;
  position: absolute;
}
/* ==============================
   LABELS
============================== */
body.popup label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
}

/* ==============================
   POPUP CLOSE BUTTON
============================== */
body.popup .popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
  color: #555;
  cursor: pointer;
}

body.popup .popup-close:hover {
  color: #000;
}
/* ================================
   MAIN CONTENT
================================ */
#main {
  grid-area: main;
  transition: height 0.3s ease;
  overflow: hidden;
  padding: var(--spacing-md);
  background: var(--light-bg);
  border-radius: var(--radius-md);
  min-height: 400px;
  box-shadow: var(--shadow-sm);
  margin-left: 15px;
  margin-right: 15px;
}

/* Container styling */
#container {
  align-items: start;
  background: #fff;
}

/* ================================
   LEFT SIDEBAR (LEFT PATH)
================================ */
#left_path {
  width: 100%;
  background: #ADC087;
  padding: var(--spacing-md);
  border-right: 1px solid #6B7B3B;
  height: 100%;
  overflow-y: auto;
  border-radius: var(--radius-md);
}

#left_path h3 {
  font-size: 0.95rem;
  margin: var(--spacing-md) 0 var(--spacing-sm);
  color: var(--dark-text);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#left_path a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  text-decoration: none;
  color: #222;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), padding-left var(--transition-fast);
}

#left_path a:hover {
  background: #DDF0A7;
  color: #000;
  padding-left: calc(var(--spacing-md) + 4px);
}

/* ================================
   FACETTE TABLE
================================ */
#facette table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--spacing-md) 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}
#facette th, 
#facette td {
  padding: var(--spacing-xs);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
#facette th {
  background: var(--primary);
  font-weight: 600;
  color: var(--light-text);
  position: sticky;
  top: 0;
}
#facette tr:last-child td {
  border-bottom: none;
}
#facette tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
#facette tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ================================
   FORMS & BUTTONS
================================ */
input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  width: auto;
  min-width: 180px;
  max-width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  box-sizing: border-box;
  margin-bottom: var(--spacing-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(39, 169, 179, 0.2);
}

select {
  width: auto;
  min-width: 150px;
  max-width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(39, 169, 179, 0.2);
}

input[type="submit"],
input[type="button"],
button {
  height: auto;
  min-height: 36px;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-right: 4px;
  background: var(--secondary);
  color: var(--light-text);
  font-weight: 600;
  border: 2px solid var(--secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
  background: #ffebb7;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ================================
   BLUE BUTTON (Smaller Style)
================================ */
.button-unstylized {
  display: inline-block;
  padding: 4px 10px;            /* smaller padding */
  font-size: 0.85rem;           /* slightly smaller text */
  font-weight: 500;             /* a bit lighter */
  background: var(--primary);   /* theme blue */
  color: var(--light-text);
  margin-bottom: var(--spacing-sm);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: background-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
}

.button-unstylized:hover {
  background: #046b9c;          /* lighter blue hover */
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button-unstylized:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.button-unstylized:disabled {
  background: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ================================
   NAVIGATION MENU
================================ */
#menuDeroulant {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  background: #ff6e31;
}
#menuDeroulant > li {
  position: relative;
}
#menuDeroulant > li > a {
  display: block;
  padding: 12px 18px;
  border: 2px solid transparent;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}
#menuDeroulant > li > a:hover {
  background: #fff;
  color: #ff6e31;
  border: 2px solid #ff6e31;
}
#menuDeroulant .sousMenu {
  font-family: Arial, Verdana, Helvetica, sans-serif;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #34495e;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 180px;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  z-index: 9999;
}
#menuDeroulant .sousMenu li a {
  display: block;
  font-size: 16px;
  padding: 10px 15px;
  color: #ecf0f1;
  text-decoration: none;
  transition: background 0.3s ease;
}
#menuDeroulant .sousMenu li a:hover {
  background: #3d566e;
}
#menuDeroulant li:hover > .sousMenu {
  display: block;
}

/* ================================
   NAVIGATOR TABLE (Enhanced)
================================ */
#navigator {
  margin: 15px 0;
  background: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  overflow: hidden; /* rounded corners for table */
}

#navigator table {
  width: 100%;
  border-collapse: collapse;
}

#navigator td {
  padding: 0; /* let the link fill the cell */
  text-align: center;
  border-right: 1px solid var(--border-color);
}

#navigator td:last-child {
  border-right: none;
}

#navigator a {
  display: block;
  padding: 10px 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              box-shadow var(--transition-fast);
}

#navigator a:hover {
  background: var(--primary);
  color: var(--light-text);
  //box-shadow: inset 0 -2px 0 var(--secondary); /* subtle underline */
}

#navigator a:active {
  background: #02334d; /* darker blue when clicked */
  color: var(--light-text);
}

#navigator a.active {
  background: var(--primary);
  color: var(--light-text);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--secondary); /* strong underline */
}

/* ================================
   SEARCH TABS
================================ */
ul.search_tabs {
  list-style: none;
  margin: var(--spacing-md) 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--primary);
}

ul.search_tabs li {
  margin-right: var(--spacing-xs);
  margin-bottom: 4px;
  border: 1px solid var(--primary);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--primary);
  transition: all var(--transition-fast);
}

ul.search_tabs li a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--light-text);
  font-weight: 500;
}

ul.search_tabs li:hover {
  background: #0f5fa1;
  transform: translateY(-2px);
}

ul.search_tabs li#current {
  background: #fff;
  border-bottom: 2px solid #fff;
}

ul.search_tabs li#current a {
  color: #000;
}

/* ================================
   SEARCH RESULT TABLE
================================ */
#resultatrech table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--spacing-md) 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}
#resultatrech th, 
#resultatrech td {
  padding: var(--spacing-xs);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
#resultatrech th {
  background: var(--primary);
  font-weight: 600;
  color: var(--light-text);
  position: sticky;
  top: 0;
}
#resultatrech tr:last-child td {
  border-bottom: none;
}
#resultatrech tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
#resultatrech tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ================================
   SHELVES TABLE
================================ */
#etageres table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--spacing-md) 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}
#etageres th, 
#etageres td {
  padding: var(--spacing-xs);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
#etageres th {
  background: var(--primary);
  font-weight: 600;
  color: var(--light-text);
  position: sticky;
  top: 0;
}
#etageres tr:last-child td {
  border-bottom: none;
}
#etageres tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}
#etageres tr:hover {
  background: rgba(0, 0, 0, 0.04);
}


/* ================================
   CATEGORIES GRID
================================ */
#categories-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.row_categ {
  display: contents;
}

.category {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.category:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.category h2 {
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  color: var(--primary);
}

.category h2 img {
  margin-right: var(--spacing-sm);
  filter: brightness(0.8);
}

.category ul {
  margin: 0;
  padding-left: var(--spacing-md);
  max-height: 120px;
  overflow-y: auto;
}

.category ul li {
  margin-bottom: var(--spacing-xs);
  padding-left: var(--spacing-xs);
}

.category ul li::marker {
  color: var(--accent);
}
/* Hide category divs that are empty or only contain whitespace/&nbsp; */
.category:empty,
.category:not(:has(h2)) {
    display: none !important;
}

/* ================================
   LOCATION TABLE
================================ */
#location-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: var(--spacing-md);
  text-align: center;
}
#location-container td {
  background: #fff;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  vertical-align: top;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
#location-container td:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
#location-container td img {
  max-width: 150px;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: transform var(--transition-fast);
}

#location-container td:hover img {
  transform: scale(1.05);
}

#location-container td a b {
  display: block;
  margin-top: var(--spacing-sm);
  font-size: 1rem;
  color: var(--dark-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

#location-container td a:hover b {
  color: var(--accent);
}

@media (max-width: 600px) {
  #location-container table, 
  #location-container tbody, 
  #location-container tr, 
  #location-container td {
    display: block;
    width: 100%;
  }
  #location-container td {
    margin-bottom: 15px;
  }
}

#accessibility {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: Arial, sans-serif;
}

/* Reset list styles */
#accessibility .accessibility_font_size {
  display: flex;
  gap: 8px; /* spacing between buttons */
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each button */
#accessibility .accessibility_font_size li {
  display: inline-flex;
}

#accessibility .accessibility_font_size a {
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

#accessibility .accessibility_font_size a:hover {
  background: #f0f0f0;
  color: #000;
}


/* ================================
   RESPONSIVE
================================ */

/* Tablet view (<= 992px) ? show 2 images */
@media (max-width: 992px) {

#page,
#container {
  display: grid;
  grid-template-areas:
    "intro intro"
    "sidebar main";
  grid-template-columns: 230px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  align-items: start;
}


  #sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  #bandeau, #bandeau_2 {
    flex: 1 1 100%;
    margin-left: 15px;
    max-width: 100%;
  }

  #accessibility,
  #accueil,
  #adresse, 
  #bandeau_2 {
    padding: 15px 15px 0 15px;
  }

  #intro .p1 {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Hide all images */
  #intro .p1 img {
    display: none;
  }

  /* Show only the first 2 images */
  #intro .p1 img:nth-child(-n+2) {
    display: block;
    width: 50%;
    max-width: 50%;
    height: auto;
  }
}

/* Mobile view (<= 600px) ? show ONLY 1 image */
@media (max-width: 600px) {
  body {
    font-size: 85%;
  }

  #header {
    font-size: 1rem;
    padding: 10px;
  }

  #intro .p1 {
    flex-direction: column;
    align-items: center;
  }

  /* Hide all images */
  #intro .p1 img {
    display: none !important;   /* force override */
  }

  /* Show only the first image, full width */
  #intro .p1 img:first-child {
    display: block !important; /* force override */
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  #accueil img.center {
    max-width: 100%;
  }

  #categories-container {
    grid-template-columns: 1fr;
  }

  #left_path {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #6B7B3B;
    height: auto;
  }

  #menuDeroulant {
    flex-direction: column;
  }

  #menuDeroulant > li > a {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
  }

  ul.search_tabs {
    flex-direction: column;
  }

  ul.search_tabs li {
    margin-right: 0;
    margin-bottom: 4px;
  }
  /* Tabs behave like stacked menu */
  #search .search_tabs {
    flex-direction: column;
    border-bottom: none;
  }

  #search .search_tabs li {
    margin: 0 0 var(--spacing-xs) 0;
    width: 100%;
    border-radius: var(--radius-sm);
  }

  #search .search_tabs li a {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--spacing-sm);
  }

  /* Search form stacked vertically */
  #search form {
    flex-direction: column;
    align-items: stretch;
  }

  #search select,
  #search input.text_query,
  #search input.boutonrechercher,
  #search .button_search_help {
    width: 100%;
    font-size: 0.9rem;
    margin-bottom: 4px;
  }
}


/* ================================
   LATEST ENTRIES MARQUEE
================================ */

/* Layout Container */
.marquee-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    position: relative;
}

#marqueeContainer {
    flex-grow: 1;
    overflow: hidden;
    padding: 20px 0 40px 0;
}

#marqueeContent {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    transition: transform 0.4s ease-in-out;
}

/* The Clickable Tile */
.book-item {
    flex: 0 0 140px; 
    max-width: 140px;
    position: relative; /* Context for the badge */
}

.tile-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Thumbnail Display Fix */
.image-wrapper {
    width: 140px;
    height: 200px;
    background: #ffffff; /* Clean white background */
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Critical for the badge to show */
    box-shadow: var(--shadow-sm);
}

.image-wrapper img.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block !important;
}

/* Badge Style - Restored and Fixed */
.new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e74c3c;
    color: white !important;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 5;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.text-wrapper {
    padding: 10px 5px;
    width: 100%;
    min-height: 50px;
    display: block !important;
}

/* Professional Khmer Typography */
.book-title {
    display: -webkit-box !important;
    visibility: visible !important;
    color: #2c3e50 !important;
    font-family: 'Battambang', 'Kantumruy Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    margin: 0;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Clean up extra PMB duplicates */
.book-item .vignetteimg, 
.book-item br {
    display: none !important;
}

/* Navigation Buttons */
.btn-left, .btn-right {
    background-color: var(--secondary); 
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    z-index: 100;
    margin-top: -60px; /* Adjusted to sit centered on the cover */
}

.btn-left:hover, .btn-right:hover {
    background-color: #e67e22;
    transform: scale(1.1);
}
/* --- Hover Effects --- */

/* 1. Lift the whole card and add a stronger shadow */
.book-item:hover .image-wrapper {
    transform: translateY(-8px); /* Moves the card up */
    box-shadow: 0 12px 24px rgba(0,0,0,0.2); /* Deepens the shadow */
    transition: all 0.3s ease;
}

/* 2. Slight zoom on the book cover image */
.book-item:hover .book-cover {
    transform: scale(1.08); /* Zooms in 8% */
    transition: transform 0.3s ease;
}

/* 3. Change title color on hover to match your orange theme */
.book-item:hover .book-title {
    color: #ff7f50 !important; 
    transition: color 0.3s ease;
}

/* Ensure smooth transition when moving cursor AWAY */
.image-wrapper, .book-cover, .book-title {
    transition: all 0.3s ease;
}

/* Fix thumbnail positioning inside the card */
.image-wrapper {
    position: relative;
    width: 100%;
    height: 200px; /* Adjust height to match your desired card size */
    background-color: #f8f8f8;
    border-radius: 10px;
    overflow: hidden; /* Keeps the zoom effect inside the card */
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the white card area */
    transition: transform 0.3s ease;
}

/* Ensure the text stays below the white card */
.text-wrapper {
    padding-top: 10px;
    text-align: center;
}
/* This is the container that holds all the book-items */
/* The 'Window' that hides the extra books */
.thumbnail-marquee {
    overflow-x: hidden !important; /* Vital to hide books outside the current view */
    width: 100%;
    position: relative;
    scroll-behavior: smooth;
    display: block;
}

/* The 'Long Shelf' that holds all books in a single line */
.marquee-content {
    display: flex !important;       /* Forces horizontal row */
    flex-direction: row !important;
    flex-wrap: nowrap !important;   /* STOP books from stacking vertically */
    gap: 15px;                      /* Consistent spacing */
    padding: 10px 5px;
    width: max-content;             /* Allows the row to be as wide as needed for many books */
}

/* Fixed item width to prevent squashing */
.book-item {
    flex: 0 0 155px !important;     /* Keeps covers consistent */
    width: 155px;
    max-width: 155px;
}
/* This targets the content area inside your etagere slider */
#etagere-container .marquee-content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Forces items to stay in one line */
    gap: 20px;
    padding: 10px 5px;
}

/* Ensure individual items don't stretch or shrink */
#etagere-container .book-item {
    flex: 0 0 160px !important;
    max-width: 160px;
}
.mores-container {
    text-align: right;
    padding: 10px 40px; /* Aligns with the end of the slider */
}

.mores-link {
    color: #ff6600; /* Matches your navigation button color */
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}

.mores-link:hover {
    text-decoration: underline;
}