/* ==========================================================================
   Whitfield Mercantile — site styles
   Mobile-first, no framework. Tokens live on :root.
   ========================================================================== */

:root {
  /* Palette: cream paper, warm ink, terracotta accent (pulled from the photos) */
  --color-cream: #faf6f0;
  --color-paper: #ffffff;
  --color-sand: #eadfcf;
  --color-sand-dark: #d8c9b3;
  --color-ink: #2b2420;
  --color-ink-soft: #5e544d;
  --color-ink-muted: #7d726a;
  --color-accent: #a8542f;
  --color-accent-dark: #8c4325;
  --color-accent-soft: #f4e4da;
  --color-accent-light: #f2c9a8;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1140px;
  --gutter: 1rem;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 36, 32, 0.08);
  --header-height: 72px;
  --transition: 180ms ease;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

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

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

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

a {
  color: var(--color-accent-dark);
  text-underline-offset: 0.15em;
}

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

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Anchored sections land below the sticky header */
[id] {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--color-ink);
}

h1 {
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);
}

h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

.container {
  width: min(100% - (2 * var(--gutter)), var(--max-width));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.5rem, 6vw, 6rem);
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.section-head p {
  color: var(--color-ink-soft);
  font-size: 1.075rem;
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-ink);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

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

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: currentColor;
}

.btn-ghost:hover {
  background: var(--color-ink);
  color: #fff;
  border-color: var(--color-ink);
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 240, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-sand);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--color-ink);
}

.brand small {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 500;
  font-size: 0.95rem;
}

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

.site-nav .btn {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
}

.site-nav .btn:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-sand-dark);
  border-radius: 10px;
  background: var(--color-paper);
  color: var(--color-ink);
  cursor: pointer;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-sand);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav li:not(:last-child) a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--color-sand);
  }

  .site-nav li:last-child {
    padding-top: 1rem;
  }

  .site-nav .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: min(78vh, 720px);
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  margin: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(38, 28, 22, 0.9) 0%, rgba(38, 28, 22, 0.74) 48%, rgba(38, 28, 22, 0.28) 100%);
}

.hero-content {
  max-width: 600px;
  padding-block: 5rem;
}

.hero .eyebrow {
  color: var(--color-accent-light);
}

.hero h1 {
  color: #fff;
}

.hero p {
  max-width: 540px;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero .btn-ghost {
  color: #fff;
}

.hero .btn-ghost:hover {
  background: #fff;
  color: var(--color-ink);
  border-color: #fff;
}

@media (max-width: 599px) {
  .hero::after {
    background: linear-gradient(180deg, rgba(38, 28, 22, 0.7) 0%, rgba(38, 28, 22, 0.88) 100%);
  }

  .hero-content {
    padding-block: 4rem 3rem;
  }
}

/* --------------------------------------------------------------------------
   Quick facts strip
   -------------------------------------------------------------------------- */

.facts {
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-sand);
}

.facts ul {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem 2rem;
}

.facts li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-ink-soft);
}

.facts svg {
  flex: none;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Category cards / services
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  /* Six categories → two balanced rows of three */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--color-paper);
  border: 1px solid var(--color-sand);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0;
  font-size: 0.97rem;
  color: var(--color-ink-soft);
}

.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.services-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--color-paper);
  border: 1px solid var(--color-sand);
  border-radius: var(--radius);
}

.services-list svg {
  flex: none;
  margin-top: 0.15rem;
  color: var(--color-accent);
}

.services-list h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.services-list p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about {
  background: var(--color-paper);
  border-top: 1px solid var(--color-sand);
  border-bottom: 1px solid var(--color-sand);
}

.about-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 5fr 6fr;
    gap: 4.5rem;
  }
}

.about-photo {
  margin: 0;
  max-width: 480px;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-photo figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.about-text p {
  color: var(--color-ink-soft);
}

.about blockquote {
  margin: 1.75rem 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--color-ink);
}

.about blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--color-ink-muted);
}

/* --------------------------------------------------------------------------
   Visit (dark band)
   -------------------------------------------------------------------------- */

.visit {
  background: var(--color-ink);
  color: #f5ede3;
}

.visit .eyebrow {
  color: var(--color-accent-light);
}

.visit h2,
.visit h3 {
  color: #fff;
}

.visit .section-head p {
  color: rgba(245, 237, 227, 0.8);
}

.visit a {
  color: var(--color-accent-light);
}

.visit a:hover {
  color: #fff;
}

.visit-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.visit-block h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.visit-block svg {
  color: var(--color-accent-light);
}

.hours {
  width: 100%;
  max-width: 420px;
  border-collapse: collapse;
}

.hours th,
.hours td {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
  font-weight: 400;
}

.hours th {
  font-weight: 600;
  color: #fff;
}

.hours td {
  text-align: right;
}

.visit-note {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: rgba(245, 237, 227, 0.7);
}

.visit address {
  font-style: normal;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  text-align: center;
}

.contact .section-head {
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1rem + 2vw, 2.1rem);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-email:hover {
  text-decoration: underline;
}

.contact-hint {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--color-ink-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 3.5rem 0 2rem;
  background: var(--color-paper);
  border-top: 1px solid var(--color-sand);
  font-size: 0.95rem;
  color: var(--color-ink-soft);
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
  }
}

.footer-brand p {
  max-width: 380px;
  margin-top: 1rem;
}

.footer-grid h3 {
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 0.5rem;
}

.footer-grid a {
  color: var(--color-ink);
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-sand);
  font-size: 0.85rem;
  color: var(--color-ink-muted);
}

/* --------------------------------------------------------------------------
   News — card grid (home "Latest news" and news.html)
   -------------------------------------------------------------------------- */

.news {
  background: var(--color-paper);
  border-top: 1px solid var(--color-sand);
}

.news-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-paper);
  border: 1px solid var(--color-sand);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}

/* On the home page the whole band is white, so the cards go cream instead */
.news .news-card {
  background: var(--color-cream);
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.news-card > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--color-sand);
}

.news-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.5rem;
}

.news-date {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.news-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.news-card h3 a {
  color: inherit;
  text-decoration: none;
}

/* Whole card is clickable, but only the title is a link for screen readers */
.news-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.news-card h3 a:hover {
  color: var(--color-accent);
}

.news-card p {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
}

.news-readmore {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent-dark);
}

.news-actions {
  margin-top: 2.5rem;
}

.news-empty {
  padding: 2rem;
  background: var(--color-paper);
  border: 1px dashed var(--color-sand-dark);
  border-radius: var(--radius);
  color: var(--color-ink-muted);
}

/* --------------------------------------------------------------------------
   News — single post
   -------------------------------------------------------------------------- */

.post {
  padding-block: 2.5rem 4.5rem;
}

.post-layout {
  width: min(100% - (2 * var(--gutter)), 760px);
  margin-inline: auto;
}

.post-header {
  padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem;
  border-bottom: 1px solid var(--color-sand);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-ink-muted);
}

.post-hero {
  margin: 2rem 0 0;
}

.post-hero img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

.post-hero figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.post-body {
  margin-top: 2.5rem;
  font-size: 1.075rem;
}

.post-body > p:first-child {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--color-ink-soft);
}

.post-body h2 {
  margin-top: 2.5rem;
  font-size: 1.5rem;
}

.post-body h3 {
  margin-top: 1.75rem;
}

.post-body ul,
.post-body ol {
  padding-left: 1.3rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body img {
  width: 100%;
  border-radius: var(--radius);
  margin: 2rem 0;
}

.post-body blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--color-accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.35;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--color-sand);
}

.post-footer p {
  color: var(--color-ink-soft);
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-decoration: none;
}

.backlink:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Legal pages (Privacy Policy, Terms of Use)
   -------------------------------------------------------------------------- */

.page-hero {
  padding: clamp(3rem, 6vw, 5rem) 0 2rem;
  border-bottom: 1px solid var(--color-sand);
}

.page-hero h1 {
  margin-bottom: 0.5rem;
}

.page-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-ink-muted);
}

.legal {
  padding-block: 3rem 5rem;
}

.legal-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .legal-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 4rem;
  }

  .toc {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    align-self: start;
  }
}

.toc {
  padding: 1.25rem 1.5rem;
  background: var(--color-paper);
  border: 1px solid var(--color-sand);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.toc h2 {
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.toc li {
  margin-bottom: 0.45rem;
}

.toc a {
  color: var(--color-ink);
  text-decoration: none;
}

.toc a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.legal-content {
  max-width: 72ch;
}

.legal-content > p:first-child {
  font-size: 1.075rem;
  color: var(--color-ink-soft);
}

.legal-content h2 {
  margin-top: 2.75rem;
  font-size: 1.5rem;
}

.legal-content h2:first-of-type {
  margin-top: 0;
}

.legal-content h3 {
  margin-top: 1.75rem;
  font-size: 1.1rem;
}

.legal-content ul {
  padding-left: 1.3rem;
}

.legal-content li {
  margin-bottom: 0.45rem;
}

.legal-content .callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--color-accent-soft);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 10px 10px 0;
}

.legal-content .callout p:last-child {
  margin-bottom: 0;
}

.legal-content address {
  font-style: normal;
  line-height: 1.7;
}

/* Print: keep legal pages readable on paper */
@media print {
  .site-header,
  .site-footer,
  .toc,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }
}
