/* RS Joinery - Premium furniture & installation */
:root {
  --color-bg: #0f0f0e;
  --color-surface: #1a1a18;
  --color-surface-2: #252522;
  --color-text: #e8e6e3;
  --color-text-muted: #9c9994;
  --color-accent: #c9a962;
  --color-accent-hover: #d4b872;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --header-height: 72px;
  --container: min(1200px, 100vw - 2rem);
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(15, 15, 14, 0.92);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  height: 100%;
}
.logo img {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
}
.logo:hover img {
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav a {
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover,
.nav a[data-active="true"] {
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav a {
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: center;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-slideshow {
  position: absolute;
  inset: 0;
  background: var(--color-surface-2);
}
.hero-slideshow .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slideshow .slide.active {
  opacity: 1;
  z-index: 1;
}
.hero-slideshow .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
}
.hero-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--header-height) 1.5rem 2rem;
  max-width: 720px;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}

/* Sections */
.section {
  padding: 4rem 1rem;
  scroll-margin-top: var(--header-height);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}

/* Services */
.section-services {
  background: var(--color-surface);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--color-surface-2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.service-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* About */
.section-about {
  background: var(--color-bg);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.about-image-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-surface-2);
}
.about-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-content {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  white-space: pre-line;
}

@media (max-width: 768px) {
  .about-inner {
    grid-template-columns: 1fr;
  }
  .about-image-wrap {
    max-height: 280px;
    aspect-ratio: 16/10;
  }
}

/* Gallery */
.section-gallery {
  background: var(--color-surface);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-surface-2);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-item .caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.9rem;
  color: #fff;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem;
}

/* Videos */
.section-videos {
  background: var(--color-bg);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.video-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface-2);
  border: 1px solid rgba(255,255,255,0.06);
}

.video-card .video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.video-card .video-wrap video,
.video-card .video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.video-card .video-wrap video {
  object-fit: cover;
}

.video-card .title {
  padding: 1rem;
  font-weight: 500;
  color: var(--color-text);
}

.videos-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem;
}

/* Testimonials */
.section-testimonials {
  background: var(--color-surface);
}

.testimonials-slider {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.testimonials-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 2rem;
  padding: 1rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.testimonials-track::-webkit-scrollbar {
  display: none;
}

.testimonial-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: var(--color-surface-2);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.testimonial-card .quote {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 1rem;
  font-style: italic;
}

.testimonial-card .author {
  color: var(--color-accent);
  font-weight: 500;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
}
.slider-btn:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}
.slider-btn.prev { left: -1rem; }
.slider-btn.next { right: -1rem; }

@media (max-width: 768px) {
  .slider-btn.prev { left: 0.25rem; }
  .slider-btn.next { right: 0.25rem; }
}

.testimonials-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem;
}

/* Contact */
.section-contact {
  background: var(--color-bg);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-info .contact-item {
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
}
.contact-info .contact-item a {
  color: var(--color-text);
}
.contact-info .contact-item a:hover {
  color: var(--color-accent);
}

.btn-map {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  color: var(--color-bg) !important;
  border-radius: 8px;
  font-weight: 500;
}
.btn-map:hover {
  background: var(--color-accent-hover);
}

.contact-map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
  background: var(--color-surface-2);
}

.map {
  width: 100%;
  height: 320px;
  min-height: 280px;
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .map {
    height: 280px;
  }
}

/* Footer */
.footer {
  padding: 1.5rem;
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  position: relative;
}

.footer .admin-link {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}
