/* CleanEnd OÜ - Main Stylesheet */

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #2c2c2c;
  background-color: #f8f7f5;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

body.home {
  height: 100svh;
  overflow: hidden;
}

body.home main {
  display: flex;
  flex-direction: column;
}

body.home .hero {
  flex: 1;
  min-height: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #4a6741;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #5a7d50;
}

ul {
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.4em;
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
}

/* === Header === */
.site-header {
  background: #ffffff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: #2c2c2c;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.logo:hover {
  color: #4a6741;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.lang-switch a {
  display: block;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 0;
}

.lang-switch a:hover,
.lang-switch a.active {
  opacity: 1;
}

.lang-switch img {
  width: 28px;
  height: 18px;
  border-radius: 2px;
}

/* === Hamburger Menu === */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #2c2c2c;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Navigation === */
.main-nav {
  display: none;
  width: 100%;
  flex-direction: column;
  background: #ffffff;
}

.main-nav.open {
  display: flex;
}

.main-nav a {
  display: block;
  color: #5a5a5a;
  padding: 0.6rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid #eee;
  transition: color 0.2s;
}

.main-nav a:last-child {
  border-bottom: none;
}

.main-nav a:hover,
.main-nav a.active {
  color: #4a6741;
}

/* Desktop nav */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .header-inner {
    padding-bottom: 0;
  }

  .main-nav {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 0;
    margin-top: 0.25rem;
    border-top: 1px solid #eee;
  }

  .main-nav a {
    padding: 0.6rem 1rem;
    border-bottom: 2px solid transparent;
    text-align: center;
  }

  .main-nav a:hover {
    border-bottom-color: #4a6741;
    color: #4a6741;
  }

  .main-nav a.active {
    border-bottom-color: #4a6741;
    color: #4a6741;
  }

  .logo {
    font-size: 1.5rem;
  }
}

/* === Hero Section (Homepage) === */
.hero {
  position: relative;
  min-height: calc(100svh - 52px); /* fallback for non-home pages */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.hero-text {
  position: relative;
  z-index: 1;
  color: #ffffff;
  text-align: center;
  padding: 2rem 1.5rem 1rem;
  max-width: 750px;
  font-size: 1.35rem;
  line-height: 1.7;
  font-weight: 300;
}

.hero-cta {
  position: relative;
  z-index: 1;
  display: inline-block;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  border-radius: 3px;
  margin-top: 0.5rem;
}

.hero-cta:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

@media (min-width: 768px) {
  .hero-text {
    font-size: 1.65rem;
    padding: 3rem 2rem 1.25rem;
  }

  .hero-cta {
    font-size: 0.9rem;
    padding: 0.7rem 2rem;
  }
}

/* === Content Sections === */
.content {
  padding: 2rem 0 3rem;
}

.content h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3a3a3a;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #4a6741;
  display: inline-block;
}

.content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #3a3a3a;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.content p {
  margin-bottom: 0.85rem;
}

.content ul {
  margin-bottom: 1rem;
}

.content .note {
  background: #f0eeea;
  border-left: 3px solid #4a6741;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.content .note strong {
  color: #4a6741;
}

/* === Button === */
.btn {
  display: inline-block;
  background: #4a6741;
  color: #ffffff;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  margin-top: 1rem;
  transition: background 0.2s;
}

.btn:hover {
  background: #5a7d50;
  color: #ffffff;
}

/* === Contact Page === */
.contact-info {
  padding: 2.5rem 0 3rem;
  text-align: center;
}

.contact-info p {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.contact-info .phone,
.contact-info .email {
  font-size: 1.4rem;
  font-weight: 600;
  color: #4a6741;
  margin: 0.5rem 0 1rem;
}

.contact-info .email a {
  color: #4a6741;
}

.contact-info .email a:hover {
  color: #5a7d50;
}

/* === Photo Gallery (Previous Jobs) === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 1.5rem 0 3rem;
}

.gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  line-height: 0;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
  transition: transform 0.3s;
}

.gallery-grid a:hover img {
  transform: scale(1.03);
}

@media (min-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

/* === Lightbox === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
  border-radius: 3px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: #ffffff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-size: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

/* === Footer === */
.site-footer {
  background: #2c2c2c;
  color: #a0a0a0;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}

.site-footer p {
  margin-bottom: 0.25rem;
}

.site-footer a {
  color: #a0a0a0;
}

.site-footer a:hover {
  color: #ffffff;
}
