/* assets/style.css
   Kehra Kultuurikoda – main styles
   Stable, readable, mobile-first
*/

/* =========================
   VARIABLES
   ========================= */

:root {
  --bg: #0e1324;
  --panel: rgba(255,255,255,0.14);
  --text: rgba(255,255,255,0.96);
  --muted: rgba(255,255,255,0.80);
  --muted2: rgba(255,255,255,0.65);
  --stroke: rgba(255,255,255,0.18);
  --shadow2: 0 14px 40px rgba(0,0,0,0.35);
  --radius: 18px;
  --max: 1100px;
}

/* =========================
   RESET / BASE
   ========================= */

* { box-sizing: border-box; }

html, body { height: 100%; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

/* allow footer to stay at the very bottom */
.content-layer {
  flex: 1;
}

/* =========================
   TOPBAR
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(14,19,36,0.78);
  border-bottom: 1px solid var(--stroke);
}

.topbar.is-hidden {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.topbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

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

/* =========================
   NAVIGATION
   ========================= */

.nav {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  font-size: 13px;
  color: var(--muted);
}

.chip.active {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

/* =========================
   HAMBURGER
   ========================= */

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* =========================
   HERO (default: homepage)
   ========================= */

.hero-fixed {
  position: relative;
  height: 80vh;
  min-height: 520px;
  overflow: hidden;
}

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Homepage hero text layer */
.hero-content{
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 10vh 0 12vh;
}

.hero-panel{
  display: inline-block;
  max-width: 760px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(14,19,36,0.22);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}

.hero-logo {
  margin-bottom: 18px;
}

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

.hero-title{
  margin: 0 0 10px;
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: -0.6px;
  text-shadow: 0 18px 50px rgba(0,0,0,0.55);
}

.hero-sub{
  margin: 0;
  font-size: 18px;
  color: rgba(255,255,255,0.90);
  text-shadow: 0 18px 50px rgba(0,0,0,0.55);
}

.hero-actions{
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.35);
}

.btn-ghost{
  background: rgba(255,255,255,0.06);
}

/* =========================
   CONTENT LAYER (default: homepage)
   ========================= */

.content-layer {
  position: relative;
  z-index: 2;
  margin-top: 80vh;
  background: linear-gradient(
    to bottom,
    rgba(14,19,36,0.90),
    rgba(14,19,36,1)
  );
  padding: 96px 0 120px;
}

/* =========================
   SUBPAGES WITH HERO BACKGROUND (NO SCROLL SPACER)
   Usage:
     <body class="has-hero-bg">
     keep hero-fixed + hero-bg in the page
   ========================= */

.has-hero-bg .hero-fixed{
  height: 0;
  min-height: 0;
  overflow: visible;
}

.has-hero-bg .hero-bg{
  position: fixed;
  inset: 0;
  z-index: -1;
}

.has-hero-bg .content-layer{
  margin-top: 0;
  padding: 80px 0 120px; /* consistent start across subpages */
  background: transparent;
}

/* Remove top padding from the first section to avoid double spacing */
.has-hero-bg .content-layer > section:first-child{
  padding-top: 0;
}

/* Remove the dark overlay/stripe on subpages (if any pseudo element existed) */
.has-hero-bg .content-layer::before{
  content: none;
}

/* =========================
   SECTIONS
   ========================= */

section { padding: 24px 0; }

.sectionHead h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.sectionHead p {
  margin: 0;
  font-size: 15px;
  color: var(--muted2);
}

/* =========================
   CARDS / GRID
   ========================= */

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: rgba(10, 14, 28, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow2);
  overflow: hidden;
}

.cardBody { padding: 22px; }

.card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

/* =========================
   CONTACT GRID
   ========================= */

.contact-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 28px;
}

@media (max-width: 900px){
  .contact-grid{ grid-template-columns: 1fr; }
}

/* =========================
   FOOTER
   ========================= */

footer {
  position: relative;
  z-index: 3;
  padding: 32px 0;
  border-top: 1px solid var(--stroke);
  background: var(--bg);
  font-size: 14px;
  color: var(--muted2);
}

/* =========================
   HELPERS
   ========================= */

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: #ff6b6b;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {

  .nav {
    position: absolute;
    top: 64px;
    right: 16px;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(14,19,36,0.97);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow2);
    display: none;
  }

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

  .nav-toggle { display: flex; }
}

/* Mobile: keep hero content fully visible (logo + all CTA buttons) */
@media (max-width: 768px) {

  /* Make hero tall enough so content never gets clipped */
  .hero-fixed{
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  /* Spacer must match hero height on mobile */
  .content-layer{
    margin-top: 100vh;
    padding: 72px 0 96px;
  }

  /* Subpages keep their own logic */
  .has-hero-bg .content-layer{
    margin-top: 0;
    padding: 64px 0 96px;
  }

  section { padding: 56px 0; }

  /* Move content to top (under topbar) and reduce vertical padding */
  .hero-content{
    height: auto;
    padding: 84px 0 20px; /* ~64px topbar + breathing room */
    align-items: flex-start;
  }

  /* Make panel fit and feel lighter */
  .hero-panel{
    width: 100%;
    max-width: 680px;
    padding: 14px 14px 12px;
  }

  /* Ensure logo is visible and not oversized */
  .hero-logo{
    margin-bottom: 10px;
  }

  .hero-logo img{
    height: 110px;
    width: auto;
  }

  /* Slightly smaller typography to free vertical space */
  .hero-title{
    font-size: 34px;
    line-height: 1.06;
    margin: 0 0 8px;
  }

  .hero-sub{
    font-size: 15px;
  }

  /* CTA buttons: stack, full-width */
  .hero-actions{
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
  }

  .hero-actions .btn{
    width: 100%;
  }

  .cardBody { padding: 24px; }
}

@media (max-width: 420px) {
  .hero-logo img{ height: 92px; }
  .hero-title{ font-size: 30px; }
}