/* =====================================================
   Edinburgh Home Improvements – Responsive Stylesheet
   ===================================================== */

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

:root {
  --brand:       #8B0000;
  --brand-hover: #a01010;
  --white:       #ffffff;
  --bg:          #f2f2f2;
  --surface:     #ffffff;
  --border:      #e0e0e0;
  --text:        #1a1a1a;
  --muted:       #666666;
  --max-w:       1100px;
  --radius:      6px;
  --nav-h:       64px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.10);
  --shadow-md:   0 4px 16px rgba(0,0,0,.13);
  --trans:       0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Verdana, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--brand); }

/* ─── HEADER ──────────────────────────────────────── */
header {
  background: var(--white);
  border-bottom: 3px solid var(--brand);
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo img { height: 44px; width: auto; }

nav ul  { display: flex; gap: .15rem; align-items: center; list-style: none; }

nav a {
  display: block;
  padding: .4rem .7rem;
  font-size: .85rem;
  font-family: Verdana, Arial, sans-serif;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
}
nav a:hover,
nav a.active       { background: var(--brand); color: var(--white); }
nav a.btn-quote    { background: var(--brand); color: var(--white); font-weight: 600; }
nav a.btn-quote:hover { background: var(--brand-hover); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: .5rem;
  border-radius: var(--radius);
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text);
  transition: all .3s;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO SLIDESHOW ──────────────────────────────── */
.hero { position: relative; overflow: hidden; background: #111; }

.slide-track {
  position: relative; width: 100%; padding-top: 44%; overflow: hidden;
}
.slide-track img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.slide-track img.active { opacity: 1; }

.slide-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff;
  border: none; width: 48px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; cursor: pointer; z-index: 10;
  transition: background var(--trans);
}
.slide-btn:hover     { background: rgba(139,0,0,.75); }
.slide-btn.prev      { left:0;  border-radius: 0 var(--radius) var(--radius) 0; }
.slide-btn.next      { right:0; border-radius: var(--radius) 0 0 var(--radius); }

.slide-dots {
  position: absolute; bottom: .85rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .5rem; z-index: 10;
}
.slide-dots button {
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8);
  background: transparent;
  cursor: pointer; padding: 0;
  transition: background var(--trans);
}
.slide-dots button.active { background: #fff; }

.hero-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.45);
  color: #FFFF88; padding: 3.5rem 2rem 2.75rem;
  pointer-events: none;
}
.hero-caption h1 {
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  margin-bottom: .4rem; font-weight: 700;
  color: #FFFF88; border: none; padding: 0;
}
.hero-caption p { font-size: clamp(.85rem, 2vw, 1.05rem); opacity: .9; }

/* ─── HOME SECTIONS ───────────────────────────────── */
.home-intro {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.home-intro .inner,
.home-cta   .inner {
  max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.25rem;
}
.home-intro .inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
}
.home-intro h2 { color: var(--brand); margin-bottom: .65rem; font-size: 1.2rem; }
.home-intro p  { color: var(--muted); margin-bottom: .75rem; }

.services-list ul {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .5rem; list-style: none;
  margin-top: .75rem;
}
.services-list li {
  display: flex; gap: .4rem; align-items: flex-start; font-size: .9rem;
}
.services-list li::before {
  content: "✓"; color: var(--brand); font-weight: 700; flex-shrink: 0; line-height: 1.65;
}

.home-cta { background: var(--brand); color: #fff; text-align: center; }
.home-cta h2 { color: #fff; font-size: 1.4rem; margin-bottom: .5rem; }
.home-cta p  { opacity: .9; margin-bottom: 1.5rem; font-size: 1rem; }
.home-cta a  { color: #ffd09a; }
.home-cta .btn { color: var(--brand); }
.home-cta .btn:hover { color: var(--brand); }

/* ─── LAYOUT (inner pages) ────────────────────────── */
main { max-width: var(--max-w); margin: 0 auto; }
.page-wrap { padding: 2rem 1.25rem 3rem; }

h1 {
  font-size: 1.55rem; color: var(--brand);
  padding-bottom: .45rem; border-bottom: 2px solid var(--brand);
  margin-bottom: 1.25rem;
}
h2 { color: var(--brand); font-size: 1.15rem; margin: 1.25rem 0 .65rem; }
p  { margin-bottom: .75rem; }

/* ─── PAGE BANNER (top image + title) ────────────────*/
.page-banner {
  display: flex; gap: 1.5rem; align-items: flex-start;
  padding: 1.5rem 1.25rem 0;
}
.page-banner img {
  width: 190px; height: 190px; object-fit: cover;
  border-radius: var(--radius); flex-shrink: 0;
}

/* ─── ABOUT ──────────────────────────────────────── */
.about-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 2rem; margin-top: 1rem;
}
.about-photos {
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem;
}
.about-photos img {
  width: 100%; height: 110px; object-fit: cover; border-radius: var(--radius);
}
.about-photos img.tall {
  grid-column: 1 / -1; height: 160px;
}

.about-text ul {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr;
  gap: .35rem .5rem; margin: .5rem 0 1rem;
}
.about-text li { display: flex; gap: .4rem; font-size: .9rem; }
.about-text li::before { content: "✓"; color: var(--brand); font-weight: 700; flex-shrink: 0; }

/* ─── GALLERY ────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  padding: .5rem 0 1rem;
}
.gallery-grid a {
  display: block; overflow: hidden;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.gallery-grid img {
  width: 100%; height: 165px; object-fit: cover;
  transition: transform .35s ease;
}
.gallery-grid a:hover img { transform: scale(1.06); }

/* ─── LIGHTBOX ───────────────────────────────────── */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 1000;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }

.lb-inner {
  position: relative; max-width: 92vw; max-height: 92vh;
}
.lb-inner img {
  max-width: 88vw; max-height: 85vh; object-fit: contain;
  border-radius: var(--radius);
}

.lb-close {
  position: fixed; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.12); color: #fff;
  border: none; font-size: 1.4rem;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--trans);
}
.lb-close:hover { background: var(--brand); }

.lb-prev, .lb-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); color: #fff;
  border: none; font-size: 2.2rem;
  width: 52px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--trans);
}
.lb-prev:hover, .lb-next:hover { background: rgba(139,0,0,.7); }
.lb-prev { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.lb-next { right: 0; border-radius: var(--radius) 0 0 var(--radius); }

/* ─── TESTIMONIALS ───────────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem; padding: .5rem 0 1rem;
}
.testimonial-card {
  background: #e8f5ee;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.25rem;
}
.testimonial-card blockquote {
  font-style: italic; color: #1a5c33;
  margin-bottom: .7rem; line-height: 1.7; font-size: .92rem;
}
.testimonial-card cite {
  font-style: normal; font-weight: 600;
  color: var(--muted); font-size: .82rem;
}

/* ─── CONTACT LAYOUT ─────────────────────────────── */
.contact-layout {
  display: grid; grid-template-columns: 1fr 1.65fr; gap: 2.5rem;
  padding-top: .5rem;
}

.contact-info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}
.contact-info-box h2 { margin-top: 0; }

.contact-detail {
  display: flex; gap: .75rem; align-items: flex-start;
  margin-bottom: 1rem; font-size: .95rem;
}
.contact-detail .icon { font-size: 1.15rem; flex-shrink: 0; width: 24px; margin-top: .15rem; }
.contact-detail a     { color: var(--brand); text-decoration: none; word-break: break-all; }
.contact-detail a:hover { text-decoration: underline; }

/* ─── FORM ───────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.form-card h2 { margin-top: 0; margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block; font-weight: 500; font-size: .88rem;
  margin-bottom: .3rem; color: var(--text);
}
.form-group label .req { color: var(--brand); }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: #fafafa;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--brand); background: var(--white);
  box-shadow: 0 0 0 3px rgba(139,0,0,.1);
}
.form-group textarea { resize: vertical; min-height: 110px; }

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

.form-note {
  font-size: .8rem; color: var(--muted); margin-top: .5rem;
}

/* ─── PHONE / WHATSAPP CTA ───────────────────────── */
.phone-cta {
  background: var(--brand);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
}
.phone-cta p    { color: rgba(255,255,255,.85); font-size: .85rem; margin-bottom: .4rem; }
.phone-cta .phone-number {
  display: block; color: #fff;
  font-size: 1.5rem; font-weight: 700; text-decoration: none;
  letter-spacing: .03em; margin-bottom: .75rem;
  transition: opacity var(--trans);
}
.phone-cta .phone-number:hover { opacity: .85; }

.btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .6rem 1rem;
  background: #25D366; color: #fff;
  border: none; border-radius: var(--radius);
  font-size: .95rem; font-family: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background var(--trans);
}
.btn-whatsapp:hover { background: #1ebe5d; }
.btn-whatsapp svg  { flex-shrink: 0; }

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.6rem;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: .95rem; font-family: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background var(--trans), transform var(--trans);
  white-space: nowrap;
}
.btn:hover          { background: var(--brand-hover); transform: translateY(-1px); }
.btn:active         { transform: translateY(0); }
.btn-lg             { padding: .8rem 2.2rem; font-size: 1rem; }
.btn-white          { background: #fff; color: var(--brand); }
.btn-white:hover    { background: #f0f0f0; transform: translateY(-1px); }
.btn-outline        { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover  { background: var(--brand); color: #fff; }

/* ─── LINKS PAGE ─────────────────────────────────── */
.links-list { display: grid; gap: 1.4rem; padding: .5rem 0 1rem; }

.link-card {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.link-card img { width: 140px; height: auto; object-fit: contain; flex-shrink: 0; }
.link-card-body h3 { margin-bottom: .35rem; }
.link-card-body h3 a { color: var(--brand); text-decoration: none; font-size: 1.05rem; }
.link-card-body h3 a:hover { text-decoration: underline; }
.link-card-body p  { color: var(--muted); font-size: .88rem; margin: 0; line-height: 1.6; }

/* ─── FOOTER ─────────────────────────────────────── */
footer {
  background: var(--brand); color: rgba(255,255,255,.88);
  padding: 2.5rem 1.25rem 1.5rem; margin-top: 3rem;
  font-size: .875rem;
}
footer a       { color: #ffcc99; text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; }

.footer-inner { max-width: var(--max-w); margin: 0 auto; }

.footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  margin-bottom: 1.75rem; text-align: left;
}
.footer-grid h4    { color: #fff; margin-bottom: .6rem; font-size: .95rem; }
.footer-grid ul    { list-style: none; }
.footer-grid li    { margin-bottom: .3rem; }
.footer-grid p     { margin-bottom: .35rem; opacity: .88; }

.footer-copy {
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 1rem; text-align: center; opacity: .7;
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  .home-intro .inner  { grid-template-columns: 1fr; gap: 1.75rem; }
  .about-layout       { grid-template-columns: 1fr; }
  .about-photos       { grid-template-columns: repeat(4, 1fr); }
  .about-photos img   { height: 90px; }
  .about-photos img.tall { grid-column: auto; height: 90px; }
  .about-text ul      { grid-template-columns: 1fr; }
  .contact-layout     { grid-template-columns: 1fr; }
  .footer-grid        { grid-template-columns: 1fr 1fr; }
}

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

  nav {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--brand);
    box-shadow: var(--shadow-md);
    display: none;
  }
  nav.open          { display: block; }
  nav ul            { flex-direction: column; gap: 0; padding: .5rem 0; }
  nav a             { border-radius: 0; padding: .7rem 1.25rem; font-size: .95rem; }
  nav a.btn-quote   { border-radius: 0; }

  .hero .slide-track { padding-top: 60%; }
  .hero-caption      { padding: 1.5rem 1rem 2.5rem; }

  .page-banner           { flex-direction: column; }
  .page-banner img       { width: 100%; max-height: 200px; }

  .services-list ul  { grid-template-columns: 1fr; }
  .form-row-2        { grid-template-columns: 1fr; }
  .footer-grid       { grid-template-columns: 1fr; gap: 1.25rem; }
}

@media (max-width: 480px) {
  .hero .slide-track    { padding-top: 72%; }
  .about-photos         { grid-template-columns: repeat(3, 1fr); }
  .about-photos img     { height: 80px; }
  .slide-btn            { width: 36px; height: 56px; font-size: 1.4rem; }
  h1                    { font-size: 1.3rem; }
}
