/* ========================================
   EHITUSEBUD.EE - PREMIUM & TIMELESS DESIGN
   ======================================== */

:root {
  /* Palette: Deep Blue (Trust), Noble Gold (Prestige), Anthracite (Solidity) */
  --primary: #1e3a5f;
  --primary-dark: #152844;
  --primary-light: #2c5282;
  --accent: #d4a574;
  --accent-dark: #b8915f;
  --accent-light: #f0e4d7;
  --secondary: #2d3748;
  --secondary-light: #4a5568;

  /* Text: High contrast and readability */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #718096;
  --text-on-dark: #edf2f7;
  --text-on-dark-secondary: rgba(237, 242, 247, 0.7);

  /* Backgrounds: Clean and structured */
  --bg-body: #f7fafc;
  --bg-main: #ffffff;
  --bg-light: #edf2f7;
  --bg-card: #ffffff;
  --bg-dark: #1a202c;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, var(--primary), var(--primary-light));
  --grad-dark: linear-gradient(135deg, var(--primary-dark), var(--secondary));

  /* Shadows: Soft and layered */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-accent: 'Playfair Display', Georgia, serif;

  /* Layout */
  --container-width: 1320px;
  --section-padding: clamp(80px, 10vw, 120px);
  --border-radius: 12px;
  --border-radius-lg: 20px;

  /* Transitions: Smooth and professional */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-primary);
  background: var(--bg-body);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: clamp(16px, 1.2vw, 17px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
main { display: block; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-accent);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
p { margin: 0 0 1rem 0; }
a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--accent); }
img, picture, svg, video { display: block; max-width: 100%; }
ul { list-style: none; padding: 0; margin: 0; }

/* ========================================
   UTILITIES & HELPERS
   ======================================== */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
.section { padding: var(--section-padding) 0; position: relative; }
.scroll-fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--transition-slow), transform 0.8s var(--transition-slow); }
.scroll-fade-in.visible { opacity: 1; transform: translateY(0); }

/* ========================================
   BUTTONS (UNIFIED STYLE)
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-weight: 600;
  border: 2px solid var(--primary);
  border-radius: 50px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: var(--transition);
  background: transparent;
  color: var(--primary);
}
.btn:hover {
  background: var(--primary);
  color: white;
}
.btn-lg { padding: 18px 36px; font-size: 1.1rem; }

.btn-primary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-primary:hover {
    background: var(--primary);
    color: white;
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.cta-button-icon { transition: var(--transition); }
.btn:hover .cta-button-icon { transform: translateX(4px); }

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: #e2e8f0;
  box-shadow: var(--shadow-sm);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 800; font-family: var(--font-accent); color: var(--primary); }
.logo img { height: 60px; }
.nav-container { display: flex; align-items: center; flex-grow: 1; justify-content: center; }
.nav-menu { display: flex; gap: clamp(20px, 3vw, 40px); align-items: center; }
.mobile-logo-container { display: none; }
.nav-link {
  position: relative;
  padding: 8px 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); transform-origin: left; }
.lang-switcher { display: flex; gap: 4px; padding: 4px; background: var(--bg-light); border-radius: 50px; }
.lang-btn { padding: 6px 12px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; border-radius: 50px; color: var(--text-secondary); border: none; background: transparent; cursor: pointer; }
.lang-btn:hover { color: var(--primary); }
.lang-btn.active { background: var(--bg-main); color: var(--accent); box-shadow: var(--shadow-sm); }
.lang-switcher-mobile { display: none; }
.mobile-toggle { display: none; }

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
  background-color: var(--bg-light);
}
.hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('https://images.unsplash.com/photo-1581092916381-74f41b4e343a?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&w=3600');
  background-size: cover;
  background-position: center;
}
.hero-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
}
.hero-content { position: relative; z-index: 1; max-width: 750px; text-align: center; margin: 0 auto; }
.hero-title { 
  margin-bottom: 20px;
  color: var(--primary);
  text-transform: none;
  text-wrap: balance;
}
.hero-buttons { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.hero-buttons .btn-outline { border-color: var(--primary); }
.hero-buttons .btn-outline:hover { background: var(--primary); color: white; }


/* ========================================
   SHARED SECTION STYLES
   ======================================== */
.section-header { text-align: center; margin-bottom: 60px; max-width: 800px; margin-left: auto; margin-right: auto; }
.section-badge {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
}
.section-badge::before {
    content: '— ';
    margin-right: 8px;
}
.section-badge::after {
    content: ' —';
    margin-left: 8px;
}
.section-title { color: var(--primary); }
.section-subtitle { font-size: 1.1rem; }

/* ========================================
   SERVICES SECTION
   ======================================== */
.services { background: var(--bg-main); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.service-card {
  background: var(--bg-card);
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.service-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 25px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-primary);
  border-radius: var(--border-radius);
  font-size: 1.8rem;
  color: white;
  flex-shrink: 0;
}
.service-title { font-size: 1.5rem; margin-bottom: 15px; color: var(--primary); flex-grow: 0; min-height: 3.6rem; display: flex; align-items: center; }
.service-description { margin-bottom: 20px; flex-grow: 1; }
.service-features li { padding: 8px 0; display: flex; align-items: center; gap: 12px; font-size: 0.95rem; }
.service-features li::before {
  content: '✓';
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

/* ========================================
   APPROACH SECTION
   ======================================== */
.approach { background: var(--bg-body); }
.approach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.approach-item { text-align: center; padding: 40px 30px; }
.approach-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 20px; }
.approach-item h4 { color: var(--primary); }
.approach-item p { font-size: 0.95rem; margin: 0; }

/* ========================================
   CTA SECTION (REWORKED)
   ======================================== */
.cta-section {
    background: var(--bg-main);
}
.cta-background {
    display: none;
}
.cta-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.cta-content .section-title {
    color: var(--primary);
}
.cta-content .section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 70px 0 30px;
  font-size: 0.95rem;
}
.footer a { color: var(--text-on-dark); }
.footer a:hover { color: var(--accent); }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 50px; margin-bottom: 50px; }
.footer-brand .footer-logo { display: inline-block; margin-top: 10px; margin-bottom: 20px; text-decoration: none; }
.footer-brand .footer-logo img { height: 100px; width: auto; display: block; }
.footer-brand h4 { color: white; margin-bottom: 5px; font-size: 1.1rem; font-family: var(--font-primary); font-weight: 600; letter-spacing: 0.5px; }
.footer-description { opacity: 0.7; margin-bottom: 25px; }
.footer-section h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; font-family: var(--font-primary); font-weight: 600; }
.footer-section ul li { padding: 6px 0; }
.footer-contact-info li { display: flex; align-items: start; gap: 12px; }
.footer-contact-info li i { margin-top: 5px; color: var(--accent); }
.social-links { display: flex; gap: 12px; margin-top: 20px; }
.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  color: white;
  font-size: 1rem;
}
.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent);
}
.footer-bottom { padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.15); text-align: center; }
.footer-bottom-content { color: rgba(255, 255, 255, 0.6); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  .mobile-toggle {
    display: block;
    position: relative;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
  }
  .burger-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s;
  }
  .burger-line:nth-child(1) { top: 0; }
  .burger-line:nth-child(2) { top: 50%; transform: translateY(-50%); }
  .burger-line:nth-child(3) { bottom: 0; }
  .mobile-toggle.active .burger-line:nth-child(1) { transform: translateY(11px) rotate(45deg); }
  .mobile-toggle.active .burger-line:nth-child(2) { opacity: 0; }
  .mobile-toggle.active .burger-line:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

  .nav-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-main);
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }
  .nav-menu.active { transform: translateX(0); }
  .mobile-logo-container { display: block; margin-bottom: 40px; width: 100%; text-align: center; }
  .mobile-logo-container .logo { display: flex; flex-direction: column; align-items: center; gap: 15px; font-size: 1.5rem; }
  .mobile-logo-container .logo img { height: 80px; }
  .nav-link { font-size: 1.5rem; }
  .lang-switcher-mobile { display: block; margin-top: 30px; }
  .lang-switcher-container { display: none; }
  .lang-switcher { margin-left: 0; }

  .hero-buttons { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  
  .footer-content { grid-template-columns: 1fr; text-align: center; }
  .footer-brand .footer-logo, .social-links { justify-content: center; }
  .footer-contact-info li { justify-content: center; }
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   COOKIE CONSENT
   ======================================== */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-dark);
  color: white;
  padding: 20px;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  transform: translateY(100%);
  transition: transform 0.5s ease;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
}
.cookie-consent.visible {
  transform: translateY(0);
}
.cookie-consent p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 800px;
}
.cookie-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.cookie-btn:hover {
  background: var(--accent-dark);
}
@media (max-width: 768px) {
  .cookie-consent {
    flex-direction: column;
    text-align: center;
  }
}

.cookie-buttons { display: flex; gap: 10px; }
.cookie-btn.decline { background: transparent; border: 1px solid white; }
.cookie-btn.decline:hover { background: rgba(255,255,255,0.1); }

.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    text-align: left;
    pointer-events: none;
}
.lightbox-info h3 { margin: 0 0 5px; font-size: 1.5rem; font-family: var(--font-accent); }
.lightbox-info p { margin: 0; font-size: 1rem; opacity: 0.9; }

.lightbox-play {
    position: absolute;
    top: 20px;
    right: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}
.lightbox-play:hover { background: var(--accent); color: var(--bg-dark); }

/* Enhanced Lightbox */
.lightbox {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.85);
}
.lightbox-content {
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.lightbox-content img {
    display: block;
    max-height: 85vh;
}
.lightbox-info {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    padding: 40px 30px 30px;
}
.lightbox-prev, .lightbox-next {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    width: 60px;
    height: 60px;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}
.lightbox-close {
    top: 30px;
    right: 30px;
    background: transparent;
    border: none;
    font-size: 2rem;
    opacity: 0.7;
}
.lightbox-close:hover {
    background: transparent;
    opacity: 1;
    transform: rotate(90deg);
    color: white;
}
