/* ============================================================
   KIVIKODU.EE — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --green-dark:  #1b3a1d;
  --green-mid:   #2c5e2e;
  --green-light: #4a8c4d;
  --green-pale:  #e8f0e8;
  --off-white:   #f6f5f1;
  --text:        #1c1c1c;
  --text-muted:  #5a5a5a;
  --border:      #d8d6d0;
  --white:       #ffffff;
  --max-width:   1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--off-white);
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--green-light); text-decoration: underline; }

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

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--green-dark);
}

p + p { margin-top: 0.9em; }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--green-dark);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo img {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  text-transform: uppercase;
}

.header-contact {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.header-contact a {
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
}

.header-contact .fb-link {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.header-contact .fb-link:hover { opacity: 1; }
.header-contact .fb-link img { width: 24px; height: 24px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0.25rem;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  background: var(--green-mid);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-list > li {
  position: relative;
}

.nav-list > li > a {
  display: block;
  padding: 0.7rem 1rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
  background: var(--green-dark);
  color: var(--white);
  text-decoration: none;
}

/* Dropdown */
.nav-dropdown {
  list-style: none;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: var(--green-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 200;
}

.nav-list > li:hover .nav-dropdown,
.nav-list > li:focus-within .nav-dropdown {
  display: block;
}

.nav-dropdown li a {
  display: block;
  padding: 0.6rem 1rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s;
  text-decoration: none;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.nav-dropdown li a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
}

/* ============================================================
   PAGE LAYOUTS
   ============================================================ */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Hero (index page) */
.hero {
  position: relative;
  background: var(--green-dark);
  color: var(--white);
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
}

.hero-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}

.hero-content h1 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
  max-width: 640px;
}

.hero-content p {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 3px;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--green-light);
  color: var(--white);
  border: 2px solid var(--green-light);
}
.btn-primary:hover {
  background: var(--white);
  color: var(--green-dark);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}

/* Page banner (for interior pages) */
.page-banner {
  background: var(--green-dark);
  color: var(--white);
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
}

.page-banner .banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
}

.page-banner .banner-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.page-banner h1 {
  color: var(--white);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.page-banner p {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

/* ============================================================
   HOME PAGE SECTIONS
   ============================================================ */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.intro-grid .text h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.intro-grid .text p { color: var(--text-muted); }

.intro-grid .badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.badge-img {
  max-height: 130px;
  width: auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.25rem 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.service-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  border-color: var(--green-light);
}

.service-card h3 {
  font-size: 0.95rem;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.service-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.service-card a {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-light);
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.section { margin-bottom: 3rem; }

.section-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--green-pale);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--green-mid);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.info-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
}

.info-block ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.info-block ul li {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

/* Opening hours / info table */
.info-table {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  font-size: 0.92rem;
}

.info-table p { margin-bottom: 0.25rem; color: var(--text-muted); }
.info-table strong { color: var(--text); }

/* Price notice */
.price-notice {
  background: var(--green-pale);
  border-left: 4px solid var(--green-mid);
  padding: 1rem 1.25rem;
  border-radius: 0 4px 4px 0;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  color: var(--green-dark);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.gallery-grid a {
  display: block;
  border-radius: 3px;
  overflow: hidden;
}

.gallery-grid img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.2s, opacity 0.2s;
}

.gallery-grid img:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-info h2 { font-size: 1.2rem; margin-bottom: 1rem; }

.contact-detail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.93rem;
}

.contact-detail strong { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.contact-detail a { font-size: 1rem; font-weight: 600; color: var(--green-mid); }

.contact-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--white);
  color: var(--text);
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--green-light);
}

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

.contact-form button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* ============================================================
   RENTAL PRICE TABLE
   ============================================================ */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.price-table th,
.price-table td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.price-table thead th {
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col p, .footer-col address { font-style: normal; line-height: 1.8; }
.footer-col a { color: rgba(255,255,255,0.75); }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ============================================================
   UTILITY
   ============================================================ */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .intro-grid,
  .two-col,
  .three-col,
  .contact-layout { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; }

  .three-col { grid-template-columns: 1fr; }

  .menu-toggle { display: flex; }
  .header-contact { display: none; }
  
  .site-nav { display: none; width: 100%; }
  .site-nav.nav-open { display: block; max-height: calc(100vh - 62px); overflow-y: auto; }
  .nav-inner { padding: 0; }
  .nav-list { flex-direction: column; margin: 0; }
  .nav-list > li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }
  
  .nav-dropdown { 
    position: static; 
    box-shadow: none; 
    display: block; 
    background: rgba(0,0,0,0.15); 
    padding-left: 1rem;
  }
  
  .nav-list > li:hover .nav-dropdown,
  .nav-list > li:focus-within .nav-dropdown { display: block; }
  
  .nav-list > li.dropdown-open .nav-dropdown { display: block; }
}

@media (max-width: 600px) {
  .header-inner { flex-wrap: nowrap; height: 60px; padding: 0 1rem; justify-content: space-between; }
  .header-right { gap: 0.5rem; }
  .site-logo .logo-text { font-size: 1.15rem; }
  .site-logo img { height: 26px; }

  .footer-inner { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr 1fr; }

  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid img { height: 150px; }
  
  .hero-content h1 { font-size: 1.6rem; }
}

@media (max-width: 420px) {
  .services-grid, .three-col { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid img { height: 200px; }
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border: 4px solid var(--white);
  border-radius: 4px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}
.lightbox-close:hover {
  color: #ccc;
}
