/* Stowers Ranch — responsive stylesheet.
   Colors, fonts and textures carried over from the original Stowers theme. */

:root {
  --navy: #003663;        /* logo / home heading */
  --navy-link: #145077;   /* links on white */
  --slate: #273742;       /* cards, contact button */
  --olive: #464836;       /* nav active */
  --sage: #a09e7b;        /* page background (under texture) */
  --sage-pale: #bfd79a;   /* card headings, hover */
  --brown: #544741;       /* h2 */
  --ink: #362f2d;         /* body text */
  --sky: #489fdb;         /* links on dark */
  --paper: #fff;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: Helvetica, Arial, Tahoma, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

html {
  background: var(--sage) url("../img/theme/bg-sage.png");
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

/* Images never stretch: they scale down to fit, never up past their own size. */
img { max-width: 100%; height: auto; border: 0; }

h1, h2, .serif {
  font-family: var(--serif);
  font-weight: normal;
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.15; margin: 0 0 0.5em; color: #000; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.25; margin: 1.6em 0 0.5em; color: var(--brown); }
h3 { font-size: 18px; margin: 1.4em 0 0.5em; color: #302d2a; }
h4 { font-size: 16px; margin: 1.2em 0 0.4em; color: #100e0e; }
p, ul, ol, address { margin: 0 0 1em; }

a { color: var(--navy-link); }
a:hover, a:focus { color: var(--olive); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--paper); color: var(--navy); padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

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

.site-header { padding-top: 20px; }

.masthead {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding-bottom: 16px;
}
.brand { display: block; flex: 0 1 485px; min-width: 0; }
.brand img { display: block; width: 100%; max-width: 485px; }

.contact-block { display: flex; align-items: stretch; font-size: 14px; font-weight: bold; }
.contact-block address {
  font-style: normal; text-align: right; line-height: 1.5; margin: 0;
  padding: 2px 14px 2px 0; border-right: 1px solid rgba(0, 0, 0, 0.2);
}
.contact-block .links {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
  padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.contact-block .button-small {
  display: inline-block; background: var(--slate); color: #fff; text-decoration: none;
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em;
  padding: 7px 18px; border-radius: 4px; border-top: 3px solid rgba(0, 0, 0, 0.2);
}
.contact-block .button-small:hover { background: var(--olive); color: #fff; }
.contact-block .phone { color: #093762; font-size: 22px; font-weight: normal; text-decoration: none; white-space: nowrap; }

.site-nav { background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: 12px 23px; color: #fff; text-decoration: none;
  font-family: var(--serif); font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em;
}
.site-nav a:hover, .site-nav a:focus, .site-nav a[aria-current] { background: var(--olive); color: #fff; }

.nav-toggle {
  display: none; width: 100%; text-align: left; cursor: pointer;
  background: var(--olive); color: #fff; border: 0; border-radius: 0;
  font-family: var(--serif); font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 13px 18px;
}
.nav-toggle::after { content: "+"; float: right; font-size: 20px; line-height: 1; }
.nav-toggle[aria-expanded="true"]::after { content: "\2212"; }

/* ---------- Photo frames ---------- */

/* A hero box has a fixed shape; the photo is cropped to fill it (object-fit: cover),
   so nothing is ever distorted. Boxes are never wider than the photo file itself. */
.hero {
  margin: 28px 0 0; padding: 8px; background: rgba(0, 0, 0, 0.2);
}
.hero a { display: block; }
.hero img {
  display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover;
  object-position: var(--focus, 50% 50%);
}
.hero--inline { margin: 0 0 24px; padding: 0; background: none; }
.hero--inline img { aspect-ratio: 16 / 9; border: 1px solid #a6a3a3; padding: 1px; }

/* ---------- Home ---------- */

.welcome {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 16px 48px; padding: 32px 0 8px;
}
.welcome h1 { color: var(--navy); margin-bottom: 0.3em; }
.welcome p { font-weight: bold; line-height: 1.7; max-width: 68ch; margin: 0; }

.button-wood {
  display: inline-block; background: #5b4a3a url("../img/theme/bg-wood.jpg") center / cover;
  color: #fff; text-decoration: none; text-transform: uppercase; white-space: nowrap;
  font-family: var(--serif); font-size: 16px; letter-spacing: 1px; line-height: 1;
  padding: 20px 30px; border-radius: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.button-wood:hover, .button-wood:focus { color: var(--sage-pale); }

.buckets {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  padding: 32px 0 48px;
}
.bucket {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--slate); color: #fff; border-radius: 4px;
}
.bucket__photo { display: block; }
.bucket__photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: var(--focus, 50% 50%); }
.bucket__body { padding: 20px; }
.bucket__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.bucket h2 { font-size: 30px; color: var(--sage-pale); margin: 0; }
.bucket h2 a { color: inherit; text-decoration: none; }
.bucket .more { color: var(--sage-pale); font-size: 13px; font-style: italic; white-space: nowrap; }
.bucket .more::after { content: " \203A"; }
.bucket p { margin: 0; line-height: 1.5; }

/* ---------- Interior pages ---------- */

.page { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0; margin: 28px 0 48px; align-items: start; }
.page--single { grid-template-columns: minmax(0, 1fr); }

.subnav { background: #eee; margin-top: 28px; }
.subnav ul { list-style: none; margin: 0; padding: 0; border-top: 1px dotted var(--navy-link); }
.subnav li { border-bottom: 1px dotted var(--navy-link); }
.subnav a {
  display: block; padding: 14px 16px 14px 28px; color: #000; text-decoration: none;
  font-family: var(--serif); font-size: 14px; text-transform: uppercase;
}
.subnav a:hover, .subnav a:focus, .subnav a[aria-current] { background: rgba(0, 0, 0, 0.08); color: #000; }

.panel {
  background: var(--paper); padding: clamp(20px, 4vw, 48px);
  border: 8px solid var(--paper); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  min-width: 0;
}
.panel > :last-child { margin-bottom: 0; }
.prose { max-width: 72ch; }
.prose li { margin-bottom: 0.5em; }
.prose ul { list-style: square; padding-left: 1.3em; }
.prose img { height: auto; }

/* Tables (price list): fluid, and scroll sideways inside their own box if they must. */
.table-scroll { overflow-x: auto; margin: 0 0 1.5em; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th { background: #898989; color: #fff; font-weight: bold; text-align: left; padding: 10px; }
.prose td { border: 1px solid #898989; padding: 9px 10px; text-align: left; vertical-align: top; }

/* Map / embeds */
.embed { position: relative; aspect-ratio: 3 / 2; max-height: 520px; width: 100%; margin: 0 0 0.5em; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Galleries ---------- */

.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; }
.gallery a { display: block; background: #2a2a28; border: 1px solid #a6a3a3; padding: 1px; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery .is-small img { object-fit: scale-down; }   /* small originals stay at their own size */
.gallery figcaption { font-size: 13px; line-height: 1.4; padding: 6px 2px 0; }

.lightbox {
  border: 0; padding: 0; background: transparent; color: #fff;
  max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden;
}
.lightbox::backdrop { background: rgba(20, 20, 18, 0.94); }
.lightbox__stage { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; padding: 56px 16px 16px; }
.lightbox__stage img { display: block; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; min-height: 0; }
.lightbox__caption { text-align: center; font-family: var(--serif); font-size: 16px; padding: 12px 48px 0; min-height: 2.4em; }
.lightbox button {
  position: absolute; background: rgba(0, 0, 0, 0.45); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px; font-size: 22px; line-height: 1; width: 44px; height: 44px; cursor: pointer;
}
.lightbox button:hover { background: var(--olive); }
.lightbox__close { top: 8px; right: 8px; }
.lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }

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

.site-footer { padding: 0 0 40px; }
.footer-bar {
  background: #1a1716; color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding: 12px 20px;
}
.footer-bar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-bar a { color: #fff; text-decoration: none; font-family: var(--serif); font-size: 14px; text-transform: uppercase; display: inline-block; padding: 6px 0; }
.footer-bar a:hover, .footer-bar a:focus { color: var(--sage-pale); }
.footer-bar p { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.footer-bar p img { display: block; }

/* ---------- Breakpoints ---------- */

@media (max-width: 900px) {
  .buckets { grid-template-columns: 1fr 1fr; }
  .buckets .bucket:last-child { grid-column: 1 / -1; }
  .page { grid-template-columns: minmax(0, 1fr); }
  .subnav { margin: 0; background: rgba(255, 255, 255, 0.35); }
  .subnav ul { display: flex; flex-wrap: wrap; border: 0; }
  .subnav li { border: 0; }
  .subnav a { padding: 12px 14px; }
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .site-nav a { padding: 12px 14px; }
  .masthead { flex-direction: column; align-items: flex-start; }
  .brand { flex: none; width: 100%; }
  .contact-block { width: 100%; }
  .contact-block address { display: none; }
  .contact-block .links { flex-direction: row-reverse; justify-content: space-between; align-items: center; width: 100%; padding: 0; border: 0; }
}

@media (max-width: 760px) {
  .site-nav ul { flex-direction: column; }
  .js .nav-toggle { display: block; }
  .js .site-nav ul { display: none; }
  .js .site-nav.is-open ul { display: flex; }
  .site-nav a { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .hero { padding: 4px; margin-top: 16px; }
  .hero img { aspect-ratio: 3 / 2; }
  .hero--inline img { aspect-ratio: 3 / 2; }
  .page { margin-top: 16px; }
  .panel { border-width: 0; }
}

@media (max-width: 560px) {
  .buckets { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .site-nav a, .button-wood, .subnav a { transition: background-color 0.15s, color 0.15s; }
}
