/* =========================================================
   E. K. Patterson — shared stylesheet
   Palette: warm paper-neutral canvas, tuned to sit evenly
            beneath all four accent hues. Each section carries
            its own accent color:
              Home        — neutral taupe
              Photography — tomato red
              Writing     — yellow ochre
              Artwork     — cerulean blue
   Fonts: Space Grotesk (headers) / Karla (body)
   ========================================================= */

:root {
  --color-bg: #f6f3ef;
  --color-bg-alt: #eae4dc;
  --color-surface: #ffffff;
  --color-border: #dcd3c6;

  --color-text: #322920;
  --color-text-muted: #7a6b5c;

  /* Home / neutral accent (default) */
  --color-accent: #5b484e;
  --color-accent-dark: #3b2b30;
  --color-accent-soft: #e9e2e4;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Karla", "Segoe UI", sans-serif;

  --max-width: 1100px;
}

/* Per-section accent overrides — same saturation/lightness formula
   across hues so the four accents read as one coordinated family */
body.page-photography {
  --color-accent: #b8492e;
  --color-accent-dark: #87321d;
  --color-accent-soft: #f1d6d0;
}

body.page-writing {
  --color-accent: #b88e2e;
  --color-accent-dark: #87671d;
  --color-accent-soft: #f1e7d0;
}

body.page-artwork {
  --color-accent: #2e8ab8;
  --color-accent-dark: #1d6387;
  --color-accent-soft: #d0e6f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

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

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

/* ===== Site header / nav ===== */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-bg);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.site-title:hover {
  color: var(--color-accent);
}

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

.site-nav a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background-color: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

.site-nav a[aria-current="page"] {
  background-color: var(--color-accent);
  color: #fff;
}

/* ===== Hero (index page) ===== */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: left;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0 0 20px;
}

.hero .about-blurb {
  max-width: 640px;
  margin: 0;
  color: var(--color-text);
}

/* ===== Explore cards (index page) ===== */

.explore-grid {
  max-width: var(--max-width);
  margin: 20px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.explore-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 14px;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(51, 39, 48, 0.1);
}

/* Preview image pulled from the linked section — swap for a real <img> */
.explore-frame {
  aspect-ratio: 3 / 2;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.explore-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.explore-frame--photography {
  background-image: repeating-linear-gradient(135deg, #f1d6d0, #f1d6d0 12px, #fff 12px, #fff 24px);
}

.explore-frame--writing {
  background-color: #f1e7d0;
}

.explore-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  line-height: 1.45;
  color: var(--color-accent-dark);
  margin: 0;
}

.explore-frame--artwork {
  background-image: repeating-linear-gradient(135deg, #d0e6f1, #d0e6f1 12px, #fff 12px, #fff 24px);
}

/* Once a real preview photo is in place, add this alongside .explore-frame — drops
   the padding and striped placeholder pattern so the image fills the whole button */
.explore-frame--has-image {
  padding: 0;
  background-image: none;
}

.explore-card .kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-dark);
  font-weight: 600;
}

.explore-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0;
}

.explore-card p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.explore-card .view-link {
  margin-top: auto;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ===== Section header (photography / writing / artwork pages) ===== */

.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 32px;
}

.page-header .kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark);
  font-weight: 600;
  margin: 0 0 8px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  margin: 0 0 14px;
}

.page-header p {
  max-width: 620px;
  color: var(--color-text-muted);
  margin: 0;
}

.page-header .shot-note {
  margin-top: 8px;
  font-size: 0.85rem;
  font-style: italic;
}

.page-header .rights-note {
  margin-top: 14px;
  font-size: 0.8rem;
}

/* ===== Work grid (photography / artwork) =====
   A masonry-style brick layout via CSS multi-column — no JS. Cards flow
   down each column and wrap to the next; the column count adapts on its
   own as the viewport narrows (3 columns of >=260px, then 2, then 1). */

.work-grid {
  max-width: var(--max-width);
  margin: 0 auto 80px;
  padding: 0 24px;
  columns: 3 260px;
  column-gap: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

/* Wraps a thumbnail — either opens a lightbox (#lb-...) or navigates
   to a collection page. Hover/focus lifts the frame to read as clickable. */
.work-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-card-link:hover .work-frame,
.work-card-link:focus-visible .work-frame {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(50, 41, 32, 0.14);
}

.work-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background-image: repeating-linear-gradient(
    135deg,
    var(--color-accent-soft),
    var(--color-accent-soft) 12px,
    var(--color-surface) 12px,
    var(--color-surface) 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Once a real photo is in place, add this alongside .work-frame — drops
   the placeholder's fixed box shape and striped pattern so the frame
   sizes itself to that image's own aspect ratio instead of letterboxing it */
.work-frame--has-image {
  aspect-ratio: auto;
  background-image: none;
  background-color: var(--color-surface);
  padding: 0;
}

.work-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 9px;
}

/* Marks a thumbnail as the cover of a collection rather than a single piece */
.collection-badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  background-color: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
}

.work-caption .work-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.work-caption .work-meta {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===== Lightbox (pure CSS, no JS — opened via #lb-... anchors) ===== */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 48px 24px;
  align-items: center;
  justify-content: center;
}

.lightbox:target {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(30, 22, 16, 0.86);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: min(90vw, 900px);
  max-height: 78vh;
  border-radius: 6px;
  object-fit: contain;
}

/* Placeholder for the full-size image — swap for <img src="..." alt="..."> */
.lightbox-frame {
  width: min(80vw, 640px);
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.14) 14px,
    rgba(255, 255, 255, 0.04) 14px,
    rgba(255, 255, 255, 0.04) 28px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #fdf9f6;
  font-size: 0.9rem;
}

.lightbox-frame-hint {
  display: block;
  margin-top: 8px;
  font-size: 0.78rem;
  opacity: 0.75;
}

.lightbox-caption {
  margin: 0;
  color: #fdf9f6;
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fdf9f6;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
}

.lightbox-close:hover {
  color: var(--color-accent-soft);
}

/* ===== Writing list ===== */

.writing-list {
  max-width: 760px;
  margin: 0 auto 80px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.writing-entry {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 32px;
}

.writing-entry:last-child {
  border-bottom: none;
}

/* Optional — omit this element entirely on entries with no icon */
.writing-entry-icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background-image: repeating-linear-gradient(
    135deg,
    var(--color-accent-soft),
    var(--color-accent-soft) 8px,
    var(--color-surface) 8px,
    var(--color-surface) 16px
  );
}

.writing-entry-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.writing-entry-body {
  flex: 1;
  min-width: 0;
}

.writing-entry .work-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 4px;
}

.writing-entry h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 10px;
}

.writing-entry h2 a {
  color: inherit;
  text-decoration: none;
}

.writing-entry h2 a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

.writing-entry p.excerpt {
  margin: 0 0 12px;
  color: var(--color-text);
}

.writing-entry .read-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.writing-entry .read-link:hover {
  text-decoration: underline;
}

/* ===== Back link + article body (collection & writing-piece pages) ===== */

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.article-body {
  max-width: 700px;
  margin: 0 auto 80px;
  padding: 0 24px;
  color: var(--color-text);
}

.article-body p {
  margin: 0 0 20px;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 32px 0 12px;
  color: var(--color-accent-dark);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body ol {
  margin: 0 0 20px;
  padding-left: 1.3em;
}

.article-body li {
  margin-bottom: 14px;
}

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

/* ===== Footer ===== */

.site-footer {
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg-alt);
  padding: 28px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer .footer-links {
  margin-bottom: 8px;
}

.site-footer .footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  margin: 0 8px;
}

.site-footer .footer-links a:hover {
  color: var(--color-accent-dark);
}

/* ===== 404 (not_found.html) ===== */

.error-page {
  max-width: 600px;
  margin: 100px auto 140px;
  padding: 0 24px;
  text-align: center;
}

.error-page .kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark);
  font-weight: 600;
  margin: 0 0 16px;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  color: var(--color-accent);
  margin: 0;
  line-height: 1;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 12px 0 16px;
}

.error-page p:not(.kicker) {
  color: var(--color-text-muted);
  margin: 0 auto 28px;
}

.error-page .home-link {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-decoration: none;
}

.error-page .home-link:hover {
  text-decoration: underline;
}

/* ===== Featured piece (artwork page, single-item teaser while gallery is on hold) ===== */

.featured-piece {
  max-width: 300px;
  margin: 0 auto 32px;
  padding: 0 24px;
  text-align: center;
}

.featured-piece-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark);
  font-weight: 600;
  margin: 0 0 16px;
}

.featured-piece-frame {
  border-radius: 10px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(50, 41, 32, 0.1);
}

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

.featured-piece-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 16px 0 4px;
}

.featured-piece-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ===== Coming soon (artwork page, gallery on hold) ===== */

.coming-soon {
  max-width: var(--max-width);
  margin: 0 auto 100px;
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
}

.coming-soon-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark);
  font-weight: 600;
  margin: 0 0 8px;
}

.coming-soon h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0 0 12px;
}

.coming-soon p:last-child {
  max-width: 480px;
  margin: 0 auto;
  color: var(--color-text-muted);
}

/* ===== Responsive ===== */

@media (max-width: 800px) {
  .explore-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .explore-grid {
    grid-template-columns: 1fr;
  }
}
