/* ============================================================
   Kiilopään Nonparelli – Main Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary:    #2e7d6e;
  --color-primary-dk: #1f5a4e;
  --color-bg:         #ffffff;
  --color-bg-alt:     #f5f5f0;
  --color-dark:       #1a2e2b;
  --color-text:       #222222;
  --color-text-muted: #666666;
  --color-border:     #ddd;
  --color-highlight:  #e8f4f1;

  --font-family: 'Lato', system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-dk); }

ul { list-style: none; }
address { font-style: normal; }

/* ---------- Utility ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  border: 2px solid transparent;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dk);
  border-color: var(--color-primary-dk);
  color: #fff;
}

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

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.9rem; }

/* ---------- Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand a {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.03em;
}
.nav-brand a:hover { color: var(--color-primary); }

.nav-links { display: flex; gap: 0.25rem; }
.nav-links li a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.nav-links li a:hover,
.nav-links li a.active {
  background: var(--color-primary);
  color: #fff;
}

/* Language switcher */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: background var(--transition);
}
.lang-btn:hover { background: rgba(255,255,255,0.15); }
.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 130px;
  z-index: 200;
  flex-direction: column;
  gap: 0;
  padding: 0.25rem 0;
}
.lang-dropdown.open { display: flex; }
.lang-dropdown li { list-style: none; }
.lang-dropdown li button {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--color-dark);
  transition: background var(--transition);
}
.lang-dropdown li button:hover { background: #f5f5f5; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: #fff;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(30,60,50,0.65) 0%, rgba(10,25,20,0.55) 100%),
    url('../images/4e9cf80f-7cec-4f48-9ca2-ede0d4f19be4.jpg') center center / cover no-repeat;
  background-color: var(--color-dark);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 780px;
  padding: 0 1.25rem;
}

.hero-content h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 2rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Offset anchor scroll targets so headings aren't hidden behind sticky nav */
section[id], aside[id] {
  scroll-margin-top: 68px;
}

/* ---------- Page content wrapper ---------- */
.page-content {
  background: var(--color-bg-alt);
  padding: 2rem 0 4rem;
}

/* ---------- Two-column layout ---------- */
/* Mobile first: single column, gallery → sidebar → main */
.two-col-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.gallery-col { min-width: 0; }
.sidebar-col  { min-width: 0; }
.main-col     { min-width: 0; }

/* Mobile order: gallery → mökki/varusteet → varaukset/hinnasto → yhteystiedot */
@media (max-width: 899px) {
  .gallery-col { order: 1; }
  .main-col    { order: 2; }
  .sidebar-col { order: 3; }
}

/* Desktop: CSS grid with gallery top-left, sidebar spanning right, main bottom-left */
@media (min-width: 900px) {
  .two-col-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    grid-template-areas:
      "gallery sidebar"
      "main    sidebar";
    column-gap: 2.5rem;
    row-gap: 0;
    align-items: start;
  }
  .gallery-col { grid-area: gallery; }
  .sidebar-col {
    grid-area: sidebar;
    align-self: start;
  }
  .main-col { grid-area: main; }
}

/* ---------- Gallery ---------- */
.gallery-main,
.gallery-thumbs {
  user-select: none;
  -webkit-user-select: none;
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow);
}

.gallery-main .swiper-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.gallery-thumbs {
  margin-top: 6px;
}

.gallery-thumbs .swiper-slide {
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s;
  border-radius: 3px;
  overflow: hidden;
}

.gallery-thumbs .swiper-slide-thumb-active,
.gallery-thumbs .swiper-slide:hover {
  opacity: 1;
}

.gallery-thumbs .swiper-slide img {
  width: 100%;
  height: 68px;
  object-fit: cover;
}

.gallery-main .swiper-button-prev,
.gallery-main .swiper-button-next {
  color: rgba(255,255,255,0.95);
  background: none;
  width: 40px !important;
  height: 40px !important;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-main .swiper-button-prev::after,
.gallery-main .swiper-button-next::after {
  font-size: 2rem !important;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.gallery-main:hover .swiper-button-prev,
.gallery-main:hover .swiper-button-next { opacity: 0.75; }
.gallery-main .swiper-button-prev:hover,
.gallery-main .swiper-button-next:hover { opacity: 1; }

/* ---------- Sidebar ---------- */
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-block {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--color-highlight);
}

.sidebar-intro {
  font-size: 0.87rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* Contact address in sidebar */
.sidebar-block address p { margin-bottom: 0.35rem; font-size: 0.93rem; }
.sidebar-block address a  { color: var(--color-primary); }
.map-wrap { margin-top: 1rem; overflow: hidden; border-radius: var(--radius); }

/* ---------- Main column ---------- */
.main-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.25rem;
}

.content-block {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.content-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  position: relative;
}
.content-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 48px; height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* Mökki text */
.mokki-text { margin-bottom: 1.5rem; }
.mokki-text .lead {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--color-primary-dk);
}
.mokki-text p { margin-bottom: 0.85rem; }

.mokki-specs h3 {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 0.85rem;
}
.mokki-specs p { margin-bottom: 0.75rem; }

/* Varusteet */
.varusteet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.varuste-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  border: 1px solid #e8e8e0;
}
.varuste-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-highlight);
}
.varuste-card li {
  padding: 0.18rem 0;
  font-size: 0.85rem;
  color: var(--color-text);
  border-bottom: 1px solid #ededea;
}
.varuste-card li:last-child { border-bottom: none; }

/* ---------- Calendar widget ---------- */
.calendar-wrapper {
  max-width: 100%;
  margin: 0 0 0.5rem;
}

.cal-legend {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.55rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text);
}
.legend-box {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-box.free   { background: #c8e6c9; }
.legend-box.booked { background: #f5a8a8; }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.55rem;
}
.cal-nav button {
  background: #d0d0d0;
  border: none;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cal-nav button:hover { background: #b8b8b8; }
#cal-month-select {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fff;
}

.cal-grid {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-row {
  display: grid;
  grid-template-columns: 34px repeat(7, 1fr);
  border-bottom: 1px solid #eee;
}
.cal-row:last-child { border-bottom: none; }
.cal-cell { padding: 0.3rem 0.1rem; text-align: center; font-size: 0.8rem; }
.cal-wk {
  background: #f0f0f0;
  color: #999;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #ddd;
}
.cal-dname { font-weight: 700; background: #fafafa; padding: 0.45rem 0.1rem; }
.cal-day   { min-height: 36px; display: flex; align-items: center; justify-content: center; }
.cal-day.free        { background: #c8e6c9; color: #1b5e20; }
.cal-day.booked      { background: #f5a8a8; color: #7f1d1d; }
.cal-day.outside     { background: #fafafa; }
.cal-day.today       { outline: 2px solid #888; outline-offset: -2px; font-weight: 700; }

#cal-prev:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

/* ---------- Hinnasto (in sidebar) ---------- */
.hinnasto-table-wrap { overflow-x: auto; margin-bottom: 0.85rem; }

.hinnasto-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 0.88rem;
}
.hinnasto-table thead { background: var(--color-primary); color: #fff; }
.hinnasto-table th { padding: 0.6rem 0.85rem; text-align: left; font-weight: 700; }
.hinnasto-table td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--color-border); }
.hinnasto-table tbody tr:last-child td { border-bottom: none; }
.hinnasto-table tbody tr:hover { background: var(--color-highlight); }
.row-season td { background: #fff9e6; }

.price { font-weight: 900; font-size: 0.95rem; color: var(--color-primary); white-space: nowrap; }

.ehdot-box {
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
}
.ehdot-box h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.ehdot-list li {
  padding: 0.3rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.45;
}
.ehdot-list li:last-child { border-bottom: none; }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
}
#lightbox[hidden] { display: none; }

#lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 4px 32px rgba(0,0,0,0.6);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

#lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
#lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* Show tap hint cursor on gallery images for touch devices */
@media (hover: none) {
  .gallery-main .swiper-slide img { cursor: zoom-in; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f1e1b;
  color: rgba(255,255,255,0.6);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.88rem;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--color-dark);
    flex-direction: column;
    padding: 0.75rem 1.25rem 1.25rem;
    gap: 0.1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }
  .nav-links.open { display: flex; }
  .nav-links li a { padding: 0.65rem 0.75rem; font-size: 1rem; }
  .lang-switcher { justify-content: flex-start; padding: 0.2rem 0; }
  .lang-dropdown { position: static; box-shadow: none; border: none; background: rgba(255,255,255,0.08); border-radius: var(--radius); }
  .lang-dropdown li button { color: #fff; }
  .lang-dropdown li button:hover { background: rgba(255,255,255,0.15); }

  .hero { min-height: 70vh; }

  .gallery-main .swiper-slide img { height: 280px; }
  .gallery-thumbs .swiper-slide img { height: 52px; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .gallery-main .swiper-slide img { height: 220px; }
  .gallery-thumbs .swiper-slide img { height: 44px; }
  .cal-cell  { font-size: 0.72rem; padding: 0.2rem 0.05rem; }
  .cal-day   { min-height: 30px; }
  .cal-row   { grid-template-columns: 26px repeat(7, 1fr); }
}
