@import url('variables.css');

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  padding: 48px 4%;
}

/* ==========================================================================
   HEADER & NAVIGATION (DESKTOP)
   ========================================================================== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  position: relative;
}

/*
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  position: relative;
  max-width: 1400px; /* Matches content-container--wide 
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
*/


.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
}

.site-logo {
  height: 120px;
  width: auto;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.site-title {
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.015em;
  color: var(--color-text);
  line-height: 1;
}

/* Desktop Navigation */
.site-nav,
.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav ul,
.nav-menu ul {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a,
.nav-menu a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 400;
  transition: opacity 0.2s ease;
}

.site-nav a:hover,
.nav-menu a:hover {
  opacity: 0.5;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.mobile-menu-toggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 4px 0;
  background-color: var(--color-text);
  transition: all 0.3s ease;
}

/* ==========================================================================
   PORTFOLIO GALLERY IMAGE GRID & ITEM CARDS
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-section-header {
  margin-bottom: 2rem;
}

.gallery-section-header h1,
.gallery-section-header h2 {
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.5;
}

.gallery-item-card {
  display: flex;
  flex-direction: column;
  position: relative;
}

.gallery-item {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Aspect ratio for gallery thumbnails */
.image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 3;
  overflow: hidden;
  background-color: #f4f4f4;
  border-radius: 5px;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
  border-radius: 5px;
}

.gallery-item:hover .image-wrapper img {
  opacity: 0.75;
}

.item-meta {
  margin-top: 12px;
}

.item-title {
  display: block;
  font-weight: 500;
  font-size: 0.925rem;
  line-height: 1.25;
  color: var(--color-text);
}

.item-category {
  display: block;
  font-size: 0.825rem;
  color: var(--color-muted);
  margin-top: 3px;
  font-weight: 400;
}

.item-sale-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.item-price {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.inquire-btn {
  font-size: 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  transition: all 0.2s ease;
}

.inquire-btn:hover {
  background-color: var(--color-text);
  color: var(--color-bg);
}

.status-sold {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

/* Hide secondary gallery links off-screen so PhotoSwipe can process them cleanly */
.offscreen-gallery-views {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================================================================
   PHOTOSWIPE TOUCH & CAPTION STYLES
   ========================================================================== */
.pswp__img {
  border-radius: 8px;
}

.pswp__caption-wrapper {
  display: flex !important;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 15px;
  height: 100%;
}

/* 
Caption floating over the image on destop and under the image on mobile.
It looks good on mobile but not as good on desktop.

.pswp__custom-caption {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  z-index: 1000;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
} */

/* 
Caption along the bottom of the lightbox image.
This looks the best on both destop and mobile
*/
/* Base Styles: Mobile First */
.pswp__custom-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 0.95rem; /* Standard mobile size */
  line-height: 1.4;
  text-align: center;
  z-index: 1000;
  box-sizing: border-box;
}

/* Caption Desktop Override. Makes the text slightly larger on destop */
@media (min-width: 768px) {
  .pswp__custom-caption {
    font-size: 1.25rem; /* Larger font size for desktop (~20px) */
    padding: 20px 32px;
  }
}

/* Prevent native image drag blocking PhotoSwipe touch gestures */
.pswp,
.pswp__scroll-wrap,
.pswp__container,
.pswp__item,
.pswp__content,
.pswp__img {
  touch-action: pan-y pinch-zoom !important;
  -webkit-user-select: none;
  user-select: none;
}

/* Safely conceal secondary gallery links off-screen without breaking PhotoSwipe touch measurements */
.pswp-hidden-group {
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pswp-hidden-group img {
  width: 1px !important;
  height: 1px !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 100px;
  padding-top: 20px;
  font-size: 1.0rem;
  color: var(--color-muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & NAVIGATION (768px and below)
   ========================================================================== */
@media screen and (max-width: 768px) {
  .site-logo {
    height: 60px;
    max-height: 60px;
  }

  .site-title {
    font-size: 1.1rem;
    white-space: nowrap;
  }

  .brand-link {
    gap: 8px;
  }

  .site-wrapper {
    padding: 24px 20px;
  }

  .site-header {
    margin-bottom: 36px;
  }

  .site-footer {
    font-size: 0.7rem;
    margin-top: 60px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
  }

  .mobile-menu-toggle {
    display: block !important;
    position: relative;
    z-index: 1001;
  }

  .site-nav,
  .nav-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background-color: var(--color-bg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
  }

  .site-nav.active,
  .nav-menu.active {
    display: flex !important;
  }

  .site-nav ul,
  .nav-menu ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .site-nav li,
  .nav-menu li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #eee;
  }

  .site-nav a,
  .nav-menu a {
    display: block;
    padding: 16px 20px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #eee;
  }

  .mobile-menu-toggle.open .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.open .bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* ==========================================================================
   TEXT CONTENT CONTAINERS
   ========================================================================== */
.content-container {
  display: block;
  width: 100%;
  max-width: var(--container-width, 1100px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.content-container--full {
  --container-width: 100%;
}

.content-container--wide {
  --container-width: 1400px;
}

.content-container--standard {
  --container-width: 1100px;
}

.content-container--narrow {
  --container-width: 800px;
}

.content-container p {
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.content-container ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content-container li {
  margin-bottom: 0.5rem;
}

.content-container img {
  max-width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .content-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   CONTACT PAGE STYLING
   ========================================================================== */
.contact-section {
  padding: 2rem 0;
}

.contact-intro {
  margin-bottom: 2rem;
  color: #555;
  line-height: 1.6;
}

.contact-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.contact-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.25rem;
}

.contact-link {
  font-size: 1.1rem;
  color: #111;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.contact-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.content-container a.bold-link {
  font-weight: bold;
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   ARTWORK SEARCH INPUT & RESULTS DROPDOWN
   ========================================================================== */
.search-box {
  position: relative;
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  outline: none;
}

.search-box input:focus {
  border-color: #222;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-results li {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.search-results li:last-child {
  border-bottom: none;
}

.search-results li:hover {
  background: #f4f4f4;
}

.qr-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #ddd;
}

.qr-container img {
  width: 220px;
  height: 220px;
  display: block;
  margin: 0 auto;
  border: 1px solid #eee;
  padding: 6px;
  background: #fff;
  border-radius: 4px;
}

/* ==========================================================================
   SOLD WORKS PORTAL / ARTWORK DETAILS
   ========================================================================== */
.art-section {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
  color: #222;
  line-height: 1.6;
}

.art-meta-top {
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 0.5rem;
}

.art-title {
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin: 0 0 0.5rem 0;
}

.art-specs {
  font-size: 1rem;
  color: #555;
  margin-bottom: 2rem;
}

.provenance-card {
  background: #f9f9f9;
  border-left: 3px solid #222;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 4px 4px 0;
}

.provenance-card h3 {
  margin-top: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #444;
}

.provenance-card p {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.process-text {
  white-space: pre-line;
  color: #333;
  font-size: 1.05rem;
}

#loading, 
#error {
  text-align: center;
  padding: 3rem 1rem;
}

.hidden { 
  display: none !important; 
}