/* =========================================================================
   Sarah Pointon — shared stylesheet
   Palette is deliberately restrained greyscale so uploaded artwork supplies
   all the colour on the page; the interface itself stays quiet.
   ========================================================================= */

:root {
  --bar-mid:        #6e6c68;   /* top / bottom bars */
  --bar-mid-dark:   #5c5a57;   /* hover / active shade of the mid bar */
  --bar-dark:       #2e2c2a;   /* dark bar under folder thumbnails */
  --bg-page:        #efeeec;   /* light grey page background */
  --panel-white:    #fbfaf9;   /* letterbox mat behind thumbnails */
  --text-on-mid:    #f5f4f2;
  --text-body:      #2a2926;
  --text-muted:     #6b6965;
  --hairline:       #d9d7d3;
  --focus-ring:     #4a6f8a;
  --max-width:      1120px;

  --font-body: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

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

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------------- */
/* Header / top bar                                                       */
/* ----------------------------------------------------------------------- */

.site-header {
  background: var(--bar-mid);
  color: var(--text-on-mid);
  min-height: 2cm;
  padding: 0.35cm 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  z-index: 30;
}

.site-title {
  font-size: 1.3rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: bold;
  white-space: nowrap;
}

.site-title a { color: inherit; }

/* Desktop nav */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.9;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  opacity: 1;
  border-bottom-color: var(--text-on-mid);
}

.nav-menu a.current {
  opacity: 1;
  border-bottom-color: var(--text-on-mid);
}

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-on-mid);
  margin: 5px auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----------------------------------------------------------------------- */
/* Page body                                                              */
/* ----------------------------------------------------------------------- */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 5vw 4rem;
  min-height: 40vh;
}

.page-title {
  font-size: 1.9rem;
  font-weight: bold;
  margin: 0 0 1.75rem;
  letter-spacing: 0.01em;
}

.lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: -1rem 0 2.25rem;
}

.content-block {
  max-width: 68ch;
  margin: 0 0 1.4rem;
}

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

.content-columns figure {
  margin: 0;
}

.content-columns figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.image-frame {
  background: var(--panel-white);
  border: 1px solid var(--hairline);
  padding: 0.5rem;
}

.image-frame img { width: 100%; height: auto; }

.about-hero-image {
  margin-bottom: 2.5rem;
}

/* Home page: image floats so the text wraps around it, then continues
   full-width underneath once the text runs past the image's height. */
.text-wrap {
  display: flow-root; /* contains the float without needing a clearfix */
}

.float-image {
  float: right;
  width: 300px;
  margin: 0 0 1.5rem 2.5rem;
}

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Simple contact form styling */
.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 42ch;
  margin-top: 1.5rem;
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--hairline);
  background: var(--panel-white);
  color: var(--text-body);
}

.contact-form button {
  justify-self: start;
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bar-dark);
  color: var(--text-on-mid);
  border: none;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
}

.contact-form button:hover { background: var(--bar-mid-dark); }

.contact-details {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* CV-style dated lists (About page: education, exhibitions, etc.) */
.cv-section {
  margin: 0 0 2rem;
}

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

.cv-section h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

.cv-entry {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1rem;
  margin: 0 0 0.85rem;
  align-items: baseline;
}

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

.cv-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cv-desc { margin: 0; }

/* ----------------------------------------------------------------------- */
/* Footer / bottom bar                                                    */
/* ----------------------------------------------------------------------- */

.site-footer {
  background: var(--bar-mid);
  color: var(--text-on-mid);
  padding: 0.55cm 5vw;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copyright { flex: 1 1 auto; }

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-on-mid);
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.social-link:hover,
.social-link:focus-visible { opacity: 1; }

/* ----------------------------------------------------------------------- */
/* Work: folder / sub-folder grid                                        */
/* ----------------------------------------------------------------------- */

.work-back {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
}

.work-back:hover { color: var(--text-body); border-bottom-color: var(--text-muted); }

.work-toptext {
  max-width: 68ch;
  margin: 0 0 2.5rem;
  color: var(--text-body);
}

.work-toptext p { margin: 0 0 1rem; }

.work-section-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2.5rem 0 1.1rem;
}

.work-section-label:first-of-type { margin-top: 0; }

.folder-grid,
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.4rem;
  margin: 0 0 1rem;
}

.folder-tile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  background: var(--panel-white);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.folder-tile .thumb-wrap {
  flex: 3 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-white);
  overflow: hidden;
}

.folder-tile .thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.folder-tile .thumb-wrap.no-thumb {
  background: var(--bg-page);
}

.folder-tile .folder-label {
  flex: 1 1 0;
  background: var(--bar-dark);
  color: var(--text-on-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.6rem;
}

.folder-tile:hover .folder-label { background: var(--bar-mid-dark); }

/* Individual image tiles within a folder (no label bar) */
.image-tile {
  aspect-ratio: 1 / 1;
  background: var(--panel-white);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
}

.image-tile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.image-tile:hover img { transform: scale(1.03); }

/* ----------------------------------------------------------------------- */
/* Lightbox                                                               */
/* ----------------------------------------------------------------------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 18, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 3rem 4vw;
}

.lightbox-overlay.open { display: flex; }

.lightbox-content {
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
  color: var(--text-on-mid);
  font-size: 0.92rem;
  margin-top: 1rem;
  text-align: center;
  max-width: 60ch;
  min-height: 1.2em;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-on-mid);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  opacity: 0.85;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-on-mid);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem 1rem;
  opacity: 0.55;
  font-weight: 300;
  transition: opacity 0.2s ease;
}

.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

/* ----------------------------------------------------------------------- */
/* Responsive                                                              */
/* ----------------------------------------------------------------------- */

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bar-mid);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-menu.open { max-height: 400px; }

  .nav-menu a {
    display: block;
    padding: 0.9rem 5vw;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .content-columns { grid-template-columns: 1fr; }
  .two-up { grid-template-columns: 1fr; }

  .float-image {
    float: none;
    width: 100%;
    margin: 0 0 1.5rem;
  }

  .cv-entry {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .lightbox-nav { font-size: 1.8rem; padding: 0.4rem 0.6rem; }
  .lightbox-prev { left: 0; }
  .lightbox-next { right: 0; }
}

@media (max-width: 480px) {
  .folder-grid, .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
  }
}
