@import url("../fonts/fonts.css");

/* ---------- Colors & basics (change the colors here) ---------- */
:root {
  --background: #fbfaf8;   /* warm off-white page */
  --text: #2b2b2b;         /* main text */
  --muted: #8a8580;        /* secondary text (years, captions) */
  --line: #e6e2dc;         /* thin divider lines */
  --frame: #f3f1ed;        /* soft backdrop behind artworks */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter);
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1.5rem; }
h2 { font-size: 1.75rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.35rem; margin: 0 0 0.25rem; }

:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

/* Clearly marks text you still need to replace */
.placeholder {
  background: #fff6d6;
  border-left: 3px solid #e0b84a;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* ---------- Header ---------- */
#site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem var(--gutter) 0;
}

.site-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}

#site-header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }

#site-header nav a {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
@media (max-width: 480px) {
  #site-header nav { gap: 0.5rem 1.1rem; }
  #site-header nav a { letter-spacing: 0.1em; font-size: 0.75rem; }
}
#site-header nav a:hover,
#site-header nav a[aria-current="page"] { color: var(--text); border-color: var(--text); }

/* ---------- Footer ---------- */
#site-footer {
  max-width: calc(1280px - 2 * var(--gutter));
  margin: 0 auto;
  width: calc(100% - 2 * var(--gutter));
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
#site-footer p { margin: 0; }
#site-footer .social { display: flex; gap: 1.5rem; }
#site-footer a { text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase; }
#site-footer a:hover { color: var(--text); }

/* ---------- Gallery grid (home) ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 3.5rem);
}
@media (min-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.work { text-decoration: none; display: block; }

.work-frame {
  aspect-ratio: 4 / 5;
  background: var(--frame);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
  overflow: hidden;
}
.work-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* never crops the artwork */
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.09));
  transition: transform 0.6s ease;
}
.work:hover .work-frame img { transform: scale(1.025); }

.work-title { font-family: var(--serif); font-size: 1.25rem; margin: 1rem 0 0; line-height: 1.3; }
.work-meta { margin: 0.1rem 0 0; font-size: 0.8rem; color: var(--muted); }

.sold {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.05rem 0.45rem;
  vertical-align: middle;
}

/* ---------- Single artwork page ---------- */
.artwork {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 900px) {
  .artwork { grid-template-columns: 3fr 2fr; gap: 4rem; }
  .artwork-info { position: sticky; top: 2rem; }
}

.artwork-image {
  margin: 0;
  background: var(--frame);
  padding: clamp(1rem, 5vw, 3.5rem);
}
.artwork-image img {
  margin: 0 auto;
  max-height: 80vh;
  width: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 10px 30px rgba(0, 0, 0, 0.08);
}

.artwork-info h1 { margin-bottom: 0.5rem; }
.artwork-details { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.5rem; }
.artwork-text { margin: 1.5rem 0 2rem; max-width: 34rem; }

.artwork-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.artwork-nav a { text-decoration: none; color: var(--muted); }
.artwork-nav a:hover { color: var(--text); }

/* ---------- Button ---------- */
.button, button {
  display: inline-block;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--background);
  background: var(--text);
  border: 1px solid var(--text);
  padding: 0.95rem 1.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.button:hover, button:hover { background: transparent; color: var(--text); }
button:disabled { opacity: 0.5; cursor: wait; }

/* ---------- Text pages (About, Contact) ---------- */
.prose { max-width: 40rem; }
.prose p { margin: 0 0 1.25rem; }

.about-layout { display: grid; gap: 3rem; }
/* Two columns only when a portrait photo is on the page */
@media (min-width: 900px) { .about-layout:has(.portrait) { grid-template-columns: 1fr 2fr; gap: 5rem; } }
.portrait { width: 100%; height: auto; }

.portrait-placeholder {
  aspect-ratio: 4 / 5;
  background: var(--frame);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* ---------- Contact form ---------- */
.contact-form { display: grid; gap: 1.5rem; max-width: 36rem; margin-top: 2.5rem; }
.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;          /* 16px+ stops phones from zooming in */
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid #cfc9c1;
  border-radius: 0;
  padding: 0.5rem 0;
  letter-spacing: normal;
  text-transform: none;
}
.contact-form textarea { min-height: 9rem; resize: vertical; border: 1px solid #cfc9c1; padding: 0.75rem; }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--text); }
.contact-form button { justify-self: start; }
.hidden { display: none !important; }

.form-status { margin: 0; font-size: 0.95rem; min-height: 1.5em; }
.form-status.success { color: #3d6b47; }
.form-status.error { color: #a14a3b; }

/* Hidden on screen but still read by screen readers and search engines */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Small line under a page title, e.g. "Zurich · Milan" on the About page */
h1.with-subtitle { margin-bottom: 0.5rem; }
.page-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2.5rem !important;
}
.prose strong { font-weight: 500; }

/* ---------- Exhibition cards ---------- */
.page-intro { text-align: center; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.page-intro h1 { margin-bottom: 0.75rem; }
.page-intro p { margin: 0; color: var(--muted); }

.exhibition-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
}
@media (min-width: 600px) { .exhibition-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .exhibition-grid { grid-template-columns: repeat(4, 1fr); } }

.exhibition-card {
  cursor: default;
  transition: transform 0.3s ease;
}
.exhibition-card:hover { transform: translateY(-6px); }

.exhibition-image {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;          /* keeps the zoomed image inside the rounded square */
  background: var(--frame);
  transition: box-shadow 0.3s ease;
}
.exhibition-card:hover .exhibition-image { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1); }
.exhibition-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* fills the square, cropped from the center */
  transition: transform 0.3s ease;
}
.exhibition-card:hover .exhibition-image img { transform: scale(1.05); }

.exhibition-card h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1.1rem 0 0.3rem;
}
.exhibition-when {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.exhibition-card .description {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #6b6661;            /* slightly lighter than the main text */
}
.exhibitions-empty { text-align: center; color: var(--muted); }

/* People who turn off animations in their system settings get no movement */
@media (prefers-reduced-motion: reduce) {
  .exhibition-card, .exhibition-image, .exhibition-image img, .work-frame img { transition: none; }
  .exhibition-card:hover, .exhibition-card:hover .exhibition-image img { transform: none; }
}
