/*
Theme Name: Muul 3D
Theme URI: https://www.muul.ee/
Author: Muul OÜ
Author URI: https://www.muul.ee/
Description: 3D-printimise teenuse maandumisleht — Muul OÜ kõrvalärisuund. Tume, tehniline kujundus mustas, sinises ja valges. Block-teema (FSE) WordPress 6.4+ jaoks.
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: muul3d
Tags: block-theme, full-site-editing, one-column, dark-mode, landing-page, custom-colors, custom-logo, block-patterns, block-styles
*/

/* Subtle grid backdrop */
body {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  background-attachment: fixed;
}

::selection {
  background: rgba(56, 132, 255, 0.45);
  color: #ffffff;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid #00aeef;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Gradient text utility */
.has-muul-gradient-text-color,
.muul-gradient-text {
  background: linear-gradient(135deg, #00aeef 0%, #5fd2ff 60%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

/* Glow card */
.is-style-muul-glow-card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  backdrop-filter: blur(8px);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.is-style-muul-glow-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,174,239,0.45);
  box-shadow: 0 20px 60px -20px rgba(0,174,239,0.4);
}

/* Outline button */
.wp-block-button.is-style-muul-outline > .wp-block-button__link {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.22);
  transition: border-color .2s ease, background .2s ease;
}
.wp-block-button.is-style-muul-outline > .wp-block-button__link:hover {
  border-color: #00aeef;
  background: rgba(0,174,239,0.08);
}

/* Eyebrow */
.is-style-muul-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: #5fd2ff;
}

/* Stat number */
.is-style-muul-stat {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, #00aeef, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* Featured pricing tier */
.is-style-muul-featured {
  border: 1.5px solid #00aeef !important;
  box-shadow: 0 20px 60px -20px rgba(0,174,239,0.45);
  position: relative;
}
.is-style-muul-featured::before {
  content: "Populaarseim";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #00aeef;
  color: #ffffff;
  padding: 4px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 999px;
}

/* ========================================================
   Sektsioonide kompaktsem padding (vähendab hiiglaslikku tühja ruumi)
   ======================================================== */
.wp-site-blocks main > section,
.wp-site-blocks main > .wp-block-group {
  /* Default oli 5rem-6rem, vähendame 3rem peale, hingamisruum jääb */
  padding-top: clamp(2.5rem, 4vw + 1rem, 4rem) !important;
  padding-bottom: clamp(2.5rem, 4vw + 1rem, 4rem) !important;
}

/* Hero (esimene cover) jätame natuke suuremana — see on lehe pealkiri */
.wp-site-blocks main > .wp-block-cover:first-child {
  padding-top: clamp(4rem, 6vw + 2rem, 6rem) !important;
  padding-bottom: clamp(3.5rem, 5vw + 1.5rem, 5rem) !important;
}

/* Soft entry animation */
@media (prefers-reduced-motion: no-preference) {
  .wp-site-blocks > * {
    animation: muul-fade-in .6s ease both;
  }
  @keyframes muul-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ========================================================
   Sticky header — kleepub lehe ülaosas kerides
   Sihime WordPressi enda <header class="wp-block-template-part">
   elementi, mis on .wp-site-blocks otsene laps — see on
   sticky käitumiseks õige asukoht.
   ======================================================== */
header.wp-block-template-part {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}

/* Disable entry animation on the sticky header so see ei "hüppaks" sisselaadimisel */
header.wp-block-template-part {
  animation: none !important;
}

/* Pisut kompaktsem padding desktopil */
@media (min-width: 768px) {
  .muul-sticky-header {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
}

/* Anchor-linkide skroll'imisel jätke päise jaoks ruumi */
:where([id]) {
  scroll-margin-top: 90px;
}

/* ========================================================
   Päise navigatsioon — desktop
   ======================================================== */
.muul-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.muul-nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.muul-nav-list a {
  color: #8a93a6;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.muul-nav-list a:hover {
  color: #ffffff;
}

.muul-nav-list .muul-nav-back {
  color: #5fd2ff;
}

/* Hambureri-nupp — vaikimisi peidetud (näeb vaid mobiilis) */
.muul-burger {
  display: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-left: 1rem;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.muul-burger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.muul-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

/* ========================================================
   MOBIIL — alla 782px
   ======================================================== */
@media (max-width: 781px) {

  /* Peida CTA nupp mobiilis */
  .muul-sticky-header .muul-header-cta {
    display: none;
  }

  /* Sticky päis kompaktsem */
  .muul-sticky-header {
    padding-top: 0.875rem !important;
    padding-bottom: 0.875rem !important;
  }

  /* Logo natuke väiksem */
  .muul-sticky-header svg {
    height: 32px !important;
  }

  /* Hambureri-nupp nähtavale, paremale äärde */
  .muul-burger {
    display: flex;
    margin-left: auto;
    background: transparent;
    border: none;
    z-index: 250;
    position: relative;
  }

  /* Navigatsioon — täisekraani overlay, vaikimisi peidetud
     NB! JavaScript viib selle <body> otse, et sticky parent ei segaks position: fixed käitumist */
  .muul-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* dünaamiline viewport — arvestab mobiili menüüriba */
    background: #000000;
    background: rgba(0, 0, 0, 0.97);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 240;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    margin-left: 0;
    padding: 2rem;
  }

  .muul-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
  }

  .muul-nav-list {
    flex-direction: column;
    gap: 1.75rem;
    text-align: center;
  }

  .muul-nav-list a {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
  }

  .muul-nav-list a:active {
    color: #00aeef;
  }

  /* Burger animatsioon — kolm kriipsu animeerivad ristiks (X), kui menüü on avatud */
  .muul-burger.is-open {
    position: fixed;
    top: 0.875rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    z-index: 250;
  }

  .muul-burger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .muul-burger.is-open span:nth-child(2) {
    opacity: 0;
  }

  .muul-burger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ======== Üldised mobiili sisu parandused ======== */

  .wp-block-cover h1 {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  .wp-block-cover h2 {
    font-size: 1.25rem !important;
  }

  .wp-block-cover {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  main > .wp-block-cover:first-child {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  .wp-site-blocks section {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

/* ========================================================
   Contact Form 7 — match the dark/blue theme
   ======================================================== */
.muul3d-form p {
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.muul3d-form label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.muul3d-form input[type="text"],
.muul3d-form input[type="email"],
.muul3d-form input[type="tel"],
.muul3d-form input[type="url"],
.muul3d-form input[type="number"],
.muul3d-form select,
.muul3d-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color .2s ease, background .2s ease;
}

.muul3d-form input:focus,
.muul3d-form select:focus,
.muul3d-form textarea:focus {
  outline: none;
  border-color: #00aeef;
  background: rgba(0,174,239,0.05);
}

.muul3d-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.muul3d-form input[type="file"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 0.75rem;
  color: #8a93a6;
  font-size: 0.9rem;
  cursor: pointer;
}

.muul3d-form input[type="file"]:hover {
  border-color: #00aeef;
  color: #ffffff;
}

.muul3d-form input[type="submit"] {
  background: linear-gradient(135deg, #0089bf 0%, #00aeef 50%, #5fd2ff 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.95rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease;
  width: 100%;
}

.muul3d-form input[type="submit"]:hover {
  box-shadow: 0 12px 40px -12px rgba(0,174,239,0.5);
  transform: translateY(-1px);
}

.muul3d-form input[type="submit"]:active {
  transform: translateY(0);
}

/* CF7 status messages */
.wpcf7-response-output {
  border-radius: 8px !important;
  padding: 1rem 1.25rem !important;
  margin: 1.5rem 0 0 !important;
  font-size: 0.95rem;
}

.wpcf7 form.sent .wpcf7-response-output {
  border-color: #34d399 !important;
  background: rgba(52,211,153,0.08);
  color: #34d399;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output {
  border-color: #ff5c5c !important;
  background: rgba(255,92,92,0.08);
  color: #ff8a8a;
}

.wpcf7-not-valid-tip {
  color: #ff8a8a !important;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
