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

:root {
  --tan: #c8a97e;
  --tan-dark: #b0906a;
  --tan-light: #e8d5b8;
  --border: #a07850;
  --white: #fff;
  --text: #3a2a1a;
}

/* FONTIT */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/open-sans-v44-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/open-sans-v44-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/playfair-display-v40-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/playfair-display-v40-latin-700.woff2') format('woff2');
}
/* MAIN BODY CSS */
body {
  font-family: 'Open Sans', sans-serif;
  background: #f5ede0;
  color: var(--text);
  min-height: 100vh;
}

.wrapper {
  max-width: 960px;
  margin: 30px auto;
  border: 2px solid var(--border);
  background: var(--white);
}

header {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--tan);
  border-bottom: 2px solid var(--border);
}

header .header-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-right: 2px solid var(--border);
  object-position: center top;
}

header .site-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  color: var(--text);
  padding: 20px;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  text-align: center;
}

nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--border);
  background: var(--tan-light);
}

nav a {
  display: block;
  text-align: center;
  padding: 16px 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}

nav a:last-child { border-right: none; }

nav a:hover {
  background: var(--tan);
}

nav a.aktiivinen {
  background: var(--tan);
  font-weight: 600;
}

main {
  padding: 24px;
  display: block;
}

.content-box {
  border: 2px solid var(--border);
  padding: 20px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  background: var(--white);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  grid-column: auto;
}

.main-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border: 2px solid var(--border);
}

.bottom-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.kuvat-allekkain {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bottom-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border: 2px solid var(--border);
}
#kuva-keski {
  object-fit: unset;
  height: auto;
  margin-top: 60px;
}

.hassu-kuva {
  height: auto !important;
  object-fit: unset !important;
  width: 100%;
}

footer {
  background: var(--tan-light);
  border-top: 2px solid var(--border);
  text-align: center;
  padding: 18px;
  font-size: 0.95rem;
  color: var(--text);
}

footer a {
  color: var(--text);
  text-decoration: none;
  margin: 0 8px;
  font-weight: 600;
}

footer a:hover { text-decoration: underline; }

/* ETUSIVU KUVA JA TEKSTI SAMALLE RIVILLE */
.intro-rivi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* KAUPPA CSS KOODI ALLA */

.tuotteet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.tuote {
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.tuote img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-bottom: 2px solid var(--border);
  background: var(--tan-light);
}

.tuote-tiedot {
  padding: 16px;
  flex-grow: 1;
}

.tuote-tiedot h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  font-family: 'Playfair Display', serif;
}

.tuote-tiedot p {
  font-size: 0.95rem;
  margin-bottom: 10px;
  line-height: 1.5;
}

.hinta {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.nappi {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--tan);
  border: 2px solid var(--border);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.nappi:hover {
  background: var(--tan-dark);
}

h2 {
  grid-column: 1 / -1;
  margin-bottom: 20px;
}

.kielimorko {
  width: 400px;
  height: auto;
}

/*PÄÄ HEDARI H1 */
main h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--text);
}

/* CTA */
.cta-alue {
  width: 100%;
  text-align: center;
  padding: 24px;
  background: var(--tan-light);
  border: 2px solid var(--border);
}

.cta-alue p {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* MOBIILI CSS KOODI ALLA */

@media (max-width: 768px) {

  .wrapper {
    margin: 0;
    border-left: none;
    border-right: none;
  }

  header {
    grid-template-columns: 1fr;
  }

  header .header-img {
    height: 160px;
    border-right: none;
    border-bottom: 2px solid var(--border);
  }

  header .site-title {
    font-size: 2rem;
    padding: 16px;
  }

  nav {
    grid-template-columns: 1fr;
  }

  nav a {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  nav a:last-child {
    border-bottom: none;
  }

  main {
    grid-template-columns: 1fr;
    padding: 16px;
  }

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

  .main-img,
  .bottom-img {
    height: 200px;
  }

  h1, .site-title {
    font-size: 1.8rem;
  }

  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }

  p {
    font-size: 1rem;
    line-height: 1.6;
  }

   .content-box {
    grid-column: 1;
  }

    .cta-alue {
    grid-column: 1;
    width: 100%;
  }

  .tuotteet {
    grid-template-columns: 1fr;
  }

  .tuote {
    width: 100%;
  }

  .intro-rivi {
    grid-template-columns: 1fr;
  }

  .bottom-row {
    grid-template-columns: 1fr;
  }

  .kuvat-allekkain {
    flex-direction: column;
  }
}