/* ============================================
   Ehitus Partnerid — Stylesheet
   ============================================ */

:root{
  --navy: #17324f;
  --navy-dark: #0f2438;
  --navy-deep: #0b1d30;
  --orange: #e08a3c;
  --orange-dark: #c8762c;
  --bg: #f3f5f7;
  --card-bg: #ffffff;
  --text: #1c2b3a;
  --text-muted: #5b6b7a;
  --line: #e2e6ea;
}
*{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
h1,h2,h3,h4{
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
}
a{ text-decoration:none; color:inherit; }
ul{ list-style:none; }
img{ max-width:100%; display:block; }
.wrap{ max-width: 1180px; margin: 0 auto; padding: 0 24px; }
button{ font-family:inherit; cursor:pointer; border:none; }

/* Buttons */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 13px 24px;
  border-radius: 6px;
  font-weight:600;
  font-size: 0.95rem;
  transition: transform .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); }
.btn-orange{ background: var(--orange); color:#fff; }
.btn-orange:hover{ background: var(--orange-dark); }
.btn-navy{ background: var(--navy); color:#fff; }
.btn-navy:hover{ background: var(--navy-dark); }
.btn-outline{ background:#fff; color:var(--navy); border:1px solid var(--line); }
.btn-outline:hover{ background:#f0f2f4; }
.btn svg{ width:14px; height:14px; flex-shrink:0; }

/* Header */
header{
  position: sticky; top:0; z-index: 100;
  background:#fff;
  border-bottom: 1px solid var(--line);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  height: 76px;
}
.logo{ display:flex; align-items:center; gap:10px; font-weight:700; color:var(--navy); font-size:1.05rem; letter-spacing:0.2px; }
.logo-mark{ width:52px; height:52px; flex-shrink:0; object-fit:contain; }
.logo-text-single{ font-size:1.1rem; font-weight:700; letter-spacing:0.5px; }

nav.main-nav{ display:flex; gap:30px; }
nav.main-nav a{
  font-size:0.93rem; font-weight:500; color: var(--text);
  padding: 6px 0; position:relative;
}
nav.main-nav a.active{ color: var(--navy); font-weight:600; }
nav.main-nav a.active::after{
  content:""; position:absolute; left:0; right:0; bottom:-4px; height:2px; background: var(--orange);
}
nav.main-nav a:hover{ color: var(--navy); }

.header-right{ display:flex; align-items:center; gap:18px; }
.menu-toggle{ display:none; background:none; width:26px; height:20px; position:relative; }
.menu-toggle span{ position:absolute; left:0; right:0; height:2px; background:var(--navy); transition:.2s; }
.menu-toggle span:nth-child(1){ top:0; }
.menu-toggle span:nth-child(2){ top:9px; }
.menu-toggle span:nth-child(3){ top:18px; }

/* Hero */
.hero{
  position: relative;
  min-height: 480px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  color:#fff;
  text-align:center;
}
.hero-bg{
  position:absolute; top:0; right:0; bottom:0; left:0;
  width:100%; height:100%;
  display:flex;
}
.hero-bg > div{ flex:1; height:100%; background-size:cover; background-position:center; position:relative; }
.hero-bg .left{ background-image: linear-gradient(180deg, rgba(15,36,56,.6), rgba(15,36,56,.42)), url('img/hero-left.jpg'); background-position: center 30%; }
.hero-bg .right{ background-image: linear-gradient(180deg, rgba(11,29,48,.6), rgba(11,29,48,.42)), url('img/hero-right.jpg'); background-position: center 30%; }
.hero-overlay{
  position:relative; z-index:2; width:100%;
  display:flex; flex-direction:column; align-items:center;
  padding: 60px 24px;
}
.hero-content{ max-width: 720px; margin: 0 auto; }
.hero-content h1{
  color:#fff; font-size: 2.1rem; margin-bottom: 18px; letter-spacing:-0.4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.35);
}
.hero-content p{ font-size: 1.05rem; color: #e7edf3; max-width: 560px; margin: 0 auto 32px; text-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.hero-actions{
  width:100%;
  max-width: 620px;
  margin: 0 auto;
  display:grid; grid-template-columns: 1fr 1fr;
  gap:16px;
}
.hero-actions .btn{ justify-self:center; }

/* Services intro */
.services{
  display:grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 56px 24px;
  max-width: 1180px; margin:0 auto;
}
.service-card{
  display:grid; grid-template-columns: 1fr 1.15fr;
  background: var(--card-bg);
  border-radius: 10px;
  overflow:hidden;
  border: 1px solid var(--line);
}
.service-card .photo{ height:100%; min-height: 220px; background-size:cover; background-position:center; }
.service-card .photo.apt{ background-image:url('img/service-apartments.jpg'); }
.service-card .photo.rail{ background-image:url('img/service-railway.jpg'); }
.service-card .content{ padding: 28px 26px; display:flex; flex-direction:column; }
.service-icon{
  width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:#fff; margin-bottom:14px;
}
.service-icon.navy-bg{ background: var(--navy); }
.service-icon.orange-bg{ background: var(--orange); }
.service-card h3{ font-size:1.25rem; margin-bottom:12px; }
.service-text{ font-size:0.93rem; color: var(--text-muted); margin-bottom:16px; }
.link-arrow{ font-weight:600; font-size:0.92rem; margin-top:auto; }
.link-arrow.navy{ color: var(--navy); }
.link-arrow.orange{ color: var(--orange); }

/* Features */
.features{
  background: #eef1f4;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 48px 24px;
}
.features-inner{
  max-width:1180px; margin:0 auto;
  display:grid; grid-template-columns: repeat(3,1fr); gap: 28px;
}
.feature{ text-align:center; padding: 0 10px; }
.feature-icon{
  width:60px; height:60px; border-radius:50%;
  background:#fff; box-shadow: 0 2px 8px rgba(20,40,60,0.08);
  display:flex; align-items:center; justify-content:center;
  margin: 0 auto 16px;
  color: var(--navy);
}
.feature h4{ font-size:1rem; margin-bottom:8px; }
.feature p{ font-size:0.87rem; color:var(--text-muted); }

/* Stats */
.stats{
  background: var(--navy-deep);
  color:#fff;
  padding: 52px 24px;
}
.stats-inner{
  max-width:1180px; margin:0 auto;
  display:flex; flex-wrap:wrap;
  justify-content:center; align-items:center;
}
.stat{
  display:flex; align-items:center; gap:18px;
  padding: 12px 48px;
  position:relative;
}
.stat:not(:first-child){ border-left: 1px solid rgba(255,255,255,0.14); }
.stat-icon{
  width:54px; height:54px; border-radius:50%; flex-shrink:0;
  background: rgba(224,138,60,0.12);
  border: 1px solid rgba(224,138,60,0.35);
  display:flex; align-items:center; justify-content:center;
  color: var(--orange);
}
.stat-text{ text-align:left; }
.stat .num{ font-size:2rem; font-weight:700; font-family:'Poppins',sans-serif; line-height:1.1; }
.stat .label{ font-size:0.85rem; color:#b8c4cf; margin-top:2px; }

/* Projects */
.projects{ padding: 64px 24px; max-width:1180px; margin:0 auto; }
.projects-head{
  display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:28px; flex-wrap:wrap; gap:16px;
}
.projects-head h2{ font-size:1.7rem; position:relative; padding-bottom:12px; }
.projects-head h2::after{
  content:""; position:absolute; left:0; bottom:0; width:46px; height:3px; background: var(--orange);
}
.tabs{ display:flex; gap:10px; }
.tab-btn{
  padding: 9px 18px; border-radius:6px; font-size:0.88rem; font-weight:600;
  background:#fff; color:var(--text-muted); border:1px solid var(--line);
}
.tab-btn.active{ background: var(--navy); color:#fff; border-color:var(--navy); }

.project-carousel-wrap{ overflow:hidden; position:relative; }
.project-track{
  display:flex; gap:20px;
  transition: transform .6s ease;
}
.project-track.grid-mode{
  display:grid; grid-template-columns: repeat(3,1fr);
  transform:none !important; transition:none;
}
.project-track.grid-mode .project-card.clone{ display:none; }
.project-card{
  flex: 0 0 270px;
  background:#fff; border-radius:10px; overflow:hidden; border:1px solid var(--line);
  transition: box-shadow .2s ease;
  cursor: pointer;
}
.project-track.grid-mode .project-card{ flex:none; }
.project-card:hover{ box-shadow: 0 8px 24px rgba(20,40,60,0.1); }
.project-card:hover .thumb{ transform: scale(1.04); }
.project-card .thumb{
  height:170px; background-size:cover; background-position:center;
  transition: transform .35s ease;
}
.project-card .info{ padding: 14px 16px; }
.project-card h4{ font-size:0.95rem; margin-bottom:3px; }
.project-card p{ font-size:0.82rem; color: var(--text-muted); }
.project-card.clone{ }

.view-all-wrap{ text-align:right; margin-bottom: 20px; }

/* Lightbox */
.lightbox-overlay{
  display:none; position:fixed; inset:0; z-index:200;
  background: rgba(8,16,26,0.92);
  align-items:center; justify-content:center;
}
.lightbox-overlay.open{ display:flex; }
.lightbox-img{
  max-width: 88vw; max-height: 78vh; border-radius:8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-caption{
  position:absolute; bottom:36px; left:0; right:0; text-align:center;
  color:#fff; font-size:0.95rem;
}
.lightbox-close{
  position:absolute; top:20px; right:24px;
  background:none; border:none; color:#fff; font-size:2.2rem; line-height:1; cursor:pointer;
}
.lightbox-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  background: rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.25);
  color:#fff; width:48px; height:48px; border-radius:50%;
  font-size:1.8rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.lightbox-nav:hover{ background: rgba(255,255,255,0.2); }
.lightbox-prev{ left:20px; }
.lightbox-next{ right:20px; }

/* Back to top */
.back-to-top{
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy); color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 4px 14px rgba(11,29,48,0.35);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, background .15s ease;
}
.back-to-top.visible{ opacity:1; visibility:visible; transform:translateY(0); }
.back-to-top:hover{ background: var(--navy-dark); }
.back-to-top svg{ width:20px; height:20px; }
.page-hero{
  position: relative;
  min-height: 340px;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; text-align:center; color:#fff;
  background-size:cover; background-position:center;
}
.page-hero::before{
  content:"";
  position:absolute; top:0; right:0; bottom:0; left:0;
  background: linear-gradient(180deg, rgba(11,29,48,.72), rgba(11,29,48,.6));
}
.page-hero.apt-bg{ background-image: url('img/page-hero-apartments.jpg'); }
.page-hero.rail-bg{ background-image: url('img/page-hero-railway.jpg'); }
.page-hero-content{ position:relative; z-index:2; max-width: 680px; padding: 24px; }
.page-hero-icon{
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  margin: 0 auto 18px; background: rgba(224,138,60,0.18); border:1px solid rgba(224,138,60,0.5);
}
.page-hero-content h1{ color:#fff; font-size:2rem; margin-bottom:14px; text-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.page-hero-content p{ color:#dfe6ec; font-size:1rem; margin:0 auto; }

.article-wrap{ max-width:1100px; margin:0 auto; padding:56px 24px; }
.article-layout{ display:grid; grid-template-columns: 1.6fr 1fr; gap:48px; align-items:start; }

.article-main > p.lead{ font-size:1.08rem; color:var(--navy); font-weight:500; margin-bottom:24px; line-height:1.6; }
.article-main h2{ font-size:1.2rem; margin: 32px 0 16px; color:var(--navy); }
.article-main h2:first-child{ margin-top:0; }
.article-main .btn{ margin-top:8px; }
.article-list{ display:flex; flex-direction:column; gap:16px; margin:0; }
.article-list li{ position:relative; padding-left:38px; color:var(--text); line-height:1.55; }
.article-list li::before{
  content:"✓"; position:absolute; left:0; top:1px;
  width:24px; height:24px; border-radius:50%;
  background: rgba(224,138,60,0.14); color: var(--orange);
  font-size:0.7rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.article-list li strong{ color:var(--navy); }
.article-list .sub-list{ list-style:none; margin: 10px 0 0; padding:0; display:flex; flex-direction:column; gap:10px; }
.article-list .sub-list li{ padding-left:30px; font-size:0.95rem; }
.article-list .sub-list li::before{
  content:"–"; background:none; color: var(--orange); font-size:0.95rem; width:auto; height:auto;
  border-radius:0; top:0;
}

.article-aside{ position:sticky; top:96px; display:flex; flex-direction:column; gap:20px; }
.aside-photo{ width:100%; border-radius:12px; object-fit:cover; height:220px; }
.aside-box{
  background:#fff; border:1px solid var(--line); border-radius:12px; padding:22px;
}
.aside-box-icon{
  width:42px; height:42px; border-radius:50%;
  background: var(--navy); color:#fff;
  display:flex; align-items:center; justify-content:center; margin-bottom:12px;
}
.aside-box-title{ font-weight:700; color:var(--navy); margin-bottom:6px; }
.aside-box-text{ font-size:0.88rem; color:var(--text-muted); }
.aside-cta{ display:flex; justify-content:center; width:100%; }
.cta-banner{
  background: var(--navy-deep);
  color:#fff;
  padding: 64px 24px;
}
.cta-inner{
  max-width:1180px; margin:0 auto;
  display:grid; grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items:start;
}
.cta-info h2{ color:#fff; font-size:1.6rem; margin-bottom:10px; }
.cta-info > p{ color:#c3ccd5; max-width:400px; font-size:0.95rem; margin-bottom:32px; }
.cta-contacts{ display:flex; flex-direction:column; gap:20px; }
.contact-item{ display:flex; align-items:center; gap:12px; }
.contact-item .c-icon{
  width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,0.08);
  display:flex;align-items:center;justify-content:center; color: var(--orange); flex-shrink:0;
}
.contact-item .c-label{ font-size:0.78rem; color:#a9b6c1; }
.contact-item .c-value{ font-size:0.93rem; font-weight:600; }
.contact-item .c-value a:hover{ text-decoration:underline; }

.contact-form{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 28px;
  display:flex; flex-direction:column; gap:16px;
}
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-field{ display:flex; flex-direction:column; gap:6px; }
.form-field label{ font-size:0.82rem; color:#c3ccd5; }
.form-field input, .form-field textarea{
  font-family:inherit; font-size:0.92rem; color:#fff;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  padding: 11px 14px;
  resize: vertical;
}
.form-field input::placeholder, .form-field textarea::placeholder{ color:#8393a1; }
.form-field input:focus, .form-field textarea:focus{
  outline: none; border-color: var(--orange); background: rgba(255,255,255,0.09);
}
.contact-form .btn{ align-self:flex-start; }
.form-note{ font-size:0.85rem; min-height:1.2em; }
.form-note.success{ color:#7fd396; }
.form-note.error{ color:#e88a8a; }

/* Footer */
footer{ background: var(--navy-deep); color:#c3ccd5; border-top:1px solid rgba(255,255,255,0.08); padding: 30px 24px; }
.footer-inner{
  max-width:1180px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px;
}
.footer-logo{ display:flex; align-items:center; gap:10px; color:#fff; font-weight:700; font-size:0.95rem; }
.footer-logo-mark{ width:30px; height:30px; object-fit:contain; flex-shrink:0; }
.footer-nav{ display:flex; gap:22px; flex-wrap:wrap; }
.footer-nav a{ font-size:0.85rem; color:#c3ccd5; }
.footer-nav a:hover{ color:#fff; }
.footer-social{ display:flex; gap:10px; }
.footer-social a{
  width:34px;height:34px;border-radius:50%; border:1px solid rgba(255,255,255,0.2);
  display:flex; align-items:center; justify-content:center;
}
.footer-bottom{
  max-width:1180px; margin: 20px auto 0; padding-top:18px;
  border-top:1px solid rgba(255,255,255,0.08);
  display:flex; justify-content:space-between; font-size:0.8rem; color:#8896a3; flex-wrap:wrap; gap:10px;
}

/* Responsive */
@media (max-width: 980px){
  .article-layout{ grid-template-columns:1fr; }
  .article-aside{ position:static; flex-direction:row; flex-wrap:wrap; }
  .aside-photo{ flex:1; min-width:220px; height:180px; }
  .aside-box{ flex:1; min-width:220px; }
  nav.main-nav{
    position:absolute; top:76px; left:0; right:0;
    background:#fff; flex-direction:column; gap:0;
    border-bottom:1px solid var(--line);
    max-height:0; overflow:hidden; transition: max-height .25s ease;
  }
  nav.main-nav.open{ max-height:400px; }
  nav.main-nav a{ padding: 14px 24px; border-bottom:1px solid var(--line); }
  nav.main-nav a.active::after{ display:none; }
  .menu-toggle{ display:block; }
  .header-right .btn-orange.desktop-only{ display:none; }
  .services{ grid-template-columns:1fr; }
  .stat{ padding: 12px 26px; }
  .project-track.grid-mode{ grid-template-columns: repeat(2,1fr); }
  .cta-inner{ grid-template-columns:1fr; }
}
@media (max-width: 620px){
  .hero-content h1{ font-size:1.6rem; }
  .hero-actions{ grid-template-columns: 1fr; justify-items:stretch; gap:12px; }
  .hero-actions .btn{ width:100%; justify-content:center; }
  .service-card{ grid-template-columns:1fr; }
  .service-card .photo{ min-height:160px; }
  .features-inner{ grid-template-columns:1fr; }
  .project-track{
    overflow-x:auto; scroll-snap-type:x mandatory; transform:none !important;
    -webkit-overflow-scrolling:touch; padding-bottom:6px;
  }
  .project-track .project-card{ scroll-snap-align:start; }
  .project-track .project-card.clone{ display:none; }
  .project-track.grid-mode{ display:flex; overflow-x:auto; }
  .project-track.grid-mode .project-card{ flex: 0 0 200px; }
  .projects-head{ flex-direction:column; align-items:flex-start; }
  .cta-contacts{ gap:16px; }
  .form-row{ grid-template-columns:1fr; }
  .article-layout{ grid-template-columns:1fr; }
  .article-aside{ position:static; flex-direction:column; }
  .aside-photo{ height:180px; }
  .stats-inner{ flex-direction:column; align-items:stretch; }
  .stat{ flex-direction:column; text-align:center; padding: 20px 0; border-left:none !important; }
  .stat:not(:first-child){ border-top: 1px solid rgba(255,255,255,0.14); }
  .stat-text{ text-align:center; }
}
