/*
Theme Name: Standish
Theme URI: http://standish.local:8080/
Author: Bryan
Author URI: http://standish.local:8080/
Description: Minimalist, image-forward block theme for Elisabeth Standish's painting website, inspired by contemporary artist portfolio layouts.
Version: 0.5.4
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: standish
Tags: one-column, custom-colors, custom-logo, custom-menu, featured-images
*/

/*
   Colour palettes. The palette is chosen in Customizer > Colour palette
   (theme mod standish_palette) and applied as a body class.
   :root carries the default "ivory" palette; body.palette-* overrides it.
   --primary is the palette's anchor (darkest brand) colour, --on-primary
   is the readable text colour on top of it. --wp--preset--color--* mirrors
   keep Gutenberg content in sync with the chosen palette.
*/
:root {
  --ink: #1c1c1c;
  --paper: #f7f4ee;
  --cloud: #ffffff;
  --primary: #8a3324;
  --accent: #8a3324;
  --muted: #6b6256;
  --line: #e4ddd0;
  --tint: #efe9dd;
  --on-primary: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --gutter: clamp(1rem, 5vw, 4rem);
  --maxw: 1200px;
}

/* Option 1: sage green (Pantone sage green #9CAF88 as the primary colour). */
body.palette-sage {
  --ink: #2f3b2a;
  --paper: #eff3e9;
  --cloud: #fafcf6;
  --primary: #9caf88;
  --accent: #5f7a4b;
  --muted: #6f7d63;
  --line: #d9e2cd;
  --tint: #e4ebda;
  --on-primary: #2f3b2a;
  --wp--preset--color--ink: #2f3b2a;
  --wp--preset--color--paper: #eff3e9;
  --wp--preset--color--cloud: #fafcf6;
  --wp--preset--color--primary: #9caf88;
  --wp--preset--color--accent: #5f7a4b;
  --wp--preset--color--muted: #6f7d63;
  --wp--preset--color--line: #d9e2cd;
}

/* Option 2: mist blue (#E1F3F5 as the primary colour). */
body.palette-mist {
  --ink: #173239;
  --paper: #f2f9fa;
  --cloud: #fcfefe;
  --primary: #e1f3f5;
  --accent: #4a7f8c;
  --muted: #5d7c85;
  --line: #d4ebee;
  --tint: #e7f2f4;
  --on-primary: #173239;
  --wp--preset--color--ink: #173239;
  --wp--preset--color--paper: #f2f9fa;
  --wp--preset--color--cloud: #fcfefe;
  --wp--preset--color--primary: #e1f3f5;
  --wp--preset--color--accent: #4a7f8c;
  --wp--preset--color--muted: #5d7c85;
  --wp--preset--color--line: #d4ebee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--cloud);
  padding: 0.5rem 1rem; z-index: 100; transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--paper); z-index: 50;
}
.site-branding { display: flex; align-items: center; }
.site-logo { font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0.08em; text-transform: uppercase; }
.custom-logo { max-height: 52px; width: auto; }
.nav-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.nav-menu a { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.nav-menu a:hover, .nav-menu .current-menu-item > a { color: var(--accent); }

/* Sections */
.site-main { width: 100%; }
.section { padding: clamp(2.5rem, 7vw, 6rem) var(--gutter); border-bottom: 1px solid var(--line); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(340px, 60vh, 660px);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(3rem, 9vw, 7rem) var(--gutter); background: var(--cloud);
}
.hero-copy {
  position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.hero-banner { position: absolute; inset: 0; z-index: 0; }
.hero-banner-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; opacity: 0; transition: opacity 1.4s ease;
}
.hero-banner-img.is-active { opacity: 0.6; }
.hero-scrim {
  position: absolute; inset: 0; z-index: 1; background: var(--cloud); opacity: 0.78;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, #000 40%, rgba(0,0,0,0.5) 66%, transparent 88%);
  mask-image: linear-gradient(100deg, #000 0%, #000 40%, rgba(0,0,0,0.5) 66%, transparent 88%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 20ch; }
.hero .tagline { color: var(--muted); max-width: 44ch; font-size: 1.05rem; }
.btn {
  display: inline-block; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); border: 1px solid var(--ink); padding: 0.75rem 1.25rem; align-self: flex-start;
}
.btn:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.feature .ph-image {
  aspect-ratio: 4 / 5; border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, var(--paper), var(--paper) 12px, var(--tint) 12px, var(--tint) 24px);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem; letter-spacing: 0.08em;
}
.feature h3 { margin-top: 1rem; font-size: 1.25rem; }
.feature p { color: var(--muted); font-size: 0.95rem; }
.feature-image { display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); background: var(--cloud); }
.feature-image img { width: 100%; height: 100%; object-fit: cover; }

/* Works grid */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.work-tile {
  aspect-ratio: 1 / 1; border: 1px solid var(--line); background: var(--cloud);
  display: flex; flex-direction: column; justify-content: center;
  color: var(--muted); font-size: 0.85rem; letter-spacing: 0.08em;
  margin: 0;
}
.work-tile a { flex: 1 1 auto; display: block; overflow: hidden; }
.work-tile img { width: 100%; height: 100%; object-fit: cover; }
.work-tile figcaption {
  padding: 0.6rem 0.75rem; border-top: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted);
}
.work-ref { font-size: 0.7rem; opacity: 0.55; }

/* Statement + placeholders */
.statement { max-width: 60ch; }
.ph-text {
  border: 1px dashed var(--line); padding: 1.5rem;
  color: var(--muted); font-style: italic;
}

/* Lightbox artwork viewer */
.lightbox {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem); background: rgba(18, 18, 18, 0.93); color: #f7f4ee;
}
.lightbox[hidden] { display: none; }
body.has-lightbox { overflow: hidden; }
.lightbox-inner { display: flex; flex-direction: column; gap: 0.75rem; max-width: min(1100px, 100%); min-width: 0; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.lightbox-image { display: block; margin: 0 auto; max-width: 100%; max-height: 78vh; object-fit: contain; background: #fff; }
.lightbox figcaption { text-align: center; font-size: 0.9rem; letter-spacing: 0.08em; opacity: 0.85; }
.lightbox-counter { text-align: center; margin: 0; font-size: 0.78rem; letter-spacing: 0.12em; opacity: 0.6; }
.lightbox-nav, .lightbox-close {
  position: fixed; border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: 1.9rem; line-height: 1; padding: 0.5rem 0.7rem;
}
.lightbox-nav:hover, .lightbox-close:hover { opacity: 0.65; }
.lightbox-nav:focus-visible, .lightbox-close:focus-visible { outline: 2px solid currentColor; }
.lightbox-prev { left: clamp(0.4rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: clamp(0.4rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lightbox-close { top: clamp(0.4rem, 2vw, 1.5rem); right: clamp(0.4rem, 2vw, 1.5rem); }

/* Pages */
.page-main { padding: clamp(2.5rem, 7vw, 6rem) var(--gutter); }
.page-article { max-width: var(--maxw); margin: 0 auto; }
.page-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.5rem; }
.page-header { max-width: 70ch; margin-inline: auto; }
.page-content { max-width: 70ch; margin-inline: auto; }
.page-content > .wp-block-image { margin-block: 0 1.75rem; }

/* Soft white panels: content sits on a raised card, titles stay bare */
.panel,
.page-content,
.feature-grid,
.works-grid {
  background: var(--cloud);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  box-shadow: 0 22px 45px -28px rgba(28, 28, 28, 0.35), 0 4px 12px -6px rgba(28, 28, 28, 0.12);
}
.panel { display: grid; gap: 1.25rem; max-width: 70ch; }
.panel .btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.panel .btn { justify-self: start; }

/* Contact form (Ninja Forms) */
.nf-field-container { margin-bottom: 1.25rem; }
.nf-field-label label {
  display: block; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.4rem;
}
.ninja-forms-req-symbol { color: var(--accent); }
.ninja-forms-field {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.75rem 0.9rem;
}
.ninja-forms-field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea.ninja-forms-field { min-height: 9rem; resize: vertical; }
.nf-error-msg, .nf-form-errors { color: var(--accent); font-size: 0.85rem; }
.submit-container .ninja-forms-field {
  width: auto; background: var(--cloud); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 0; cursor: pointer;
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.75rem 1.25rem;
}
.submit-container .ninja-forms-field:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.nf-form-complete { font-family: var(--serif); font-size: 1.15rem; }
.nf-form-hp { display: none; }

/* Footer */
.site-footer { padding: clamp(2rem, 5vw, 4rem) var(--gutter); display: grid; gap: 1.5rem; text-align: center; }
.footer-nav { text-align: center; }
.footer-menu { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin: 0; padding: 0; }
.footer-menu a { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.footer-menu a:hover { color: var(--accent); }
.social-icon { display: inline-flex; }
.social-icon svg { width: 24px; height: 24px; display: block; }
.footer-copy { font-size: 0.8rem; color: var(--muted); margin: 0; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap;
}

@media (max-width: 720px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .nav-menu { gap: 0.9rem; }
  .hero { min-height: clamp(300px, 52vh, 480px); }
  .hero-scrim { opacity: 0.86; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-banner-img { transition: none; }
}
