/**
 * Applari.fi: what this site adds to or changes in the base theme.
 *
 * Loaded last on the front end and in the editor canvas. The base theme's
 * files stay as they are, so later base theme fixes merge cleanly; anything
 * site-specific that is not a block of its own lives here, in sections:
 *
 *   1. Dark green palette (.dark-color-section), the site's third palette
 *   2. Layout values that differ from the base theme
 *   3. Typography that differs from the base theme
 *   4. Legacy utility classes still used in this site's content
 *   5. Small site-wide content styles (selling points, numbered lists …)
 *   6. Article and post template tweaks
 *   7. Header and the off-canvas menu
 *   8. Forms
 *   9. Footer
 *
 * Colors and fonts themselves are in colors.css and typography.css.
 */

/* ---------- 1. Dark green palette ---------- */

/* Same rules as base.css gives .wrapper-alternate-color and
   .wrapper-extra-color. Variables in colors.css. */
.dark-color-section {
    color: var(--font-clr);
}

.gb-container.dark-color-section {
    background-color: var(--bg-clr);
}

.dark-color-section .gb-container {
    background-color: unset;
}

/* base.css drops the top padding of the second of two sections with the same
   palette, and treats a section without a wrapper class as the default
   palette. A dark section is not the default palette, so it keeps its top
   padding after a white section, and a white section keeps it after a dark
   one. Two dark sections in a row share one gap. */
.gb-container.color-section:not(.wrapper-alternate-color):not(.wrapper-extra-color):not(.dark-color-section)
  + .gb-container.color-section.dark-color-section,
.gb-container.color-section.dark-color-section
  + .gb-container.color-section:not(.wrapper-alternate-color):not(.wrapper-extra-color):not(.dark-color-section) {
    padding-top: var(--section-padding-y);
}

.gb-container.color-section.dark-color-section
  + .gb-container.color-section.dark-color-section {
    padding-top: 0;
}

/* A container that keeps a white surface inside a colored section (cards,
   mockups). After the nested-container resets above and in base.css, which
   have the same specificity. */
.gb-container.surface-white {
    background-color: var(--body-bg-clr);
}

/* ---------- 2. Layout ---------- */

:root {
    --default-margin-top: 80px;
    --default-margin-bottom: 80px;
}

/* Article blocks (content lift, summary) keep a gap below them. */
.article-block {
    padding-bottom: 40px;
}

/* ---------- 3. Typography ---------- */

/* Links are semi-bold and do not scale with the surrounding text. */
a {
    font-size: 1rem;
    font-weight: 600;
}

@media only screen and (min-width: 1280px) {
    h2.larger-h2 {
        font-size: 4rem;
    }
}

/* "dark-green" was a GeneratePress global color before the palette came from
   colors.css (includes/setup/palette.php). Saved content still has its
   classes (the front page hero heading), and GP no longer prints them. */
.has-dark-green-color {
    color: var(--dark-green);
}

.has-dark-green-background-color {
    background-color: var(--dark-green);
}

/* Chain animations run at 0.4s on this site, whatever the block's own
   duration setting says (the old theme hardcoded it; the base theme honors
   the editor value, which is 0.6s in saved content). !important wins over
   the inline --animation-duration the render filter writes. */
.chain-animated {
    --animation-duration: 0.4s !important;
}

/* ---------- 4. Legacy utility classes ---------- */

/* Eyebrow above a section heading */
.sub-heading {
    margin-bottom: 0;
    font-size: 1.25rem;
    color: var(--link-clr);
}

/* The site's huge heading is smaller than the base theme's on phones. */
.huge-heading {
    font-size: 42px;
    line-height: 1em;
}

@media only screen and (min-width: 768px) {
    .huge-heading {
        font-size: 80px;
    }
}

@media only screen and (min-width: 1280px) {
    .huge-heading {
        font-size: 80px;
    }
}

/* Image focus position (use on the img) */
.object-position-bottom { object-position: bottom; }
.object-position-top { object-position: top; }
.object-position-center { object-position: center; }
.object-position-left { object-position: left; }
.object-position-right { object-position: right; }

/* Drawing on white with an orange wash (use on the img). With JS and
   .observe-visibility the wash sweeps in when the image scrolls into view. */
figure:has(> img.white-background),
figure:has(> img.orange-layer) {
    display: inline-grid;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    justify-items: center;
}

figure:has(> img.white-background) {
    background-color: var(--body-bg-clr);
}

figure > img.white-background {
    grid-area: 1 / 1;
    display: block;
    max-width: 100%;
    height: auto;
    filter: grayscale(1) contrast(300%);
}

figure:has(> img.orange-layer)::after {
    content: "";
    grid-area: 1 / 1;
    z-index: 1;
    justify-self: stretch;
    align-self: stretch;
    pointer-events: none;
    background-color: var(--orange);
    mix-blend-mode: screen;
}

.js figure:has(> img.orange-layer.observe-visibility)::after {
    -webkit-mask-image: linear-gradient(105deg, #000 40%, transparent 70%);
            mask-image: linear-gradient(105deg, #000 40%, transparent 70%);
    -webkit-mask-size: 280% 280%;
            mask-size: 280% 280%;
    -webkit-mask-position: 100% 0;
            mask-position: 100% 0;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    transition: mask-position 1s cubic-bezier(0.22, 0.61, 0.36, 1),
                -webkit-mask-position 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js figure:has(> img.orange-layer.observe-visibility.is-visible)::after {
    -webkit-mask-position: 0% 0;
            mask-position: 0% 0;
}

@media (prefers-reduced-motion: reduce) {
    .js figure:has(> img.orange-layer.observe-visibility)::after {
        transition: none;
        -webkit-mask-image: none;
                mask-image: none;
    }
}

/* Older content uses max-width-* from 768px on; the base theme starts them at
   990px. The misspelled max-widht-768 is still in some saved pages. */
@media only screen and (min-width: 768px) {
    .max-widht-768,
    .gb-container.max-widht-768 {
        max-width: 768px;
        margin: 0 auto;
    }
}

/* ---------- 5. Site-wide content styles ---------- */

/* A selling point under a service heading: thin orange rule above. The
   site's own on purpose; not converted to the base theme's cards. */
.selling-point {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--link-clr);
}

/* Small print under a call-to-action button */
.button-footnote {
    margin-top: 15px;
    font-size: 16px;
}

/* Text link under a lift card */
.lift-link {
    font-size: 13px;
}

/* Image captions in the title font */
figcaption {
    margin-top: 15px;
    font-family: var(--title-font);
    font-size: 13px;
    font-style: italic;
}

/* Numbered lists: big orange numbers in the title font */
ol.wp-block-list li::marker {
    font-family: var(--title-font);
    font-size: 20px;
    font-weight: bold;
    line-height: 0.7rem;
    color: var(--link-clr);
}

ol.wp-block-list li {
    margin-bottom: 20px;
    padding-left: 10px;
}

/* Article lists (post-list): the featured images are drawings on a white
   ground, so the whole drawing shows in the card instead of a cover crop. */
.post-item figure.gb-block-image img {
    object-fit: contain;
}

/* The site's list titles keep the h3 size (the base theme uses h4). The
   title link inherits it; the site's link rule (section 3) would fix it
   at 1rem. */
.post-item-title {
    font-size: var(--h3-size);
}

.post-item-title a {
    font-size: inherit;
    font-weight: inherit;
}

/* FAQ questions: regular weight instead of the base theme's 600. */
.accordion button.gb-accordion__toggle {
    font-weight: 400;
}

/* Process steps: dark green markers on a grey line, as the site's old
   applari-path had; orange stays for buttons and highlights. */
.process {
    --process-marker-bg: var(--heading-clr);
    --process-line-clr: var(--placeholder-clr);
}

@media only screen and (min-width: 990px) {
    figcaption {
        font-size: 15px;
    }

    .button-footnote {
        margin-top: 25px;
        font-size: 22px;
    }
}

/* ---------- 6. Article ---------- */

/* Images narrower than the reading column sit in its middle. */
.post-content img {
    margin: 0 auto;
}

/* Table of contents: lighter than the base theme (links are semi-bold
   site-wide above), so the list reads as a quiet aid. */
.post-toc {
    font-size: 0.875rem;
}

.post-toc a {
    padding: 5px 0 5px 12px;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.7;
    transition: border-color var(--transition-speed) var(--transition-timing-function),
                color var(--transition-speed) var(--transition-timing-function),
                opacity var(--transition-speed) var(--transition-timing-function);
}

.post-toc a:hover,
.post-toc a[aria-current="true"] {
    opacity: 1;
}

.post-toc a[aria-current="true"] {
    font-weight: 500;
}

/* ---------- 7. Header and the off-canvas menu ---------- */

/* "Jutellaan" link next to the menu: orange, as on the rest of the site.
   The transparent header (.header-wrap) keeps the base theme's hero colors,
   whose selectors are more specific. */
#site-navigation .quick-link a,
#sticky-navigation .quick-link a {
    font-size: 12px;
    color: var(--link-clr);
}

#site-navigation .quick-link a:hover,
#sticky-navigation .quick-link a:hover {
    color: var(--link-hover-clr);
}

/* The off-canvas menu is GP's full-screen overlay (Customizer: overlay
   mode), not the base theme's side panel: dark backdrop over the whole
   screen, orange top-level links without dividers, white sub-menu links.
   Colors in colors.css (--slideout-*). */
:root {
    --gp-slideout-width: 100%;
}

#generate-slideout-menu.slideout-navigation {
    box-shadow: none;
}

#generate-slideout-menu .inside-navigation {
    padding: 10% 10% 0;
}

#generate-slideout-menu .main-nav .slideout-menu > li {
    margin-bottom: 10px;
    border-bottom: 0;
}

#generate-slideout-menu .main-nav .slideout-menu > li > a {
    padding: 0 0 0 20px;
    font-size: 20px;
    line-height: 1.4em;
    color: var(--link-clr);
}

#generate-slideout-menu.main-navigation .main-nav ul ul.sub-menu.toggled-on {
    margin-top: 10px;
}

#generate-slideout-menu .sub-menu li a {
    margin-bottom: 10px;
    padding: 0 20px 0 30px;
    font-size: 16px;
}

#generate-slideout-menu .slideout-exit {
    top: 0;
    right: 10px;
}

/* ---------- 8. Forms ---------- */

/* WPForms runs with its full styling on this site (the base theme assumes
   "Base styling only"), so its submit button needs the theme colors with a
   selector stronger than WPForms' own. */
div.wpforms-container-full form.wpforms-form button[type="submit"][class~="wpforms-submit"] {
    background-color: var(--btn-bg);
    color: var(--btn-font-clr);
}

div.wpforms-container-full form.wpforms-form button[type="submit"][class~="wpforms-submit"]:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-font);
}

/* ---------- 9. Footer ---------- */

/* Link lists: centered and tight on phones, left aligned from 768px. */
.site-footer nav {
    align-items: center;
}

.site-footer .wp-block-navigation__container {
    align-items: center;
    gap: 0;
}

.site-footer .wp-block-navigation-item__content {
    padding: 0;
}

.socket-wrapper a {
    padding: 10px;
}

/* A page with its own contact form section (a landing page) hides the
   footer's duplicate, so the page keeps a single form. */
body:has(.site-main .contact-form-section) .site-footer .contact-form-section {
    display: none;
}

@media only screen and (min-width: 768px) {
    .site-footer nav,
    .site-footer .wp-block-navigation__container {
        align-items: flex-start;
    }
}
