/* ============================================================
   Viesu grāmata — moderni latvialainen teema
   Sama ilme kuin Vitrupes Pludmale -sivustolla.
   Ladataan manala.css:n JÄLKEEN (ohittaa sen tarvittaessa).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Nunito+Sans:wght@300;400;600;700;800&display=swap');

:root {
  --lv-red:         #9E1B32;
  --lv-red-dark:    #6E1223;
  --lv-amber:       #C08A2E;
  --lv-amber-light: #E4C77A;
  --lv-ink:         #2B211C;
  --lv-linen:       #F5EEE2;
  --lv-cream:       #FBF7F0;
  --lv-line:        #E6DCCB;
  --gb-ok:          #2F7D4F;
}

* { box-sizing: border-box; }

.gb-body {
  margin: 0;
  background: var(--lv-cream);
  color: var(--lv-ink);
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
}

/* ---------- Hero (täysleveä taustakuva, kuten Vitrupe-hero) ---------- */
.gb-hero {
  position: relative; width: 100%;
  min-height: clamp(300px, 40vw, 520px);
  background: url('images/gb_banner.jpg') center / cover no-repeat;
  border-bottom: 4px solid var(--lv-amber);
}
.gb-back {
  position: absolute; top: 18px; left: 18px;
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(43, 20, 16, .55); color: #fff; text-decoration: none;
  font-weight: 700; font-size: .9rem; letter-spacing: .01em;
  padding: .5rem 1.1rem; border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(4px); transition: background .2s;
}
.gb-back:hover { background: var(--lv-red); }

/* ---------- Layout ---------- */
.gb-layout {
  width: min(1120px, 92vw); margin: clamp(2rem, 5vw, 3.5rem) auto;
  display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.5rem, 3vw, 2.2rem);
  align-items: start;
}

/* ---------- Kortit ---------- */
.gb-card {
  background: #fff; border: 1px solid var(--lv-line);
  border-radius: 18px; padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: 0 10px 26px rgba(43, 33, 28, .07);
}
.gb-subtitle {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  color: var(--lv-ink); font-size: 1.5rem; margin: 0 0 1.2rem;
  display: flex; align-items: center; gap: .6rem;
}
.gb-subtitle::before { content: ''; width: 26px; height: 3px; background: var(--lv-amber); border-radius: 2px; }
.gb-count { color: var(--lv-amber); font-family: 'Nunito Sans', sans-serif; font-size: 1rem; font-weight: 700; }

/* ---------- Viestit (palaute) ---------- */
.gb-msg { border-radius: 10px; padding: .75rem 1rem; margin: 0 0 1rem; font-weight: 600; font-size: .95rem; }
.gb-msg-ok  { background: rgba(47, 125, 79, .12); color: var(--gb-ok); border: 1px solid rgba(47, 125, 79, .3); }
.gb-msg-err { background: rgba(158, 27, 50, .10); color: var(--lv-red); border: 1px solid rgba(158, 27, 50, .3); }

/* ---------- Lomake ---------- */
.gb-form { display: flex; flex-direction: column; }
.gb-label {
  font-family: 'Nunito Sans', sans-serif; font-weight: 800; font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--lv-amber);
  margin: .6rem 0 .35rem;
}
.gb-input {
  font: inherit; color: var(--lv-ink);
  border: 1px solid var(--lv-line); border-radius: 10px;
  padding: .7rem .9rem; background: var(--lv-cream);
  transition: border-color .18s, box-shadow .18s;
}
.gb-input:focus { outline: none; border-color: var(--lv-red); box-shadow: 0 0 0 3px rgba(158, 27, 50, .12); background: #fff; }
.gb-textarea { resize: vertical; min-height: 130px; }
.gb-submit {
  margin-top: 1.3rem; align-self: flex-start;
  background: var(--lv-red); color: #fff; border: 2px solid var(--lv-red);
  font-family: 'Nunito Sans', sans-serif; font-weight: 700; letter-spacing: .02em;
  padding: .7rem 1.8rem; border-radius: 40px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(158, 27, 50, .22); transition: transform .18s, background .18s, box-shadow .18s;
}
.gb-submit:hover { background: var(--lv-red-dark); border-color: var(--lv-red-dark); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(110, 18, 35, .3); }

/* hunajapurkki piiloon (botit täyttävät, ihmiset eivät näe) */
.gb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Ieraksti (viestilista) ---------- */
.gb-empty { color: #7a6b5f; font-style: italic; margin: 0; }
.gb-entries { list-style: none; margin: 0; padding: 0; }
.gb-entry {
  background: var(--lv-linen); border-left: 4px solid var(--lv-amber);
  border-radius: 10px; padding: .95rem 1.2rem; margin-bottom: .9rem;
}
.gb-entry:last-child { margin-bottom: 0; }
.gb-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .35rem; flex-wrap: wrap; }
.gb-name { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--lv-red); font-size: 1.08rem; }
.gb-date { font-size: .8rem; color: #8a7a6c; white-space: nowrap; }
.gb-text { margin: 0; color: #3f342c; }

/* ---------- Footer + paluulinkki Vitrupeen ---------- */
.gb-footer {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(var(--lv-cream), var(--lv-linen));
  color: var(--lv-ink);
  text-align: center; padding: 2.6rem 1rem;
  border-top: 3px solid var(--lv-amber);
}
.gb-footer-link {
  display: inline-flex; align-items: center; gap: .7rem;
  background: linear-gradient(135deg, var(--lv-red) 0%, var(--lv-red-dark) 100%);
  color: #fff; text-decoration: none;
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 1.18rem;
  letter-spacing: .01em; padding: .85rem 2.1rem; border-radius: 40px;
  border: 2px solid var(--lv-amber);
  box-shadow: 0 8px 24px rgba(158, 27, 50, .38);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.gb-footer-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(158, 27, 50, .5);
  border-color: var(--lv-amber-light);
}
.gb-footer-link .gb-arrow { font-size: 1.3em; line-height: 1; transition: transform .2s; }
.gb-footer-link:hover .gb-arrow { transform: translateX(-5px); }
.gb-footer-copy { margin: 1.3rem 0 0; font-size: .85rem; color: #8A7A6C; }
.gb-footer-copy a { color: var(--lv-red); text-decoration: none; font-weight: 600; }
.gb-footer-copy a:hover { text-decoration: underline; }

/* ---------- Responsiivisuus ---------- */
@media (max-width: 820px) {
  .gb-layout { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
