/*
Theme Name: Rattel.ee Divi 5 Child
Theme URI: https://rattel.ee
Description: Divi 5 child theme kohandusteks
Author: Urho Rättel
Author URI: https://rattel.ee
Template: Divi
Version: 1.0.0
*/

/* ==========================================================================
   1. FONDID
   ========================================================================== */

@font-face {
  font-family: "Clash Display";
  src: url("fonts/ClashDisplay-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   2. MUUTUJAD
   Breakpointid: sm 320 | md 744 | lg 1280 | xl 1920 | 2xl 2560 (1rem = 16px)
   Fluid interpolatsioon ankrupunktide vahel, 2560 px juures kasv lõpeb.
   ========================================================================== */

:root {
  /* Fondiperekonnad */
  --font-display: "Clash Display", system-ui, sans-serif;
  --font-grotesk: "Space Grotesk", system-ui, sans-serif;

  /* Font weight (vaikimisi kõikjal 500) */
  --fw-body: 500;

  /* Line-height */
  --lh-h1: 1;
  --lh-h2: 1;
  --lh-body: 1.4;
  --lh-link: 1;
  --lh-button: 1.2;
  --lh-menu: 1.4;

  /* Letter-spacing */
  --ls-h1: -0.04em;
  --ls-h2: 0.04em;
  --ls-body: 0.05em;
  --ls-link: 0.05em;
  --ls-button: 0.05em;
  --ls-menu: 0.05em;

  /* Fondisuurused: 320 -> 744 px */
  --fs-body: 0.625rem;
  --fs-h1: clamp(2rem, 1.2453rem + 3.7736vw, 3rem);
  --fs-h2: clamp(1.5rem, 1.3113rem + 0.9434vw, 1.75rem);
  --fs-link: clamp(0.625rem, 0.5307rem + 0.4717vw, 0.75rem);
  --fs-button: 0.75rem;
  --fs-menu: 0.625rem;
}

/* 744 -> 1280 px */
@media (min-width: 744px) {
  :root {
    --fs-body: clamp(0.625rem, 0.4515rem + 0.3731vw, 0.75rem);
    --fs-h1: clamp(3rem, 0.9179rem + 4.4776vw, 4.5rem);
    --fs-h2: clamp(1.75rem, 1.056rem + 1.4925vw, 2.25rem);
    --fs-link: 0.75rem;
    --fs-button: 0.75rem;
    --fs-menu: clamp(0.625rem, 0.4515rem + 0.3731vw, 0.75rem);
  }
}

/* 1280 -> 1920 px */
@media (min-width: 1280px) {
  :root {
    --fs-body: clamp(0.75rem, 0.625rem + 0.15625vw, 0.8125rem);
    --fs-h1: clamp(4.5rem, 1.5rem + 3.75vw, 6rem);
    --fs-h2: clamp(2.25rem, 0.75rem + 1.875vw, 3rem);
    --fs-link: clamp(0.75rem, 0.625rem + 0.15625vw, 0.8125rem);
    --fs-button: clamp(0.75rem, 0.625rem + 0.15625vw, 0.8125rem);
    --fs-menu: clamp(0.75rem, 0.625rem + 0.15625vw, 0.8125rem);
  }
}

/* 1920 -> 2560 px (üle 2560 px väärtus ei kasva) */
@media (min-width: 1920px) {
  :root {
    --fs-body: clamp(0.8125rem, 0.625rem + 0.15625vw, 0.875rem);
    --fs-h1: clamp(6rem, 3rem + 2.5vw, 7rem);
    --fs-h2: clamp(3rem, 1.5rem + 1.25vw, 3.5rem);
    --fs-link: clamp(0.8125rem, 0.625rem + 0.15625vw, 0.875rem);
    --fs-button: clamp(0.8125rem, 0.625rem + 0.15625vw, 0.875rem);
    --fs-menu: clamp(0.8125rem, 0.625rem + 0.15625vw, 0.875rem);
  }
}

/* ==========================================================================
   3. BODY
   ========================================================================== */

body,
#page-container,
p,
li {
  font-family: var(--font-display) !important;
  font-size: var(--fs-body) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-body) !important;
  letter-spacing: var(--ls-body) !important;
}

/* Uppercase ainult body tekstil */
p,
li {
  text-transform: uppercase !important;
}

/* ==========================================================================
   4. PEALKIRJAD
   ========================================================================== */

h1 {
  font-family: var(--font-grotesk) !important;
  font-size: var(--fs-h1) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-h1) !important;
  letter-spacing: var(--ls-h1) !important;
}

h2 {
  font-family: var(--font-display) !important;
  font-size: var(--fs-h2) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-h2) !important;
  letter-spacing: var(--ls-h2) !important;
}

/* ==========================================================================
   5. LINK
   (link p/li sees pärib uppercase'i body tekstilt)
   ========================================================================== */

p a,
li a,
.et_pb_text_inner a,
a.link {
  font-family: var(--font-display) !important;
  font-size: var(--fs-link) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-link) !important;
  letter-spacing: var(--ls-link) !important;
}

/* ==========================================================================
   6. BUTTON
   (a.et_pb_button variandid, et võita link-i reegel tekstimooduli sees)
   ========================================================================== */

.et_pb_button,
.et_pb_module .et_pb_button,
.et_pb_text_inner a.et_pb_button,
p a.et_pb_button,
li a.et_pb_button,
button,
input[type="submit"],
.button {
  font-family: var(--font-display) !important;
  font-size: var(--fs-button) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-button) !important;
  letter-spacing: var(--ls-button) !important;
  text-transform: uppercase !important;
}
/* ==========================================================================
   7. MENU NAV LINK
   (viimane, et võidaks üldise link-reegli, kui menüü on li a sees)
   ========================================================================== */

#top-menu li a,
#et-top-navigation a,
.et_pb_menu .et-menu li a,
.et_pb_menu .et-menu-nav li a,
.et_mobile_menu li a,
.nav-link,
li a.nav-link,
p a.nav-link,
.et_pb_text_inner a.nav-link {
  font-family: var(--font-display) !important;
  font-size: var(--fs-menu) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-menu) !important;
  letter-spacing: var(--ls-menu) !important;
  text-transform: none !important;
}

/* ==========================================================================
   8. FONT WEIGHT KLASSID (300–600)
   Lisa Divi 5 visual builderis elemendile CSS klass.
   #page-container annab piisava spetsiifilisuse, et võita ka nupu ja menüü reeglid.
   ========================================================================== */

#page-container .fw-300,
#page-container .fw-300 * {
  font-weight: 300 !important;
}

#page-container .fw-400,
#page-container .fw-400 * {
  font-weight: 400 !important;
}

#page-container .fw-500,
#page-container .fw-500 * {
  font-weight: 500 !important;
}

#page-container .fw-600,
#page-container .fw-600 * {
  font-weight: 600 !important;
}

/* ==========================================================================
   9. CONTACT FORM LABEL
   Sama stiil mis body (font, suurus, kaal, line-height, letter-spacing, uppercase)
   ========================================================================== */

#page-container .et_pb_contact_form .et_pb_contact_form_label,
#page-container .et_pb_contact_form .et_pb_contact_field label,
#page-container .et_pb_contact_form .et_pb_contact_field_options_title,
#page-container .et_pb_contact_form .et_pb_contact_field .input,
#page-container .et_pb_contact_form .et_pb_contact_field textarea,
#page-container .et_pb_contact_form .et_pb_contact_field select {
  font-family: var(--font-display) !important;
  font-size: var(--fs-body) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-body) !important;
  letter-spacing: var(--ls-body) !important;
  text-transform: uppercase !important;
}

#page-container .et_pb_contact_form .et_pb_contact_field .input::placeholder,
#page-container .et_pb_contact_form .et_pb_contact_field textarea::placeholder {
  font-family: var(--font-display) !important;
  font-size: var(--fs-body) !important;
  font-weight: var(--fw-body) !important;
  line-height: var(--lh-body) !important;
  letter-spacing: var(--ls-body) !important;
  text-transform: uppercase !important;
}