/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:root {
    /* colors */
    --background-color: #ffffff;
    --light-color: #f8f8f8;
    --dark-color: #505050;
    --text-color: #131313;
    --link-color: #3b63fb;
    --link-hover-color: #1d3ecf;
    --overlay-background-color: #f6f6f6;
    --border-color: #dadada;
    --black: #000000;
    --white: #ffffff;
    --gray-light: #eeeeee;
    --shadow-light: #00000010;
    --shadow-medium: #00000030;
    --shadow-dark: #00000060;

    /* fonts */
    --body-font-family: roboto, roboto-fallback, sans-serif;
    --heading-font-family: roboto-condensed, roboto-condensed-fallback,
        sans-serif;

    /* body sizes */
    --body-font-size-m: 22px;
    --body-font-size-s: 19px;
    --body-font-size-xs: 17px;

    /* heading sizes */
    --heading-font-size-xxl: 55px;
    --heading-font-size-xl: 44px;
    --heading-font-size-l: 34px;
    --heading-font-size-m: 27px;
    --heading-font-size-s: 24px;
    --heading-font-size-xs: 22px;

    /* spacing */
    --spacing-xs: 8px;
    --spacing-s: 16px;
    --spacing-m: 24px;
    --spacing-l: 32px;
    --spacing-xl: 40px;

    /* border radius */
    --border-radius-s: 0.5rem;
    --border-radius-m: 1rem;
    --border-radius-l: 2.4rem;

    /* transitions */
    --transition-fast: 0.18s;
    --transition-normal: 0.2s;
    --transition-slow: 0.3s;

    /* container widths */
    --container-max-width: 1200px;
    --article-max-width: 900px;
    --embed-max-width: 800px;
    --embed-youtube-max-width: var(--embed-max-width);

    /* gaps */
    --gap-s: 0.5rem;
    --gap-m: 1rem;
    --gap-l: 1.5rem;

    /* nav heights */
    --nav-height: 64px;
    --breadcrumbs-height: 34px;
    --header-height: var(--nav-height);

    /* breakpoints */
    --desktop-breakpoint: 900px;
}

* {
    box-sizing: border-box;
}

/* fallback fonts */
@font-face {
    font-family: roboto-condensed-fallback;
    size-adjust: 88.82%;
    src: local("Arial");
}

@font-face {
    font-family: roboto-fallback;
    size-adjust: 99.529%;
    src: local("Arial");
}

@media (min-width:900px) {
    :root {
        /* body sizes */
        --body-font-size-m: 18px;
        --body-font-size-s: 16px;
        --body-font-size-xs: 14px;

        /* heading sizes */
        --heading-font-size-xxl: 45px;
        --heading-font-size-xl: 36px;
        --heading-font-size-l: 28px;
        --heading-font-size-m: 22px;
        --heading-font-size-s: 20px;
        --heading-font-size-xs: 18px;
    }
}

/* ── Skip-to-content link ── */
.skip-to-content {
    background: var(--background-color);
    border: 2px solid var(--link-color);
    color: var(--link-color);
    font-size: var(--body-font-size-s);
    font-weight: 700;
    left: -9999px;
    padding: 0.5rem 1rem;
    position: absolute;
    top: 1rem;
    z-index: 9999;
}

.skip-to-content:focus-visible {
    left: 1rem;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    display: none;
    font-family: var(--body-font-family);
    font-size: var(--body-font-size-m);
    line-height: 1.6;
    margin: 0;
}

body.appear {
    display: block;
}

header {
    height: var(--header-height);
}

/* min-height reserves space on the outer <footer> tag from first paint so it
   never renders at 0 height while blocks/footer/footer.css (loaded async via
   loadCSS) and the footer fragment are still loading. This must live here —
   not in footer.css — because on light/fast pages first paint can happen
   before footer.css's own network request resolves, so a reservation placed
   there loses the race and the footer still visibly jumps from 0 to full
   height. min-height never clips content since real height can only grow
   past the floor. */
footer {
    min-height: clamp(260px, 390px, 500px);
}

@media (max-width: 599px) {
    [data-brand="lemaar"] footer {
        min-height: 935px;
    }
}

/* Reserve approximate height before decorate() runs — this must live here
   (loaded synchronously in <head>), not in article-list.css (loaded async
   via loadCSS() inside loadBlock()), because on first paint the raw
   authored block (just its config text, e.g. "4") can render before
   article-list.css's own network request resolves. A reservation placed
   there loses that race, so the block briefly renders at near-zero height
   and then jumps once its stylesheet + skeleton/data populate it — this
   was the dominant CLS culprit on /en/articles (footer/body/main shifting
   down). min-height never clips real content since it can only grow past
   the floor. */
.article-list:not([data-block-status="loaded"]) {
    min-height: clamp(600px, 80dvh, 1200px);
}

/* Same async-stylesheet race as .article-list above, for the PDP block.
   Reserve a full viewport-minus-nothing so sections rendered after this
   block always start below the fold; once GraphQL data arrives and the
   block inflates from loading → content, nothing in the viewport shifts.
   Lifted once data-state="loaded"/"error". */
.lemaar-product-detail:not([data-state="loaded"], [data-state="error"]) {
    min-height: 100dvh;
}

/* Same async-stylesheet race as above, for product-grid. Before JS sets
   data-state, reserve approximate grid height so the empty authored block
   doesn't shift content when decorate() inflates it. This one was the
   actual dominant CLS culprit on /en/products (footer/body/main shifting
   down) — the pagination/skeleton-count mismatch fixed separately in
   product-grid.js was real but secondary. */
.product-grid:not([data-state]) {
    min-height: clamp(600px, 80dvh, 1200px);
}

header .header,
footer .footer {
    visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
    visibility: visible;
}

body[data-breadcrumbs] {
    --header-height: calc(var(--nav-height) + var(--breadcrumbs-height));
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font-family);
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    margin-top: 0.8rem;
    scroll-margin: 40px;
}

h1 {
    font-size: var(--heading-font-size-xxl);
}

h2 {
    font-size: var(--heading-font-size-xl);
}

h3 {
    font-size: var(--heading-font-size-l);
}

h4 {
    font-size: var(--heading-font-size-m);
}

h5 {
    font-size: var(--heading-font-size-s);
}

h6 {
    font-size: var(--heading-font-size-xs);
}

p,
dl,
ol,
ul,
pre,
blockquote {
    margin-bottom: 0.25rem;
    margin-top: 0.8rem;
}

code,
pre {
    font-size: var(--body-font-size-s);
}

pre {
    background-color: var(--light-color);
    border-radius: 8px;
    overflow-x: auto;
    padding: 16px;
    white-space: pre;
}

input,
textarea,
select,
button {
    font: inherit;
}

/* links */
a:any-link {
    color: var(--link-color);
    overflow-wrap: break-word;
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* buttons */
a.button:any-link,
button {
    background-color: var(--link-color);
    border: 2px solid transparent;
    border-radius: 2.4rem;
    box-sizing: border-box;
    color: var(--background-color);
    cursor: pointer;
    display: inline-block;
    font-family: var(--body-font-family);
    font-style: normal;
    font-weight: 500;
    line-height: 1.25;
    margin: 12px 0;
    max-width: 100%;
    overflow: hidden;
    padding: 0.5rem 1.2rem;
    text-align: center;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.button:hover,
a.button:focus,
button:hover,
button:focus {
    background-color: var(--link-hover-color);
    cursor: pointer;
}

button:disabled,
button:disabled:hover {
    background-color: var(--light-color);
    cursor: unset;
}

a.button.secondary,
button.secondary {
    background-color: unset;
    border: 2px solid currentcolor;
    color: var(--text-color);
}

main img {
    height: auto;
    max-width: 100%;
    width: auto;
}

/* Rich Text Editor Formatting Support */

/* Text Alignment - using data attributes */
[data-align="left"],
.text-left {
    text-align: left;
}

[data-align="center"],
.text-center {
    text-align: center;
}

[data-align="right"],
.text-right {
    text-align: right;
}

[data-align="justify"],
.text-justify {
    text-align: justify;
}

/* Text Direction - using data attributes */
[data-direction="rtl"],
.text-rtl {
    direction: rtl;
}

[data-direction="ltr"],
.text-ltr {
    direction: ltr;
}

/* Indentation - using data attributes */
[data-indent="1"],
.indent {
    margin-left: 2rem;
}

[data-indent="2"],
.indent-2 {
    margin-left: 4rem;
}

[data-indent="3"],
.indent-3 {
    margin-left: 6rem;
}

/* Text Formatting */
u {
    text-decoration: underline;
}

del,
s,
strike {
    text-decoration: line-through;
}

sup {
    font-size: 0.75rem;
    line-height: 0;
    position: relative;
    top: -0.5rem;
    vertical-align: baseline;
}

sub {
    bottom: -0.25rem;
    font-size: 0.75rem;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

/* Code Block (already exists above, enhanced here) */
code {
    background-color: var(--light-color);
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    padding: 2px 6px;
}

.icon {
    align-items: center;
    display: flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.icon img {
    height: 100%;
    width: 100%;
}

/* sections */
main > .section {
    padding: 1rem 0;
}

main > .section > div {
    margin: auto;
    max-width: var(--container-max-width);
    padding: 0 var(--spacing-m);
}

main > .section:first-of-type {
    margin-top: 0;
}

@media (min-width:900px) {
    main > .section > div {
        padding: 0 var(--spacing-l);
    }
}

/* section metadata */
main .section.columns-30-70 {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
}

main .section.light,
main .section.highlight {
    background-color: var(--light-color);
    margin: 0;
    padding: var(--spacing-xl) 0;
}

@media (max-width: 899px) {
    main .section.hide-mobile,
    main .section[data-visibility="hide-mobile"] {
        display: none !important;
    }
}

@media (min-width: 900px) {
    main .section.hide-desktop,
    main .section[data-visibility="hide-desktop"] {
        display: none !important;
    }
}

/* column control stylings */
.columns-container .columns-wrapper .columns-5050 > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.columns-container .columns-wrapper .columns-3070 > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.columns-container .columns-wrapper .columns-7030 > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

main .section.columns-30-70 > div:first-child {
    width: 30%;
}

main .section.columns-30-70 > div:last-child {
    width: 70%;
}

main .section.columns-30-70 .rich-text-wrapper {
    margin: 0 auto;
}

.columns-container .columns-wrapper .columns-5050 > div > div:nth-child(1) {
    flex-grow: 1;
}

.columns-container .columns-wrapper .columns-5050 > div > div:nth-child(2) {
    flex-grow: 1;
}

.columns-container .columns-wrapper .columns-3070 > div > div:nth-child(1) {
    flex-grow: 1;
}

.columns-container .columns-wrapper .columns-3070 > div > div:nth-child(2) {
    flex-grow: 3;
}

.columns-container .columns-wrapper .columns-7030 > div > div:nth-child(1) {
    flex-grow: 3;
}

.columns-container .columns-wrapper .columns-7030 > div > div:nth-child(2) {
    flex-grow: 1;
}
