/*
Theme Name: OrganicMinds Gallery
Theme URI: https://work.organicminds.design/
Author: OrganicMinds Studio
Author URI: https://organicminds.design/
Description: Standalone, ultra-fast, Behance-inspired Portfolio & Case Study WordPress theme for OrganicMinds — built exclusively for Brand Design, Creative Graphics, and Persona Storytelling with zero plugin bloat.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: organicminds-gallery
*/

:root {
  --sand: #faf9f5;
  --forest: #14281d;
  --moss: #2d5a3f;
  --sage: #88a990;
  --white: #ffffff;
  --surface-subtle: #f3f1ea;
  --line: rgba(45, 90, 63, 0.14);
  --muted: #5e6d63;
  --radius: 24px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 40, 29, 0.04), 0 12px 32px -12px rgba(20, 40, 29, 0.12);
  --shadow-lg: 0 30px 60px -24px rgba(20, 40, 29, 0.28);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, monospace;
  --wrap: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

.dark {
  --sand: #0a110d;
  --forest: #eef4ee;
  --moss: #88a990;
  --sage: #88a990;
  --white: #15211a;
  --surface-subtle: #0e1712;
  --line: rgba(136, 169, 144, 0.2);
  --muted: #9eb0a3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 34px -14px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, 0.78);
  color-scheme: dark;
}

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

html {
  font-family: var(--font);
  background: var(--sand);
  color: var(--forest);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sand);
  color: var(--forest);
  line-height: 1.6;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

body.om-modal-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
.font-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.om-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.om-main { flex: 1 0 auto; }

/* Minimal Sticky Header */
.om-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.dark .om-header { background: rgba(10, 17, 13, 0.92); }
.om-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 70px;
}
.om-brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.om-brand-dot { color: var(--sage); }

.om-filter-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-subtle);
}
.om-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 180ms var(--ease), background-color 180ms var(--ease);
}
.om-filter-btn:hover { color: var(--forest); }
.om-filter-btn.is-active { background: var(--moss); color: #ffffff; }
.dark .om-filter-btn.is-active { background: var(--sage); color: #0a110d; font-weight: 600; }

.om-back-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.om-back-inline:hover { color: var(--forest); }
.om-header-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

/* Buttons */
.om-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease);
}
.om-btn:focus-visible, .om-card-trigger:focus-visible, .om-filter-btn:focus-visible, .om-modal-close:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}
.om-btn-sm { padding: 10px 16px; font-size: 0.8125rem; }
.om-btn-primary { background: var(--moss); color: #ffffff; }
.om-btn-primary:hover { background: #234731; transform: translateY(-1px); }
.dark .om-btn-primary { background: var(--sage); color: #0a110d; }
.dark .om-btn-primary:hover { background: #a5c4ad; }
.om-btn-ghost { background: transparent; color: var(--forest); border-color: var(--line); }
.om-btn-ghost:hover { border-color: var(--sage); background: var(--surface-subtle); transform: translateY(-1px); }

/* Celestial Dark/Light Toggle */
.om-celestial-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 64px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  background: #102017;
}
.om-sky-day, .om-sky-night { position: absolute; inset: 0; transition: opacity 260ms var(--ease); }
.om-sky-day { background: linear-gradient(180deg, #8ec5e8 0%, #cde7f5 100%); opacity: 0; }
.om-sky-night { background: linear-gradient(180deg, #0b1610 0%, #172b20 100%); opacity: 1; }
.om-celestial-toggle.is-light .om-sky-day { opacity: 1; }
.om-celestial-toggle.is-light .om-sky-night { opacity: 0; }
.om-stars-layer, .om-clouds-layer {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  transition: opacity 240ms var(--ease), transform 260ms var(--ease);
}
.om-celestial-toggle.is-light .om-stars-layer { opacity: 0; transform: translateY(-6px); }
.om-celestial-toggle.is-dark .om-clouds-layer { opacity: 0; transform: translateY(8px); }
.om-celestial-orb {
  position: relative; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  transform: translateX(37px); transition: transform 260ms var(--ease);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); overflow: hidden;
}
.om-celestial-toggle.is-light .om-celestial-orb { transform: translateX(3px); }
.om-orb-sun, .om-orb-moon { position: absolute; inset: 0; border-radius: 50%; transition: opacity 220ms var(--ease); }
.om-orb-sun { background: radial-gradient(circle at 35% 35%, #fff5cc 0%, #f5c542 65%, #e5a920 100%); opacity: 0; }
.om-orb-moon { background: radial-gradient(circle at 35% 35%, #f4f7f5 0%, #cfd8d2 70%, #aab8af 100%); opacity: 1; }
.om-celestial-toggle.is-light .om-orb-sun { opacity: 1; }
.om-celestial-toggle.is-light .om-orb-moon { opacity: 0; }

/* Archive Intro */
.om-archive-intro { padding: 56px 0 36px; }
.om-intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.om-kicker { margin: 0 0 12px; font-size: 0.75rem; color: var(--sage); letter-spacing: 0.02em; }
.om-h1 {
  margin: 0; max-width: 18ch; font-size: clamp(2rem, 3.6vw, 3.125rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance;
}
.om-h2 {
  margin: 0 0 12px; font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance;
}
.om-intro-lead { margin: 0; max-width: 40ch; font-size: 0.9375rem; color: var(--muted); }
.om-mobile-filters { display: none; margin-top: 24px; gap: 8px; flex-wrap: wrap; }

/* Behance-Style 3-Column Grid */
.om-grid-section { padding: 8px 0 88px; }
.om-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 26px; }
.om-card { display: flex; flex-direction: column; }
.om-card.is-filtered-out { display: none; }
.om-card-trigger {
  display: flex; flex-direction: column; height: 100%; border-radius: var(--radius);
  overflow: hidden; background: var(--white); border: 1px solid var(--line);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease);
}
.om-card-trigger:hover { transform: translateY(-4px); border-color: var(--sage); }
.om-card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-subtle); }
.om-card-media img {
  width: 100%; height: 100%; object-fit: cover; transform: scale(1);
  transition: transform 360ms var(--ease); will-change: transform;
}
.om-card-trigger:hover .om-card-media img { transform: scale(1.038); }
.om-card-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.75rem; }
.om-card-caption { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.om-card-meta { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--muted); }
.om-card-title { margin: 0; font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.om-card-excerpt {
  margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.om-empty-filter, .om-empty-state {
  padding: 64px 28px; text-align: center; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--white);
}
.om-empty-state p { max-width: 52ch; margin: 12px auto 24px; color: var(--muted); }
.om-empty-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Pop-Out Modal (GPU Transform & Opacity Only) */
.om-modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease);
}
.om-modal.is-open { opacity: 1; pointer-events: auto; }
.om-modal[hidden] { display: none; }
.om-modal-backdrop { position: absolute; inset: 0; background: rgba(6, 11, 8, 0.78); backdrop-filter: blur(8px); }
.om-modal-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 960px; max-height: calc(100vh - 48px);
  overflow-y: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white);
  box-shadow: var(--shadow-lg); transform: translateY(16px) scale(0.97); opacity: 0;
  transition: transform 240ms var(--ease), opacity 220ms var(--ease); will-change: transform, opacity;
}
.om-modal.is-open .om-modal-dialog { transform: translateY(0) scale(1); opacity: 1; }
.om-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 3; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(10, 17, 13, 0.72);
  color: #eef4ee; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.om-modal-figure { margin: 0; }
.om-modal-media { aspect-ratio: 4 / 3; max-height: 58vh; width: 100%; overflow: hidden; background: var(--surface-subtle); }
.om-modal-media img { width: 100%; height: 100%; object-fit: cover; }
.om-modal-caption {
  padding: 12px 32px; font-size: 0.75rem; line-height: 1.55; color: var(--muted);
  background: var(--surface-subtle); border-bottom: 1px solid var(--line);
}
.om-modal-body { padding: 28px 32px 32px; }
.om-modal-meta { font-size: 0.75rem; color: var(--sage); margin-bottom: 10px; }
.om-modal-title { margin: 0 0 12px; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.om-modal-desc { margin: 0 0 26px; max-width: 68ch; font-size: 0.96875rem; line-height: 1.65; color: var(--muted); }
.om-modal-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Dedicated Individual Case Study Page */
.om-single-header { padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.om-single-head-inner { max-width: 900px; }
.om-back-link {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  font-size: 0.875rem; font-weight: 600; color: var(--sage);
}
.om-back-link:hover { color: var(--forest); }
.om-single-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.75rem; color: var(--muted); margin-bottom: 14px; }
.om-single-title { margin: 0 0 18px; font-size: clamp(2.125rem, 4.4vw, 3.5rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; }
.om-single-story { font-size: 1.0625rem; line-height: 1.7; color: var(--muted); max-width: 68ch; }
.om-single-story p { margin: 0 0 14px; }
.om-single-story p:last-child { margin-bottom: 0; }
.om-single-gallery { padding: 44px 0 64px; }
.om-plate-stack { display: flex; flex-direction: column; gap: 36px; }
.om-gallery-plate { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--white); }
.om-gallery-plate img { width: 100%; height: auto; cursor: zoom-in; background: var(--surface-subtle); }
.om-plate-caption {
  padding: 16px 24px; font-size: 0.75rem; line-height: 1.6; color: var(--muted);
  background: var(--white); border-top: 1px solid var(--line);
}
.om-single-pager { border-top: 1px solid var(--line); padding: 36px 0; }
.om-pager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.om-pager-right { text-align: right; }
.om-pager-link { display: inline-flex; flex-direction: column; gap: 6px; }
.om-pager-label { font-size: 0.75rem; color: var(--sage); }
.om-pager-link strong { font-size: 1.125rem; letter-spacing: -0.015em; }
.om-cta-band { padding: 20px 0 88px; }
.om-cta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 44px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white);
}
.om-cta-copy { margin: 0; max-width: 52ch; color: var(--muted); }
.om-cta-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

/* Plate Lightbox */
.om-lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; }
.om-lightbox[hidden] { display: none; }
.om-lightbox-backdrop { position: absolute; inset: 0; background: rgba(6, 11, 8, 0.92); }
.om-lightbox-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; max-width: 94vw; max-height: 90vh; }
.om-lightbox img { max-width: 94vw; max-height: 80vh; border-radius: var(--radius-sm); object-fit: contain; }
.om-lightbox-caption { margin: 14px 0 0; max-width: 72ch; text-align: center; font-size: 0.75rem; line-height: 1.6; color: #c7d4cb; }
.om-lightbox-close {
  position: absolute; top: 20px; right: 24px; z-index: 2; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(10, 17, 13, 0.8);
  color: #ffffff; font-size: 1.5rem; line-height: 1; cursor: pointer;
}

/* Footer */
.om-footer { border-top: 1px solid var(--line); padding: 36px 0; background: var(--surface-subtle); }
.om-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.om-footer-note { margin: 6px 0 0; font-size: 0.8125rem; color: var(--muted); }
.om-footer-links { display: flex; align-items: center; gap: 24px; font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.om-footer-links a:hover { color: var(--forest); }
.om-footer-copy { margin: 0; font-size: 0.8125rem; color: var(--muted); }

@media (max-width: 1024px) {
  .om-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .om-intro-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .om-cta-box { flex-direction: column; align-items: flex-start; padding: 32px; }
}
@media (max-width: 820px) {
  .om-header .om-filter-nav { display: none; }
  .om-mobile-filters { display: flex; }
}
@media (max-width: 640px) {
  .om-header-inner { height: 62px; gap: 12px; }
  .om-wrap { padding: 0 18px; }
  .om-grid { grid-template-columns: 1fr; gap: 24px; }
  .om-modal { padding: 12px; }
  .om-modal-caption { padding: 12px 20px; }
  .om-modal-body { padding: 20px 20px 24px; }
  .om-pager-grid { grid-template-columns: 1fr; }
  .om-pager-right { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
