/* ═══════════════════════════════════════════════════════
   LIGHT / DARK MODE
   ═══════════════════════════════════════════════════════ */

/* Light mode overrides */
[data-theme="light"] {
  --color-bg:        #f8f6f2;
  --color-surface:   #ffffff;
  --color-surface-2: #f0ece6;
  --color-border:    #e0d9d0;
  --color-text:      #1a1714;
  --color-muted:     #6b6560;
  --color-accent:    #a07840;
  --color-accent-2:  #5c3d1e;
  --color-white:     #1a1714;
}

[data-theme="light"] .site-header {
  background: rgba(248,246,242,0.88);
  border-bottom-color: var(--color-border);
}
[data-theme="light"] .site-header.scrolled {
  background: rgba(248,246,242,0.98);
}
[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    to top,
    rgba(248,246,242,0.92) 0%,
    rgba(248,246,242,0.35) 50%,
    rgba(248,246,242,0.1) 100%
  );
}
[data-theme="light"] .hero-title  { color: #1a1714; }
[data-theme="light"] .hero-subtitle { color: #5c3d1e; }
[data-theme="light"] .lightbox-overlay { background: rgba(248,246,242,0.97); }
[data-theme="light"] .lightbox-img { box-shadow: 0 8px 40px rgba(0,0,0,0.15); }
[data-theme="light"] .lightbox-close,
[data-theme="light"] .lightbox-nav { color: #1a1714; }
[data-theme="light"] .masonry-item { background: var(--color-surface-2); }
[data-theme="light"] .btn-outline {
  border-color: rgba(26,23,20,0.25);
  color: var(--color-text);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  cursor: pointer;
  width: 44px;
  height: 24px;
  position: relative;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.theme-toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  transition: transform var(--transition), background var(--transition);
}
[data-theme="light"] .theme-toggle-knob {
  transform: translateX(20px);
}
.theme-toggle-icon {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}
[data-theme="light"] .theme-toggle-icon { right: auto; left: 6px; }


/* ═══════════════════════════════════════════════════════
   QUICK PAGE EDITOR — INLINE TOOLBAR
   ═══════════════════════════════════════════════════════ */

/* Only visible to logged-in editors */
body.foto-editor-active [data-editable]:hover {
  outline: 2px dashed rgba(201,169,110,0.6);
  outline-offset: 4px;
  cursor: text;
}
body.foto-editor-active [data-editable]:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* Floating Toolbar */
#foto-edit-toolbar {
  position: fixed;
  z-index: 9998;
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 6px 8px;
  display: none;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
#foto-edit-toolbar.visible { display: flex; }

.foto-toolbar-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.foto-toolbar-btn:hover { background: #333; color: #fff; }
.foto-toolbar-btn.active { background: var(--color-accent); color: #0d0d0d; }
.foto-toolbar-divider { width: 1px; height: 18px; background: #333; margin: 0 2px; }

/* Editor Toggle Bar (top bar when editing) */
#foto-editor-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9997;
  background: #0d0d0d;
  border-top: 1px solid #2a2a2a;
  padding: 10px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
#foto-editor-bar.visible { display: flex; }
.foto-editor-bar-left { display: flex; align-items: center; gap: 1rem; }
.foto-editor-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.foto-editor-label { font-size: 0.75rem; color: #888; letter-spacing: 0.08em; text-transform: uppercase; }
.foto-editor-status { font-size: 0.8rem; color: var(--color-accent); }


/* ═══════════════════════════════════════════════════════
   EDITOR PANEL — always dark, never inherits site theme
   All selectors scoped inside #foto-side-panel or
   #foto-editor-bar so light mode can't bleed in.
   ═══════════════════════════════════════════════════════ */

/* Panel CSS custom properties — fixed dark palette */
#foto-side-panel,
#foto-editor-bar {
  --ep-bg:        #111111;
  --ep-surface:   #1a1a1a;
  --ep-surface2:  #222222;
  --ep-border:    #2e2e2e;
  --ep-text:      #e8e4de;
  --ep-muted:     #888880;
  --ep-subtle:    #555550;
  --ep-accent:    #c9a96e;
  --ep-accent-fg: #0d0d0d;
  color-scheme: dark;
}

/* ── Editor bottom bar ──────────────────────────────── */
#foto-editor-bar {
  background: var(--ep-bg) !important;
  border-top: 1px solid var(--ep-border) !important;
  color: var(--ep-text) !important;
}
#foto-editor-bar .btn-outline {
  border-color: var(--ep-border) !important;
  color: var(--ep-muted) !important;
  background: transparent !important;
}
#foto-editor-bar .btn-outline:hover {
  border-color: var(--ep-accent) !important;
  color: var(--ep-accent) !important;
}
#foto-editor-bar .btn-primary {
  background: var(--ep-accent) !important;
  color: var(--ep-accent-fg) !important;
  border-color: var(--ep-accent) !important;
}

/* ── Side panel shell ───────────────────────────────── */
#foto-side-panel {
  position: fixed;
  top: 0; right: 0;
  width: 360px;
  height: 100vh;
  background: var(--ep-bg);
  border-left: 1px solid var(--ep-border);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ep-text);
}
#foto-side-panel.open { transform: translateX(0); }

/* ── Panel header ───────────────────────────────────── */
.foto-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ep-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--ep-bg);
}
.foto-panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ep-accent);
}
.foto-panel-close {
  background: none; border: none;
  color: var(--ep-muted); font-size: 1.25rem;
  cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.foto-panel-close:hover { color: var(--ep-text); }

/* ── Tabs ───────────────────────────────────────────── */
.foto-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--ep-border);
  flex-shrink: 0;
  background: var(--ep-bg);
}
.foto-panel-tab {
  flex: 1; padding: 0.75rem 0.25rem;
  background: none; border: none;
  color: var(--ep-subtle); font-size: 0.68rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.foto-panel-tab:hover { color: var(--ep-muted); }
.foto-panel-tab.active {
  color: var(--ep-accent);
  border-bottom-color: var(--ep-accent);
}

/* ── Body / scroll area ─────────────────────────────── */
.foto-panel-body {
  flex: 1; overflow-y: auto;
  padding: 1.25rem 1.5rem;
  background: var(--ep-bg);
}
.foto-panel-body::-webkit-scrollbar { width: 4px; }
.foto-panel-body::-webkit-scrollbar-track { background: var(--ep-surface); }
.foto-panel-body::-webkit-scrollbar-thumb { background: var(--ep-surface2); border-radius: 2px; }

/* ── Sections ───────────────────────────────────────── */
.foto-panel-section { margin-bottom: 1.5rem; }
.foto-panel-section-title {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ep-subtle); margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--ep-border);
}

/* ── Fields ─────────────────────────────────────────── */
.foto-panel-field { margin-bottom: 0.75rem; }
.foto-panel-field label {
  display: block; font-size: 0.7rem;
  color: var(--ep-muted); margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

/* All inputs/selects/textareas inside the panel — dark always */
#foto-side-panel input:not([type="color"]):not([type="checkbox"]):not([type="range"]),
#foto-side-panel select,
#foto-side-panel textarea {
  width: 100%;
  background: var(--ep-surface) !important;
  border: 1px solid var(--ep-border) !important;
  border-radius: 4px;
  color: var(--ep-text) !important;
  font-size: 0.84rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
#foto-side-panel input:focus,
#foto-side-panel select:focus,
#foto-side-panel textarea:focus {
  border-color: var(--ep-accent) !important;
}
#foto-side-panel select option {
  background: var(--ep-surface2);
  color: var(--ep-text);
}
#foto-side-panel textarea { resize: vertical; min-height: 70px; }

/* range slider */
#foto-side-panel input[type="range"] {
  width: 100%; accent-color: var(--ep-accent);
  background: transparent !important; border: none !important; padding: 0 !important;
}

/* checkboxes */
#foto-side-panel input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--ep-accent);
  cursor: pointer;
}

/* ── Buttons inside panel ───────────────────────────── */
#foto-side-panel .btn-outline {
  border-color: var(--ep-border) !important;
  color: var(--ep-muted) !important;
  background: transparent !important;
}
#foto-side-panel .btn-outline:hover {
  border-color: var(--ep-accent) !important;
  color: var(--ep-accent) !important;
}
#foto-side-panel .btn-primary {
  background: var(--ep-accent) !important;
  color: var(--ep-accent-fg) !important;
  border-color: var(--ep-accent) !important;
}
#foto-side-panel .btn-primary:hover {
  background: #d4b47a !important;
}

/* Column switcher buttons */
.foto-col-btn {
  border: 1px solid var(--ep-border) !important;
  color: var(--ep-muted) !important;
  background: transparent !important;
  border-radius: 4px;
  padding: 0.5rem !important;
  font-size: 0.82rem !important;
  cursor: pointer;
  transition: all 0.2s;
}
.foto-col-btn:hover {
  border-color: var(--ep-accent) !important;
  color: var(--ep-accent) !important;
}
.foto-col-btn.active-col {
  background: var(--ep-accent) !important;
  color: var(--ep-accent-fg) !important;
  border-color: var(--ep-accent) !important;
}

/* Upload / misc action buttons */
.foto-panel-upload-btn {
  width: 100%;
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: 4px;
  color: var(--ep-muted);
  font-size: 0.75rem;
  padding: 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, color 0.2s;
  display: block;
  margin-top: 4px;
}
.foto-panel-upload-btn:hover {
  border-color: var(--ep-accent);
  color: var(--ep-accent);
}

/* Color row */
.foto-panel-color-row {
  display: flex; align-items: center; gap: 0.5rem;
}
.foto-panel-color-row span { color: var(--ep-subtle) !important; }
.foto-panel-color-row input[type="color"] {
  width: 36px; height: 36px; padding: 2px;
  border-radius: 4px; cursor: pointer;
  border: 1px solid var(--ep-border) !important;
  background: var(--ep-surface) !important;
}

/* Image preview box */
.foto-panel-img-preview {
  width: 100%; aspect-ratio: 16/9;
  background: var(--ep-surface2);
  border: 1px dashed var(--ep-border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 6px; cursor: pointer;
  position: relative; transition: border-color 0.2s;
}
.foto-panel-img-preview:hover { border-color: var(--ep-accent); }
.foto-panel-img-preview img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.foto-panel-img-placeholder { text-align:center; color: var(--ep-subtle); font-size:0.8rem; }

/* ── Footer ─────────────────────────────────────────── */
.foto-panel-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ep-border);
  display: flex; gap: 0.5rem;
  flex-shrink: 0;
  background: var(--ep-bg);
}
.foto-panel-footer .btn { flex: 1; justify-content: center; font-size: 0.75rem; padding: 0.65rem; }


/* ═══════════════════════════════════════════════════════
   CLIENT PORTAL
   ═══════════════════════════════════════════════════════ */

.client-portal-wrap {
  min-height: calc(100vh - var(--nav-height));
  padding: var(--space-xl) 0;
}

/* Login Page */
.client-login-box {
  max-width: 440px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}
.client-login-box h2 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}
.client-login-box .eyebrow { display: block; margin-bottom: 1rem; }

/* Portal Dashboard */
.portal-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
  margin-bottom: var(--space-xl);
}
.portal-header-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.portal-welcome { font-size: 0.85rem; color: var(--color-muted); }
.portal-welcome strong { color: var(--color-text); }

/* Gallery Grid */
.portal-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.portal-gallery-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
}
.portal-gallery-card:hover { border-color: var(--color-accent); transform: translateY(-3px); }
.portal-gallery-thumb {
  aspect-ratio: 4/3;
  background: var(--color-surface-2);
  position: relative; overflow: hidden;
}
.portal-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.portal-gallery-info { padding: 1rem; }
.portal-gallery-name { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 0.25rem; }
.portal-gallery-meta { font-size: 0.75rem; color: var(--color-muted); }

/* Photo Grid inside gallery */
.portal-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.portal-photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  cursor: pointer;
}
.portal-photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* prevent right-click save */
}
.portal-photo-item:hover img { transform: scale(1.04); }

/* Watermark overlay (CSS layer — server-side watermark is on the image itself) */
.portal-photo-item.locked::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(13,13,13,0.35);
}

/* Lock badge */
.photo-lock-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(13,13,13,0.8);
  color: var(--color-accent);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* Free badge */
.photo-free-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(76,175,80,0.9);
  color: #fff;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Select checkbox */
.photo-select-check {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.portal-photo-item.selected .photo-select-check {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.portal-photo-item.selected .photo-select-check::after {
  content: '✓';
  color: #0d0d0d;
  font-size: 11px;
  font-weight: 700;
}

/* Download bar */
.portal-download-bar {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1rem var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.portal-download-bar-left { font-size: 0.85rem; color: var(--color-muted); }
.portal-download-bar-left strong { color: var(--color-text); }
.portal-quota-bar {
  width: 160px; height: 4px;
  background: var(--color-border);
  border-radius: 2px; margin-top: 4px;
}
.portal-quota-fill {
  height: 100%; border-radius: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

/* Payment modal */
.foto-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.foto-modal-overlay.open { opacity: 1; pointer-events: all; }
.foto-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 90%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  padding: var(--space-xl);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.foto-modal-overlay.open .foto-modal { transform: translateY(0); }
.foto-modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.foto-modal-close { background: none; border: none; color: var(--color-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.foto-modal-close:hover { color: var(--color-text); }

.payment-option {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex; align-items: center; gap: 1rem;
}
.payment-option:hover { border-color: var(--color-accent); background: rgba(201,169,110,0.05); }
.payment-option.selected { border-color: var(--color-accent); background: rgba(201,169,110,0.1); }
.payment-option-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition);
}
.payment-option.selected .payment-option-radio { border-color: var(--color-accent); }
.payment-option.selected .payment-option-radio::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-accent);
}
.payment-option-info { flex: 1; }
.payment-option-name { font-weight: 600; margin-bottom: 0.2rem; }
.payment-option-desc { font-size: 0.8rem; color: var(--color-muted); }
.payment-option-price { font-family: var(--font-display); font-size: 1.5rem; color: var(--color-accent); }

/* Stripe card element placeholder */
#stripe-card-element {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  min-height: 44px;
}
#stripe-card-element:focus-within { border-color: var(--color-accent); }

@media (max-width: 768px) {
  .portal-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .portal-gallery-grid { grid-template-columns: 1fr 1fr; }
  #foto-side-panel { width: 100%; }
}
@media (max-width: 480px) {
  .portal-gallery-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   ADMIN BAR OFFSET — prevents nav being hidden behind WP bar
   ═══════════════════════════════════════════════════════ */

/* WordPress admin bar is 32px tall on desktop */
.admin-bar .site-header,
.admin-bar .site-header.is-admin-bar {
    top: 32px !important;
}

/* Hero must also account for admin bar height */
.admin-bar .hero {
    margin-top: 0;
}

/* The main content needs no extra padding-top since hero is full-height */
.site-main {
    padding-top: 0 !important;
}

/* Hero is always 100vh minus nav — admin bar pushes everything down automatically */
.admin-bar .site-header { top: 32px; }

@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

/* ── Hero Background via inline option (set by side panel) ── */
.hero-bg[data-foto-bg] {
    background-image: var(--foto-hero-bg-url);
}

/* ── Side Panel Image Upload Preview ───────────────────── */
.foto-panel-img-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #1c1c1c;
    border: 1px dashed #3a3a3a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.5rem;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}
.foto-panel-img-preview:hover { border-color: var(--color-accent); }
.foto-panel-img-preview img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute; inset: 0;
}
.foto-panel-img-placeholder {
    text-align: center;
    color: #555;
    font-size: 0.8rem;
}
.foto-panel-img-placeholder span {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.25rem;
}
.foto-panel-upload-btn {
    width: 100%;
    background: #1c1c1c;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    color: #ccc;
    font-size: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, color 0.2s;
}
.foto-panel-upload-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ═══════════════════════════════════════════════════════
   Header account + automatic theme controls
   ═══════════════════════════════════════════════════════ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 1rem;
  flex-shrink: 0;
}
.nav-login-btn,
.nav-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-login-btn:hover,
.nav-edit-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.nav-actions .theme-toggle {
  width: 48px;
  height: 26px;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
}
[data-theme-mode="auto"] .theme-toggle {
  border-color: var(--color-accent);
}
[data-theme-mode="auto"] .theme-toggle-knob {
  left: 50%;
  transform: translateX(-50%);
}
[data-theme="light"][data-theme-mode="auto"] .theme-toggle-knob {
  transform: translateX(-50%);
}
[data-theme-mode="auto"] .theme-toggle-icon {
  left: 6px;
  right: 6px;
  width: auto;
  text-align: center;
  color: var(--color-accent);
  font-size: 9px;
  font-weight: 800;
}

/* Keep the WP media picker above the custom front-end editor panel. */
.media-modal,
.media-modal-backdrop,
.media-frame,
.media-router,
.media-toolbar {
  z-index: 1000000 !important;
}
.media-modal-backdrop { z-index: 999999 !important; }

/* More complete light-mode coverage for sections/cards/forms. */
[data-theme="light"] body {
  background: var(--color-bg);
  color: var(--color-text);
}
[data-theme="light"] .site-main,
[data-theme="light"] .section,
[data-theme="light"] #portfolio,
[data-theme="light"] #pricing,
[data-theme="light"] #contact {
  background: var(--color-bg);
  color: var(--color-text);
}
[data-theme="light"] #stats-bar,
[data-theme="light"] #about,
[data-theme="light"] #testimonials,
[data-theme="light"] .site-footer,
[data-theme="light"] .pricing-card,
[data-theme="light"] .testimonial-card,
[data-theme="light"] .contact-form,
[data-theme="light"] .contact-detail,
[data-theme="light"] article {
  background: var(--color-surface) !important;
  color: var(--color-text);
  border-color: var(--color-border) !important;
}
[data-theme="light"] .stat-number,
[data-theme="light"] .section-header h2,
[data-theme="light"] .about-content h2,
[data-theme="light"] .pricing-name,
[data-theme="light"] .testimonial-name,
[data-theme="light"] .contact-info h2,
[data-theme="light"] .site-logo {
  color: var(--color-text);
}
[data-theme="light"] .stat-label,
[data-theme="light"] .pricing-desc,
[data-theme="light"] .testimonial-meta,
[data-theme="light"] .contact-info p,
[data-theme="light"] .footer-brand p,
[data-theme="light"] .footer-links a,
[data-theme="light"] .form-group label,
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
  color: var(--color-muted);
}
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
  background: var(--color-surface-2);
  border-color: var(--color-border);
}
[data-theme="light"] .masonry-overlay {
  background: linear-gradient(to top, rgba(248,246,242,0.88) 0%, transparent 65%);
}
[data-theme="light"] .masonry-item-title { color: var(--color-text); }
[data-theme="light"] .masonry-item-category { color: var(--color-accent); }
[data-theme="light"] .filter-btn {
  background: transparent;
  color: var(--color-muted);
  border-color: var(--color-border);
}
[data-theme="light"] .filter-btn.active,
[data-theme="light"] .filter-btn:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

@media (max-width: 900px) {
  .nav-actions { gap: 0.45rem; margin-left: auto; }
  .nav-login-btn { padding: 0.45rem 0.65rem; font-size: 0.62rem; }
  .nav-edit-btn { display: none; }
}
@media (max-width: 640px) {
  .nav-login-btn { max-width: 94px; overflow: hidden; text-overflow: ellipsis; }
  .nav-actions .theme-toggle { width: 42px; }
}

/* v3.2.7 fixes: about image should be a single fixed portrait frame. */
.about-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.about-image-frame img,
.about-image > img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 4 / 5;
  object-fit: cover !important;
  border-radius: var(--radius-md);
  display: block;
}
.about-image-frame .about-placeholder { pointer-events: none; }

/* v3.2.7 fixes: complete light mode coverage. Supports html or body carrying the data attribute. */
html[data-theme="light"],
body[data-theme="light"],
html.theme-light,
body.theme-light {
  --color-bg:        #f8f6f2 !important;
  --color-surface:   #ffffff !important;
  --color-surface-2: #f0ece6 !important;
  --color-border:    #ded6ca !important;
  --color-text:      #1a1714 !important;
  --color-muted:     #655f58 !important;
  --color-accent:    #a07840 !important;
  --color-accent-2:  #5c3d1e !important;
  --color-white:     #1a1714 !important;
  background: #f8f6f2 !important;
  color: #1a1714 !important;
}

html[data-theme="light"] body,
html.theme-light body,
body[data-theme="light"] {
  background: #f8f6f2 !important;
  color: #1a1714 !important;
}

html[data-theme="light"] .site-header,
html.theme-light .site-header,
body[data-theme="light"] .site-header {
  background: rgba(248,246,242,0.94) !important;
  border-bottom-color: #ded6ca !important;
}
html[data-theme="light"] .site-logo,
html.theme-light .site-logo,
body[data-theme="light"] .site-logo,
html[data-theme="light"] .nav-menu a,
html.theme-light .nav-menu a,
body[data-theme="light"] .nav-menu a {
  color: #1a1714 !important;
}
html[data-theme="light"] .site-logo span,
html.theme-light .site-logo span,
body[data-theme="light"] .site-logo span,
html[data-theme="light"] .eyebrow,
html.theme-light .eyebrow,
body[data-theme="light"] .eyebrow {
  color: #a07840 !important;
}

html[data-theme="light"] .hero-overlay,
html.theme-light .hero-overlay,
body[data-theme="light"] .hero-overlay {
  background: linear-gradient(to top, rgba(248,246,242,0.92) 0%, rgba(248,246,242,0.62) 45%, rgba(248,246,242,0.38) 100%) !important;
}
html[data-theme="light"] .hero-title,
html[data-theme="light"] .hero-subtitle,
html.theme-light .hero-title,
html.theme-light .hero-subtitle,
body[data-theme="light"] .hero-title,
body[data-theme="light"] .hero-subtitle {
  color: #1a1714 !important;
  text-shadow: none !important;
}

html[data-theme="light"] .site-main,
html[data-theme="light"] main,
html[data-theme="light"] section,
html[data-theme="light"] .section,
html[data-theme="light"] #portfolio,
html[data-theme="light"] #pricing,
html[data-theme="light"] #contact,
html[data-theme="light"] .page-section,
html.theme-light .site-main,
html.theme-light main,
html.theme-light section,
html.theme-light .section,
html.theme-light #portfolio,
html.theme-light #pricing,
html.theme-light #contact,
html.theme-light .page-section,
body[data-theme="light"] .site-main,
body[data-theme="light"] main,
body[data-theme="light"] section,
body[data-theme="light"] .section,
body[data-theme="light"] #portfolio,
body[data-theme="light"] #pricing,
body[data-theme="light"] #contact,
body[data-theme="light"] .page-section {
  background-color: #f8f6f2 !important;
  color: #1a1714 !important;
}

html[data-theme="light"] #stats-bar,
html[data-theme="light"] #about,
html[data-theme="light"] #testimonials,
html[data-theme="light"] .site-footer,
html.theme-light #stats-bar,
html.theme-light #about,
html.theme-light #testimonials,
html.theme-light .site-footer,
body[data-theme="light"] #stats-bar,
body[data-theme="light"] #about,
body[data-theme="light"] #testimonials,
body[data-theme="light"] .site-footer {
  background-color: #ffffff !important;
  color: #1a1714 !important;
  border-color: #ded6ca !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] p,
html.theme-light h1,
html.theme-light h2,
html.theme-light h3,
html.theme-light h4,
html.theme-light p,
body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] h4,
body[data-theme="light"] p {
  color: inherit;
}
html[data-theme="light"] .about-content p,
html[data-theme="light"] .pricing-desc,
html[data-theme="light"] .pricing-features li,
html[data-theme="light"] .testimonial-meta,
html.theme-light .about-content p,
html.theme-light .pricing-desc,
html.theme-light .pricing-features li,
html.theme-light .testimonial-meta,
body[data-theme="light"] .about-content p,
body[data-theme="light"] .pricing-desc,
body[data-theme="light"] .pricing-features li,
body[data-theme="light"] .testimonial-meta {
  color: #655f58 !important;
}
html[data-theme="light"] .btn-outline,
html.theme-light .btn-outline,
body[data-theme="light"] .btn-outline {
  color: #1a1714 !important;
  border-color: rgba(26,23,20,0.32) !important;
  background: transparent !important;
}
html[data-theme="light"] .btn-primary,
html.theme-light .btn-primary,
body[data-theme="light"] .btn-primary {
  background: #c9a96e !important;
  color: #1a1714 !important;
}

/* v3.2.8 fixes: editable about badge, mobile/tablet layout, stronger light/dark mode coverage. */
.about-image-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 132px;
  min-height: 132px;
  padding: 1rem;
  text-align: center;
  overflow: hidden;
}
.about-image-badge span {
  display: block;
  max-width: 110px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  letter-spacing: 0.12em;
}
.about-image-badge strong { line-height: 1; }

html[data-theme="dark"],
body[data-theme="dark"],
html.theme-dark,
body.theme-dark {
  --color-bg:        #0d0d0d !important;
  --color-surface:   #141414 !important;
  --color-surface-2: #1a1a1a !important;
  --color-border:    #2a2a2a !important;
  --color-text:      #f0ece6 !important;
  --color-muted:     #888880 !important;
  --color-white:     #ffffff !important;
  background: #0d0d0d !important;
  color: #f0ece6 !important;
}
html[data-theme="light"] .site-main,
html[data-theme="light"] main,
html[data-theme="light"] section,
html[data-theme="light"] .section,
html[data-theme="light"] .section--sm,
html[data-theme="light"] #stats-bar,
html[data-theme="light"] #about,
html[data-theme="light"] #portfolio,
html[data-theme="light"] #pricing,
html[data-theme="light"] #testimonials,
html[data-theme="light"] #contact,
html[data-theme="light"] .site-footer,
html.theme-light .site-main,
html.theme-light main,
html.theme-light section,
html.theme-light .section,
html.theme-light .section--sm,
html.theme-light #stats-bar,
html.theme-light #about,
html.theme-light #portfolio,
html.theme-light #pricing,
html.theme-light #testimonials,
html.theme-light #contact,
html.theme-light .site-footer,
body[data-theme="light"] .site-main,
body[data-theme="light"] main,
body[data-theme="light"] section,
body[data-theme="light"] .section,
body[data-theme="light"] .section--sm,
body[data-theme="light"] #stats-bar,
body[data-theme="light"] #about,
body[data-theme="light"] #portfolio,
body[data-theme="light"] #pricing,
body[data-theme="light"] #testimonials,
body[data-theme="light"] #contact,
body[data-theme="light"] .site-footer {
  background-color: var(--color-bg) !important;
  color: var(--color-text) !important;
}
html[data-theme="light"] #stats-bar,
html[data-theme="light"] #about,
html.theme-light #stats-bar,
html.theme-light #about,
body[data-theme="light"] #stats-bar,
body[data-theme="light"] #about {
  background-color: var(--color-surface) !important;
}
html[data-theme="light"] .hero-title,
html[data-theme="light"] .hero-subtitle,
html[data-theme="light"] .site-logo,
html[data-theme="light"] .nav-menu a,
html[data-theme="light"] .section-header h2,
html[data-theme="light"] .about-content h2,
html[data-theme="light"] .stat-number,
html.theme-light .hero-title,
html.theme-light .hero-subtitle,
html.theme-light .site-logo,
html.theme-light .nav-menu a,
html.theme-light .section-header h2,
html.theme-light .about-content h2,
html.theme-light .stat-number,
body[data-theme="light"] .hero-title,
body[data-theme="light"] .hero-subtitle,
body[data-theme="light"] .site-logo,
body[data-theme="light"] .nav-menu a,
body[data-theme="light"] .section-header h2,
body[data-theme="light"] .about-content h2,
body[data-theme="light"] .stat-number {
  color: var(--color-text) !important;
}
html[data-theme="light"] .site-logo span,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .stat-number,
html.theme-light .site-logo span,
html.theme-light .eyebrow,
html.theme-light .stat-number,
body[data-theme="light"] .site-logo span,
body[data-theme="light"] .eyebrow,
body[data-theme="light"] .stat-number {
  color: var(--color-accent) !important;
}

@media (max-width: 1180px) {
  .hero-content { max-width: 760px; }
  .about-strip { gap: 2rem; }
  .about-content h2 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
}

@media (max-width: 1024px) {
  .container { width: min(100% - 2rem, var(--container-max)); }
  .hero { min-height: 78vh; }
  .hero-title { font-size: clamp(3.2rem, 10vw, 7rem); }
  #stats-bar .container > div { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 2rem 1rem !important; }
  .about-strip { grid-template-columns: 1fr !important; }
  .about-image { max-width: 620px; margin-inline: auto; }
  .about-content { max-width: 720px; margin-inline: auto; text-align: left; }
  .masonry-grid { columns: 2 !important; }
}

@media (max-width: 768px) {
  .site-header .container { width: calc(100% - 1rem); }
  .nav-inner { min-height: 64px; gap: 0.5rem; }
  .site-logo { font-size: clamp(1.05rem, 5vw, 1.45rem); max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-actions { gap: 0.35rem; margin-left: auto; }
  .nav-login-btn { min-height: 32px; padding: 0.4rem 0.5rem; font-size: 0.58rem; max-width: 102px; }
  .nav-actions .theme-toggle { width: 40px; height: 24px; }
  .hero { min-height: 72vh; padding-top: calc(var(--nav-height) + 2rem); }
  .hero-content { padding-inline: 0; }
  .hero-title { font-size: clamp(2.9rem, 13vw, 5rem); line-height: 0.95; }
  .hero-actions { flex-direction: column; align-items: stretch; max-width: 360px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .section, .section--sm { padding-block: 4rem; }
  .section-header { gap: 1rem; }
  .section-header h2 { font-size: clamp(2.6rem, 12vw, 4.5rem); }
  .portfolio-filter { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; }
  .portfolio-filter .filter-btn { flex: 0 0 auto; }
  .masonry-grid { columns: 1 !important; }
  .about-image-badge { min-width: 104px; min-height: 104px; padding: 0.7rem; }
  .about-image-badge strong { font-size: 1.7rem; }
  .about-image-badge span { max-width: 86px; font-size: 0.58rem; }
  .about-content h2 { font-size: clamp(2.3rem, 11vw, 4rem); }
  .pricing-grid, .testimonials-grid, .contact-grid, .footer-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 1.25rem); }
  .nav-edit-btn { display: none !important; }
  .hero-title { font-size: clamp(2.5rem, 15vw, 4rem); }
  #stats-bar .container > div { grid-template-columns: 1fr !important; }
  .about-image-badge { position: absolute; right: 0.75rem; bottom: 0.75rem; }
}

/* v3.2.9 fixes: stats edit/remove, reliable about image, responsive polish */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  text-align: center;
}
.stat-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: var(--color-accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.35rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.about-image-frame > img.foto-about-front-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; gap: 1rem; }
  .stat-card { padding: 0.75rem 0; }
}
