/*--
Website design & development © 2026 Logan Barnard.
Created for J&C Building & Maintenance Ltd.
All branding, logos, and business identity remain the property of J&C Building & Maintenance Ltd.
*/

:root {
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bg: #121212;
  --surface: #1e1e1e;
  --text: #eaeaea;
  --muted: #aaaaaa;
  --border: #2a2a2a;

  --topbar-h: 102px;
  --footer-h: 64px;
}

* {
  box-sizing: border-box;
}

/* Link colour (override default purple visited links) */
a,
a:visited {
  color: #274b7c;
}

a:hover,
a:focus-visible {
  color: #3969ab;
  text-decoration: underline;
}

/* Import custom fonts */
@font-face {
  font-family: 'Orkney';
  src: url('orkney.regular.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Orkney';
  src: url('orkney.bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

/* Apply the font */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Orkney', system-ui, sans-serif;
  font-weight: 300;
}

body.booting{
  overflow:hidden;
}

/* prevent background scrolling when menu/modal open (mobile friendly) */
body.menu-open,
body.modal-open {
  overflow: hidden;
}

/* Top bar */
.top-bar {
  position: fixed;
  top: 0;
  height: var(--topbar-h);
  width: 100%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.hamburger {
  position: absolute;
  left: 16px;
  font-size: 26px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
}

.hamburger:active {
  background: rgba(255,255,255,0.06);
}

.logo-container{
  display:flex;
  align-items:center;
}

.site-logo{
  width:82px;   /* adjust as needed */
  height:auto;
  cursor:pointer;
}

/* Side menu */
.side-menu {
  position: fixed;
  top: var(--topbar-h);
  left: -260px;
  width: 240px;
  height: calc(100% - var(--topbar-h));
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: left 0.25s ease;
  z-index: 9999;
  border-right: 1px solid var(--border);
}

.side-menu.open {
  left: 0;
}

.side-menu a {
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  padding: 8px 6px;
  border-radius: 10px;
}

.side-menu a:active {
  background: rgba(255,255,255,0.06);
}

/* menu overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Pages */
main{
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--footer-h) + var(--safe-b) + 24px);
  flex: 1 0 auto;
}

.page {
  display: none;
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

.page.active {
  display: block;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero p {
  color: var(--muted);
}

.content-block {
  margin-top: 40px;
}

/* Services */
.services-list {
  list-style: none;
  padding: 0;
}

.services-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.services-list span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Contact form */
.contact-form {
  max-width: 500px;
  margin-top: 20px;
}

.contact-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px; /* stops iOS zoom */
  border-radius: 10px;
}

.contact-form button {
  margin-top: 10px;
  padding: 12px 20px;
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  border-radius: 10px;
}

/* Footer */
.footer{
  position: static;
  width: 100%;
  min-height: var(--footer-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 12px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  padding: 14px;
  border-top: 1px solid var(--border);
  padding: calc(14px + var(--safe-b)) 14px 14px;
}

/* Desktop footer layout */
.footer-inner{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap:12px;
  width:100%;
}

/* left text */
.footer-left{
  text-align:left;
}

/* icons stay centered */
.footer-center{
  display:flex;
  justify-content:center;
  gap:10px;
}

/* right text */
.footer-right{
  text-align:right;
}

.footer-socials{
  text-align:right;
}

.footer a{
  color: inherit;          /* keeps same colour as footer text */
  text-decoration: underline;
}

.footer a:visited{
  color: inherit;          /* prevents purple visited links */
}

.footer a:hover{
  color: inherit;
  opacity: 0.85;           /* optional subtle hover */
}
/* Gallery */
.gallery {
  overflow: hidden;
  margin: 40px auto;
  max-width: 1000px;
  touch-action: pan-y; /* allow vertical scroll; swipes handled in JS */
}

.gallery-track {
  display: flex;
  gap: 12px;
  transition: transform 0.6s ease;
  will-change: transform;
}

.gallery-item {
  flex: 0 0 calc(33.333% - 8px);
  cursor: pointer;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 18px;
}

.modal.active {
  display: flex;
}

/* Bigger + allows upscaling of small images/videos */
.modal-content{
  width: min(1200px, 96vw);
  height: min(86vh, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content img,
.modal-content video{
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;     /* never crop, always fit */
  border-radius: 10px;
  background: #000;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: 22px;
  color: #fff;
  cursor: pointer;
}

/* Video play overlay */
.gallery-item.video {
  position: relative;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.85);
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(0,0,0,0.4) 0%,
    rgba(0,0,0,0.1) 40%,
    rgba(0,0,0,0) 70%
  );
  border-radius: 8px;
}

/* Sidebar socials */
.side-socials {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Social icon bubble */
.icon-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  cursor: pointer;

  box-shadow: 0 0 0 rgba(255,255,255,0);

  transition:
    box-shadow 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease;
}

.icon-link svg {
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,0.85);
  transition: fill 0.25s ease;
}

/* hover (desktop) */
.icon-link:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
  box-shadow:
    0 0 10px rgba(138, 138, 138, 0.25),
    0 0 12px rgba(138, 138, 138, 0.25);
}

.icon-link:hover svg {
  fill: #ffffff;
}

/* focus/active (mobile + keyboard) */
.icon-link:active,
.icon-link:focus-visible {
  background: rgba(255,255,255,0.08);
  box-shadow:
    0 0 10px rgba(138, 138, 138, 0.25),
    0 0 12px rgba(138, 138, 138, 0.25);
  outline: none;
}

/* Threads SVG recolouring */
.icon-link img {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-link.threads img {
  filter: invert(1) brightness(1.8);
  transition: filter 0.25s ease;
}

.icon-link.threads:hover img,
.icon-link.threads:active img,
.icon-link.threads:focus-visible img {
  filter: invert(1) brightness(2.4);
}

/* ---------- Mobile UI support ---------- */
@media (max-width: 900px) {
  /* show 2 gallery items */
  .gallery-item {
    flex: 0 0 calc(50% - 6px);
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-h: 84px;
    --footer-h: 92px;
  }

  .site-logo{
    width:56px;      /* smaller logo */
    height:auto;
  }

  .page {
    padding: 16px;
  }

  .hero {
    margin-bottom: 26px;
  }

  .hero h1 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  /* show 1 gallery item */
  .gallery-item {
    flex: 0 0 100%;
  }

  .gallery-item img,
  .gallery-item video {
    height: 200px;
  }

  /* side menu becomes wider and nicer on mobile */
  .side-menu {
    width: min(82vw, 320px);
    left: calc(-1 * min(82vw, 320px));
    padding: 18px;
  }
}

/* default (desktop/tablet) */
.credit-mobile{ display:none; }
.credit-desktop{ display:inline; }

/* mobile */
@media (max-width: 600px){
  .credit-desktop{ display:none; }
  .credit-mobile{ display:inline; }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 1.42rem;
  }

  .gallery-item img,
  .gallery-item video {
    height: 180px;
  }

  .hamburger {
    left: 10px;
  }
}

/* Hide honeypot field */
.hp-field { display: none; }

/* Status message styling (optional) */
.form-status { margin-top: 12px; }

/* About page image (top-right) */
#about{
  position: relative;
}

/* About page image: float right so text wraps left + continues underneath */
.about-media{
  float: right;
  width: 260px;
  height: 170px;
  margin: 6px 0 12px 16px;   /* space from text */
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  position: relative;
}

.about-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.about-img.is-active{
  opacity: 1;
}

/* Mobile: keep it above text (full width) */
@media (max-width: 700px){
  .about-media{
    float: none;
    width: 100%;
    height: 200px;
    margin: 12px 0 18px;
  }
}

/* Mobile: stack it above text instead of top-right */
@media (max-width: 700px){
  .about-media{
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    height: 200px;
    margin: 12px 0 18px;
  }

  #about h2,
  #about p{
    padding-right: 0;
  }
}

/* ---------- Home enhancements ---------- */
.home-actions{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top: 14px;
}

.home-cta{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor:pointer;
  font-weight: 600;
}

.home-cta.ghost{
  background: transparent;
}

.home-cta:active{
  background: rgba(255,255,255,0.10);
}

.home-intro p{ color: var(--muted); }

.home-bullets{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.home-bullet{
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  background: rgba(255,255,255,0.02);
}

.home-bullet span{
  display:block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.home-cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.home-card{
  text-align:left;
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px;
  background: rgba(255,255,255,0.02);
  cursor:pointer;
}

.home-card h3{
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #fff;
}

.home-card p{
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.35;
}

.home-card-link{
  font-weight: 700;
  text-decoration: underline;
  color: rgba(255,255,255,0.65);
}

.home-card:active{
  background: rgba(255,255,255,0.06);
}

.home-steps{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.home-step{
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  background: rgba(255,255,255,0.02);
}

.home-step span{
  display:block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.home-actions.bottom{
  margin-top: 14px;
}

/* responsive */
@media (max-width: 900px){
  .home-bullets{ grid-template-columns: 1fr; }
  .home-cards{ grid-template-columns: 1fr; }
  .home-steps{ grid-template-columns: 1fr; }
}

/* ---------- Gallery page grid ---------- */
.media-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.media-item{
  position: relative;
  cursor: pointer;
}

.media-item img,
.media-item video{
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  display:block;
}

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

@media (max-width: 640px){
  .media-grid{ grid-template-columns: 1fr; }
  .media-item img,
  .media-item video{ height: 200px; }
}
/* ---------- Footer (DESKTOP default) ---------- */
.footer-inner{
  display:grid;
  grid-template-columns: 1fr auto 1fr; /* left | icons | right */
  align-items:center;
  gap: 12px;
  width:100%;
}

.footer-left{ text-align:left; }
.footer-center{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap; /* ok on desktop too */
}
.footer-right{ text-align:right; }

/* ---------- Footer (MOBILE) ---------- */
@media (max-width: 640px){
  .footer-inner{
    grid-template-columns: 1fr;
    text-align:center;
    gap: 10px;
  }

  .footer-left,
  .footer-right{
    text-align:center;
  }

  .footer{
    padding: 14px 12px;
  }
}

/* ---------- Feed page ---------- */
.feed-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.feed-card{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}

.feed-card h3{
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: #fff;
}

.feed-note{
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 12px;
}

.feed-links a{
  font-weight: 700;
  text-decoration: underline;
  color: rgba(255,255,255,0.75);
}

.embed-wrap{
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
}

.embed-wrap iframe{
  width: 100%;
  display:block;
}

@media (max-width: 900px){
  .feed-grid{ grid-template-columns: 1fr; }
}

/* =========================
   Clean page enter animations
   ========================= */

@media (prefers-reduced-motion: reduce){
  .page .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* default: visible (so nothing can "disappear" permanently) */
.page .reveal{
  opacity: 1;
  transform: none;
}

/* only hide while a page is entering (temporary) */
.page.is-entering .reveal{
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.992);
  will-change: transform, opacity;
}

/* animate in */
@keyframes cleanIn{
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.992); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* optional slight sideways fly-in (subtle) */
@keyframes cleanInLeft{
  from { opacity: 0; transform: translate3d(-10px, 10px, 0) scale(0.992); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes cleanInRight{
  from { opacity: 0; transform: translate3d(10px, 10px, 0) scale(0.992); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* run animation while entering */
.page.is-entering .reveal{
  animation: cleanIn 520ms cubic-bezier(.2,.85,.2,1) both;
  animation-delay: var(--d, 0ms);
}

/* tiny variety but still clean */
.page.is-entering .reveal.from-left{  animation-name: cleanInLeft; }
.page.is-entering .reveal.from-right{ animation-name: cleanInRight; }

/* once entered, force stable final state */
.page.is-entered .reveal{
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* =========================
   Page backdrop crossfade
   ========================= */

/* a full-page overlay that gently fades away after enter */
.page-fade {
  position: fixed;
  inset: 0;
  background: var(--surface);          /* matches site base colour */
  opacity: 0;
  pointer-events: none;
  z-index: 1500;                  /* above pages, below modal (2000) */
  transition: opacity 360ms ease;
}

/* while fading, show overlay */
.page-fade.active {
  opacity: 1;
}

/* =========================
   Fullscreen Loader Overlay
   ========================= */
.site-loader{
  position: fixed;
  inset: 0;                 /* top/right/bottom/left = 0 */
  width: 100%;
  height: 100vh;            /* fallback */
  height: 100svh;           /* iOS “small viewport” (stable visible area) */
  height: 100dvh;           /* modern dynamic viewport */

  background: var(--bg);

  display: grid;
  place-items: center;      /* dead-center */

  z-index: 9999;

  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;

  touch-action: none;
  overscroll-behavior: contain;
  will-change: opacity;
}

.site-loader.active{
  opacity: 1;
  pointer-events: auto;
}

.site-loader.done {
  opacity: 0;
  pointer-events: none;
}

.site-loader-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:18px;
  text-align:center;
}

.site-loader-logo{
  width: 150px;
  height: auto;
  image-rendering: auto;
}

.site-loader-inner svg{
  display: block;           /* important */
  width:min(180px,40vw);
  height:auto;
}

/* tiny subtle loading bar (not too flashy) */
.site-loader-bar{
  width:min(240px,65vw);
  height:3px;
  border-radius:999px;
  background:rgba(255,255,255,0.12);
  overflow:hidden;
}

.site-loader-progress{
  height:100%;
  width:0%;
  background:rgba(255,255,255,0.65);
  border-radius:999px;
  transition:width 0.6s cubic-bezier(.3,.8,.25,1);
}

@keyframes loaderSweep{
  0%   { transform: translateX(-70%); opacity: .3; }
  50%  { opacity: .8; }
  100% { transform: translateX(70%); opacity: .3; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .site-loader{ transition: none; }
  .site-loader-bar::after{ animation: none; }
}

/* Hide site content until we're ready to animate (prevents pre-animation flash) */
body.booting header,
body.booting nav,
body.booting .menu-overlay,
body.booting main,
body.booting footer,
body.booting .modal,
body.booting .page-fade{
  visibility: hidden;
}

/* keep loader visible even while booting */
body.booting .site-loader{
  visibility: visible;
}

/* ---------- OAP Deal ---------- */
.deal-card{
  margin: 18px 0 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0;
}

.deal-left{
  padding: 16px 16px 14px;
}

.deal-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
}

.deal-card h3{
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.deal-card p{
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.4;
}

.deal-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.deal-media{
  appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  background: #000;
  cursor: pointer;
  position: relative;
  min-height: 200px;
}

.deal-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.05);
}

.deal-page{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.deal-poster{
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  padding: 0;
  cursor: pointer;
}

.deal-poster img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.deal-info{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}

.deal-info h3{
  margin: 0 0 10px;
}

.deal-list{
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.deal-small{
  margin: 10px 0 0;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 900px){
  .deal-card{ grid-template-columns: 1fr; }
  .deal-media{ min-height: 220px; }
  .deal-page{ grid-template-columns: 1fr; }
}

html, body{
  height: auto;
}

body{
  min-height: 100dvh; /* mobile-friendly viewport unit */
  display: flex;
  flex-direction: column;
}

main{
  flex: 1 0 auto; /* push footer to bottom when pages are short */
}

.footer{
  flex: 0 0 auto;
}

/* forces a small scroll before footer appears */
.footer-spacer{
  height:60px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.15));
}

@media (max-width: 420px){
  .footer{
    font-size: 11px;
    letter-spacing: 0.6px;
  }
}