/* ==========================================================
   Eleni Pape — artist website
   Headings, links, forms: Hanken Grotesk (free stand-in for Apercu)
   Body text: EB Garamond
   Both load from Google Fonts in the <head> of each page.
   ========================================================== */

:root {
  --paper: #ffffff;
  --ink: #333333;
  --black: #000000;
  --grey: #555555;
  --line: #b9b9b9;
  --tile: #f1f2f5;

  /* To switch to Apercu later: self-host it with @font-face and put
     "Apercu" first in this list. */
  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "EB Garamond", Garamond, "Cormorant Garamond", Georgia, serif;

  --pad: 48px;
}

@media (max-width: 780px) {
  :root { --pad: 20px; }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.lb-open { overflow: hidden; }

[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--black);
  margin: 0;
}

p { margin: 0 0 1.1em; }

a { color: inherit; }

img { max-width: 100%; }

button { font-family: var(--sans); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  padding: 52px var(--pad) 47px;
  font-family: var(--sans);
}

.wordmark {
  font-size: 22px;
  line-height: 26px;
  color: var(--black);
  text-decoration: none;
}

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

.site-nav a {
  font-size: 20px;
  line-height: 26px;
  color: var(--grey);
  text-decoration: none;
}

.site-nav a:hover { color: var(--black); }

.site-nav a[aria-current="page"] {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--black);
}

.nav-toggle span + span { margin-top: 20px; }

@media (max-width: 780px) {
  .site-header { padding-top: 48px; }
  .nav-toggle { display: block; margin-top: -4px; }
  .site-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding-top: 28px;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    font-size: 24px;
    line-height: 1.2;
    padding: 12px 0;
  }
}

/* ---------- Home: gallery ---------- */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0 var(--pad) 96px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 34px;
}

.tile--wide { grid-column: 1 / -1; }

.tile-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--tile);
  line-height: 0;
  cursor: pointer;
}

.tile-btn img {
  display: block;
  width: 100%;
  height: auto;
}

.caption {
  margin: 12px 0 0;
  min-height: 1.5em;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--grey);
}

/* Desktop with a mouse: caption appears on hover (or keyboard focus).
   Phones, tablets and narrow windows always show the caption. */
@media (hover: hover) and (pointer: fine) and (min-width: 781px) {
  .gallery .caption {
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .gallery .tile:hover .caption,
  .gallery .tile:focus-within .caption {
    opacity: 1;
  }
}

@media (max-width: 780px) {
  .gallery {
    grid-template-columns: 1fr;
    row-gap: 32px;
  }
  .tile--wide { grid-column: auto; }
}

/* ---------- Lightbox (selected state) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.lb-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 125px;
  padding: 52px var(--pad) 0;
}

.lb-logo {
  background: none;
  border: 0;
  padding: 0;
  font-size: 22px;
  line-height: 26px;
  color: var(--black);
  cursor: pointer;
}

.lb-actions {
  display: flex;
  gap: 24px;
  padding-top: 5px;
}

.lb-actions button,
.lb-nav button {
  background: none;
  border: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.2;
  color: var(--grey);
  cursor: pointer;
}

.lb-actions button:hover,
.lb-nav button:hover { color: var(--black); }

.lb-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.lb-img {
  position: absolute;
  top: 0;
  left: var(--pad);
  width: calc(100% - (var(--pad) * 2));
  height: calc(100% - 28px);
  object-fit: contain;
  cursor: zoom-in;
}

.lightbox.is-zoomed .lb-stage {
  overflow: auto;
  display: flex;
}

.lightbox.is-zoomed .lb-img {
  position: static;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: none;
  margin: auto;
  object-fit: none;
  cursor: zoom-out;
}

.lb-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 0 var(--pad) 30px;
}

.lb-footer .caption {
  margin: 0;
  min-height: 0;
  opacity: 1;
}

.lb-nav {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--grey);
}

@media (max-width: 780px) {
  .lb-header { height: 110px; padding-top: 48px; }
  .lb-footer { flex-direction: column; gap: 14px; padding-bottom: 24px; }
}

/* ---------- About / Contact ---------- */
.page {
  max-width: calc(660px + (var(--pad) * 2));
  margin: 0 auto;
  padding: 36px var(--pad) 90px;
}

.page h1,
.page h2 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 26px;
}

.page .block {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.page .block--last {
  border-bottom: 0;
  margin-bottom: 0;
}

.page p a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.page .plain { margin-bottom: 0; }

/* CV lists */
.cv {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv li {
  display: flex;
  gap: 0;
  margin-bottom: 26px;
  font-size: 18px;
  line-height: 1.45;
}

.cv li:last-child { margin-bottom: 0; }

.cv-year {
  flex: 0 0 114px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--black);
}

.cv-text { flex: 1; }

.studio {
  margin: 56px calc(var(--pad) * -1) 0;
  max-width: none;
}

.studio img {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 1000px) {
  .studio {
    width: 888px;
    margin: 56px auto 0;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 780px) {
  .page { padding-top: 12px; padding-bottom: 60px; }
  .cv-year { flex-basis: 84px; }
  .studio { margin-left: 0; margin-right: 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 76px var(--pad) 48px;
  font-family: var(--sans);
}

.footer-inner {
  max-width: 1116px;
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 341px minmax(0, 1fr);
  column-gap: 0;
}

.footer-label {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 18px;
}

.footer-contact {
  font-style: normal;
}

.footer-contact p {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--black);
}

.footer-contact a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.subscribe-form {
  display: flex;
  gap: 25px;
  align-items: stretch;
}

.hidden-field { display: none; }

.subscribe-form input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--black);
  font-family: var(--sans);
  font-size: 18px;
  -webkit-appearance: none;
  appearance: none;
}

.subscribe-form input[type="email"]::placeholder { color: var(--grey); opacity: 1; }

.subscribe-form input[type="email"]:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 0;
}

.subscribe-form button {
  flex: 0 0 203px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: var(--black);
  color: var(--paper);
  font-size: 18px;
  cursor: pointer;
}

.subscribe-form button:hover { background: #2a2a2a; }
.subscribe-form button:disabled { opacity: 0.6; cursor: default; }

.form-note {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--black);
}

.footer-copy {
  margin: 52px 0 0;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--black);
}

@media (max-width: 780px) {
  .site-footer { padding-top: 48px; padding-bottom: 36px; }
  .footer-main { grid-template-columns: 1fr; row-gap: 40px; }
  .subscribe-form { flex-direction: column; gap: 12px; }
  .subscribe-form button { flex-basis: 56px; width: 100%; }
  .footer-copy { margin-top: 40px; padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
