/* =========================================================
   Autosolid — index.css (Dark Theme Only, Bug Fixes Included)
   ========================================================= */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* =========================================================
   Color Scheme & Variables (Dark Theme Only)
   ========================================================= */
:root {
  color-scheme: dark;

  --primary-bg: #212529;
  --primary-bg-alt: #2c3e50;
  --secondary-bg: #1a2533;

  --text-light: #f8f9fa;
  --text-muted: #e0e4e9; /* slightly brighter for better contrast */

  --accent-color: #e8491d;
  --accent-hover: #f05f3a;

  --card-bg: #2c3e50;          /* used for service cards */
  --border-color: #34495e;
  --placeholder-color: #8e9bab; /* unified placeholder text colour */

  --shadow-1: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-2: 0 10px 20px rgba(0,0,0,0.20);
  --focus-ring: 0 0 0 3px rgba(232, 73, 29, 0.35);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --transition-speed: 0.25s;

  --content-max: 1200px;
  --gutter: clamp(1.5rem, 5vw, 4rem); /* fluid — tighter on mobile, generous on desktop */
  --header-height: 72px;
  --section-pad: clamp(4rem, 8vw, 7rem); /* consistent vertical rhythm */
}

/* =========================================================
   Reset / Base
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--text-light); text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
main { flex-grow: 1; }

/* Account for sticky header when using anchor links */
main section[id] { scroll-margin-top: var(--header-height); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-color);
  color: var(--text-light);
  padding: 8px 12px;
  z-index: 2000;
  transition: top 0.3s ease;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid var(--accent-hover);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* =========================================================
   Header / Main Navigation
   ========================================================= */
.app-header {
  background-color: rgba(26, 37, 51, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem var(--gutter);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  min-height: var(--header-height);
}

.app-header.scrolled {
  background-color: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-1);
}

.logo img {
  max-width: 150px;
  height: auto;
  transition: opacity 0.3s ease;
}
.logo a:hover img { opacity: 0.85; }

.main-nav ul { display: flex; gap: 2rem; align-items: center; }

.main-nav a {
  font-weight: 600;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}
.main-nav a:hover,
.main-nav a.active { color: var(--accent-color); }
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}
.main-nav a:hover::after,
.main-nav a.active::after { width: 100%; }

/* =========================================================
   Hero Carousel
   ========================================================= */
.hero-carousel {
  position: relative;
  height: 80vh;
  min-height: 520px;
  color: var(--text-light);
  overflow: hidden;
}

/* gradient fade at bottom blends hero into the next section */
.hero-carousel::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--primary-bg-alt));
  z-index: 2;
  pointer-events: none;
}

.carousel-container { position: relative; height: 100%; width: 100%; }

.carousel-track {
  list-style: none;
  position: relative;
  height: 100%;
  margin: 0;
  padding: 0;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--primary-bg-alt);
  display: flex;
  justify-content: flex-start; /* left-aligned: editorial feel */
  align-items: center;
  text-align: left;
  opacity: 0; visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
  will-change: opacity;
  z-index: 0;
}
.carousel-slide.current-slide {
  position: relative;
  opacity: 1; visibility: visible; z-index: 1;
}

.visually-hidden-fallback,
.visually-hidden {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

.slide-content {
  max-width: 640px;
  padding: 2rem var(--gutter);
  position: relative; z-index: 3;
}

/* accent bar above heading */
.slide-content::before {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.slide-content h2 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 2px 2px 12px rgba(0,0,0,0.6);
}
.slide-content p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.88);
  max-width: 480px;
  margin: 0 0 2rem 0;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

/* CTA button */
.cta-button {
  background-color: var(--accent-color);
  color: var(--text-light);
  padding: 0.8rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-transform: uppercase;
  transition: background-color var(--transition-speed) ease,
              transform var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
  display: inline-block;
  border: none; cursor: pointer;
}
.cta-button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}
.cta-button:focus-visible { box-shadow: var(--focus-ring); }
.cta-button:disabled {
  background-color: var(--text-muted);
  cursor: not-allowed; transform: none; box-shadow: none;
}

/* Carousel controls */
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background-color: rgba(0,0,0,0.4);
  border: none; color: white; font-size: 2rem;
  width: 50px; height: 50px; border-radius: 50%;
  cursor: pointer; transition: background-color 0.3s ease, outline 0.3s ease;
  z-index: 3; display: flex; align-items: center; justify-content: center;
}
.carousel-nav:hover,
.carousel-nav:focus-visible {
  background-color: rgba(0,0,0,0.7);
  outline: 3px solid var(--accent-color); outline-offset: 3px;
}
.carousel-nav.prev { left: 2rem; }
.carousel-nav.next { right: 2rem; }

.carousel-indicators {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; gap: 0.75rem;
}
.carousel-indicators button {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ffffff; opacity: 0.7; border: none; cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}
.carousel-indicators button.current-slide {
  background: var(--accent-color);
  opacity: 1;
  transform: scale(1);
  width: 28px;         /* pill shape for active indicator */
  border-radius: 6px;
}

.carousel-toggle {
  position: absolute; bottom: 2rem; right: 2rem;
  background-color: rgba(0,0,0,0.4);
  color: white; padding: 0.5rem 1rem; border-radius: var(--radius-md); border: none;
  cursor: pointer; font-size: 1rem; transition: background-color 0.3s ease, outline 0.3s ease;
  z-index: 3;
}
.carousel-toggle:hover,
.carousel-toggle:focus-visible {
  background-color: rgba(0,0,0,0.7);
  outline: 3px solid var(--accent-color); outline-offset: 3px;
}

/* =========================================================
   Generic Sections
   ========================================================= */
.content-section,
.services { padding: var(--section-pad) var(--gutter); }

/* [FIX] Removed text-align: center from services section */
.content-section:not(.about-section) { text-align: center; }

.content-section.bg-alt, .services.bg-alt { background-color: var(--primary-bg-alt); }
.content-section.bg-secondary { background-color: var(--secondary-bg); }

.content-section h2,
.services h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

/* accent underline decoration below every section heading */
.content-section h2::after,
.services h2::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
  margin: 0.65rem auto 0;
}
.content-section > .inner > p,
.services > .inner > p {
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 3rem auto;
  text-align: center;
}

/* Constrain wide blocks */
.content-section > .inner,
.services > .inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* =========================================================
   Services
   ========================================================= */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* fixed 2×2 layout */
  gap: 2rem;
}

.service-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  border: 1px solid var(--border-color);
  will-change: transform;
}

/* animated accent bar slides in from left on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-speed) ease;
  z-index: 1;
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); }

.service-card img {
  width: 100%;
  aspect-ratio: 16 / 9; /* adapts naturally to card width instead of fixed 200px */
  object-fit: cover;
}

.service-card-content {
  padding: 1.75rem 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}
.service-card-content h3 {
  font-size: 1.3rem; line-height: 1.3; margin-bottom: 0.5rem; color: var(--text-light);
}
.service-card-content p {
  color: var(--text-muted); 
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.service-button {
  color: var(--accent-color);
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  align-self: flex-start;
  margin-top: auto;
}
.service-button:hover { color: var(--accent-hover); transform: translateX(2px); }

/* =========================================================
   Occasions
   ========================================================= */
#occasions {
  background-color: var(--secondary-bg);
  padding: var(--section-pad) var(--gutter);
  text-align: center;
}

#occasions h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  color: var(--text-light);
  font-weight: 700;
}
#occasions p {
  max-width: 700px; margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.1rem; line-height: 1.6;
}

/* =========================================================
   About
   ========================================================= */
.about-section { padding: var(--section-pad) var(--gutter); }

.about-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
}

.about-image-container {
  position: relative;
}

/* decorative accent border offset behind the image */
.about-image-container::before {
  content: '';
  position: absolute;
  top: -14px; left: -14px;
  right: 14px; bottom: 14px;
  border: 2px solid var(--accent-color);
  border-radius: var(--radius-lg);
  opacity: 0.35;
  pointer-events: none;
}

.about-image-container img {
  position: relative; /* sits above the ::before frame */
  width: 100%; height: auto; border-radius: var(--radius-lg); object-fit: cover;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.about-content h2 { text-align: left; }

.about-subtitle {
  font-size: 1.3rem; font-weight: 600; color: var(--accent-color); margin-bottom: 1.5rem;
}

.about-content > p {
  color: var(--text-muted); text-align: left; margin-bottom: 2rem;
}

.values-title {
  font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1.5rem;
  padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); color: var(--text-light);
}

.about-values {
  display: flex; flex-direction: column; gap: 1.5rem; padding: 0; margin: 0;
}
.about-values li { display: flex; align-items: flex-start; gap: 1rem; }
.about-values svg { flex-shrink: 0; width: 28px; height: 28px; color: var(--accent-color); margin-top: 5px; }
.about-values strong {
  font-weight: 600; color: var(--text-light); display: block; font-size: 1.1rem; margin-bottom: 0.25rem;
}
.about-values p { color: var(--text-muted); margin: 0; line-height: 1.5; }

/* =========================================================
   Contact Form
   ========================================================= */
.contact-form {
  max-width: 700px;
  margin: 2.5rem auto 0;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
}

/* full-width items */
#form-feedback,
.form-group.honeypot,
.form-group:has([name="phone"]),
.form-group:has(textarea),
.contact-form > button { grid-column: 1 / -1; }

/* name + email sit side-by-side */
.form-group:has([name="name"]),
.form-group:has([name="email"]) { grid-column: span 1; }

.form-group { margin-bottom: 1.5rem; }
.form-group.honeypot { display: none !important; }

.form-group label {
  display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-muted);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  width: 100%; padding: 0.8rem 1rem;
  background-color: var(--primary-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  color: var(--text-light);
  font-family: inherit; font-size: 1rem;
  transition: border-color var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease,
              background-color var(--transition-speed) ease;
  accent-color: var(--accent-color);
}

.contact-form input[type="text"]::placeholder,
.contact-form input[type="email"]::placeholder,
.contact-form input[type="tel"]::placeholder,
.contact-form textarea::placeholder {
  color: var(--placeholder-color);
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form textarea:focus {
  outline: none; border-color: var(--accent-color); box-shadow: var(--focus-ring);
}

.contact-form textarea { resize: vertical; min-height: 120px; }

.contact-form .cta-button { width: 100%; padding: 1rem; font-size: 1.1rem; }

#form-feedback {
  margin-bottom: 1.5rem; padding: 1rem; border-radius: var(--radius-md); text-align: center; font-weight: 600; display: none;
}
#form-feedback.feedback-success {
  background-color: rgba(46, 204, 113, 0.1);
  border: 1px solid #2ecc71; color: #2ecc71;
}
#form-feedback.feedback-error {
  background-color: rgba(231, 76, 60, 0.1);
  border: 1px solid #e74c3c; color: #e74c3c;
}

/* =========================================================
   Footer
   ========================================================= */
.app-footer {
  background-color: var(--secondary-bg);
  color: var(--text-muted);
  padding: 3rem var(--gutter);
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 2rem 3rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-contact { text-align: left; }
.footer-contact p { margin: 0 0 0.4rem 0; font-size: 0.95rem; }
.footer-contact p:first-child { font-size: 1rem; margin-bottom: 0.75rem; }

.footer-contact a { color: var(--accent-color); font-weight: 500; }
.footer-contact a:hover { text-decoration: underline; }

.footer-nav { align-self: center; justify-self: center; }
.footer-nav ul {
  display: flex; gap: 1.75rem; flex-wrap: wrap; justify-content: center; padding: 0; margin: 0;
}

.footer-nav a {
  color: var(--text-light); font-weight: 600; font-size: 0.95rem;
  padding: 0.5rem 0; position: relative; transition: color 0.3s ease;
}
.footer-nav a:hover,
.footer-nav a.active { color: var(--accent-color); }

.footer-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background-color: var(--accent-color); transition: width 0.3s ease;
}
.footer-nav a:hover::after,
.footer-nav a.active::after { width: 100%; }

.footer-bottom {
  text-align: right;
  align-self: center;
  font-size: 0.9rem;
  color: var(--placeholder-color);
}

/* =========================================================
   Cookie Bar
   ========================================================= */
#cookie-bar {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background-color: var(--secondary-bg); color: var(--text-light);
  padding: 1rem 2rem; display: none; /* shown by JS if no cookie decision */
  justify-content: space-between; align-items: center;
  z-index: 2000; border-top: 1px solid var(--border-color);
  flex-wrap: wrap; gap: 1rem;
}
#cookie-bar p { margin: 0; flex-grow: 1; color: var(--text-muted); }
#cookie-bar .cta-button { padding: 0.6rem 1.5rem; flex-shrink: 0; }

/* =========================================================
   Back to Top
   ========================================================= */
#back-to-top {
  position: fixed; bottom: 20px; right: 20px;
  background-color: var(--accent-color); color: var(--text-light);
  border: none; border-radius: 50%; width: 50px; height: 50px; font-size: 24px;
  display: flex; align-items: center; justify-content: center; /* centers the ↑ glyph */
  cursor: pointer; z-index: 1001;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
              background-color var(--transition-speed) ease;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background-color: var(--accent-hover); }
#back-to-top:focus-visible { box-shadow: var(--focus-ring); }

/* =========================================================
   Scroll Animations
   ========================================================= */
.animate-on-scroll {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* subtle stagger for service cards */
.service-card.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.service-card.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.service-card.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1200px) {
  .about-container { gap: 2.25rem; }
}

@media (max-width: 992px) {
  .about-container { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-content h2, .about-subtitle, .about-content > p { text-align: center; }
  .about-image-container { max-width: 500px; margin: 0 auto; order: -1; }
}

@media (max-width: 768px) {
  /* header is taller on mobile — increase scroll offset to match */
  main section[id] { scroll-margin-top: calc(var(--header-height) + 40px); }

  .app-header { flex-direction: column; gap: 1rem; padding: 1rem 2%; min-height: calc(var(--header-height) + 8px); }
  .main-nav ul { gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
  .main-nav a { font-size: 0.95rem; }
  .carousel-nav.prev { left: 1rem; }
  .carousel-nav.next { right: 1rem; }
  .carousel-toggle { bottom: 4.5rem; right: 1rem; font-size: 0.95rem; }
  .footer-content { grid-template-columns: 1fr; text-align: center; }
  .footer-contact, .footer-bottom { text-align: center; }
  .footer-nav ul { flex-direction: column; align-items: center; gap: 0.75rem; }
  #cookie-bar { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .service-grid { grid-template-columns: 1fr; } /* single column on small phones */
}

@media (max-width: 576px) {
  .slide-content h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
  .slide-content p { font-size: clamp(0.95rem, 3.5vw, 1.05rem); }
  .carousel-nav { width: 40px; height: 40px; font-size: 1.5rem; }
  /* centre-align hero on small screens */
  .carousel-slide { justify-content: center; text-align: center; }
  .slide-content { max-width: 100%; }
  .slide-content::before { margin-left: auto; margin-right: auto; }
  .slide-content p { margin-left: auto; margin-right: auto; }
  /* single-column contact form on mobile */
  .contact-form { grid-template-columns: 1fr; }
  .form-group:has([name="name"]),
  .form-group:has([name="email"]) { grid-column: 1 / -1; }
}

/* =========================================================
   Reduced Motion / Transparency / Contrast
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .app-header, .carousel-toggle, .carousel-nav {
    background-color: var(--secondary-bg);
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
}

@media (prefers-contrast: more) {
  :root { --focus-ring: 0 0 0 3px rgba(232, 73, 29, 0.6); }
  .main-nav a::after, .footer-nav a::after { height: 3px; }
}

/* =========================================================
   Print
   ========================================================= */
@media print {
  .app-header, #cookie-bar, .carousel-nav, .carousel-toggle, #back-to-top { display: none !important; }
  a::after { content: " (" attr(href) ")"; font-weight: normal; font-size: 90%; color: #999; }
  .service-card, .about-image-container img { box-shadow: none !important; }
}
