/* ============================================================
   DL Joinery — main.css
   Professional British joinery: navy blue brand theme
   ============================================================ */

/* --- Custom properties --- */
:root {
  --clr-brand:     #2B6096;
  --clr-brand-dark:#1d4370;
  --clr-brand-light:#C5D8E8;
  --clr-cream:     #f5f8fb;
  --clr-stone:     #dce8f0;
  --clr-charcoal:  #1a2535;
  --clr-mid:       #5a6a7a;
  --clr-white:     #fff;

  --ff-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --max-w:        1200px;
  --max-w-narrow: 740px;
  --gap:          2rem;
  --section-y:    5rem;
  --radius:       6px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
a { color: inherit; }

/* --- Base --- */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  color: var(--clr-charcoal);
  background: var(--clr-white);
  line-height: 1.75;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--ff-heading);
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: .5rem; }
p  { margin-bottom: 1rem; }
.lead { font-size: 1.15rem; color: var(--clr-mid); line-height: 1.85; }
.section-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-brand);
  margin-bottom: .75rem;
}

.prose p  { margin-bottom: 1.25rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }

/* --- Layout --- */
.container {
  width: 90%;
  max-width: var(--max-w);
  margin-inline: auto;
}
.container--narrow { max-width: var(--max-w-narrow); }
.section { padding-block: var(--section-y); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: .85rem 2rem;
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn + .btn { margin-left: .75rem; }
.btn-primary  { background: var(--clr-brand); color: var(--clr-white); border: 2px solid var(--clr-brand); }
.btn-primary:hover { background: var(--clr-brand-dark); border-color: var(--clr-brand-dark); }
.btn-secondary { background: transparent; color: var(--clr-white); border: 2px solid rgba(255,255,255,0.75); }
.btn-secondary:hover { background: var(--clr-white); color: var(--clr-charcoal); border-color: var(--clr-white); }
.btn-outline { background: transparent; color: var(--clr-brand); border: 2px solid var(--clr-brand); }
.btn-outline:hover { background: var(--clr-brand); color: var(--clr-white); }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-stone);
  padding-block: .65rem;
  box-shadow: 0 2px 8px rgba(43,96,150,0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
}
.site-logo img {
  height: 52px;
  width: auto;
  display: block;
}
.site-nav > ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-nav a {
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--clr-charcoal);
  transition: color .2s;
}
.site-nav a:hover { color: var(--clr-brand); }
.nav-cta {
  background: var(--clr-brand);
  color: var(--clr-white) !important;
  padding: .5rem 1.25rem;
  border-radius: var(--radius);
  text-transform: uppercase !important;
}
.nav-cta:hover { background: var(--clr-brand-dark) !important; transform: translateY(-1px); }
.nav-toggle { display: none; }

/* --- Nav dropdowns --- */
.nav-has-dropdown { position: relative; }
.nav-has-dropdown > a::after {
  content: '';
  display: inline-block;
  margin-left: .35em;
  vertical-align: .15em;
  border: 4px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .6rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 210px;
  background: var(--clr-white);
  border: 1px solid var(--clr-stone);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(43,96,150,0.12);
  padding: .4rem 0;
  z-index: 200;
  flex-direction: column;
}
.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown { display: flex; }
.nav-dropdown li { list-style: none; }
.nav-dropdown a {
  display: block;
  padding: .55rem 1.25rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--clr-charcoal);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-dropdown a:hover { background: var(--clr-cream); color: var(--clr-brand); }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--clr-charcoal);
  background-size: cover;
  background-position: center;
  color: var(--clr-white);
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,25,50,0.72) 0%, rgba(10,25,50,0.55) 100%);
  z-index: 1;
}
.hero .container {
  position: relative;
  z-index: 2;
}
.hero h1 {
  color: var(--clr-white);
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}
.hero-sub {
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  opacity: .88;
  max-width: 580px;
  margin-inline: auto;
}

/* --- Page hero --- */
.page-hero {
  background: var(--clr-brand-dark);
  color: var(--clr-white);
  padding-block: 4rem;
}
.page-hero h1 { color: var(--clr-white); margin-bottom: .5rem; }
.page-hero p { color: rgba(255,255,255,0.65); }

/* --- Intro section --- */
.intro { background: var(--clr-cream); border-bottom: 1px solid var(--clr-stone); }
.intro h2 { color: var(--clr-brand-dark); }
.intro.section { padding-block: 3.5rem; }

/* --- Services preview --- */
.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
  margin-bottom: 2.5rem;
}
.service-card {
  background: var(--clr-white);
  border: 1px solid var(--clr-stone);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.12);
}
.service-card-img {
  overflow: hidden;
  height: 210px;
}
.service-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.service-card:hover .service-card-img img { transform: scale(1.06); }
.service-card-body { padding: 1.5rem; }
.service-card-body h3 { margin-bottom: .4rem; }
.service-card-body p { font-size: .9rem; color: var(--clr-mid); margin-bottom: 1rem; }
.service-card-body a {
  color: var(--clr-brand);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
.service-card-body a:hover { color: var(--clr-brand-dark); }

/* --- Services list page --- */
.service-entry {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gap);
  padding-block: 3.5rem;
  border-bottom: 1px solid var(--clr-stone);
}
.service-entry:last-child { border-bottom: none; }
.service-image img { width: 100%; height: 300px; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 700px) {
  .service-entry { grid-template-columns: 1fr; }
}

/* --- Gallery --- */
.gallery-preview { background: var(--clr-cream); border-top: 1px solid var(--clr-stone); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin-bottom: 2.5rem;
}
.gallery-grid--large { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.gallery-item figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.gallery-item img {
  width: 100%; height: 220px; object-fit: cover;
  transition: transform .4s ease;
}
.gallery-item a:hover img { transform: scale(1.06); }
.gallery-item figcaption {
  padding: .5rem 0;
  font-size: .82rem;
  color: var(--clr-mid);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-category {
  font-size: .72rem;
  font-weight: 500;
  background: var(--clr-stone);
  padding: .15rem .6rem;
  border-radius: 3px;
}

/* --- About --- */
.about-photo { margin-bottom: 2.5rem; }
.about-photo img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); }

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}
@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}
form label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .35rem;
  margin-top: 1.25rem;
}
form input,
form textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--clr-stone);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--ff-body);
  background: var(--clr-white);
  transition: border-color .2s, box-shadow .2s;
}
form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px rgba(43,96,150,0.12);
}
form button { margin-top: 1.5rem; }
.hidden { display: none; }

/* --- CTA strip --- */
.cta-strip {
  background: var(--clr-brand-dark);
  color: var(--clr-white);
  text-align: center;
}
.cta-strip h2 { color: var(--clr-white); margin-bottom: .75rem; }
.cta-strip p { color: rgba(255,255,255,0.75); margin-bottom: 2rem; }
.cta-strip .btn-primary { background: var(--clr-white); color: var(--clr-brand-dark); border-color: var(--clr-white); }
.cta-strip .btn-primary:hover { background: var(--clr-brand-light); border-color: var(--clr-brand-light); color: var(--clr-brand-dark); }

/* --- Footer --- */
.site-footer {
  background: var(--clr-brand-dark);
  color: var(--clr-stone);
  padding-block: 3rem;
  font-size: .875rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1.5rem;
}
.footer-logo img {
  height: 52px;
  width: auto;
  display: block;
  border-radius: 4px;
  margin-bottom: .5rem;
}
.footer-tagline { color: rgba(255,255,255,0.55); font-style: italic; margin: 0; }
.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-end;
}
.footer-nav a { text-decoration: none; color: var(--clr-stone); transition: color .2s; }
.footer-nav a:hover { color: var(--clr-white); }
.footer-copy {
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: .78rem;
}

/* --- Gallery item button --- */
.gallery-item-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.gallery-item-btn:hover img { transform: scale(1.06); }

/* --- Gallery modal --- */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.gallery-modal[hidden] { display: none; }
.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  cursor: pointer;
}
.gallery-modal-content {
  position: relative;
  z-index: 1;
  background: var(--clr-white);
  border-radius: var(--radius);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.gallery-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: rgba(0,0,0,0.55);
  color: var(--clr-white);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .2s;
}
.gallery-modal-close:hover { background: rgba(0,0,0,0.8); }
.gallery-modal-img-wrap {
  overflow: hidden;
  border-radius: var(--radius) 0 0 var(--radius);
  min-height: 320px;
}
.gallery-modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-modal-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}
.gallery-modal-category {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-brand);
  margin-bottom: .5rem;
}
.gallery-modal-title {
  font-size: 1.5rem;
  color: var(--clr-brand-dark);
  margin-bottom: 1rem;
}
.gallery-modal-desc {
  color: var(--clr-mid);
  font-size: .95rem;
  flex: 1;
  margin-bottom: 2rem;
}
.gallery-modal-cta { align-self: flex-start; }

/* prev / next arrows */
.gallery-modal-prev,
.gallery-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0,0,0,0.45);
  color: var(--clr-white);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.gallery-modal-prev { left: -54px; }
.gallery-modal-next { right: -54px; }
.gallery-modal-prev:hover,
.gallery-modal-next:hover { background: rgba(0,0,0,0.75); }
.gallery-modal-prev:disabled,
.gallery-modal-next:disabled { opacity: .25; cursor: default; }

@media (max-width: 860px) {
  .gallery-modal-prev { left: .3rem; }
  .gallery-modal-next { right: .3rem; }
}

@media (max-width: 620px) {
  .gallery-modal-content { grid-template-columns: 1fr; }
  .gallery-modal-img-wrap {
    border-radius: var(--radius) var(--radius) 0 0;
    min-height: 220px;
    max-height: 260px;
  }
}

/* --- Gallery filter tabs --- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.gallery-filter {
  background: none;
  border: 1.5px solid var(--clr-stone);
  border-radius: 99px;
  padding: .35rem 1rem;
  font-size: .85rem;
  font-family: var(--ff-body);
  color: var(--clr-mid);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.gallery-filter:hover {
  border-color: var(--clr-brand);
  color: var(--clr-brand);
}
.gallery-filter.active {
  background: var(--clr-brand);
  border-color: var(--clr-brand);
  color: var(--clr-white);
  font-weight: 600;
}

/* --- Mobile nav --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .3rem;
  }
  .nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--clr-brand);
    transition: transform .2s, opacity .2s;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--clr-white);
    border-bottom: 1px solid var(--clr-stone);
    padding: 1.25rem 5%;
  }
  .site-nav.is-open { display: block; }
  .site-nav > ul { flex-direction: column; gap: 1rem; }
  .nav-has-dropdown > a::after { display: none; }
  .nav-dropdown { display: none !important; }
  .btn + .btn { margin-left: .5rem; }
  .footer-inner { flex-direction: column; }
  .footer-nav ul { align-items: flex-start; }
  .guide-table { font-size: .85rem; }
  .guide-link-list li { flex-direction: column; gap: .15rem; }
  .guide-link-label { min-width: unset; }
}

/* --- Guide page --- */
.guide-links { margin-bottom: 2.5rem; }
.guide-link-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.guide-link-list li {
  display: flex;
  align-items: baseline;
  gap: .75rem;
}
.guide-link-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--clr-mid);
  min-width: 140px;
  flex-shrink: 0;
}
.guide-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.guide-section ol li { margin-bottom: .4rem; }
.guide-section code {
  background: var(--clr-stone);
  padding: .1em .4em;
  border-radius: 3px;
  font-size: .88em;
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.75rem;
  font-size: .9rem;
}
.guide-table th,
.guide-table td {
  text-align: left;
  padding: .65rem .85rem;
  border: 1px solid var(--clr-stone);
  vertical-align: top;
}
.guide-table th {
  background: var(--clr-cream);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-mid);
}
.guide-table td:first-child { white-space: nowrap; }
