/*
Theme Name: SouthDevonWindscreens
Author: You
Version: 1.0
*/

@import url('https://fonts.googleapis.com/css2?family=Playwrite+NZ+Basic:wght@100..400&family=SN+Pro:ital,wght@0,200..900;1,200..900&display=swap');

/* ---------- THEME COLOURS & GLOBAL SETTINGS ---------- */

:root {
  /* Neutrals */
  --bg: #f7f7f8;              /* page background (off‑white) */
  --surface: #ffffff;         /* cards/sections background */
  --primary-dark: #111827;    /* main dark text / headings */
  --text: #111827;            /* default body text */

  /* Accents */
  --accent-red: #be0618;      /* primary red accent */
  --accent-blue: #2563eb;     /* secondary blue accent */

  /* For existing uses of --primary / --accent */
  --primary: var(--accent-red);
  --accent: var(--accent-red);

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(17,24,39,0.12);
  --shadow-md: 0 8px 25px rgba(17,24,39,0.15);
  --shadow-lg: 0 20px 40px rgba(17,24,39,0.2);
  --shadow-red: 0 12px 30px rgba(190,6,24,0.2);
  --shadow-blue: 0 12px 30px rgba(37,99,235,0.15);
  
  /* Responsive fixes */
  --safe-padding: clamp(0.75rem, 2vw, 1.25rem);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "SN Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

html {
  scroll-behavior: smooth; /* SMOOTH SCROLLING ENABLED */
}

/* ---------- HEADER & HERO ---------- */

header {
  background: linear-gradient(
              135deg,
              rgba(17,24,39,0.8),
              rgba(190,6,24,0.8)
            ),
            url("assets/background-car.jpg") center/cover no-repeat;
  color: white;
  padding: 1rem var(--safe-padding) 3.5rem;
}

@media (min-width: 769px) {
  header {
    background: linear-gradient(
                135deg,
                rgba(17,24,39,0.8),
                rgba(190,6,24,0.8)
              ),
              url("assets/background-car.jpg") center/cover no-repeat fixed;
    background-size: cover;
    background-attachment: fixed;
  }
}

/* ---------- NAVIGATION ---------- */

.nav {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 1rem;
  color: #ffffff;
}

/* Header call-to-action button (desktop/mobile) */
.nav-phone {
  display: none;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent-blue);
}

@media (min-width: 900px) {
  .nav-phone {
    display: none !important;  /* hide phone link on larger screens */
  }

  .nav-links {
    display: flex;
    margin-left: auto;         /* right-aligned menu */
  }
}

/* ---------- HERO CONTENT ---------- */

.hero {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-main h1 {
  font-size: clamp(1.8rem, 3vw + 1rem, 2.6rem);
  margin-bottom: 0.5rem;
}

.hero-main p.lead {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.hero-main .slogan {
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.05rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.hero-cta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-badges {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.2);
}

/* ---------- LAYOUT & SECTIONS ---------- */

main {
  max-width: 1200px;
  margin: 2.5rem auto 3rem;
  padding: 0 var(--safe-padding);
}

section {
  margin-bottom: 3rem;
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1.75rem var(--safe-padding);
  box-shadow: 0 6px 20px rgba(15,23,42,0.06);
  border: 1px solid #e5e7eb;
}

section h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

section p {
  margin-bottom: 0.75rem;
  font-size: 0.98rem;
}

/* ---------- FEATURE PILLS ---------- */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(190,6,24,0.06);
  color: var(--primary-dark);
  border: 1px solid rgba(190,6,24,0.25);
}

/* ---------- GRID & SERVICE CARDS ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.card {
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1.1rem 1rem;
  border: 1px solid #e5e7eb;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--primary-dark);
}

.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Service icons above headings */
.card .service-icon {
  width: 140px !important;
  height: 140px !important;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15,23,42,0.12);
  transition: all 0.3s ease;
}

.card:hover .service-icon {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(92,1,11,0.2);
}

/* ---------- HOME PAGE GALLERY (GRID OF 4) ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15,23,42,0.15);
}

.gallery-item img {
  height: 160px;
  width: 100%;
  object-fit: cover;
}

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

.gallery-item p {
  padding: 0.6rem 0.7rem;
  margin: 0;
  font-size: 0.9rem;
}

.gallery-cta {
  text-align: right;
  margin-top: 0.5rem;
}

/* ---------- MEET THE TEAM ---------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.team-card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(15,23,42,0.06);
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-blue);
}

.team-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 4px solid rgba(37,99,235,0.2);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.team-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  color: var(--primary-dark);
}

.team-card h3 span {
  color: var(--accent-blue);
  font-weight: 500;
  font-size: 0.95rem;
}

.team-role {
  color: var(--accent-red);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-size: 0.92rem;
}

.team-stats li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.team-stats li:last-child {
  border-bottom: none;
}

.team-stats strong {
  color: var(--primary-dark);
}

/* ---------- BUTTONS ---------- */

/* Main red button */
.btn-primary {
  background: var(--accent-red);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: #e11d2c;
}

/* Secondary blue outline button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: rgba(37,99,235,0.06);
  color: var(--accent-blue);
  border: 1.5px solid var(--accent-blue);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--accent-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.3);
}

/* ---------- FIXED CONTACT SECTION ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;  /* Fixed ratio, no overflow */
  gap: 1.75rem;
  margin-top: 1rem;
  align-items: start;  /* Changed from stretch */
  height: auto;        /* Fully flexible */
}

.contact-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-cta {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-card {
  background: var(--surface);
  border-radius: 0.75rem;
  padding: clamp(1.5rem, 4vw, 2rem);  /* Responsive padding */
  border: 1px solid #e5e7eb;
  text-align: center;
  width: 80%;
  height: fit-content;  /* No fixed height */
  box-shadow: 0 6px 20px rgba(15,23,42,0.06);
  max-height: 300px;    /* Reasonable max */
}

.cta-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.cta-card .lead {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  color: #6b7280;
}

/* ---------- FOOTER ---------- */

footer {
  background: var(--primary-dark);
  color: #e5e7eb;
  padding: 1.5rem var(--safe-padding);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.footer-bottom {
  border-top: 1px solid rgba(148,163,184,0.35);
  padding-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
}

/* ---------- FLOATING CALL BUTTON (MOBILE) ---------- */

.float-phone {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--accent-red);
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: var(--shadow-red, 0 8px 25px rgba(190,6,24,0.3));
  z-index: 40;
}

@media (max-width: 768px) {
  .float-phone {
    display: block;
  }
}

/* ---------- BACK-TO-TOP BUTTON ---------- */

.back-to-top {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: rgba(16,17,16,0.9);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  display: none;         /* shown via JS */
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-md, 0 8px 25px rgba(17,24,39,0.15));
  cursor: pointer;
  z-index: 60;
  border: 1px solid rgba(255,255,255,0.25);
}

.back-to-top:hover {
  background: var(--accent-red);
}

@media (max-width: 768px) {
  .back-to-top {
    left: 1rem;
    bottom: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* ---------- MOBILE LAYOUT TWEAKS ---------- */

@media (max-width: 768px) {
  header {
    padding-bottom: 2.5rem;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 1.5rem;
  }

  .hero-cta {
    justify-content: flex-start;
  }

  /* FIXED CONTACT SECTION - MOBILE */
  .contact-grid {
    grid-template-columns: 1fr;  /* Single column */
    gap: 1.5rem;
  }
  
  .cta-card {
    max-height: none;  /* Full height on mobile */
    padding: 1.5rem;
  }
}

/* ---------- FULL GALLERY PAGE ---------- */

.full-gallery {
  background: var(--bg);
  padding: 2rem var(--safe-padding);
  min-height: 100vh;
}

.full-gallery section {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  margin-bottom: 0;
}

.gallery-title {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 var(--safe-padding);
}

.gallery-main-title {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.gallery-subtitle {
  font-size: 1.2rem;
  color: var(--accent-red);
  font-weight: 500;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

.big-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.big-gallery-item {
  background: var(--surface);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15,23,42,0.06);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  cursor: pointer;
}

.big-gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(92,1,11,0.12);
}

.big-gallery-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.big-gallery-item p {
  padding: 1rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--primary-dark);
}

/* ---------- IMAGE MODAL (FULL GALLERY) ---------- */

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(16,17,16,0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-image {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-caption {
  color: white;
  background: rgba(190,6,24,0.9);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  max-width: 90%;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: -2rem;
  right: -2rem;
  background: var(--accent-red);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #e11d2c;
  transform: scale(1.1);
}

.back-btn {
  position: fixed;
  top: 1rem;
  left: var(--safe-padding);
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 8px 25px rgba(15,23,42,0.15);
  border: 1px solid #e5e7eb;
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: white;
  box-shadow: 0 12px 30px rgba(92,1,11,0.2);
  transform: translateY(-2px);
}

.loading-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #6b7280;
  font-size: 1.1rem;
}

/* ========== ULTRA-RESPONSIVE FIXES ========== */

@media (max-width: 480px) {
  main {
    margin: 1.5rem auto 2rem;
    padding: 0 1rem;
  }
  
  section {
    padding: 1.25rem 1rem;
    margin-bottom: 2rem;
  }
  
  .hero {
    gap: 1rem;
  }
  
  .gallery {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .big-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  header {
    padding: 1rem 1rem 2rem;
  }
}

@media (max-height: 600px) {  
  main {
    margin-top: 1rem;
  }
  
  section {
    margin-bottom: 2rem;
    padding: 1.25rem;
  }
  
  .hero {
    gap: 1rem;
  }
}

/* HOMEPAGE GALLERY - ROUNDED SIDES */
#gallery .gallery-item img {
  border-radius: 12px !important;
  overflow: hidden;
}

#gallery .gallery-item {
  overflow: hidden;
  border-radius: 12px;
}

#gallery .gallery-item:hover img {
  transform: scale(1.05);
  border-radius: 12px !important; /* Keep rounded on hover */
}

/* MODAL CLOSE BUTTON */
.modal-close-btn {
  position: relative;  /* Back to normal flow */
  display: block;
  margin: 1.5rem auto 0;  /* Centered + space above */
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(190,6,24,0.4);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.modal-close-btn:hover {
  background: #e11d2c;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(190,6,24,0.5);
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* No extra padding needed */
}


/* Hide old X positioning */
.image-modal .modal-close {
  display: none !important;
}