:root {
  --site-header-height: 0px;
  --toolbar-height: 0px;
  --mobile-bottom-height: 0px;
  --z-backtotop: 2400;
  --z-spinner: 2500;
  --z-overlay: 2599;
  --z-toast: 2600;
  --z-fab: 900;
}

html, body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}


/* Toolbar */
.toolbar-sticky {
  position: sticky;
  top: calc(var(--site-header-height) - 1px);
  z-index: 1010;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 1rem .8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.toolbar-sticky .date-group { display: flex; align-items: center; gap: .75rem; }
.toolbar-sticky .date-icon { width: 28px; height: auto; display: block; }
.toolbar-sticky .date-text { font-weight: 700; font-size: 1.2rem; line-height: 1; color: #6b7280; }

.toolbar-sticky .btn-group {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid orange;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.toolbar-sticky .btn.btn-toggle-month {
  appearance: none;
  border: 0;
  background: #fff;
  color: orange;
  padding: .55rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.toolbar-sticky .btn.btn-toggle-month + .btn.btn-toggle-month {
  border-left: 1px solid rgba(255, 165, 0, .35);
}
.toolbar-sticky .btn.btn-toggle-month.active {
  background: orange;
  color: #fff;
}


/* Image Gallery */
#status { display: none; text-align: center; color: #e11d48; padding: .5rem 1rem; }

.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 2.25rem 1rem;
  color: #6b7280;
}
.empty-placeholder .bi { font-size: 64px; color: #f39a1f; }
.empty-placeholder .empty-title { font-size: 1.6rem; font-weight: 700; }

#gallery-grid {
  width: 80%;
  margin: 0 auto;
  padding: 1rem 0;
  padding-bottom: calc(var(--mobile-bottom-height) + 54px);
}

.menu-img-wrapper { margin-bottom: 1.5rem; }
.menu-img-wrapper img {
  display: block;
  width: 100%;
  background: #fafafa;
  border: 1px solid #ddd;
}

.menu-label-wrapper {
  display: flex;
  justify-content: flex-start;
  margin: 1rem 0 0.5rem 0;
}
.menu-label-inline {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 14px 22px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}

.img-error {
  width: 100%;
  border: 1px solid #fca5a5; 
  background: #fee2e2;  
  color: #be2a2a;  
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
}
.img-error-msg {
  line-height: 1.6;
}


/* Loading */
#loading-scrim {
  position: absolute;
  inset: 0;
  background: rgba(244, 237, 237, 0.61);
  backdrop-filter: blur(1px);
  display: none;
  z-index: 10;
}
#loading-fixed {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-spinner);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #e5e7eb;
  border-top-color: #f39a1f;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* Deadline */
#deadline-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(280px, 40vw, 420px);
  max-height: 60vh;
  overflow: auto;
  background: #fff;
  padding: 14px 16px 12px;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0,0,0,.4);
  z-index: var(--z-toast);
  display: none;
  overflow: hidden;
}
#deadline-toast.show { display: block; animation: fadeIn .12s ease-out; }
#deadline-toast .toast-close {
  position: absolute;
  top: 6px;                     
  right: 10px;                     
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  outline: none;
}
#deadline-toast .toast-head {
  position: relative;              
  display: flex;
  align-items: center;
  justify-content: center;         
  padding: 0.5rem 0.5rem;  
  border-bottom: 0.5px solid rgba(85, 85, 85, 0.3);
  margin-bottom: 0.8rem;
}
#deadline-toast .toast-title { font-weight: 600; font-size: 1rem; text-align: center; width: 100%;}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#deadline-toast .toast-text { padding: 0.75rem 0.5rem; font-size: 0.95rem; line-height: 1.5; color: #333; }
#deadline-toast .deadline-section { margin-bottom: 1rem;}
#deadline-toast .deadline-label { font-weight: 700; color: #333; margin-bottom: 0.3rem; }
#deadline-toast .deadline-item { padding-left: 0.25rem }
#toast-overlay {
  position: fixed;
  inset: 0;
  background: #212529a6;
  z-index: var(--z-overlay);
  display: none;
  opacity: 0;
  transition: opacity .12s ease-out;
}
#toast-overlay.show { display: block; opacity: 1; }

/* Deadline (Desktop) */
.deadline-btn {
  background: orange;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

/* Deadline (Mobile) */
#global-deadline-fab {
  opacity: 0;
  position: fixed;
  right: 12px;
  top: calc(var(--site-header-height) + var(--toolbar-height) + 12px);
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #ffa501;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  cursor: grab;
  z-index: var(--z-fab);
  transition: transform .08s ease, box-shadow .08s ease;
  position: fixed;
}
#global-deadline-fab .fab-icon {font-size: 1.4rem; }
#global-deadline-fab .fab-close {
  position: absolute;
  top: -1px;  
  right: -4px; 
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e0e0e0; 
  color: #000; 
  font-weight: bold;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#global-deadline-fab.fab-hidden {opacity: 0.8; }
#global-deadline-fab.fab-hidden .fab-close {display: none; }

/* Back to Top */
#back-to-top {
  position: fixed;
  right: 10px;
  bottom: calc(20px + var(--mobile-bottom-height));
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  display: none;              
  place-items: center;
  background: #ffa501;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  z-index: var(--z-backtotop);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
#back-to-top .bi { font-size: 18px; }
#back-to-top.show {
  display: grid;
  opacity: 1;
}


/* Responsive */
@media (min-width: 992px) {
  .toolbar-sticky { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .toolbar-sticky .date-group { justify-self: start; }
  #toolbar-deadline-btn { justify-self: center; }
  .toolbar-sticky .btn-group { justify-self: end; }
  #back-to-top {
    right: 60px;     
    bottom: 60px;   
    width: 58px;      
    height: 58px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
  }
  #back-to-top .bi { font-size: 24px; }
}

@media (max-width: 991px) {
  .toolbar-sticky { padding: .8rem 1rem; }
  #gallery-grid { width: 95%; }
  .menu-label-inline { padding: 8px 14px; font-size: 1rem; border-radius: 6px; letter-spacing: 0.3px; }
  .menu-label-wrapper { margin: 0.5rem 0 0.3rem 0; }
}

@media (max-width: 501px) {
  html:lang(en) .toolbar-sticky .date-text { font-size: 1rem; }
  html:lang(en) .toolbar-sticky .btn.btn-toggle-month { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
}

/* @media (max-width: 501px) {
  html:lang(en) .toolbar-sticky { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html:lang(en) .toolbar-sticky .date-group,
  html:lang(en) .toolbar-sticky .btn-group { flex: 0 0 auto; }
} */