/*
Theme Name: CNN Brasil Docs
Author: CNN Brasil Dev Team
Description: Tema para o site de documentação da CNN Brasil
Version: 0.1
Requires at least: 6.0.
Tested up to: 6.7.1.
Requires PHP: 8.0.
License: GPLv2.
*/

/* CSS Reset
---------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: inherit;
}

html {
    box-sizing: border-box;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

b,
strong {
    font-weight: var(--wp--custom--font-weight--semi-bold);
}

ol,
ul {
    padding: 0;
}

ol:where(:not([class*="wp-block"])),
ol:where(.wp-block-list),
ul:where(:not([class*="wp-block"])),
ul:where(.wp-block-list) {
    padding-inline-start: var(--wp--preset--spacing--medium);
}

div[class*="wp-block-"] figcaption {
    color: var(--wp--preset--color--secondary);
    font-size: var(--wp--preset--font-size--xs);
    margin-bottom: 0;
    margin-top: 20px;
    text-align: center;
}

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

/* Standardize form styling
--------------------------------------------- */

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

input[type="button"],
input[type="email"],
input[type="search"],
input[type="submit"],
input[type="text"],
textarea {
    -webkit-appearance: none;
}

input:not([type="submit"]),
select,
textarea,
.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea {
    color: var(--wp--preset--color--main);
    border-radius: 5px;
    border: solid 1px var(--wp--preset--color--main-accent);
    padding: .5em 1em;
    font-size: var(--wp--preset--font-size--small);
}

input:focus-visible,
textarea:focus-visible {
    outline-color: var(--wp--preset--color--primary);
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
    width: auto;
}

label {
    width: 100%;
    display: block;
}

::placeholder {
    color: var(--wp--preset--color--secondary);
    font-size: var(--wp--preset--font-size--small);
    opacity: 0.75;
}

/* Helper styles that can't be done via theme.json
---------------------------------------------------------------------------- */

a.more-link {
    display: block;
}

/* Inline code */
*:not(.wp-block-code) > code {
    background-color: var(--wp--preset--color--tertiary);
    font-weight: var(--wp--custom--font-weight--medium);;
    padding: 3px 5px;
    position: relative;
    border-radius: 3px;
}

/* Adjust terms at bottom of posts */
.single .wp-block-group .wp-block-post-terms,
.blog .wp-block-group .wp-block-post-terms {
    margin-bottom: -8px !important;
}

/* Remove margin on term description on archive pages */
.wp-block-term-description p:last-child {
    margin-bottom: 0;
}

/* Remove last separator on post list */
.remove-border-and-padding .wp-block-post-template li:last-child .wp-block-separator {
    display: none;
}

/* Hide post meta div if no tags assigned */
.single .wp-block-group:has(> .post-meta:empty) {
    display: none;
}

.wp-block-group:empty:has(+ .comment-respond) {
    display: none;
}

.row-logos > figure {
    flex-shrink: 1 !important;
}


/* Block editor page
---------------------------------------------------------------------------- */
.editor-visual-editor__post-title-wrapper.edit-post-visual-editor__post-title-wrapper {
    font-size: 32px;
}


/* Custom blocks
---------------------------------------------------------------------------- */
.admin-bar {
    .sidebar {
        top: 32px;
    }
}

.sidebar {
    top: 0;
    position: sticky;
}

.sidebar__logo {
    margin-inline: -32px;

    img {
        height: 145px;
        object-fit: cover;
    }
}

.sidebar__menu {
    .wp-block-navigation__container {
        width: 100%;
    }

    .wp-block-navigation-submenu {
        position: static !important;
        width: 100% !important;
        display: block !important;
        border: none !important;
        background: transparent !important;


        a {
            border: none !important;
            background: transparent !important;
        }
    }

    .wp-block-navigation-submenu__toggle {
        position: relative !important;
        width: 100%;

        &+ span {
            display: none
        }

        &::after {
            width: 8px;
            height: 8px;
            content: "";
            display: block;
            position: absolute;
            top: 10px;
            right: 0;
            border-top: 6px solid #525252;
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
        }

        &[aria-expanded=true] {
            &::after {
                transform: rotate(180deg)
            }
        }
    }
}

.post__meta {
    .wp-block-post-author {
        align-items: center;
    }

    .wp-block-post-author img,
    .wp-block-post-author .wp-block-post-author__avatar {
        width: 24px;
        height: 24px;
        margin-right: 4px;
        border-radius: 100%;
    }
}



/* Utilities
---------------------------------------------------------------------------- */
:root {
    --wp--custom--font-weight--semi-bold: bold;
}
.min-h-screen {
    min-height: 100vh;
}
