/* === Anna Steinhäusler — Gallery White (Refined) === */

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

:root {
  --bg: #FAFAF8;
  --text: #1A1A1A;
  --text-soft: #555;
  --accent: #9C8B7A;
  --accent-light: #C4B5A6;
  --border: #E8E6E1;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --max-width: 1400px;
  --header-height: 72px;
}

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

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--accent);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.25;
}

/* --- View Transitions --- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

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

.site-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 2.25rem;
  align-items: center;
}

.main-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.lang-switch a {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.lang-switch a:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Hamburger - hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  position: relative;
  transition: background 0.2s;
}

.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  position: absolute;
  left: 0;
  transition: transform 0.2s;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* --- Main Content --- */
.site-main {
  min-height: calc(100vh - var(--header-height) - 120px);
}

.page-title {
  font-size: 2.75rem;
  margin-bottom: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.01em;
}

/* --- Hero (Home) --- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  animation: heroFadeIn 0.8s ease-out both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-image img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.hero-text h1 {
  font-size: 3.75rem;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
  font-weight: 300;
}

.artist-bio {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.8;
  max-width: 36ch;
}

/* --- Upcoming Exhibition --- */
.upcoming {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2.5rem 5rem;
  border-top: 1px solid var(--border);
}

.upcoming h2 {
  font-size: 0.8rem;
  margin-bottom: 2rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--sans);
  font-weight: 400;
}

.upcoming-details p {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.upcoming-details p:first-child {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.upcoming-exhibition {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.upcoming-exhibition h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.upcoming-exhibition p {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* --- Works Page --- */
.works {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
}

/* Series Navigation */
.series-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin-bottom: 3.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.series-nav-item {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 0.4rem 0;
  transition: color 0.2s;
}

.series-nav-item:hover {
  color: var(--text);
}

.series-nav-item.active {
  color: var(--text);
}

/* Series Overview (All works view) */
.series-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.series-preview {
  position: relative;
}

.series-preview-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.series-preview-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #f0efed;
}

.series-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.series-preview-link:hover .series-preview-image img {
  transform: scale(1.03);
  opacity: 0.85;
}

.series-preview-info {
  padding: 1rem 0;
}

.series-preview-title {
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}

.series-preview-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.series-preview-meta .series-preview-year + .series-preview-count::before {
  content: "·";
  margin-right: 0.6rem;
  color: var(--accent);
  font-size: 1.4em;
  line-height: 0;
}

.series-preview-count {
  text-transform: lowercase;
}

/* Series Section */
.series-section {
  margin-bottom: 6rem;
}

.series-header {
  margin-bottom: 2.5rem;
}

.series-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 300;
  letter-spacing: -0.01em;
}

.series-year {
  font-size: 0.8rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.series-description {
  font-size: 0.95rem;
  color: var(--text-soft);
  max-width: 55ch;
  line-height: 1.7;
}

/* Gallery Grid — single-column */
.gallery-masonry {
  max-width: 700px;
}

.artwork-card {
  margin-bottom: 1.25rem;
}

.artwork-card a {
  display: block;
  overflow: hidden;
  position: relative;
}

.artwork-card img {
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
              filter 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  /* Scroll-based reveal */
  animation: cardReveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 30%;
}

.artwork-card a:hover img {
  transform: scale(1.03);
  filter: brightness(1.04);
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fallback for browsers without animation-timeline */
@supports not (animation-timeline: view()) {
  .artwork-card img {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  animation: lightboxIn 0.25s ease-out;
}

@keyframes lightboxIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox[aria-hidden="false"] {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  animation: lightboxImgIn 0.3s ease-out;
}

@keyframes lightboxImgIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  margin-top: 1.25rem;
  text-align: center;
  letter-spacing: 0.03em;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: rgba(255, 255, 255, 0.95);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.75rem;
  font-size: 1.5rem;
  padding: 0.75rem;
  font-weight: 300;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  padding: 1rem;
  font-weight: 300;
}

.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }

/* --- CV Page --- */
.cv-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
}

.cv-bio {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-bottom: 3.5rem;
  line-height: 1.8;
}

.cv-category {
  margin-bottom: 3.5rem;
}

.cv-category h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--accent);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding: 0.6rem 0;
}

.cv-year {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.cv-description {
  font-size: 0.925rem;
  line-height: 1.55;
}

/* --- About Page --- */
.about-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
}

.about-page .page-title {
  font-size: 2.75rem;
  margin-bottom: 3rem;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-portrait img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  color: var(--text-soft);
}

.about-text p:first-child {
  font-size: 1.15rem;
  color: var(--text);
}

@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-page {
    padding: 2rem 1.25rem;
  }
}

/* --- Contact Page --- */
.contact-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
  min-height: calc(100vh - var(--header-height) - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-page .page-title {
  font-size: 2.75rem;
  margin-bottom: 3rem;
}

.contact-info p {
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.contact-info p:first-child {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.contact-info a {
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s, color 0.3s;
}

.contact-info a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* --- Instagram Link --- */
.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-instagram {
  vertical-align: middle;
  flex-shrink: 0;
}

/* --- Imprint Page --- */
.imprint-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 3.5rem 2.5rem;
}

.imprint-page .page-title {
  font-size: 2.75rem;
  margin-bottom: 3rem;
}

.imprint-text p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
  color: var(--text-soft);
}

/* --- Richtext (Markdown) content --- */
.artist-bio p,
.series-description p,
.cv-bio p,
.about-text p,
.imprint-text p,
.upcoming-details p,
.exhibition-desc p {
  margin-bottom: 0.75em;
}

.artist-bio p:last-child,
.series-description p:last-child,
.cv-bio p:last-child,
.about-text p:last-child,
.imprint-text p:last-child,
.upcoming-details p:last-child,
.exhibition-desc p:last-child {
  margin-bottom: 0;
}

.series-description ul,
.artist-bio ul,
.cv-bio ul,
.about-text ul,
.imprint-text ul,
.upcoming-details ul,
.exhibition-desc ul {
  list-style-position: inside;
  padding-left: 0;
  margin-bottom: 1em;
}

.series-description ul:last-child,
.artist-bio ul:last-child,
.cv-bio ul:last-child,
.about-text ul:last-child,
.imprint-text ul:last-child,
.upcoming-details ul:last-child,
.exhibition-desc ul:last-child {
  margin-bottom: 0;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-contact {
  display: flex;
  gap: 2rem;
  font-size: 0.825rem;
  color: var(--text-soft);
}

.footer-contact a {
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.footer-contact a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--accent-light);
}

.footer-links a {
  color: var(--accent-light);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.footer-links a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* --- HTMX Transition States --- */
.htmx-settling {
  opacity: 0;
}

.htmx-swapping {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#gallery-grid {
  transition: opacity 0.3s ease;
}

#gallery-grid.htmx-settling {
  opacity: 0;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 3rem 2rem;
  }

  .hero-text h1 {
    font-size: 2.75rem;
  }

  .artist-bio {
    max-width: none;
  }

}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

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

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 99;
    padding: 2rem;
  }

  .nav-open .main-nav {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .lang-switch {
    margin-top: 1rem;
  }

  .hero {
    padding: 2rem 1.25rem;
  }

  .hero-text h1 {
    font-size: 2.25rem;
  }

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

  .works {
    padding: 2rem 1.25rem;
  }

  .series-nav {
    gap: 0.2rem 1.25rem;
  }

  .series-nav-item {
    font-size: 0.75rem;
  }

  .series-section {
    margin-bottom: 4rem;
  }

  .cv-page {
    padding: 2rem 1.25rem;
  }

  .cv-entry {
    grid-template-columns: 80px 1fr;
    gap: 0.75rem;
  }

  .contact-page {
    padding: 2rem 1.25rem;
    min-height: auto;
    justify-content: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 0 1.25rem;
  }

  .footer-contact {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-links {
    gap: 1rem;
  }

  .imprint-page {
    padding: 2rem 1.25rem;
  }

  /* Series overview mobile */
  .series-overview {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Lightbox mobile */
  .lightbox-prev,
  .lightbox-next {
    font-size: 1.5rem;
    padding: 0.75rem;
  }

  .lightbox-content img {
    max-width: 100vw;
    max-height: 80vh;
  }
}

/* Small mobile */
@media (max-width: 375px) {
  .site-title {
    font-size: 1.05rem;
  }

  .hero-text h1 {
    font-size: 1.85rem;
  }
}
