/* Louise Cowpland Photography: one stylesheet for the whole site. */

:root {
  /* Neutral black, white and grey so the photos provide the colour.
     To use an accent colour, change --accent and --accent-dark. */
  --bg: #ffffff;
  --bg-soft: #f6f6f5;
  --text: #1f1f1f;
  --muted: #666664;
  --line: #e3e3e1;
  --accent: #1f1f1f;
  --accent-dark: #000000;
  --accent-soft: #efefed;
  --ok-bg: #e7f2e6;
  --ok-text: #2f5d2c;
  --error-bg: #fbe9e7;
  --error-text: #8c2a1c;
  --radius: 6px;
  --container: 1160px;
  --gutter: 16px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { font-weight: 400; line-height: 1.25; margin: 0 0 .6em; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; font-weight: 500; }
p { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--text); color: #fff; padding: 8px 12px; }
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------- buttons */

.button, button.button, input[type=submit].button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: .7em 1.5em;
  font: inherit;
  font-weight: 500;
  letter-spacing: .03em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.button.button-light { background: transparent; color: var(--accent); }
.button.button-light:hover { background: var(--accent-soft); color: var(--accent-dark); }
.button.button-on-photo { background: rgba(255, 255, 255, .92); border-color: transparent; color: var(--text); }
.button.button-on-photo:hover { background: #fff; border-color: transparent; color: var(--text); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 16px; }

.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--text); line-height: 1.15; }
.brand:hover { color: var(--text); }
.brand-name { font-size: 1.3rem; font-weight: 400; letter-spacing: .04em; }
.brand-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .32em; color: var(--muted); }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; align-items: center; gap: 4px; }
.site-nav a, .sub-toggle {
  display: block; padding: 8px 12px; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font: inherit; font-weight: 400; font-size: .95rem;
  background: none; border: 0; cursor: pointer;
}
.site-nav a:hover, .sub-toggle:hover { background: var(--bg-soft); color: var(--text); }
.site-nav a[aria-current=page], .sub-toggle.is-current { color: var(--accent); }
.sub-toggle::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg); transition: transform .15s;
}
.sub-toggle[aria-expanded=true]::after { transform: translateY(0) rotate(225deg); }
.nav-login { border: 1px solid var(--line); margin-left: 6px; }

.has-sub { position: relative; }
.sub-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08); padding: 6px;
}
.sub-toggle[aria-expanded=true] + .sub-menu { display: block; }

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -8px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    display: block; width: 22px; height: 1.5px; background: var(--text); position: relative; transition: transform .2s, background-color .2s;
  }
  .nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bar::before { top: -7px; }
  .nav-toggle-bar::after { top: 7px; }
  .nav-toggle[aria-expanded=true] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded=true] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded=true] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-nav.is-open { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a, .sub-toggle { padding: 12px 8px; font-size: 1rem; width: 100%; text-align: left; }
  .sub-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
  .nav-login { margin: 8px 0 0; text-align: center !important; }
}

/* No JavaScript: show the whole menu as plain links. */
.no-js .nav-toggle { display: none; }
.no-js .site-nav { display: block; position: static; border: 0; padding: 0 0 12px; }
.no-js .sub-menu { display: block; position: static; box-shadow: none; border: 0; }
.no-js .header-inner { flex-wrap: wrap; }

/* ---------------------------------------------------------------- footer */

.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); margin-top: 64px; font-size: .92rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-top: 32px; padding-bottom: 32px; }
.footer-inner p { margin: 0; }
.footer-brand { color: var(--text); font-weight: 400; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.footer-links a { color: var(--text); overflow-wrap: anywhere; }
.copyright { flex-basis: 100%; font-size: .82rem; }

/* ---------------------------------------------------------------- home */

.hero {
  position: relative; height: min(78vh, 720px); min-height: 420px;
  background: #141414; overflow: hidden; color: #fff;
}
/* The current slideshow photos are only 1254px wide, so stop them stretching across very
   wide screens. Remove this once 1920/2560px versions are in home_photo_widths(). */
@media (min-width: 1440px) {
  .hero { max-width: 1440px; margin: 24px auto 0; border-radius: var(--radius); }
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .15) 45%, rgba(0, 0, 0, 0) 70%);
}
.hero-text { position: absolute; left: 0; right: 0; bottom: 56px; z-index: 2; }
.hero-text h1 { color: #fff; max-width: 16em; text-shadow: 0 1px 12px rgba(0, 0, 0, .3); }
.hero-text p { max-width: 34em; font-size: 1.05rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.hero-dots { position: absolute; z-index: 3; right: var(--gutter); bottom: 20px; display: flex; gap: 4px; }
.hero-dots button {
  width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.hero-dots button::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #fff; background: transparent;
}
.hero-dots button[aria-current=true]::before { background: #fff; }


.home-sessions { padding-top: 32px; }
.cards {
  display: grid; gap: 24px; padding: 24px 0 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card { display: block; text-decoration: none; color: var(--text); }
.card:hover { color: var(--text); }
.card-photo { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--bg-soft); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-photo img { transform: scale(1.03); }
.card h3 { margin: 14px 0 2px; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------------------------------------------------------------- call to action band */

.band { background: var(--accent-soft); margin-top: 64px; }
.band + .site-footer, .band-last { margin-top: 0; }
.band-inner { padding-top: 48px; padding-bottom: 48px; text-align: center; }
.band-inner p { color: var(--muted); max-width: 34em; margin: 0 auto 20px; }

/* ---------------------------------------------------------------- session page */

.session { display: grid; gap: 40px; padding-top: 48px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .session { grid-template-columns: 1fr 1fr; align-items: start; gap: 56px; }
  .session-photo { position: sticky; top: calc(var(--header-h) + 24px); }
}
.session-photo img { width: 100%; border-radius: var(--radius); }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.session-price { font-size: 1.1rem; color: var(--accent); font-weight: 400; margin-bottom: 1.4em; }
.session-text p { color: var(--muted); }
.packages-heading { font-size: 1.15rem; font-weight: 500; margin: 32px 0 6px; }
.packages { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; gap: 12px; }
.package { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.package-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.package-name { font-weight: 500; }
.package-price { font-weight: 500; color: var(--accent); white-space: nowrap; }
.package p { margin: 0; color: var(--muted); font-size: .93rem; }
.note { color: var(--muted); font-size: .93rem; }
.session-actions { margin-top: 24px; }
.other-sessions { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.other-sessions ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.other-sessions a { display: block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .92rem; }
.other-sessions a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- forms */

.page { padding-top: 48px; }
.narrow { max-width: 640px; }
.page-lead { color: var(--muted); }

.form { display: grid; gap: 18px; margin-top: 24px; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 400; margin-bottom: 6px; }
.field .optional { color: var(--muted); font-size: .85rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-weight: 300; color: var(--text);
  padding: 10px 12px; border: 1px solid #c8c8c6; border-radius: var(--radius); background: #fff;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.field-hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .button { justify-self: start; }
.small-print { color: var(--muted); font-size: .85rem; }

.message { border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; background: var(--error-bg); color: var(--error-text); }
.message.ok { background: var(--ok-bg); color: var(--ok-text); }

.login-box { max-width: 420px; margin: 0 auto; }
.admin-link { color: var(--muted); margin-left: 12px; white-space: nowrap; }

/* ---------------------------------------------------------------- client gallery */

.gallery-bar {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line);
  padding: 12px 0; margin-bottom: 24px;
}
.gallery-bar p { margin: 0; color: var(--muted); }
.gallery-bar .actions { display: flex; align-items: center; gap: 16px; }
.selected-count { font-weight: 500; color: var(--text); }

.thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 480px) { .thumbs { grid-template-columns: 1fr 1fr; gap: 10px; } }
.thumb { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.thumb.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.thumb a { display: block; aspect-ratio: 4 / 3; background: var(--bg-soft); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: .85rem; cursor: pointer; overflow-wrap: anywhere; }
.thumb input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* Lightbox for the client gallery */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(12, 12, 12, .95);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; }
.lightbox-caption { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #eee; font-size: .9rem; padding: 0 64px; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%;
  width: 48px; height: 48px; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------------------------------------------------------------- admin */

.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: middle; }
.admin-table th { font-weight: 500; }
.admin-table form { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table input[type=text] { font: inherit; padding: 6px 8px; border: 1px solid #c8c8c6; border-radius: var(--radius); width: 170px; }
.admin-table .button { padding: .35em .9em; }
.table-wrap { overflow-x: auto; }
.warn { color: var(--error-text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- admin galleries and uploads */

.admin-section { margin-top: 40px; }
.admin-section h2 { font-size: 1.3rem; }
.admin-create { max-width: 720px; margin-top: 8px; }
.upload-button { position: relative; }
.upload-button:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.upload-status { margin-top: 20px; max-width: 520px; }
.upload-status progress { width: 100%; height: 10px; accent-color: var(--accent); }
.upload-summary { margin: 8px 0 0; }
.upload-errors { color: var(--error-text); font-size: .9rem; padding-left: 20px; }
.thumb-name { margin: 0; padding: 8px 10px; font-size: .85rem; overflow-wrap: anywhere; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 24px; max-width: 520px; }
.button.button-danger { background: var(--error-text); border-color: var(--error-text); }
.button.button-danger:hover { background: #6d1f14; border-color: #6d1f14; }
