/* ==========================================================================
   Lyall Cuthbert Photography — Stylesheet
   Dark-mode-first (#0d0d0d) with high-contrast light mode (#fafafa)
   ========================================================================== */

:root {
  --bg-primary: #fafafa;
  --bg-header: rgba(250, 250, 250, 0.92);
  --bg-surface: #f1f1f3;
  --bg-elevated: #ffffff;
  --bg-tile: #e8e8eb;
  --text-primary: #111112;
  --text-muted: #68686d;
  --border-hairline: #e2e2e6;
  --btn-primary-bg: #111112;
  --btn-primary-text: #fafafa;
  --btn-primary-hover: #2a2a2d;
  --lightbox-bg: rgba(250, 250, 250, 0.98);
  --dropdown-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  --accent-emerald: #10b981;
}

html.dark {
  --bg-primary: #101011;
  --bg-header: rgba(13, 13, 13, 0.9);
  --bg-surface: #141416;
  --bg-elevated: #18181b;
  --bg-tile: #18181a;
  --text-primary: #fafafa;
  --text-muted: #939399;
  --border-hairline: #252529;
  --btn-primary-bg: #fafafa;
  --btn-primary-text: #0d0d0d;
  --btn-primary-hover: #e5e5e5;
  --lightbox-bg: rgba(10, 10, 11, 0.985);
  --dropdown-shadow: 0 22px 48px rgba(0, 0, 0, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Theme utility classes */
.theme-header {
  background-color: var(--bg-header);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.theme-surface {
  background-color: var(--bg-surface);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.theme-elevated {
  background-color: var(--bg-elevated);
  box-shadow: var(--dropdown-shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.theme-btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.theme-btn-primary:hover {
  background-color: var(--btn-primary-hover);
}

.theme-input {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-hairline);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-input:focus {
  border-color: var(--text-primary);
  outline: none;
}

.theme-input::placeholder {
  color: var(--text-muted);
  opacity: 0.45;
}

/* Header navigation active underline */
.nav-page-btn {
  position: relative;
}

.nav-page-btn.is-active {
  color: var(--text-primary);
}

.nav-page-btn.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background-color: var(--text-primary);
}

/* Gold gradient text for Australian Landscapes subtitle */
.text-gold-gradient {
  background: linear-gradient(90deg, #9c7221 0%, #7d5814 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #8c651a;
}

html.dark .text-gold-gradient {
  background: linear-gradient(90deg, #e5c87b 0%, #c69f4b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #d6b15a;
}

/* Home Page: Full-viewport lock & translucent frosted header */
body.is-home-view {
  overflow: hidden;
  height: 100vh;
}

body.is-home-view #site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(250, 250, 250, 0.42);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html.dark body.is-home-view #site-header {
  background-color: rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Standalone Image Page: Fixed navbar over full-screen zoom stage */
body.is-image-view #site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

html.dark body.is-home-view #site-header .nav-page-btn,
html.dark body.is-home-view #site-header .text-muted {
  color: rgba(250, 250, 250, 0.82);
}

html.dark body.is-home-view #site-header .nav-page-btn:hover {
  color: #ffffff;
}

html.dark body.is-home-view #site-header #theme-toggle-btn,
html.dark body.is-home-view #site-header #header-cart-count {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

body.is-home-view #site-header .nav-page-btn,
body.is-home-view #site-header .text-muted {
  color: rgba(17, 17, 18, 0.78);
}

body.is-home-view #site-header .nav-page-btn:hover {
  color: #111112;
}

/* Home Slideshow Crossfade */
.home-slide-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
  will-change: opacity;
}

.home-slide-layer.is-visible {
  opacity: 1;
}

/* Gallery Hub Search Suggestion Hover & Keyboard Highlight */
.hub-suggest-item {
  transition: background-color 0.14s ease, padding-left 0.14s ease;
}

.hub-suggest-item:hover,
.hub-suggest-item.is-highlighted {
  background-color: rgba(0, 0, 0, 0.055);
}

html.dark .hub-suggest-item:hover,
html.dark .hub-suggest-item.is-highlighted {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Hide native WebKit search cancel button so custom clear button is consistent across Firefox/Chrome */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* Custom Filter Checkboxes (Dark-mode styled with gold check) */
.filter-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #c8c8ce;
  background-color: #ffffff;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

html.dark .filter-checkbox {
  border-color: #3a3a40;
  background-color: #121214;
}

.filter-checkbox::before {
  content: '';
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  background-color: #ffffff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

html.dark .filter-checkbox::before {
  background-color: #0d0d0d;
}

.filter-checkbox:checked {
  border-color: #9c7221;
  background: linear-gradient(135deg, #b88a36 0%, #8a641b 100%);
}

html.dark .filter-checkbox:checked {
  border-color: #e5c87b;
  background: linear-gradient(135deg, #e5c87b 0%, #c69f4b 100%);
}

.filter-checkbox:checked::before {
  transform: scale(1);
}

/* Gallery Navigation Dropdown */
.nav-dropdown {
  opacity: 0;
  visibility: hidden;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.nav-item:hover .nav-dropdown,
.nav-item.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.gallery-menu-link {
  display: block;
  width: 100%;
  padding: 9px 16px;
  color: var(--text-primary);
  opacity: 0.65;
  transition: background-color 0.14s ease, opacity 0.14s ease;
}

.gallery-menu-link:hover,
.gallery-menu-link.is-active-link {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.055);
}

html.dark .gallery-menu-link:hover,
html.dark .gallery-menu-link.is-active-link {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Justified Grid Tiles */
.jig-tile {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-tile);
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.25s ease;
}

.jig-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: filter 0.3s ease, opacity 0.35s ease;
}

.jig-tile img.is-loaded {
  opacity: 1;
}

.jig-tile:hover img.is-loaded {
  filter: brightness(0.82);
}

.jig-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 14px 12px 14px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.35) 62%,
    transparent 100%
  );
  color: #fafafa;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.jig-tile:hover .jig-caption,
.jig-tile:focus-visible .jig-caption {
  opacity: 1;
  transform: translateY(0);
}

.jig-caption-btn {
  pointer-events: auto;
}

/* Lightbox */
#lightbox {
  background-color: var(--lightbox-bg);
  transition: opacity 0.3s ease, background-color 0.3s ease, backdrop-filter 0.3s ease;
}

#lightbox.is-shrinking-close {
  background-color: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

#lightbox.is-shrinking-close .lb-frosted-bar,
#lightbox.is-shrinking-close #lb-stage > button,
#lightbox.is-shrinking-close #lb-details-section {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lb-frosted-bar {
  background-color: rgba(250, 250, 250, 0.78);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

html.dark .lb-frosted-bar {
  background-color: rgba(13, 13, 13, 0.76);
}

#lb-image,
#sp-image {
  transition: opacity 0.2s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-drag: none;
}

#lb-image.lb-zoomable,
#sp-image.lb-zoomable {
  cursor: zoom-in;
  will-change: transform;
}

#lb-image.lb-zoomable.is-zoomed,
#sp-image.lb-zoomable.is-zoomed {
  cursor: grab;
}

#lb-image.lb-zoomable.is-zoomed.is-dragging,
#sp-image.lb-zoomable.is-zoomed.is-dragging {
  cursor: grabbing;
  transition: opacity 0.2s ease;
}

#lb-image.lb-zoomable.is-zoomed.is-coasting,
#sp-image.lb-zoomable.is-zoomed.is-coasting {
  transition: opacity 0.2s ease;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hairline);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Mobile touch-friendly captions on tap/hover */
@media (hover: none) {
  .jig-caption {
    opacity: 1;
    transform: translateY(0);
    padding: 24px 10px 8px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
  }
}

/* Subtle horizontal scrollbar hiding for filter strips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
