/* Page Transition Styles */
html {
  background-color: #F8F9FA;
}

body.fade-in-fallback > *:not(.lightbox):not(.transition-bar) {
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body.fade-out > *:not(.lightbox):not(.transition-bar) {
  animation: fadeOut 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

::view-transition-old(root) {
  animation: fadeOut 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
::view-transition-new(root) {
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Cinematic Top Progress Bar */
.transition-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--ink, #1a1918);
  z-index: 9999;
  width: 0;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Toast Notification for Clipboard Copying (shifted up to prevent overlap) */
.toast-notification {
  position: fixed;
  bottom: 84px;
  right: 24px;
  background: var(--ink, #1a1918);
  color: var(--warm-white, #F8F9FA);
  border: 1px solid var(--line, #dedad6);
  padding: 12px 20px;
  font-size: 10px;
  font-family: var(--fn-sans), 'Helvetica Neue', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transform: translate3d(0, 30px, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
}

.toast-notification.is-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.toast-icon {
  color: #cfa870;
  font-weight: bold;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink, #1a1918);
  color: var(--warm-white, #F8F9FA);
  border: 1px solid var(--line, #dedad6);
  padding: 11px 18px 9px;
  font-size: 9.5px;
  font-family: var(--fn-sans), 'Helvetica Neue', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 9999;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translate3d(0, 20px, 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.back-to-top:hover {
  background: #cfa870;
  color: #1a1918;
  border-color: #cfa870;
}

.back-to-top.is-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
}

/* Align Language and Search Toggle perfectly */
.lang-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px !important;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Search & Home Icon Toggles next to SLO/EN */
.search-toggle,
.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal, #2f2e2e);
  background: transparent;
  border: 1px solid var(--ink, #1a1918);
  height: 28px;
  padding: 0 12px;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  outline: none;
  vertical-align: middle;
}

.search-toggle:hover,
.home-button:hover {
  background: var(--ink, #1a1918);
  color: var(--warm-white, #F8F9FA);
}

.search-toggle svg,
.home-button svg {
  display: block;
}

/* Search Overlay & Backdrop Container */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 18, 0.45); /* Premium brand dark translucent overlay */
  backdrop-filter: blur(4px); /* Premium blur effect */
  -webkit-backdrop-filter: blur(4px); /* Safari support */
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.search-overlay.is-open .search-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Slide-out Search Drawer (Right side) */
.search-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100%;
  height: 100%;
  background: #141312;
  border-left: 1px solid var(--line, #dedad6);
  display: flex;
  flex-direction: column;
  padding: 40px 30px;
  box-shadow: -10px 0 40px rgba(0,0,0,0.15);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1);
  pointer-events: auto;
}

.search-overlay.is-open .search-drawer {
  transform: translate3d(0, 0, 0);
}

/* Responsive Adjustments for Mobile Nav and Search Drawer */
@media (max-width: 900px) {
  .nav-right {
    gap: 16px !important; /* Tighten gaps on mobile so buttons don't wrap/overflow */
  }
}

@media (max-width: 480px) {
  .search-drawer {
    padding: 30px 20px; /* More search area on small phone screens */
  }
  .search-item {
    padding: 11px 15px;
  }
}


/* Search Header & Input styling */
.search-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line, #dedad6);
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--fn-sans), 'Helvetica Neue', sans-serif;
  font-size: 15px;
  color: var(--warm-white, #F8F9FA);
  padding: 10px 0;
  letter-spacing: 0.05em;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.search-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  font-family: var(--fn-sans), sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.18s ease;
}

.search-close:hover {
  color: #fff;
}

/* Search suggestions & results list */
.search-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.search-results::-webkit-scrollbar {
  width: 2px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

.search-item {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.search-item:hover {
  background: rgba(207, 168, 112, 0.08);
  border-color: rgba(207, 168, 112, 0.3);
}

.search-item-title {
  font-family: var(--fn-sans), sans-serif;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  margin-bottom: 2px;
}

.search-item-meta {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
}

.search-no-results {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px 0;
}

/* Drawing Card Highlight & Pulse Effect */
.drawing-card {
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.6s cubic-bezier(0.25, 1, 0.5, 1), outline 0.6s ease !important;
}

.drawing-card-pulse {
  transform: scale(1.03) translate3d(0, 0, 0);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  outline: 1.5px solid #cfa870 !important;
  outline-offset: 4px;
  z-index: 10;
}

/* ── VIEW TRANSITIONS API ─────────────────────────── */

/* Define persistent layout elements to keep them static */
.nav {
  view-transition-name: main-nav;
  background: rgba(248, 249, 250, 0.6) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-mobile-panel {
  view-transition-name: mobile-nav;
}
footer {
  view-transition-name: main-footer;
}

/* Customize transition animations for root/main content */
::view-transition-old(root) {
  animation: 180ms cubic-bezier(0.4, 0, 0.2, 1) both fade-out;
}

::view-transition-new(root) {
  animation: 260ms cubic-bezier(0.4, 0, 0.2, 1) both fade-in,
             260ms cubic-bezier(0.1, 0.76, 0.55, 0.94) both slide-up;
}

@keyframes slide-up {
  from {
    transform: translateY(16px);
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ── NAV DROPDOWN STYLES ── */
.nav-links .has-dropdown {
  position: relative;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warm-white);
  border: 1px solid var(--line);
  min-width: 160px;
  list-style: none;
  padding: 8px 0 6px;
  z-index: 300;
}
.has-dropdown:hover .nav-dropdown {
  display: block;
}
.nav-dropdown li a {
  display: block;
  padding: 9px 20px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  opacity: 0.65;
  white-space: nowrap;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.nav-dropdown li a:hover {
  opacity: 1;
  background: var(--paper);
}

/* Global Navigation Bar Transparency Override */
.nav {
  background: rgba(248, 249, 250, 0.4) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}


