/*---------------------------------------------------------------------------------

 Theme Name:   child-themes-next-day-film
 Theme URI:    https://nextdayfilms.neletasane.ee
 Description:  Nele Tasane videolood
 Author:       Urho Rättel
 Author URI:   https://www.linkedin.com/in/urho-rattel
 Template:     Divi
 Version:      1.4.1
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html

------------------------------ ADDITIONAL CSS HERE ------------------------------*/

/* ==========================================================================
   Next Day Film – fondid ja clamp() tüpograafia
   Skaala: 320 px → 2560 px (1rem = 16px)
   Ankrud: 320 / 744 / 1024 / 1920 / 2560
   Font weight: kasutusel ainult 400 / 500 / 600
   ========================================================================== */

/* Clash Display – pealkirjad, nupud, menüü.
   Variable font: brauser kärbib font-weight väärtused vahemikku 400–600. */
@font-face {
  font-family: "Clash Display";
  src: url("fonts/ClashDisplay-Variable.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* MUUDATUS: Satoshi – body tekst.
   Variable font: font-weight vahemik 400–600 (Medium 500 ja SemiBold 600 töötavad päriselt). */
@font-face {
  font-family: "Satoshi";
  src: url("fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* --- Mobiil: 320 → 743 px --- */
:root {
  --ndf-font: "Clash Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ndf-font-body: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif; /* MUUDATUS */

  --fs-body: 1rem;
  --fs-h1: clamp(3.625rem, 3.5307rem + 0.4717vw, 3.75rem);
  --fs-h2: clamp(2rem, 1.9057rem + 0.4717vw, 2.125rem);
  --fs-h3: clamp(1rem, 0.717rem + 1.4151vw, 1.375rem);
  --fs-button: 1rem;
  --fs-link: 0.875rem;
  --fs-menu: 0.75rem;
}

/* --- Tablet: 744 → 1023 px --- */
@media (min-width: 744px) {
  :root {
    --fs-body: 1rem;
    --fs-h1: clamp(3.75rem, -6.2143rem + 21.4286vw, 7.5rem);
    --fs-h2: clamp(2.125rem, -2.1929rem + 9.2857vw, 3.75rem);
    --fs-h3: clamp(1.375rem, 0.0464rem + 2.8571vw, 1.875rem);
    --fs-button: 1rem;
    --fs-link: 0.875rem;
    --fs-menu: clamp(0.75rem, 0.4179rem + 0.7143vw, 0.875rem);
  }
}

/* --- Desktop lg: 1024 → 1919 px --- */
@media (min-width: 1024px) {
  :root {
    --fs-body: clamp(1rem, 0.8571rem + 0.2232vw, 1.125rem);
    --fs-h1: clamp(7.5rem, 4.9286rem + 4.0179vw, 9.75rem);
    --fs-h2: clamp(3.75rem, 2.4643rem + 2.0089vw, 4.875rem);
    --fs-h3: clamp(1.875rem, 1.3036rem + 0.8929vw, 2.375rem);
    --fs-button: clamp(1rem, 0.7143rem + 0.4464vw, 1.25rem);
    --fs-link: clamp(0.875rem, 0.5893rem + 0.4464vw, 1.125rem);
    --fs-menu: clamp(0.875rem, 0.5893rem + 0.4464vw, 1.125rem);
  }
}

/* --- Desktop xl → xxl: 1920 → 2560 px (alates 2560 px enam ei kasva) --- */
@media (min-width: 1920px) {
  :root {
    --fs-body: clamp(1.125rem, 0.9375vw, 1.5rem);
    --fs-h1: clamp(9.75rem, 1.5rem + 6.875vw, 12.5rem);
    --fs-h2: clamp(4.875rem, 4.0625vw, 6.5rem);
    --fs-h3: clamp(2.375rem, 0.125rem + 1.875vw, 3.125rem);
    --fs-button: clamp(1.25rem, 0.125rem + 0.9375vw, 1.625rem);
    --fs-link: clamp(1.125rem, 0.9375vw, 1.5rem);
    --fs-menu: clamp(1.125rem, 0.9375vw, 1.5rem);
  }
}

/* ==========================================================================
   Rakendus – kõigil !important (Divi inline-stiilid laadivad hiljem)

   font-weight on kujul var(--fw, VAIKIMISI).
   - Kui --fw pole kuskil määratud, kehtib VAIKIMISI väärtus (body 400, ülejäänud 500)
   - Kui visual builderis lisad klassi fw-400 / fw-500 / fw-600, määrab see --fw
     ja kõik selle elemendi sees olevad tekstid võtavad selle väärtuse
   ========================================================================== */

/* Body ja tekst – MUUDATUS: font-family on nüüd Satoshi */
body,
body p,
body li,
body .et_pb_text,
body .et_pb_text_inner,
body .et_pb_module p {
  font-family: var(--ndf-font-body) !important;
  font-size: var(--fs-body) !important;
  font-weight: var(--fw, 400) !important;
  line-height: 140% !important;
}

/* Lõikude vahe (Figma paragraph spacing 20) */
body p,
body .et_pb_text_inner p,
body .et_pb_module p {
  margin: 0 !important;
  padding-bottom: 1.25rem !important; /* 20px */
}

/* Viimasel lõigul vahet ei ole */
body p:last-child,
body .et_pb_text_inner p:last-child,
body .et_pb_module p:last-child {
  padding-bottom: 0 !important;
}

/* Pealkirjad: font-family */
h1, h2, h3, h4, h5, h6,
.et_pb_module h1,
.et_pb_module h2,
.et_pb_module h3,
.et_pb_module h4,
.et_pb_module h5,
.et_pb_module h6,
.et_pb_heading_container h1,
.et_pb_heading_container h2,
.et_pb_heading_container h3,
.et_pb_module_header {
  font-family: var(--ndf-font) !important;
}

/* h4–h6: brauseri vaikimisi on 700 (väljaspool 400–600), seega fikseeritud */
h4, h5, h6,
.et_pb_module h4,
.et_pb_module h5,
.et_pb_module h6 {
  font-weight: var(--fw, 500) !important;
}

/* strong / b / th: brauseri vaikimisi on 700 → alati 600 */
strong,
b,
th,
.et_pb_text_inner strong,
.et_pb_text_inner b {
  font-weight: 600 !important;
}

/* h1 */
h1,
.et_pb_module h1,
.et_pb_heading_container h1,
.et_pb_text_inner h1 {
  font-size: var(--fs-h1) !important;
  font-style: normal !important;
  font-weight: var(--fw, 500) !important;
  line-height: 100% !important;
  letter-spacing: -0.03em !important; /* = -0.225rem 7.5rem juures */
}

/* h2 */
h2,
.et_pb_module h2,
.et_pb_heading_container h2,
.et_pb_text_inner h2 {
  font-size: var(--fs-h2) !important;
  font-style: normal !important;
  font-weight: var(--fw, 400) !important;
  line-height: 100% !important;
  letter-spacing: 0.02em !important; /* = 0.075rem 3.75rem juures */
}

/* h3 */
h3,
.et_pb_module h3,
.et_pb_heading_container h3,
.et_pb_text_inner h3,
h3.et_pb_module_header {
  font-size: var(--fs-h3) !important;
  font-style: normal !important;
  font-weight: var(--fw, 400) !important;
  line-height: 100% !important;
  letter-spacing: 0.04em !important; /* = 0.075rem 1.875rem juures */
}

/* Lingid */
a {
  font-size: var(--fs-link) !important;
  line-height: 100% !important;
  letter-spacing: 0.05em !important; /* = 0.05rem 1rem juures */
}

/* Pealkirja sees olev link päritakse pealkirjalt */
h1 a, h2 a, h3 a {
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

/* Nupud */
button,
.et_pb_button,
a.et_pb_button,
input[type="submit"] {
  font-family: var(--ndf-font) !important;
  font-size: var(--fs-button) !important;
  font-weight: var(--fw, 500) !important;
  line-height: 100% !important;
  letter-spacing: 0.04em !important; /* = 0.04rem 1rem juures */
}

/* Menüü */
#top-menu a,
.et_pb_menu .et-menu a,
.et_pb_menu .et-menu-nav a,
.et_mobile_menu a {
  font-family: var(--ndf-font) !important;
  font-size: var(--fs-menu) !important;
  font-weight: var(--fw, 500) !important;
  color: #140B00;
  line-height: 100% !important;
  letter-spacing: 0.08em !important; /* = 0.12rem 1.5rem juures */
  text-transform: uppercase !important;

  padding-bottom: 2px !important;
  border-bottom: 2px solid transparent !important;
  transition: border-color 0.2s ease;
}

#top-menu a:hover,
#top-menu a:focus-visible,
.et_pb_menu .et-menu a:hover,
.et_pb_menu .et-menu a:focus-visible,
.et_pb_menu .et-menu-nav a:hover,
.et_pb_menu .et-menu-nav a:focus-visible,
.et_mobile_menu a:hover,
.et_mobile_menu a:focus-visible {
  border-bottom-color: #FFB442 !important;
  outline: none;
}

/* Lingid ja nupud: nähtav fookus klaviatuuriga liikujale */
a:focus-visible,
button:focus-visible,
.et_pb_button:focus-visible {
  outline: 2px solid #FFB442;
  outline-offset: 3px;
}

/* ==========================================================================
   Font weight klassid Divi 5 visual builderi jaoks
   Kasutus: Advanced → Attributes → + Add Attribute → name: class, value: fw-600
   Klassi võib panna sektsioonile, reale, veerule või moodulile –
   väärtus kehtib kõigele selle sees. Lähim (sisemine) klass võidab.
   ========================================================================== */

.fw-400 { --fw: 400; }
.fw-500 { --fw: 500; }
.fw-600 { --fw: 600; }

/* Klassiga elemendi enda tekst (kui sees pole p/h1/h2 jne) */
.fw-400,
.fw-500,
.fw-600 {
  font-weight: var(--fw) !important;
}

/* ==========================================================================
   BACK to TOP button
   ========================================================================== */

/***BACK to TOP button - START***/
.et_pb_scroll_top.et-pb-icon {
background: #140B00;
}
/* Back-to-top button hover background color*/
.et_pb_scroll_top.et-pb-icon:hover {
background: #727272;
}
/* Back-to-top button border radius*/
.et_pb_scroll_top.et-pb-icon {
border-radius:100px;
}

/* ==========================================================================
   H1 abiklassid (Divi 5: Advanced → Attributes → class)
   ========================================================================== */

/* Iga sõna eraldi real – üks pealkiri, aga kujundus nagu mitu rida */
#page-container .ndf-stack h1,
#page-container .ndf-stack h2,
#page-container .ndf-stack p {
  word-spacing: 100vw;
}

/* Suur dekoratiivne tekst Text-moodulis: näeb välja nagu H1, aga ei ole pealkiri */
#page-container .ndf-display,
#page-container .ndf-display p {
  font-family: var(--ndf-font) !important;
  font-size: var(--fs-h1) !important;
  font-weight: var(--fw, 500) !important;
  line-height: 100% !important;
  letter-spacing: -0.03em !important;
  padding-bottom: 0 !important;
}

/* Päris H1, mis näeb välja nagu H2 */
#page-container .ndf-h2-look h1 {
  font-size: var(--fs-h2) !important;
  font-weight: var(--fw, 400) !important;
  letter-spacing: 0.02em !important;
}