/* ============================================================
   Jeremiah Jossim — Stylesheet
   ============================================================ */

/* ------------------------------------------------------------
   Custom properties
   ------------------------------------------------------------ */
:root {
  --bg:        #f0eade;       /* linen */
  --ink:       #1c1b19;       /* warm near-black */
  --muted:     #a09d97;       /* warm mid-gray */
  --border:    #e9e5df;       /* very light warm gray */
  --serif:     'Cormorant Garamond', 'Georgia', serif;
  --sans:      -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --header-h:  60px;
}

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

html {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ------------------------------------------------------------
   Site Header
   ------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background-color: var(--bg);
  z-index: 200;
  transition: background-color 0.45s ease;
}

.site-header.is-transparent {
  background-color: transparent;
}

.site-header.is-transparent .site-name,
.site-header.is-transparent .nav-link {
  color: rgba(253, 252, 249, 0.85);
  transition: color 0.45s ease;
}

.site-header.is-transparent .nav-link:hover,
.site-header.is-transparent .nav-link.is-active {
  color: #fdfcf9;
}

.site-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.45s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link svg {
  display: inline-block;
  vertical-align: middle;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--ink);
}

/* ------------------------------------------------------------
   Work / Home Page
   ------------------------------------------------------------ */
.work-page {
  min-height: 100vh;
  padding-top: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  position: relative;
  z-index: 20;
}

.series-list {
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 36px;
  padding: 40px 0;
}

.series-item {}

.series-divider {
  width: 1px;
  height: 1em;
  background-color: var(--border);
  align-self: center;
  flex-shrink: 0;
}

.series-link {
  display: flex;
  align-items: baseline;
  padding: 12px 0;
}

.series-link:hover .series-name {
  color: var(--muted);
}

.series-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  transition: color 0.18s ease;
}

.series-year {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Hover Preview Panel
   ------------------------------------------------------------ */
.preview-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;

  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 10;
}

.preview-panel.is-visible {
  opacity: 1;
}

.preview-inner {
  width: 100%;
  height: 100%;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0.95;

  transition: opacity 0.45s ease;
}

/* ------------------------------------------------------------
   About Page
   ------------------------------------------------------------ */
.about-hero {
  width: 100%;
  height: 100vh;
}

.about-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.about-page {
  padding: 80px 48px 80px;
}

/* Portrait + text layout — add class .has-portrait to <main> when a portrait is present */
.about-page.has-portrait {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  max-width: 1200px;
}

.about-portrait img {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.about-text {
  max-width: 560px;
}

.about-statement {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 56px;
}

.about-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px;
  margin-bottom: 48px;
}

.about-section-title {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.about-list li {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
}

.about-cv {
  padding-top: 8px;
}

.cv-link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.cv-link:hover {
  color: var(--ink);
}

/* ------------------------------------------------------------
   Contact Page
   ------------------------------------------------------------ */
.contact-page {
  min-height: 100vh;
  padding: calc(var(--header-h) + 80px) 48px 80px;
  display: flex;
  align-items: flex-start;
}

.contact-text {
  max-width: 500px;
}

.contact-intro {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 20px;
}

.contact-email {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.2s ease;
}

.contact-email:hover {
  color: var(--muted);
}

/* ------------------------------------------------------------
   Series / Work Pages
   ------------------------------------------------------------ */
.series-page {
  padding-top: var(--header-h);
}

.series-header {
  padding: 60px 48px 48px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.series-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.series-page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: 0.03em;
}

.series-page-year {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.series-description {
  padding: 0 48px 48px;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0.95;
}

/* Painting grid */
.paintings-grid--4col {
  column-count: 4;
}

.paintings-grid--2col {
  column-count: 2;
}

.paintings-grid {
  padding: 20px 48px 100px;
  column-count: 3;
  column-gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.paintings-grid .painting-item {
  break-inside: avoid;
  margin-bottom: 24px;
}

.painting-item {
  position: relative;
  overflow: hidden;
  background-color: #f0ede8;
  cursor: pointer;
  width: 100%;
}

/* Full image — no cropping. Paintings display at their natural aspect ratio. */
.painting-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
}

.painting-item:hover img {
  opacity: 0.92;
}

/* Horizontal scroll strip — e.g. Thresholds */
.paintings-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 48px 40px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: none;
}

.paintings-scroll::-webkit-scrollbar {
  display: none;
}

.paintings-scroll:active,
.paintings-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.paintings-scroll .painting-item {
  flex: 0 0 auto;
  width: auto;
  height: 70vh;
  scroll-snap-align: start;
}

.paintings-scroll .painting-item img {
  width: auto;
  height: 100%;
  max-width: none;
}

/* Video embed in grid */
.painting-item--video {
  cursor: default;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Featured single video — Adrift page */
.video-feature {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px 80px;
}

/* Video carousel nav — Adrift page */
.video-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}

.video-carousel-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px;
  transition: color 0.2s ease;
}

.video-carousel-btn:hover {
  color: var(--ink);
}

.video-carousel-count {
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.video-caption {
  margin-top: 14px;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.painting-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 24px 20px;
  background: linear-gradient(to top, rgba(28,27,25,0.55) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.painting-item:hover .painting-caption {
  opacity: 1;
}

.painting-caption-text {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #fdfcf9;
}

.painting-caption-meta {
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: rgba(253, 252, 249, 0.7);
  margin-top: 4px;
}

/* Series nav */
.series-nav {
  display: flex;
  justify-content: space-between;
  padding: 40px 48px;
  margin-top: 2px;
}

.series-nav-link {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.series-nav-link:hover {
  color: var(--ink);
}

.series-nav-link.is-next {
  margin-left: auto;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 27, 25, 0.92);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 252, 249, 0.6);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: #fdfcf9;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 252, 249, 0.5);
  cursor: pointer;
  background: none;
  border: none;
  padding: 16px;
  transition: color 0.2s ease;
}

.lightbox-arrow:hover {
  color: #fdfcf9;
}

.lightbox-arrow.is-prev { left: 16px; }
.lightbox-arrow.is-next { right: 16px; }

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
}

.lightbox-caption {
  margin-top: 12px;
  text-align: right;
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.02em;
  color: rgba(253, 252, 249, 0.55);
}

/* ------------------------------------------------------------
   Splash Screen
   ------------------------------------------------------------ */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-image: url('../images/splash_page/itsthesamefeeling_sundayinsavannah.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  opacity: 1;
  transition: opacity 0.9s ease;
}

.splash-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  text-align: center;
}

.splash-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 3.2rem;
  letter-spacing: 0.1em;
  color: #fdfcf9;
  text-shadow: 0 1px 24px rgba(28,27,25,0.35);
}

.splash-name:hover {
  background: linear-gradient(
    90deg,
    #fdfcf9 15%,
    #e8c97a 35%,
    #fff4c2 50%,
    #e8c97a 65%,
    #fdfcf9 85%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sparkle 2.6s linear infinite;
}

@keyframes sparkle {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  padding: 28px 48px;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Dark Mode
   ------------------------------------------------------------ */
[data-theme="dark"] {
  --bg:     #1c1a17;
  --ink:    #ede9e0;
  --muted:  #6e6a64;
  --border: #2c2a27;
}

[data-theme="dark"] .painting-item {
  background-color: #252320;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --header-h: 52px;
  }

  .site-header {
    padding: 0 24px;
  }

  .site-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 0.6rem;
  }

  .theme-toggle {
    font-size: 0.6rem;
  }

  /* Hide Instagram on mobile to save space */
  .nav-link[href*="instagram"] {
    display: none;
  }

  .work-page {
    padding: 0 24px;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .series-list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
    padding: 64px 0 48px;
  }

  .series-link {
    padding: 9px 0;
  }

  .series-divider {
    width: 100%;
    height: 1px;
    margin: 8px 0;
  }

  .series-name {
    font-size: 1.4rem;
  }

  /* No hover preview on mobile */
  .preview-panel {
    display: none;
  }

  .about-page {
    padding: 48px 24px 48px;
    grid-template-columns: 1fr;
  }

  .about-details {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-statement {
    font-size: 1.15rem;
    margin-bottom: 40px;
  }

  .contact-page {
    padding: calc(var(--header-h) + 48px) 24px 48px;
  }

  .paintings-scroll {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: visible;
    padding: 0 24px 40px;
    scroll-snap-type: none;
    cursor: default;
    gap: 32px;
  }

  .paintings-scroll:active,
  .paintings-scroll.is-dragging {
    cursor: default;
  }

  .paintings-scroll .painting-item {
    flex: none;
    width: 100%;
    height: auto;
    scroll-snap-align: none;
  }

  .paintings-scroll .painting-item img {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .series-header {
    padding: 40px 24px 32px;
    flex-direction: column;
    gap: 12px;
  }

  .series-description {
    max-width: 100%;
    padding: 0 24px 40px;
  }

  .paintings-grid {
    padding: 20px 24px 60px;
    column-count: 1;
    column-gap: 0;
  }

  .paintings-grid--4col {
    column-count: 1;
  }

  .paintings-grid .painting-item {
    margin-bottom: 16px;
  }

  .series-nav {
    padding: 32px 24px;
  }

  .video-feature {
    padding: 0 24px 60px;
  }

  .site-footer {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .series-name {
    font-size: 1.25rem;
  }
}
