/*
 * Portraits and Paintings - Static Portfolio Site
 * Clean, minimal design matching original Squarespace aesthetic
 */

/* Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-text-light: #555555;
  --color-border: #e0e0e0;
  --color-overlay: rgba(0, 0, 0, 0.85);
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --transition-speed: 0.3s;
  --max-width: 1400px;
  --header-height: 80px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: opacity var(--transition-speed);
}

a:hover {
  opacity: 0.7;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-bg);
  z-index: 1000;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  display: none;
}

.header-inner {
  justify-content: flex-end;
}

/* Navigation */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text);
  transition: width var(--transition-speed);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  margin: 5px 0;
  transition: var(--transition-speed);
}

/* Main Content */
main {
  flex: 1;
  margin-top: var(--header-height);
}

/* Hero Section */
.hero {
  width: 100%;
  height: calc(100vh - var(--header-height));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero > img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: block;
  cursor: pointer;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: var(--color-bg);
}

/* Gallery item as link */
a.gallery-item {
  display: block;
  text-decoration: none;
  color: inherit;
}

.carousel-nav {
  display: none;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.carousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 1);
}

.carousel-arrow.prev {
  left: 1rem;
}

.carousel-arrow.next {
  right: 1rem;
}

/* Page Content */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.page-title {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1.75rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.gallery-item-details {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* About Page */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-bio {
  font-size: 1.125rem;
  margin-bottom: 3rem;
  text-align: center;
}

.about-section {
  margin-bottom: 2.5rem;
}

.about-section h2 {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--color-text-light);
}

.about-section ul {
  list-style: none;
}

.about-section li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.about-section li:last-child {
  border-bottom: none;
}

.about-contact a {
  color: var(--color-text);
  text-decoration: underline;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-overlay);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 1rem;
  font-family: var(--font-heading);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 1rem;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-nav.prev {
  left: 1rem;
}

.lightbox-nav.next {
  right: 1rem;
}

/* Individual Artwork Page */
.artwork-page {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

.artwork-sidebar {
  width: 180px;
  min-width: 180px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.artwork-sidebar .sidebar-nav {
  display: none;
}

.artwork-info {
  margin-top: auto;
}

.artwork-info h1 {
  display: none;
}

.artwork-info .artwork-details {
  font-size: 0.875rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

.artwork-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: #fafafa;
  position: relative;
}

.artwork-main img {
  max-width: 100%;
  max-height: calc(100vh - var(--header-height) - 2rem);
  object-fit: contain;
}

/* Responsive for artwork pages */
@media (max-width: 768px) {
  .artwork-page {
    flex-direction: column;
  }

  .artwork-sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
  }

  .artwork-sidebar .sidebar-nav {
    display: none;
  }

  .artwork-info {
    margin-top: 0;
    padding-top: 0;
  }

  .artwork-main {
    padding: 1rem;
  }

  .artwork-main img {
    max-height: 60vh;
  }
}

/* Artwork Navigation Arrows */
.artwork-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-text);
  transition: background var(--transition-speed);
}

.artwork-nav:hover {
  background: rgba(255, 255, 255, 1);
}

.artwork-nav.prev {
  left: 1rem;
}

.artwork-nav.next {
  right: 1rem;
}

/* Footer */
.site-footer {
  padding: 2rem;
  text-align: center;
}

.footer-social {
  margin-bottom: 1rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }
  
    .artwork-sidebar {
    order: 2;
  }
  .artwork-main {
    order: 1;
  }


  .header-inner {
    padding: 0 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    padding: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
  }

  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .page-content {
    padding: 2rem 1rem;
  }

  .carousel-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .artwork-nav {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

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

@media (max-width: 480px) {
  .site-title {
    font-size: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .about-bio {
    font-size: 1rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
