/* =========================================================
   Tessa Blackham Art — site stylesheet
   One file, plain CSS, no build step, no framework.
   ========================================================= */

:root {
  --shell-max: 1400px;
  --content-max: 1320px;
  --ink: #000;
  --ink-soft: #1f1f1f;
  --ink-muted: #7f7f7f;
  --ink-body: #7f7f7f;
  --accent: #005cac;
  --accent-deep: #24577a;
  --accent-link: #356b95;
  --line: #ececec;
  --panel: #f7f7f7;
  --font-serif: Georgia, Palatino, "Palatino Linotype", Times, "Times New Roman", serif;
  --space-1: 0.75rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-top: clamp(24px, 4vw, 48px);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.4;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
p { margin: 0 0 0.8rem; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}

/* ---------- layout shell ---------- */
#page {
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: 0 1rem 48px;
}

/* ---------- header / logo ---------- */
.site-header {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 300;
}

.site-header-logo {
  width: min(480px, 90vw);
  margin: 0 auto;
  aspect-ratio: 423 / 250;
  overflow: hidden;
}

.site-header-logo-image {
  width: 100%;
  transform: translateY(-25%);
}

.site-header-nav-row {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 320;
}

/* ---------- primary nav ---------- */
.tb-nav {
  width: 100%;
  max-width: 640px;
  margin: var(--space-1) auto 0;
  position: relative;
  z-index: 1000;
}

.tb-nav-list,
.tb-subnav { list-style: none; margin: 0; padding: 0; }

.tb-nav-list {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.tb-nav-item { position: relative; padding-bottom: 8px; }

.tb-nav-link {
  display: block;
  padding: 0.5rem 0.85rem;
  line-height: 1.18;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
}

.tb-nav-link:hover,
.tb-nav-link-active,
.tb-subnav-link-active {
  color: var(--accent);
}

.tb-subnav {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translate(-50%, 6px);
  min-width: 170px;
  background-color: var(--panel);
  border: 1px solid var(--line);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.tb-has-subnav:hover > .tb-subnav,
.tb-has-subnav:focus-within > .tb-subnav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.tb-subnav-link {
  display: block;
  padding: 0.45rem 0.65rem;
  text-align: center;
  font-size: 11px;
  color: var(--ink);
  text-decoration: none;
  background-color: var(--panel);
}

.tb-subnav-link:hover { color: var(--accent); }

/* visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- home page gallery ---------- */
.home-gallery {
  width: min(100%, 1400px);
  margin: 1.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, 320px);
  justify-content: center;
  gap: 0;
}

.home-gallery-item { display: block; width: 320px; max-width: 100%; }

.home-gallery-image {
  width: 320px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.home-gallery-image-framed { border: 5px solid #fff; }

/* ---------- art galleries (characters / landscapes) ---------- */
.art-gallery {
  width: min(100%, 822px);
  margin: 1.75rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.art-gallery-row,
.art-gallery-columns {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  width: 100%;
}

.art-gallery-column,
.art-gallery-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.art-gallery-image { width: 100%; height: auto; }

/* characters page specific proportions */
#characters-gallery-opening-row > .art-gallery-card-wide { flex: 0 1 548px; }
#characters-gallery-opening-row > .art-gallery-stack { flex: 0 1 242px; }
#characters-mid-row > .art-gallery-card-wide { flex: 0 1 558px; }
#characters-mid-row > .art-gallery-card-tall { flex: 0 1 236px; }
#characters-portrait-row > .art-gallery-card-slim:nth-child(1) { flex: 0 1 193px; }
#characters-portrait-row > .art-gallery-card-slim:nth-child(2) { flex: 0 1 176px; }
#characters-portrait-row > .art-gallery-card-wide { flex: 0 1 406px; }
#characters-left-column { flex: 0 1 280px; }
#characters-right-column { flex: 0 1 522px; }
#characters-lower-pair > #characters-fisherwoman { flex: 0 1 328px; }
#characters-lower-pair > #characters-family-portrait { flex: 0 1 174px; overflow: hidden; }
#characters-family-portrait-image { width: calc(100% + 20px); max-width: none; margin-left: -10px; }

/* landscapes: simple full-width stack */
.landscapes-gallery .art-gallery-card-full { width: 100%; }

/* ---------- books grid ---------- */
.books-grid {
  width: min(100%, 880px);
  margin: 1.75rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-3);
}

.book-card { display: block; text-decoration: none; justify-self: center; }
.book-card-wide { width: 100%; max-width: 343px; }
#book-card-ribbon, #book-card-small-seed { width: 100%; max-width: 253px; }
.book-card-image {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* ---------- book detail pages ---------- */
.book-detail {
  width: min(100% - 2rem, 1100px);
  margin: 1.75rem auto 0;
  display: grid;
  gap: var(--space-3);
}

.book-hero {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  align-items: center;
}

.book-cover { width: 100%; max-width: 392px; justify-self: center; }

.book-cover-image,
.book-spread-image {
  width: 100%;
  display: block;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.book-overview {
  width: 100%;
  display: grid;
  max-width: 420px; 
  gap: var(--space-2);
}

.book-title,
.book-status,
.book-meta,
.book-blurb { margin: 0; color: var(--ink-soft); }

.book-title { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.05; }

#book-info-card {
  border: 2px solid #f0f0f0;
  background-color: var(--panel);
  padding: 2rem 1.5rem;
  text-align: center;
  display: grid;
  gap: 0.85rem;
}

.book-status { font-size: 14px; line-height: 1.76; letter-spacing: 1px; }
.book-meta { font-size: 14px; line-height: 1.6; letter-spacing: 1px; }

.book-blurb {
  font-size: 1rem;
  line-height: 1.76;
  font-style: italic;
  text-align: center;
  letter-spacing: 1px;
  border: 2px solid #f0f0f0;
  background-color: var(--panel);
  padding: 1.6rem 1.2rem;
}

.book-blurb-source { display: block; margin-top: 0.6rem; }

.book-action-list { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.book-action {
  display: inline-flex;
  width: fit-content; 
  justify-self: center; 
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border: 1px solid #e2e2e2;
  color: var(--ink-soft);
  text-decoration: none;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  background-color: var(--panel);
  background-image: linear-gradient(180deg, #ffffff 100%, #f1f1f1 100%);
}

.book-action:hover {
  color: var(--accent);
  border-color: #d7deea;
  background-image: linear-gradient(180deg, #ffffff 0%, #e9eef8 100%);
}

.book-accent { width: fit-content; justify-self: center; }

.book-gallery { display: grid; gap: var(--space-3); }

@media (min-width: 768px) {
  .book-hero {
    flex-direction: row;     /* Snaps them perfectly side-by-side */
    justify-content: center; /* Centers the side-by-side pair across 1100px */
    align-items: center;     /* Keeps them vertically aligned with each other */
    gap: clamp(2rem, 5vw, 4rem); /* Dynamic gap scaling up for desktop viewports */
  }

  .book-cover { 
    max-width: 392px;        /* Restores full scale asset size for desktop layout */
    flex: 0 1 392px;         /* Lock structural sizing */
  }

  .book-overview {
    flex: 0 1 420px;         /* Lock structural sizing */
  }
}

/* ---------- about page ---------- */
.two-column-layout {
  width: min(100%, var(--content-max));
  max-width: 980px;
  margin: var(--space-3) auto;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.left-column { flex: 0 1 320px; }
.right-column { flex: 1 1 420px; color: var(--ink-body); line-height: 1.54; text-align: justify; }

.right-column .lede,
.right-column .section-heading {
  color: var(--accent-deep);
  font-size: 1.58rem;
  line-height: 1.2;
  letter-spacing: 0.2px;
  text-align: left;
  margin-bottom: 0.7rem;
}

.client-list { margin: 0; padding: 0; }

/* ---------- contact page ---------- */
.contact-image-grid {
  width: min(100%, 800px);
  margin: 1.5rem auto 0;
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 310px);
  justify-content: center;
  align-items: start;
  gap: var(--space-3);
}

.contact-secondary-images { display: grid; gap: var(--space-2); }

.contact-copy {
  width: min(100%, 800px);
  margin: 1.75rem auto 0;
  font-size: 15px;
  line-height: 1.54;
  text-align: justify;
  color: var(--ink-body);
}

.contact-copy + .contact-copy { margin-top: 0.5rem; }
.contact-copy a { color: var(--accent-link); }

.contact-form-wrap { width: min(100%, 683px); margin: 1.5rem auto 0; }

#contact-form div { margin-bottom: 0.5rem; }

#contact-form label {
  display: block;
  color: var(--ink-muted);
  margin: 0 0 4px;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  background: #fff;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: normal;
}

#contact-form textarea { height: 150px; resize: vertical; }

#contact-submit {
  width: 100%;
  padding: 12px;
  margin: 5px 0 4px;
  border: 1px solid #ccc;
  background: #fff;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-muted);
  cursor: pointer;
}

#contact-submit:hover { background-color: var(--panel); }

.contact-status {
  display: none;
  text-align: center;
  margin-top: 2rem;
  font-size: 15px;
}

.contact-status.is-visible { display: block; }
.contact-status.success { color: var(--accent-deep); }
.contact-status.error { color: #b00020; }

/* ---------- footer (shared) ---------- */
.site-footer-wrap {
  width: 100%;
  margin: 2.5rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-footer-leaves { width: max-content; margin: 0 auto; transform: translateX(10px) }

.site-footer {
  width: min(100%, var(--content-max));
  margin: 0.5rem auto 0;
  padding: 0.5rem 0 1rem;
  text-align: center;
}

.site-footer-copyright {
  font-size: 12px;
  line-height: 1.18;
  letter-spacing: 1px;
  color: var(--ink-muted);
  text-align: center;
}

.site-footer-social {
  margin: 0.75rem auto 0;
  width: 170px;
  height: 70px;
  position: relative;
}

.site-footer-social a { position: absolute; top: 0; left: 0; margin: 0; }

#social-instagram-bg { left: 0; top: 1px; }
#social-facebook-bg { left: 53px; top: 0; }
#social-pinterest-bg { left: 105px; top: 0; }
#social-instagram-icon { left: 12px; top: 20px; }
#social-pinterest-icon { left: 118px; top: 20px; }
#social-facebook-icon { left: 62px; top: 17px; }

/* ---------- lightbox (native <dialog>) ---------- */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
}

.lightbox::backdrop { background: rgba(0, 0, 0, 0.82); }

.lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .two-column-layout { flex-direction: column; gap: var(--space-2); }
  .left-column, .right-column { flex: 1 1 auto; width: 100%; }
  .right-column .lede, .right-column .section-heading { font-size: 1.4rem; }
}

@media (max-width: 840px) {
  .art-gallery-row,
  .art-gallery-columns { flex-direction: column; }

  #characters-left-column,
  #characters-right-column,
  #characters-gallery-opening-row > .art-gallery-card-wide,
  #characters-gallery-opening-row > .art-gallery-stack,
  #characters-mid-row > .art-gallery-card-wide,
  #characters-mid-row > .art-gallery-card-tall,
  #characters-portrait-row > .art-gallery-card-slim,
  #characters-portrait-row > .art-gallery-card-wide,
  #characters-lower-pair > #characters-fisherwoman,
  #characters-lower-pair > #characters-family-portrait {
    flex-basis: auto;
  }
}

@media (max-width: 760px) {
  .book-hero { flex-direction: column; }
  .book-cover, .book-overview { max-width: 100%; width: 100%; }
  .books-grid { grid-template-columns: 1fr; }
  .book-card, .book-card-wide, #book-card-ribbon, #book-card-small-seed { max-width: 343px; width: 100%; }
}

@media (max-width: 640px) {
  body { padding-top: 100px; }

  #page { padding-left: 0.75rem; padding-right: 0.75rem; }

  .contact-image-grid { grid-template-columns: 1fr; }

  .home-gallery { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .home-gallery-item { width: 100%; }
  .home-gallery-image { width: min(100%, 257px); margin: 0 auto; }

  .tb-nav-list {
    display: block;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
  }

  .tb-nav-item { width: 100%; padding-bottom: 0; border-bottom: 1px solid #efefef; }
  .tb-nav-item:last-child { border-bottom: 0; }

  .tb-nav-link {
    min-height: 46px;
    padding: 0.72rem 0.95rem;
    display: flex;
    align-items: center;
    font-size: 13px;
    letter-spacing: 0.7px;
  }

  .tb-subnav {
    position: static;
    top: auto; left: auto; transform: none;
    min-width: 0;
    border: 0;
    border-top: 1px solid #e9e9e9;
    background-color: #fafafa;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
  }

  .tb-nav-item.is-open > .tb-subnav { display: block; }
  .tb-has-subnav:hover > .tb-subnav,
  .tb-has-subnav:focus-within > .tb-subnav { transform: none; }

  .tb-subnav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    text-align: left;
    padding: 0.65rem 0.95rem 0.65rem 1.35rem;
    font-size: 12px;
    background-color: #fafafa;
  }

  .tb-subnav-link:hover,
  .tb-subnav-link:active,
  .tb-subnav-link:focus-visible,
  .tb-nav-link:active,
  .tb-nav-link:focus-visible {
    background-color: #f1f5f8;
  }
}