/* ---------- Modern base ---------- */
:root{
  --bg: #120e08;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.55);
  --gold: #f1f679;
  --card: rgba(10, 8, 5, .75);
  --card2: rgba(10, 8, 5, .40);
  --border: rgba(255,255,255,.12);
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  color:var(--text);
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.6;
  background:
    linear-gradient(180deg, rgba(0,0,0,.50), rgba(0,0,0,.78)),
    url("https://www.tetburyhorses.co.uk/gifs/back.jpg") center top / cover no-repeat fixed;
}

/* A centred page container */
.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

/* ---------- Modern header/nav ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10, 8, 5, .55);
  border-bottom: 0px solid var(--border);
}

.site-header__bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 0;
}

.brand{
  display:flex;
  flex-direction:column;
  text-decoration:none;
}
.brand__title{
  font-family: "Slabo 27px", Georgia, "Times New Roman", serif;
  letter-spacing:.04em;
  font-style: italic;
  color: var(--gold);
  font-size: 24px;
  line-height: 1.1;
}
.brand__tag{
  color: var(--muted);
  font-size: 13px;
  letter-spacing:.04em;
}

.nav-toggle{
  display:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor:pointer;
}

.nav{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav a{
  text-decoration:none;
  color: var(--text);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav a:hover{
  background: rgba(255,255,255,.08);
  border-color: var(--border);
}

/* Mobile nav */
@media (max-width: 860px){
  .nav-toggle{ display:inline-flex; }
  .nav{
    display:none;
    width:100%;
    flex-direction:column;
    align-items:stretch;
    padding: 8px 0 14px;
  }
  .nav.is-open{ display:flex; }
  .nav a{ border-radius: 12px; }
  body{ background-attachment: scroll; } /* avoids jank on iOS */
}

/* ---------- Content card ---------- */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 18px;
}

/* Headings */
h1,h2{
  font-family: "Slabo 27px", Georgia, "Times New Roman", serif;
  letter-spacing:.08em;
  font-style: italic;
  color: var(--gold);
  margin: 0 0 10px;
}
h2{ font-size: 22px; }
p{ margin: 0 0 12px; color: var(--text); }

/* ---------- Hero slider ---------- */
.hero{ margin-top: 16px; }
.hero__slider{
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.2);
  box-shadow: var(--shadow);
}
.hero__track{
  display:flex;
  transition: transform 500ms ease;
  will-change: transform;
}
.hero__slide{
  min-width: 100%;
  display:block;
  position:relative;
  text-decoration:none;
  color:inherit;
}
.hero__slide img{
  width:100%;
  height: min(60vh, 640px);
  object-fit: cover;
  display:block;
}
.hero__caption{
  position:absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  font-weight: 700;
  letter-spacing:.02em;
}

.hero__btn{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor:pointer;
}
.hero__btn:hover{ background: rgba(0,0,0,.55); }
.hero__btn--prev{ left: 12px; }
.hero__btn--next{ right: 12px; }

.hero__dots{
  position:absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display:flex;
  justify-content:center;
  gap: 8px;
  padding: 0 10px;
}
.hero__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.25);
  cursor:pointer;
}
.hero__dot.is-active{
  background: rgba(255,255,255,.85);
}

/* ---------- Cookie bar (simple + modern) ---------- */
.cookie{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 80;
  background: rgba(10, 8, 5, .72);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.cookie p{ margin:0; color: var(--muted); font-size: 14px; }
.cookie a{ color: var(--text); text-decoration: underline; }
.cookie__row{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
.cookie button{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor:pointer;
}
.cookie button:hover{ background: rgba(255,255,255,.14); }


/* ===== Typography boost ===== */
body{
  font-size: 17px;              /* was effectively ~13–14px */
  line-height: 1.75;
}

.card p{
  font-size: 1.05rem;           /* ~17.8px */
}

.card{
  padding: 22px;
}

h2{
  font-size: 26px;              /* make headings feel more premium */
  margin-top: 18px;
}

@media (max-width: 700px){
  body{ font-size: 16px; }
  h2{ font-size: 22px; }
}

/* ===== Show more background image above content ===== */
/* adds breathing room under the sticky header */
main.wrap{
  padding-top: 292px;            /* shift whole content down */
}

/* optional: make the card a bit more “floating” */
.card{
  background: rgba(10, 8, 5, .50);
  border: 1px solid rgba(255,255,255,.14);
}

/* Optional: make links stand out slightly more */
.card a{
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.card a:hover{
  text-decoration: underline;
}

.main-offset{ padding-top: 60px; }

/* Give a bit more "background reveal" above the card */
main.wrap{
  padding-top: 495px;
}

/* ===============================
   MOBILE BEHAVIOUR
   =============================== */
@media (max-width: 768px){

  .hero-bg{
    height: 260px;
    overflow: hidden;
    background-size: auto 100%;   /* key part */
    background-position: center top;
    min-width: 499px;             /* as requested */
  }

  /* prevent horizontal scrolling */
  body{
    overflow-x: hidden;
  }

  main.wrap{
    margin-top: 20px;
  }
}


:root{
  --header-h: 86px; /* adjust if needed */
}

/* Make sure we don't get horizontal scroll from the min-width image */
html, body{ overflow-x: hidden; }

/* Body should not paint an opaque background over our bg layer */
body,
body.new{
  background: transparent;
}

/* Put a base colour on html instead */
html{
  background: #120e08;
}

/* The fixed background layer starts UNDER the header and continues down */
.page-bg{
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  z-index: 0;
  overflow: hidden; /* important for mobile crop */
}

/* The actual image */
.page-bg img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  min-width: 499px;          /* your requirement */
}

/* Ensure your real content sits above the background layer */
.site-header,
main.wrap,
.footer,
.cookie{
  position: relative;
  z-index: 2;
}


/* ===============================
   SLIDER WIDTH CONTROL
   =============================== */

/* Default: mobile-first (full width) */
.hero__slider{
  width: 100%;
}

/* Desktop and larger tablets */
@media (min-width: 900px){
  .hero__slider{
    max-width: 590px;     /* your requested cap */
    margin: 0 auto;       /* centre it */
  }
}

@media (min-width: 900px){
  .hero__slide img{
    height: 420px;        /* instead of 60vh */
  }
}


/* Readable text width on desktop */
.prose{
  max-width: 68ch;     /* ideal reading width */
}

@media (min-width: 900px){
  .prose{
    margin: 0 auto;    /* centre the reading column inside the card */
  }
}


/* ===== Make the top nav stick again ===== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 9999;                 /* above background + content */
  background: rgba(10, 8, 5, .70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.14);
}

/* If any wrapper has overflow set, sticky can break.
   This keeps your normal layout but avoids common sticky killers. */
html, body{
  overflow-x: hidden;
  overflow-y: visible;
}

.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: rgba(10, 8, 5, .70);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.main-offset{
  margin-top: 4px;   
}


/* ===== Simple lightbox ===== */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}

.lightbox.is-open{ display: block; }

.lightbox__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.82);
}

.lightbox__panel{
  position: absolute;
  inset: 18px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.lightbox__imgwrap{
  display:flex;
  align-items:center;
  justify-content:center;
  overflow: hidden;
  border-radius: 14px;
}

.lightbox__img{
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  display:block;
  border-radius: 14px;
  box-shadow: 0 24px 90px rgba(0,0,0,.55);
}

.lightbox__caption{
  color: rgba(255,255,255,.92);
  font-size: 15px;
  line-height: 1.6;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  overflow: auto;
  max-height: 120px;
}

.lightbox__btn{
  position: absolute;
  top: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
}
.lightbox__btn:hover{ background: rgba(0,0,0,.55); }

.lightbox__close{ right: 18px; }
.lightbox__prev{ left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__next{ right: 18px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px){
  .lightbox__panel{ inset: 12px; }
  .lightbox__caption{ font-size: 14px; max-height: 150px; }
  .lightbox__btn{ width: 42px; height: 42px; }
}

/* ===== Stable gallery grid ===== */
.popup-gallery{
  display: grid;
  grid-template-columns: 1fr;   /* mobile: 1 wide */
  gap: 14px;
  margin-top: 18px;
}

@media (min-width: 900px){
  .popup-gallery{
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* desktop: 2 wide */
    gap: 18px;
  }
}

.gallery-item{
  margin: 0; /* remove default figure margins */
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 45px rgba(0,0,0,.35);
}

.gallery-item a{
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-item img{
  width: 100%;
  aspect-ratio: 4 / 3;     /* consistent tiles; adjust to taste */
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 240ms ease;
}

.gallery-item:hover img{
  transform: scale(1.03);
}

.gallery-item figcaption{
  padding: 10px 12px;
  font-size: 0.95rem;
  color: rgba(255,255,255,.82);
  background: rgba(0,0,0,.18);
  border-top: 1px solid rgba(255,255,255,.10);
}


/* ===== Testimonials (modern cards) ===== */
.testimonials{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

/* 2-column cards on desktop */
@media (min-width: 900px){
  .testimonials{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

.testimonials p{
  margin: 0;
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 45px rgba(0,0,0,.28);
  line-height: 1.75;
  position: relative;
}

/* Big quote mark */
.testimonials p::before{
  content: "“";
  position: absolute;
  top: -10px;
  left: 12px;
  font-family: "Slabo 27px", Georgia, "Times New Roman", serif;
  font-size: 70px;
  color: rgba(241,246,121,.45);
  line-height: 1;
}

/* Author line */
.testimonials p b{
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255,255,255,.92);
}

/* If you still have &#34; quote entities, don't worry; they’ll render fine.
   But this makes the opening quote less “double-quoted” looking. */
.testimonials p{
  text-indent: 0;
}


/* ===============================
   FOOTER – subtle modern lift
   =============================== */


.site-footer{
  margin-top: 90px;
  padding: 48px 18px 40px;
  background:
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55));
  border-top: 1px solid rgba(255,255,255,.14);
}

.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  color: rgba(255,255,255,.85);
}

/* Instagram row */
.footer-top{
  margin-bottom: 22px;
}

.footer-instagram{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  color: rgba(255,255,255,.95);
}

.footer-instagram img{
  height: 32px;
  width: auto;
}

.footer-instagram:hover span{
  text-decoration: underline;
}

/* Tagline + nav */
.footer-mid{
  margin-bottom: 26px;
}

.footer-tagline{
  font-size: 0.95rem;
  letter-spacing: .04em;
  line-height: 1.6;
  margin-bottom: 18px;
  color: rgba(255,255,255,.80);
}

/* Footer navigation */
.footer-nav{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}

.footer-nav a{
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
}

.footer-nav a:hover{
  text-decoration: underline;
}

/* Bottom legal / credit */
.footer-bottom{
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255,255,255,.70);
}

.footer-bottom a{
  color: rgba(255,255,255,.85);
  text-decoration: none;
}

.footer-bottom a:hover{
  text-decoration: underline;
}

.footer-credit{
  margin-top: 10px;
  font-size: 0.8rem;
  opacity: .85;
}

/* Mobile tweaks */
@media (max-width: 640px){
  .site-footer{
    padding: 38px 14px 34px;
  }

  .footer-nav{
    gap: 8px 12px;
  }
}


/* ===== FOOTER VISIBILITY FIX ===== */

/* Ensure footer is ABOVE the background layer */
.site-footer{
  position: relative;
  z-index: 5;
}

/* Force readable colour inheritance */
.site-footer,
.site-footer p,
.site-footer a,
.site-footer span{
  color: rgba(255,255,255,.92);
}

/* Make sure footer links are visible */
.site-footer a{
  opacity: 1;
}

/* Guard against accidental clipping */
.footer-inner,
.footer-top,
.footer-mid,
.footer-bottom{
  overflow: visible;
}
