/*
 * Stacey's Photography — shared styles for Home, Gallery, About, and Contact.
 * Direction: the supplied "Stacey's Photography — Brand Kit.html".
 *
 * Each root-level HTML page should link assets/css/styles.css. Load the brand
 * fonts in the HTML head (with preconnect to fonts.googleapis.com and
 * fonts.gstatic.com), using this stylesheet URL:
 * https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500&family=Newsreader:ital,wght@0,400;0,500;1,400&family=Pinyon+Script&display=swap
 * The fallback fonts below keep the pages usable if remote fonts are unavailable.
 *
 * Component contract:
 * - .container constrains shared page content; .section supplies vertical space.
 * - .site-header > .container holds .logo and .nav (no JavaScript menu required).
 * - .hero is reserved for the homepage; .sky-divider is a decorative separator.
 * - .gallery-grid contains .photo figures, with optional .caption figcaptions.
 * - .split-layout supports About and Contact content beside an image or form.
 * - body.theme-night or a section.theme-night opts into the dark palette.
 * - Add aria-current="page" to the current navigation link in each HTML page.
 */

/* Brand tokens are kept separate from semantic colors so night mode remains
 * readable without changing the colors used by the light theme. */
:root {
  color-scheme: light;
  --twilight: #7f7aa3;
  --twilight-deep: #4e4a6e;
  --rose: #d48a8f;
  --rose-deep: #a8575f;
  --ember: #e89a6a;
  --gold: #f1cb88;
  --silhouette: #2b2127;
  --cedar: #3e4a3c;
  --sage: #8b9570;
  --frost: #f6f3f5;
  --mist: #e6e1ea;
  --sky: linear-gradient(180deg, #5f5a82 0%, #a38ba6 28%, var(--rose) 52%, var(--ember) 78%, var(--gold) 100%);

  --font-script: "Pinyon Script", "Snell Roundhand", "Brush Script MT", cursive;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 4px;
  --measure: 62ch;
  --content-width: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-space: clamp(2.5rem, 7vw, 5rem);

  --page-background: var(--frost);
  --text-color: var(--silhouette);
  --secondary-text: var(--twilight-deep);
  --link-color: var(--twilight-deep);
  --link-hover: var(--rose-deep);
  --subtle-background: var(--mist);
  --border-color: var(--mist);
  --control-border: var(--twilight-deep);
  --focus-color: var(--twilight-deep);
}

/* Base elements: preserve native document behavior and natural photo ratios. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--page-background);
  color: var(--text-color);
  font: 400 1.0625rem/1.65 var(--font-body);
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p, ul, ol, blockquote {
  max-width: var(--measure);
  margin: 0 0 1em;
}

ul, ol { padding-inline-start: 1.4em; }
li + li { margin-top: 0.4em; }
strong, b { font-weight: 500; }

a {
  color: var(--link-color);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--link-hover); }

:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 4px;
}

img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }

/* Accessibility helpers retain labels in the accessibility tree. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.65rem 1rem;
  transform: translateY(-200%);
  background: var(--page-background);
  color: var(--text-color);
}

.skip-link:focus { transform: translateY(0); }

/* Shared page structure. Use section--mist only for text-led sections, never
 * as a colored gallery-card treatment. */
.container {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin-inline: auto;
}

.section { padding-block: var(--section-space); }
.section--mist { background: var(--subtle-background); }
.section-heading { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-heading { padding-block: var(--section-space) 2rem; }
.page-heading p { color: var(--secondary-text); }

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
}

.split-layout > * { min-width: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2:not(:first-child), .prose h3:not(:first-child) { margin-top: 1.5em; }
.lead { font-size: clamp(1.125rem, 2vw, 1.3rem); }

/* Header and navigation wrap on narrow screens rather than hiding links
 * behind an unimplemented mobile-menu button. */
.site-header { border-bottom: 1px solid var(--border-color); }
.site-header > .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  padding-block: 1.25rem;
}

.logo {
  font-family: var(--font-script);
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: inherit;
  text-decoration: none;
}

.nav, .nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  align-items: center;
}

.nav ul { padding: 0; margin: 0; list-style: none; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--rose); }
.nav a[aria-current="page"] { font-weight: 500; }

/* Homepage only: dark text stays readable across the warm/light gradient.
 * Tree silhouettes or background photography can be added in the HTML later. */
.hero {
  display: grid;
  place-items: center;
  min-height: 28rem;
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
  background: var(--sky);
  color: var(--silhouette);
  text-align: center;
}

.hero-content { width: min(100%, var(--content-width)); }
.hero p { margin-inline: auto; }
.hero .logo { font-size: clamp(3.2rem, 10vw, 6.5rem); }
.hero .btn-quiet { color: var(--silhouette); border-color: var(--silhouette); }
.hero :focus-visible { outline-color: var(--silhouette); }
.sky-divider { height: 0.3rem; background: var(--sky); }

/* Brand actions: cedar primary, outlined secondary, deep-rose hover.
 * .btn-quiet works with or without a separate .btn class. */
.btn, .btn-quiet {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.8em 1.6em;
  border: 1px solid var(--cedar);
  border-radius: 999px;
  background: var(--cedar);
  color: var(--frost);
  font: 500 0.95rem/1.4 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover, .btn-quiet:hover {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: #fff;
}

.btn-quiet { background: transparent; color: var(--cedar); }
.btn-quiet:hover {
  background: var(--mist);
  border-color: var(--cedar);
  color: var(--silhouette);
}

.button-group { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero .button-group { justify-content: center; }
.btn:disabled, .btn-quiet:disabled { opacity: 0.65; }

/* Gallery: neutral mats, square corners, and complete uncropped photographs.
 * Columns align from the top; masonry or lightbox behavior is not assumed. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.gallery-grid > * { min-width: 0; }
.photo {
  padding: 0.75rem;
  background: #fff;
  color: var(--silhouette);
  border: 1px solid var(--mist);
  border-radius: 0;
}

.photo img { width: 100%; height: auto; }
.photo > a { display: block; }
.photo .caption { color: var(--twilight-deep); }
.caption, figcaption {
  margin: 0.6rem 0 0;
  color: var(--secondary-text);
  font: italic 400 0.95rem/1.5 var(--font-display);
}

/* Contact controls: visible labels belong above each input. HTML should
 * provide required/type/autocomplete attributes and accessible error messages. */
.contact-form { width: 100%; max-width: var(--measure); }
.form-field { margin-bottom: 1.25rem; }
label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
input, textarea, select {
  width: 100%;
  max-width: 100%;
  padding: 0.7em 0.9em;
  background: #fff;
  color: var(--silhouette);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
}

/* Keep checkboxes/radios native-sized if used on the future contact form. */
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; accent-color: var(--cedar); }
textarea { min-height: 10rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--twilight-deep); opacity: 1; }
[aria-invalid="true"] { border: 2px solid var(--rose-deep); }
.form-help { margin: 0.4rem 0 0; color: var(--secondary-text); font-size: 0.9rem; }
.form-error { margin: 0.4rem 0 0; color: var(--link-hover); font-weight: 500; }

.site-footer {
  margin-top: var(--section-space);
  padding-block: 2rem;
  background: var(--subtle-background);
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer p { margin: 0; }

/* Optional explicit night theme from the kit, not an automatic OS-theme switch.
 * Gold/rose light accents provide contrast on silhouette; photo mats stay white. */
.theme-night {
  color-scheme: dark;
  --page-background: var(--silhouette);
  --text-color: var(--frost);
  --secondary-text: var(--mist);
  --link-color: var(--gold);
  --link-hover: #edb6bb;
  --subtle-background: #362b33;
  --border-color: #736773;
  --control-border: var(--mist);
  --focus-color: var(--gold);
  background: var(--page-background);
  color: var(--text-color);
}

.theme-night .btn-quiet { color: var(--frost); border-color: var(--mist); }
.theme-night .btn-quiet:hover { color: var(--silhouette); background: var(--mist); }
.theme-night input, .theme-night textarea, .theme-night select { background: var(--silhouette); color: var(--frost); }
.theme-night input::placeholder, .theme-night textarea::placeholder { color: var(--mist); }
.theme-night .photo :focus-visible { outline-color: var(--twilight-deep); }

@media (max-width: 44rem) {
  .split-layout { grid-template-columns: minmax(0, 1fr); }
  .site-header > .container { align-items: flex-start; }
  .nav, .nav ul { gap: 0.35rem 1.25rem; }
  .hero { min-height: 23rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn-quiet { transition: none; }
}


/* Portfolio gallery extension. Fixed column tracks prevent a small category
 * from expanding one image across the entire page. New entries inherit the
 * same quiet mat, viewing area, caption rhythm, and responsive behavior. */
.gallery-page { padding-bottom: 1rem; }
.gallery-heading { max-width: 45rem; }
.gallery-heading h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); }
.gallery-eyebrow {
  margin-bottom: 1rem;
  color: var(--secondary-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gallery-toolbar { margin-bottom: 2rem; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1.2rem; }
.gallery-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-color);
  font: 500 0.9rem/1.4 var(--font-body);
}
.gallery-filter span { font-size: 0.75rem; }
.gallery-filter:hover { background: var(--subtle-background); }
.gallery-filter[aria-pressed="true"] { color: var(--frost); background: var(--cedar); border-color: var(--cedar); }
.gallery-status { display: inline; font-size: 0.9rem; color: var(--secondary-text); }
.gallery-hint { margin: 0.35rem 0 0; font: italic 400 1rem/1.5 var(--font-display); color: var(--secondary-text); }
.portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-card { padding: 0.75rem 0.75rem 1rem; }
.gallery-image-link { display: block; aspect-ratio: 4 / 3; }
.gallery-image-link img { width: 100%; height: 100%; object-fit: contain; }
.gallery-card figcaption { margin: 0.9rem 0.2rem 0; }
.gallery-caption-title { display: block; color: var(--twilight-deep); }
.gallery-caption-category {
  display: block;
  margin-top: 0.35rem;
  color: var(--twilight-deep);
  font: 400 0.7rem/1.5 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gallery-empty { padding-block: 3rem; color: var(--secondary-text); }
@media (max-width: 62rem) { .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 39rem) {
  .portfolio-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-filter { padding-inline: 0.9rem; }
}


/* Homepage: a quiet introduction beside the dusk photograph that inspired
 * the palette. These styles never crop the lead or featured photographs. */
.home-introduction {
  padding-block: clamp(2.5rem, 6vw, 5.5rem);
  background: linear-gradient(180deg, var(--frost), #eee8ed);
  border-bottom: 1px solid var(--mist);
}
.home-introduction-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.home-introduction-grid > * { min-width: 0; }
.home-introduction-copy { padding-block: 1rem; }
.home-introduction-copy h1 { font-size: clamp(2.7rem, 4.8vw, 4.4rem); }
.home-introduction-copy h1 em { color: var(--twilight-deep); font-weight: 400; }
.home-introduction-description { max-width: 29ch; margin-block: 1.5rem 2rem; color: var(--secondary-text); font-size: 1.125rem; }
.home-introduction .btn { gap: 1rem; }
.home-lead-photo { padding: 0.75rem; background: #fff; border: 1px solid var(--mist); }
.home-lead-photo img { width: 100%; height: auto; }
.home-lead-photo figcaption { padding: 0.15rem 0.25rem 0.25rem; color: var(--twilight-deep); }
.home-selection { padding-bottom: 0; }
.home-selection-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; margin-bottom: 2rem; }
.home-selection-heading h2 { margin-bottom: 0; }
.home-selection-heading .gallery-eyebrow { margin-bottom: 0.75rem; }
.home-text-link { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; }
.home-category-navigation { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.75rem; border-top: 1px solid var(--mist); }
.home-category-label { color: var(--secondary-text); font: italic 400 1.15rem/1.5 var(--font-display); }
.home-category-links { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.home-category-links a { display: inline-flex; align-items: center; gap: 1rem; min-height: 2.75rem; }
@media (max-width: 52rem) {
  .home-introduction-grid { grid-template-columns: minmax(0, 1fr); }
  .home-introduction-copy { padding-block: 0; }
  .home-introduction-description { max-width: 40ch; }
}
