/*
 * Theme Name: fdl
 * Template: twentytwentyfive
 * Version: 1.0
 * Author: Toi
 */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #2f4f3e;
    --color-background: #f4efe7;
    --color-surface: #d9c7b8;
    --color-text: #1a1a1a;
    --color-accent: #c89b3c;
    --color-accent: oklch(0.60 0.12 82.43);
    --color-blush: #e8d4d0;
    --color-sage: #c9d5c1;

    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', 'Montserrat', system-ui, -apple-system, sans-serif;

    --max-width: 1280px;
    --spacing-page: clamp(1rem, 5vw, 3rem);
}

html {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: 80px;
}

body {
    min-height: 100vh;
    background-color: var(--color-background);
    display: flex;
    flex-direction: column;

    &.admin-bar {
        min-height: calc(100vh - 32px);
    }

    &>.wp-site-blocks {
        flex: 1;
        display: flex;
        flex-direction: column;

        header {
            background-color: var(--color-background);
            border-bottom: 1px solid var(--color-surface);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        footer {

            background-color: var(--color-primary);
            color: var(--color-background);
            margin-top: auto;
        }
    }
}

main {

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        margin-block-start: 1em;
        margin-block-end: 0.4em;
    }

    h1,
    h2 {
        font-family: var(--font-heading);
        font-weight: 400;
        line-height: 1.2;
    }

    h1 {
        font-size: 32px;
        font-weight: bold;
        color: var(--color-primary);
        font-size: clamp(2rem, 5vw, 3.5rem);
    }

    h2 {
        font-size: 26px;
        color: var(--color-accent);
        text-transform: uppercase;
    }

    h3 {
        font-size: 18px;
        font-weight: bold;
        color: var(--color-primary);
    }

    h3,
    h4,
    h5,
    h6 {
        font-family: var(--font-body);
    }

    p {
        margin-bottom: 8px;

    }


    p+p {
        margin-top: 8px;
    }

    ul {
        padding-inline-start: 2em;
    }

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

    a {
        color: inherit;
    }

    table {
        background-color: var(--color-accent);
        border-spacing: 1px;
    }

    thead th {
        background-color: var(--color-surface);
        padding-block: 0.25rem;
    }

    tbody {
        background: var(--color-background);

        th {
            background-color: var(--color-surface);
        }

        th,
        td {
            padding: 6px 12px;
        }
    }
}

/*----- CUSTOM ----*/

#hero {
    height: 300px;
    position: relative;
    justify-content: center;
    align-items: center;
    display: flex;
    margin-bottom: 60px;
    z-index: 0;
    flex-direction: column;
    gap: 2rem;

    h1 {
        margin: 0;
    }

    &::before {
        position: absolute;
        inset: 0;
        content: '';
        background-image: url('assets/images/hero.webp');
        background-size: cover;
        filter: saturate(0.5);
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.4;
        z-index: -1;
    }
}

.wp-block-site-title {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-weight: 400;

    a {
        text-decoration: none;
    }
}

.woocommerce.product main,
main {
    margin-block: var(--wp--preset--spacing--60);
}

footer {

    .footer_inner {
        margin: 0 auto;
        padding: 2.5rem var(--spacing-page);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        text-align: center;
    }

    nav a {
        font-size: 0.875rem;
    }

    .footer_copy {
        font-size: 0.75rem;
        color: var(--color-sage);
    }

    .wp-block-site-title {
        font-size: 18px;
        color: white;
    }
}

h1.wp-block-heading,
.wp-block-post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.list-post-preview {
    ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
        gap: 1.5rem;
    }

    li {
        container-type: inline-size;
        margin-block: 0;
    }
}

.post-preview {
    height: 100%;
    display: flex;
    /* border: 1.5px solid var(--color-surface); */
    /* border-left: 3px solid var(--color-accent); */
    background: white;
    position: relative;

    /* start - Make the card clickable */
    .wp-block-post-title a::after {
        content: '';
        position: absolute;
        inset: 0;
        /* couvre toute la carte */
        z-index: 1;
    }

    .wp-block-post-terms {
        position: relative;
        z-index: 2;
    }

    /* end - Make the card clickable */

    .card-cover {

        flex: 0 0 160px;
        width: 160px;
        aspect-ratio: unset;
        max-height: unset;
        align-self: stretch;

        &:empty {
            display: none;
        }

        figure,
        img {
            height: 100%;
            object-fit: cover;
        }
    }

    .card-body {
        flex: 1 1;
        padding: 1.75rem 2rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;

        time {
            display: inline-block;
            margin-bottom: 0.5em;
        }

        h2 {
            font-size: 1.125rem;
            font-family: var(--font-body);
            font-weight: 600;
            text-transform: none;
            color: var(--color-text);
            margin-top: 0;
        }
    }

    flex-direction: column;

    .card-cover {
        width: 100%;
        height: 120px;
    }

}

.taxonomy-post_tag {
    margin-top: .75rem;

    a {
        border: none;
        font-size: .75rem;
        font-weight: 600;
        letter-spacing: .05em;
        text-transform: uppercase;
        color: var(--color-primary);
        background-color: var(--color-sage);
        padding: .2rem .6rem;
        border-radius: 2px;
    }
}

/*---- WOOCOMMERCE ----*/

body {

    --wc-form-border-color: #ebddcd;
    /* --wc-form-color-background: #f3ebe0;
    --wc-form-color-background: var(--color-background); */
    /* --wc-form-border-width: 0px; */
}

.wp-element-button {
    --wp--preset--color--contrast: var(--color-primary);
    display: inline-block;

    &[data-variant="accent"] {

        --wp--preset--color--contrast: var(--color-accent);
    }
}

.woocommerce form.woocommerce-form {

    background: #ebddcd;
    background: #f3ebe0;
    background: white;
    border: none;
}

.product .wp-block-woocommerce-product-details .tabs {
    display: none;
}