/*
  Rocky Oak Properties CSS
  ------------------------
  This file controls the look and layout of the entire website.

  Beginner note:
  HTML creates the structure/content. CSS controls the design: colors, spacing,
  fonts, columns, buttons, mobile behavior, and animation.
*/

/*
  CSS Variables
  Variables let us define brand colors and reuse them throughout the stylesheet.
  If you want to change the overall color palette, start here.
*/
:root {
  --cream: #f7f1e8;
  --warm-white: #fffaf2;
  --sand: #dcc9af;
  --clay: #b87955;
  --terracotta: #9f5b3f;
  --olive: #68735a;
  --charcoal: #25231f;
  --muted: #706a61;
  --line: rgba(37, 35, 31, 0.12);
  --shadow: 0 20px 60px rgba(37, 35, 31, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --container: 1180px;
}

/*
  Universal box sizing.
  This makes widths easier to calculate because padding and borders are included
  inside the declared width.
*/
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
}

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

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

/*
  Reusable container class.
  This keeps content centered and prevents it from getting too wide on large screens.
*/
.container {
  width: min(100% - 40px, var(--container));
  margin: 0 auto;
}

.narrow {
  max-width: 850px;
}

/* Header and Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 241, 232, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.navbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--warm-white);
  background: linear-gradient(135deg, var(--terracotta), var(--olive));
  font-size: 0.9rem;
}

.logo-text {
  font-size: 1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.94rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--charcoal);
  background: rgba(184, 121, 85, 0.13);
}

.nav-links .nav-cta {
  color: var(--warm-white);
  background: var(--charcoal);
}

.nav-links .nav-cta:hover,
.nav-links .nav-cta.active {
  color: var(--warm-white);
  background: var(--terracotta);
}

/* Mobile menu button starts hidden on desktop. */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--warm-white);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--charcoal);
}

/* Typography */
h1,
h2,
h3 {
  margin: 0 0 16px;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5.6rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 18px;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--terracotta);
}

/* Hero */
.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(circle at top left, rgba(184, 121, 85, 0.22), transparent 36%),
    radial-gradient(circle at bottom right, rgba(104, 115, 90, 0.2), transparent 30%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 56px;
}

.hero-text {
  font-size: 1.14rem;
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: var(--warm-white);
  background: var(--charcoal);
  box-shadow: var(--shadow);
}

.button.secondary {
  color: var(--charcoal);
  background: var(--warm-white);
  border: 1px solid var(--line);
}

.hero-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-card img {
  width: 100%;
  height: 620px;
  object-fit: cover;
}

.floating-card {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.floating-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Sections */
.section,
.feature-section,
.cta-section {
  padding: 88px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.cards {
  display: grid;
  gap: 22px;
}

.three-column {
  grid-template-columns: repeat(3, 1fr);
}

.two-column {
  grid-template-columns: repeat(2, 1fr);
}

.card,
.service-card,
.contact-card,
.contact-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  background: rgba(255, 250, 242, 0.72);
  box-shadow: 0 10px 34px rgba(37, 35, 31, 0.05);
}

.icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border-radius: 16px;
  color: var(--warm-white);
  background: var(--olive);
  font-weight: 800;
}

.feature-section {
  background: var(--warm-white);
}

.feature-grid,
.split-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

.feature-grid.reverse {
  grid-template-columns: 0.95fr 1.05fr;
}

.feature-image img {
  height: 520px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}

.check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 14px;
  color: var(--muted);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--warm-white);
  background: var(--terracotta);
  font-size: 0.8rem;
  font-weight: 800;
}

.cta-box {
  text-align: center;
  padding: 56px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--olive), var(--terracotta));
  box-shadow: var(--shadow);
}

.cta-box h2,
.cta-box p {
  color: var(--warm-white);
}

/* Inner page hero */
.page-hero {
  padding: 92px 0 72px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(184, 121, 85, 0.2), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(104, 115, 90, 0.18), transparent 28%);
}

/* Services */
.service-card a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--terracotta);
  font-weight: 800;
}

/* Gallery */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 34px;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--warm-white);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
  color: var(--warm-white);
  background: var(--charcoal);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.gallery-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--warm-white);
  border: 1px solid var(--line);
  box-shadow: 0 10px 34px rgba(37, 35, 31, 0.05);
}

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

.gallery-info {
  padding: 22px;
}

.gallery-info h2 {
  font-family: "Inter", Arial, sans-serif;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

/* Contact */
.contact-grid {
  align-items: start;
}

.contact-line {
  margin-top: 14px;
  color: var(--muted);
}

.contact-line a {
  color: var(--terracotta);
  font-weight: 800;
}

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-form label {
  font-weight: 800;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  color: var(--charcoal);
  background: var(--warm-white);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 3px solid rgba(184, 121, 85, 0.25);
  border-color: var(--terracotta);
}

.form-message {
  min-height: 24px;
  font-weight: 700;
}

/* Footer */
.site-footer {
  padding: 56px 0 24px;
  background: var(--charcoal);
}

.site-footer p,
.site-footer a,
.site-footer h4 {
  color: rgba(255, 250, 242, 0.78);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}

.footer-logo .logo-text {
  color: var(--warm-white);
}

.copyright {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 250, 242, 0.16);
}

/*
  Reveal animation.
  JavaScript adds the .visible class when each element scrolls into view.
*/
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/*
  Responsive CSS
  The layout changes below certain screen widths so the site works on tablets
  and phones.
*/
@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 82px;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--warm-white);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    justify-content: center;
  }

  .hero-grid,
  .feature-grid,
  .feature-grid.reverse,
  .split-grid,
  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 64px;
  }

  .hero-card img,
  .feature-image img {
    height: 420px;
  }

  .three-column,
  .two-column,
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .logo-text {
    font-size: 0.9rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .three-column,
  .two-column,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .section,
  .feature-section,
  .cta-section {
    padding: 64px 0;
  }

  .hero-card img,
  .feature-image img {
    height: 340px;
  }

  .floating-card {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

/* --------------------------------------------------------------------------
   Portfolio / Before-and-After Gallery Styles
   --------------------------------------------------------------------------
   These styles support the upgraded Gallery page. They create:
   - responsive project cards
   - interactive before/after image sliders
   - a masonry-style supporting photo grid
   - a lightbox overlay for larger image viewing
*/

/* Adds a warmer, richer background to the gallery hero. */
.portfolio-hero {
  background:
    radial-gradient(circle at top left, rgba(159, 91, 63, 0.2), transparent 34%),
    radial-gradient(circle at bottom right, rgba(104, 115, 90, 0.18), transparent 32%),
    var(--cream);
}

/* A smaller section padding helper used for the stats strip. */
.section-tight {
  padding: 34px 0;
}

/* Three-column stats area under the gallery hero. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stats-grid div {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 242, 0.72);
  box-shadow: 0 10px 30px rgba(37, 35, 31, 0.06);
}

.stats-grid strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.55rem;
  line-height: 1;
}

.stats-grid span {
  color: var(--muted);
  font-weight: 600;
}

/* Project cards use a two-column layout on desktop and stack on mobile. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 34px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--warm-white);
  box-shadow: var(--shadow);
}

.project-content {
  padding: 24px;
}

.project-type {
  margin-bottom: 8px;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.project-content h3 {
  margin-bottom: 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.65rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.project-tags li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(220, 201, 175, 0.24);
  font-size: 0.78rem;
  font-weight: 800;
}

/*
  Before/after slider container.
  position: relative lets us layer the two images, labels, and slider input.
*/
.before-after-slider {
  position: relative;
  height: 430px;
  overflow: hidden;
  background: var(--sand);
}

.before-after-slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.before-image {
  position: absolute;
  inset: 0;
}

/*
  The after image sits on top of the before image.
  JavaScript changes the width of this wrapper as the slider moves.
*/
.after-image-wrap {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  border-right: 3px solid var(--warm-white);
}

.after-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Small labels on top of each comparison image. */
.image-label {
  position: absolute;
  top: 16px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--warm-white);
  background: rgba(37, 35, 31, 0.72);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.before-label { left: 16px; }
.after-label { right: 16px; }

/*
  Range input covers the full image area.
  The input is visually subtle, but still easy to drag or tap.
*/
.slider-range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

/* Supporting gallery grid. */
.photo-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 32px;
}

.lightbox-trigger {
  min-height: 260px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: zoom-in;
  box-shadow: 0 12px 32px rgba(37, 35, 31, 0.1);
}

.lightbox-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lightbox-trigger:hover img {
  transform: scale(1.04);
}

/* Placeholder cards use a simple generated graphic instead of a stock photo. */
.placeholder-grid {
  margin-top: 30px;
}

.placeholder-card {
  overflow: hidden;
}

.placeholder-art {
  height: 160px;
  margin: -26px -26px 22px;
  background:
    linear-gradient(135deg, rgba(159, 91, 63, 0.26), rgba(104, 115, 90, 0.28)),
    repeating-linear-gradient(90deg, rgba(37, 35, 31, 0.18) 0 10px, transparent 10px 24px),
    var(--sand);
}

/* Lightbox overlay hidden by default. JavaScript adds .open when active. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(37, 35, 31, 0.86);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(100%, 1100px);
  max-height: 88vh;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 250, 242, 0.35);
  border-radius: 50%;
  color: var(--warm-white);
  background: rgba(255, 250, 242, 0.12);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 900px) {
  .stats-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .photo-masonry {
    grid-template-columns: repeat(2, 1fr);
  }

  .before-after-slider {
    height: 380px;
  }
}

@media (max-width: 620px) {
  .photo-masonry {
    grid-template-columns: 1fr;
  }

  .before-after-slider {
    height: 340px;
  }

  .project-content {
    padding: 20px;
  }
}

/* Keeps the after photo full-width while its wrapper clips/reveals it. */
.after-image-wrap .after-image {
  position: absolute;
  inset: 0 auto auto 0;
  max-width: none;
}
