/* =============================================
   Rakennusliike KaPe Oy - Kotisivut
   styles.css - Kaikki tyylit
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.6;
}

a {
  color: #2d6432;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #d4a843;
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  background: rgba(255,255,255,0.98);
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

.site-header.scrolled .nav-links a {
  color: #333;
}

.site-header.scrolled .nav-links a:hover,
.site-header.scrolled .nav-links a.active {
  color: #d4a843;
}

.site-header.scrolled .hamburger-lines span {
  background: #333;
}

.site-header.scrolled .hamburger-label {
  color: #333;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  height: 70px;
}
.header-inner .logo {
  position: absolute;
  left: 20px;
}

.logo a {
  display: flex;
  align-items: center;
  line-height: 1.2;
}

.logo a img {
  height: 45px;
  width: auto;
  display: block;
}

/* Footer logo */
.footer-logo {
  margin-bottom: 16px;
}

.footer-logo a {
  display: inline-block;
}

.footer-logo img {
  height: 60px;
  width: auto;
  opacity: 0.9;
}

.footer-logo img:hover {
  opacity: 1;
}

/* Hero logo */
.hero-logo {
  margin-bottom: 20px;
}

.hero-logo img {
  height: 80px;
  width: auto;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #d4a843;
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: #2d6432;
}

/* Hamburger */
.hamburger {
  display: none;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  background: none;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  position: absolute;
  right: 20px;
}

.hamburger-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #333;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hamburger-lines span {
  display: block;
  width: 20px;
  height: 2.5px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active .hamburger-lines span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 5px);
}

.hamburger.active .hamburger-lines span:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-lines span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

.hamburger.active .hamburger-label {
  display: none;
}

/* --- Hero --- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #1a3a1a 0%, #2d6432 40%, #3a7a42 100%);
  color: #fff;
  overflow: hidden;
  height: 220px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 750px;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.15;
}

.hero .subtitle {
  font-size: 1.1rem;
  opacity: 0.85;
  margin-bottom: 24px;
  font-weight: 300;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  border: none;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.btn-primary {
  background: #d4a843;
  color: #fff;
}

.btn-primary:hover {
  background: #c49a35;
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: #2d6432;
  border: 2px solid #2d6432;
}

.btn-secondary:hover {
  background: #2d6432;
  color: #fff;
}

.btn-outline-white {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
}

.btn-outline-white:hover {
  background: #fff;
  color: #2d6432;
}

/* --- Section generics --- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: #f5f5f5;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  color: #2d6432;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 48px;
  font-size: 1.05rem;
}

/* --- Steps (Näin palvelumme toimii) --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step {
  text-align: center;
  padding: 32px 20px;
}

.step-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eaf5eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
}

.step-number {
  display: inline-block;
  background: #2d6432;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  line-height: 28px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.step h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: #2d6432;
}

.step p {
  color: #666;
  font-size: 0.95rem;
}

/* --- Numbers / stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: center;
}

.stat {
  padding: 30px 20px;
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 700;
  color: #2d6432;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  color: #666;
  font-size: 1rem;
}

/* --- Service cards --- */
.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.service-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #eee;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.service-card .card-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: block;
}

.service-card h3 {
  font-size: 1.15rem;
  color: #2d6432;
  margin-bottom: 10px;
}

.service-card p {
  color: #666;
  font-size: 0.93rem;
  margin-bottom: 16px;
}

.service-card .card-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: #d4a843;
}

.service-card .card-link:hover {
  color: #2d6432;
}

/* --- Contact form --- */
.contact-form,
.contact-form-direct {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.93rem;
  color: #444;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #2d6432;
  box-shadow: 0 0 0 3px rgba(45,100,50,0.1);
  background: #fff;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group .error-msg {
  color: #c0392b;
  font-size: 0.82rem;
  margin-top: 4px;
  display: none;
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #c0392b;
}

.form-group.has-error .error-msg {
  display: block;
}

.form-success {
  display: none;
  text-align: center;
  padding: 24px;
  background: #eaf5eb;
  border-radius: 8px;
  color: #2d6432;
  font-weight: 500;
}

.form-success.show {
  display: block;
}

/* --- Reference cards --- */
.ref-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.ref-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #eee;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ref-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.ref-card-img {
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #dde8dd, #a8c5aa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d6432;
  font-size: 0.9rem;
  font-weight: 500;
}

.ref-card-body {
  padding: 24px;
}

.ref-card-body h3 {
  font-size: 1.1rem;
  color: #2d6432;
  margin-bottom: 6px;
}

.ref-card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #888;
}

.ref-card-body p {
  color: #666;
  font-size: 0.93rem;
}

/* --- Page hero (sisäsivut) --- */
.page-hero {
  position: relative;
  background: linear-gradient(135deg, #1a3a1a 0%, #2d6432 40%, #3a7a42 100%);
  color: #fff;
  text-align: center;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.page-hero h1,
.page-hero p {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.page-hero p {
  font-size: 1.1rem;
  opacity: 0.85;
}

/* --- Service detail sections --- */
.service-detail {
  padding: 48px 0;
  border-bottom: 1px solid #eee;
}

.service-detail:last-child {
  border-bottom: none;
}

.service-detail-inner {
  max-width: 800px;
  margin: 0 auto;
}

.service-detail h2 {
  font-size: 1.6rem;
  color: #2d6432;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-detail h2 .icon {
  font-size: 1.8rem;
}

.service-detail p {
  color: #555;
  margin-bottom: 16px;
  line-height: 1.7;
}

.service-detail ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
  color: #555;
}

.service-detail ul li {
  margin-bottom: 6px;
}

/* --- Service card images --- */
.service-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* --- Reference card real images --- */
.ref-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* --- Service detail images --- */
.service-detail-img {
  width: 100%;
  max-width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* --- Calculator page --- */
.calc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.calc-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #eee;
  text-align: center;
}

.calc-card .calc-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.calc-card h3 {
  font-size: 1.2rem;
  color: #2d6432;
  margin-bottom: 10px;
}

.calc-card p {
  color: #666;
  font-size: 0.93rem;
  margin-bottom: 20px;
}

/* --- Article cards --- */
.article-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.article-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid #eee;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.article-card .article-tag {
  display: inline-block;
  background: #eaf5eb;
  color: #2d6432;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.article-card h3 {
  font-size: 1.15rem;
  color: #2d6432;
  margin-bottom: 10px;
}

.article-card p {
  color: #666;
  font-size: 0.93rem;
  margin-bottom: 16px;
}

/* --- Article content (yksittäinen artikkeli) --- */
.article-content h2 {
  font-size: 1.5rem;
  color: #2d6432;
  margin-top: 36px;
  margin-bottom: 14px;
}

.article-content p {
  color: #444;
  line-height: 1.8;
  margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
  list-style: disc;
  padding-left: 28px;
  margin-bottom: 16px;
  color: #444;
  line-height: 1.8;
}

.article-content ol {
  list-style: decimal;
}

.article-content ul li,
.article-content ol li {
  margin-bottom: 6px;
}

/* --- Contact info --- */
.contact-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-details {
  padding: 32px;
}

.contact-details h2 {
  font-size: 1.5rem;
  color: #2d6432;
  margin-bottom: 24px;
}

.contact-item {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.contact-item .ci-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item .ci-text strong {
  display: block;
  margin-bottom: 2px;
  color: #333;
}

.contact-item .ci-text span,
.contact-item .ci-text a {
  color: #666;
  font-size: 0.95rem;
}

.map-placeholder {
  background: linear-gradient(135deg, #dde8dd, #c5d8c7);
  border-radius: 12px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d6432;
  font-weight: 500;
  font-size: 1rem;
  margin-top: 24px;
}

/* --- RALA badge --- */
.rala-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eaf5eb;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d6432;
  margin-top: 12px;
}

/* --- Footer --- */
.site-footer {
  background: #1a2e1c;
  color: #ccc;
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col p,
.footer-col a {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-col a:hover {
  color: #d4a843;
}

.footer-col .footer-links a {
  display: block;
  margin-bottom: 6px;
}

.footer-bottom {
  text-align: center;
  padding: 24px 20px;
  margin-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem;
  color: #777;
}

/* --- Mobile call button --- */
.mobile-call-btn {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #2d6432;
  color: #fff;
  text-align: center;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-call-btn:hover {
  color: #fff;
  background: #245228;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .service-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contact-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    justify-content: space-between;
  }

  .header-inner .logo {
    position: static;
  }

  .hamburger {
    display: flex;
    position: static;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 20px;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }

  .site-header.scrolled .nav-links {
    background: #2d6432;
  }

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

  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    width: 100%;
  }

  .site-header.scrolled .nav-links a {
    border-bottom-color: rgba(255,255,255,0.15);
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .service-cards {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ref-cards {
    grid-template-columns: 1fr;
  }

  .contact-form,
  .contact-form-direct {
    padding: 24px;
  }

  .section {
    padding: 48px 0;
  }

  .page-hero {
    height: 180px;
  }

  .hero {
    height: 180px;
  }

  .page-hero h1 {
    font-size: 1.7rem;
  }

  .mobile-call-btn {
    display: block;
  }

  body {
    padding-bottom: 56px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.4rem;
  }

  .hero .subtitle {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}
