/*
Theme Name: Rizzoli
Theme URI: https://kishmish.com
Author: Kishmish
Author URI: https://kishmish.com
Description: Rizzoli theme.
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 7.2
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rizzoli
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, style-variations, accessibility-ready, blog, portfolio, news
*/

@import 'shared.css';

:root {
    --swiper-navigation-sides-offset: 135px;
    --gf-form-gap-y: 1px;
    --form_input_height: 40px;
}

html, body {
    overflow-x: hidden;
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* HELPER CLASSES --------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------------------ */

.show-mobile-only { display: none !important; }
.show-desktop-only { display: flex !important; }
.show-desktop-only-block { display: block !important; }

@media (max-width: 781px) {
    .show-mobile-only { display: block !important; }
    .show-mobile-only-flex { display: flex !important; }
    .show-desktop-only, .show-desktop-only-block { display: none !important; }
    .mobile-column-reverse { flex-direction: column-reverse; }
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* MOBILE NAV ------------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------------------ */

.has-modal-open .admin-bar .is-menu-open .wp-block-navigation__responsive-dialog {
    margin-top: 0 !important;
}

@media (max-width: 1110px) {
    :root {
        --swiper-navigation-sides-offset: 20px;
    }

    header {
        top: 0 !important;
    }

    .title-bar-block {
        top:58px;
        padding: 0 14px 8px;
        h2 {
            font-size: 17px !important;
        }
        .toggle-offcanvas-sidebar a {
            font-size: 0;
            display: flex;
            align-items: center;
        }
        .rizzoli-recommends-title-bar {
            gap: 2px !important;
            p {
                font-size: 12px !important;
            }
        }
    }

    #sort-filter-books-grid {
        .book-wrapper {
            padding: 2.5rem 12px 0 !important;
            margin: 0 auto !important;
            min-height: 0 !important;
            .grid-book-content {
                min-height: 0 !important;
            }
            .book-block-img {
                width: 366px !important;
                height: auto !important;
            }
        }
    }

    #post-archive-grid {
        padding: 2.5rem 12px 0;
        .article-container {
            margin-bottom: 0 !important;
        }
        article {
            margin-top: 0 !important;
        }
        .grid-image {
            display: flex;
            justify-content: center;
            img {
                width: 100% !important;
                height: 230px !important;
            }
        }
        .grid-title {
            margin-bottom: 0 !important;
        }
    }

    #sub-header-controls {
        display: none;
    }

    #sort-filter-events-grid {
        padding: 0 12px;
        * {
            min-height: 0 !important;
        }
        .event-wrapper {
            padding-bottom: 0 !important;
        }
        .event-columns {
            flex-direction: column-reverse;
            height: auto !important;
            gap: 0;
            .wp-block-column {
                height: auto !important;
            }
            .event-details-column {
                display: flex;
                flex-direction: column;
                align-items: center;
                .book-title {
                    text-align: center;
                    margin-bottom: 10px !important;
                }
                .event-location {
                    font-weight: 400 !important;
                }
                p {
                    text-align: center;
                }
            }
            .event-image-column {
                justify-content: center !important;
                img {
                    width: 366px !important;
                    height: auto !important;
                }
            }
            .event-date-column {
                display: none;
            }
        }
    }
    .sidebar-container {
        padding: 1rem !important;
        .custom-select {
            max-width: 100% !important;
        }

        .input-label, .author-input, .title-input, .location-input {
            margin-bottom: 0 !important;
        }
        .date-inputs {
            margin-bottom: 1rem;
            input {
                width: 130px !important;
            }
        }
        .calendar-block {
            padding: 0 1rem;
        }
    }

    .home-featured-books {
        margin-bottom: 35px !important;
        .grid-3-2 {
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            img {
                height: 168px !important;
                margin: 0 0 10px 0 !important;
            }
            .book-block-title {
                font-size: 14px !important;
                margin-bottom: 0.5rem !important;
            }
            .book-block-author {
                font-size: 12px !important;
            }
            margin-bottom: 33px !important;
        }
        .view-all {
            a {
                font-size: 13px !important;
                display: flex;
                align-items: baseline;
                padding: 12px 18px 10px;
            }
            img { height: 10px !important; }
        }
    }
    .home {
        .featured-book {
            .wp-block-cover__inner-container {
                padding: 0 !important;
            }
        }
        .wp-block-gutsliders-any-content {
            .swiper-wrapper {
                height: 460px !important;
            }
            .wp-block-gutsliders-slide {
                .swiper-container-outer {
                    .gutslider-content-inner {
                        padding: 0;
                        .gutslider-content-inner-group {
                            align-items: start;
                        }
                    }

                    .book-block-img {
                        height:196px !important;
                        max-width:220px !important;
                        margin-bottom: 20px;
                    }
                    .future-publications-column-group {
                        align-items: center;
                        padding: 20px 15px 0 !important;

                        .heading-group {
                            justify-content: space-between;
                            margin-bottom: 20px !important;
                            .future-publications-title {
                                flex-basis: fit-content;
                            }
                            .wp-block-buttons {
                                flex-basis: fit-content;
                                display: inline-block;
                                text-align: right;
                                padding-left: 7px;
                                .wp-block-button__link {
                                    padding: 0;
                                    img {
                                        display: none;
                                    }
                                }
                            }
                        }
                        .future-publications-title {
                            margin: 0;
                            font-size: 20px !important;
                        }
                        .book-title { font-size: 14px !important; }
                        .book-author {
                            font-size: 11px !important;
                            margin-bottom: 10px !important;
                        }
                        .book-description {
                            font-size: 14px !important;
                            text-align: center;
                        }
                    }
                }
            }
        }
    }

    .rizzoli-recommends {
        padding: 0;

        .wp-block-columns {
            flex-direction: column-reverse;
        }
        .cover-image {
            img {
                height: 200px !important;
                object-fit: cover !important;
                object-position: bottom center !important;
            }
        }
        .content-column {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            margin-bottom: 2rem;
            padding: 0 2rem;
            .rr-title {
                border-bottom: 4px double black;
            }
            * {
                text-align: center;
                margin: 0 !important;
            }
        }

    }

    .rizzoli-bookstore {
        min-height: 259px !important;
        .wp-block-cover__inner-container {
            padding: 0 !important;
        }
        .rb-title {
            font-size: 26px !important;
            margin-top: 0 !important;

        }
        .rb-button {
            a {
                font-size: 10px !important;
                img {
                    width: 16px !important;
                    height: 10px !important;
                }
            }
        }
    }

    .featured-event {
        margin-bottom: 3rem !important;
        .column-wrapper {
            flex-direction: column-reverse;
        }
        .content-column {
            display: flex;
            flex-direction: column-reverse;
            .book-author {
                font-size: 12px !important;
            }
        }
        .image-column {
            img {
                width: 133px !important;
                height: 180px !important;
            }
        }
        .location-column {
            .book-title {
                font-size: 12px !important;
            }

            .event-date, .event-location {
                p {
                    font-size: 10px !important;
                }
            }
            .event-date, .event-location p {
                margin-top: 5px !important;
            }
            .event-date {
                display: flex;
                justify-content: center;
                gap: 6px;
                p {
                    letter-spacing: 3px !important;
                    margin: 0 !important;
                    font-family: brandon-grotesque, sans-serif !important;
                }
            }
        }
    }

    .home-quote {
        min-height: 259px !important;
        .wp-block-cover__inner-container { padding: 0 !important; }
        .quote-text { font-size: 19px !important;}
        .quote-name { font-size: 12px !important; }
    }

    .imprints-block {
        padding-left: 26px !important;
        padding-right: 26px !important;
        .imprints-grid {
            margin-top: 30px !important;
            margin-bottom: 50px !important;
        }
    }

    .category-guide-bar-inner {
        padding: 0 14px !important;
        .category-guide-bar-content {
            flex-direction: column;
            .category-name {
                align-self: flex-start;
            }
        }
    }

    .single-post {
        --wp--style--root--padding-left: 13px;
        --wp--style--root--padding-right: 13px;

        .post-hero {
            min-height: 50vh !important;
        }

        .post-suptitle {
            padding-top: 20px;
            .post-suptitle-row {
                gap: 10px;
                time, p { font-size: 10px !important; }
            }
        }

        p {
            font-size: 15px;
        }

        .category-guide-book {
            padding-left: 0;
            padding-right: 0;
            & > .wp-block-columns {
                gap: 15px;
            }

            .wp-block-columns-reversed {
                flex-direction: column-reverse;
            }

            .category-block-image {
                align-self: auto;
                figure {
                    width: 100%;
                    margin: 0 !important;
                }
                img {
                    height: auto !important;
                    width: 100% !important;
                    object-fit: cover !important;
                }
                p {
                    padding-left: var(--wp--style--root--padding-left);
                    padding-right: var(--wp--style--root--padding-right);
                }
            }

            .category-block-text {
                width: auto;
                padding-left: var(--wp--style--root--padding-left);
                padding-right: var(--wp--style--root--padding-right);
            }

            .category-block-buy-share {
                margin-top: 30px !important;
                .category-block-buy, .category-block-share {
                    flex-basis: auto !important;
                    width: auto;
                }
                .category-block-share {
                    justify-content: flex-end !important;
                    .wp-block-group {
                        gap: 20px !important;
                    }
                }
            }
        }

        .wp-block-cover {
            min-height: 200px !important;
        }

        .wp-block-columns {
            .wp-block-column {
                .wp-block-group {
                    p {
                        margin-top: 0px !important;
                        margin-bottom: 30px !important;
                        height: auto !important;
                    }
                }
            }
        }

        figure:has(a .book-block-img) {
            margin: 0 !important;
            width: 100% !important;
            a:has(.book-block-img) {
                width: 100% !important;
                .book-block-img {
                    margin: 0 !important;
                    width: 100% !important;
                    height: auto !important;
                }
            }
        }

        .book-cta-img {
            width: 100% !important;
            height: auto !important;
        }
    }

    .mobile-height-2rem {
        height: 2rem !important;
    }

    .mobile-column-reverse {
        flex-direction: column-reverse;
    }

    .mobile-nowrap {
        flex-wrap: nowrap !important;
    }

    .day-calendars {
        .wp-block-columns {
            justify-content: space-between;
            .wp-block-column {
                max-width: 45%;
            }
        }
    }

    .wall-calendars {
        .wp-block-group.is-layout-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .calendar-iframe {
        padding-top: 327px !important;
    }

    .merch-grid {
        grid-template-columns: repeat(1, 1fr);
        img {
            object-fit: contain !important;
            width: 100% !important;
            height: auto !important;
        }
    }

    .responsive-cover {
        min-height: 224px !important;
    }

    .single-book-cover-info {
        padding: 50px 22px;
        & > .wp-block-columns {
            margin-bottom: 0 !important;
        }

        .single-book-image {
            img {
                height: 335px !important;
                object-fit: contain !important;
            }
        }
        .single-book-info {
            padding-left: 0 !important;
            padding-right: 0 !important;
            h2 {
                font-size: 26px !important;
                margin-bottom: 4px;
            }
            .single-book-author p {
                font-size: 16px !important;
            }
            .single-book-look-buy-buttons {
                margin-top: 30px;
                .wp-block-buttons {
                    gap: 0 !important;
                    justify-content: space-between;
                    width: 100%;
                }
            }
            .content {
                font-size: 15px !important;
                &:not(.expanded) {
                    max-height: 70px !important;
                }
            }
            .single-book-meta {
                font-size: 12px !important;
            }
        }
    }

    .single-book {
        details {
            margin-top: 0 !important;
            margin-bottom: 0 !important;
            summary {
                font-size: 15px !important;
                padding: 1rem 0 !important;
            }
            & > div {
                padding: 0 !important;
                margin-block-start: 0 !important;
                font-size: 15px !important;
                flex-wrap: wrap !important;
            }
            img {
                width: auto !important;
                height: 200px !important;
            }
        }
    }
}
@media (max-width: 781px) {
    header {
        .nav-menu {
            height: 58px;
            .header-content {
                flex-direction: row-reverse;
                height: 58px;
                padding: 0 !important;
                & > a {
                    height: 36px;
                    #RIZZOLI_LARGE_LOGO_HOME_PAGE {
                        width: 90px;
                        height: 36px;
                    }
                }
            }
            .wp-block-navigation__responsive-container-close {
                display: none;
            }
            .wp-block-navigation__container {
                gap: 1rem;
            }
        }

        #nav-search-link {
            display: none;
        }
    }

    .arch-row {
        width: fit-content;
        background: none;
        border-bottom: 4px double black;
        gap: 10px;
        min-height: 0 !important;
        margin-top: 42px !important;
        margin-bottom: 35px !important;
        div {
            display: none;
        }
        p {
            padding: 0 !important;
            margin: 0 !important;
        }
    }
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* HEADER/FOOTER ---------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------------------ */

.admin-bar {
    header {
        &.scrolled {
            top: 0 !important;
        }
        &.top {
            top: 46px !important;
        }
    }
}

header {
    position: fixed;
    width: 100%;
    z-index:10;

    .header-content {
        height:99px;
    }

    &.top {
        .header-content {
            min-height:148px;
        }
    }

    .wp-block-outermost-mega-menu {
        .wp-block-outermost-mega-menu__menu-container {
            &.menu-width-full {
                position: fixed;
                top: auto !important;
                transform: translateY(39px);
                left: 0 !important;
                max-width: none !important;
                width: 100vw !important;
            }
        }
    }

    button:hover, a:hover {
        color: #957d2f; !important;
    }

    @media (max-width: 781px) {
        /* shrinks header height on mobile */
        .nav-menu {
            height: 58px;
            .header-content {
                height: 58px;
                padding: 0 !important;
                & > a {
                    height: 36px;
                    #RIZZOLI_LARGE_LOGO_HOME_PAGE {
                        height: 36px;
                    }
                }
            }
        }

        .wp-block-navigation__container {
            gap: 1rem;
        }

        #nav-search-link {
            display: none;
        }
    }
}

.nav-wrapper {

    &:has( > div.is-position-sticky) {
        top: calc(0px + var(--wp-admin--admin-bar--height, 0px));
        position: sticky;
        z-index: 10;
    }

    .call-us-nav-text {
        display: none;
        padding: 1rem 0;
        @media (max-width: 383px) {
            width: 200px;
        }
    }

    .nav-menu {
        a, button {
            transition: color 0.5s ease-in-out;
            &:hover {
                color: #767676;
            }
        }
    }

    .nav-text {
        z-index: 10;
    }

    .nav-phone-icon {
        cursor: pointer;
        margin-left: 20px;
    }

    .wp-block-navigation {
        .wp-block-navigation-submenu {
            border: none !important;
            padding: 1rem;
        }

        .has-child .wp-block-navigation__submenu-container {
            transition: opacity 0.5s linear !important;
        }
    }
}

@media (min-width: 1111px) {
    .admin-bar {
        header {
            top: 32px !important;
        }
        .title-bar-block {
            top:131px;
        }
    }

    .title-bar-block {
        top: 99px;
    }
}

.title-bar-block {
    position:fixed;
    z-index:9;
    width:100%;
}

.imprints-grid {
    row-gap: 2rem;
    figure {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* ------------------------------------------------------------------------------------------------------------------ */
/* DROP SHADOWS ----------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------------------ */

.wp-block-cover {
    h2, h3, p {
        filter: drop-shadow(0px 0px 10px #222);
    }
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* HOME PAGE -------------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------------------ */

.home header {
    &.scrolled {
        filter: drop-shadow(0px -5px 10px #ccc);
    }
    &:not(.scrolled) {
        filter: drop-shadow(0px 0px 10px #222);
    }

    @media (min-width: 782px) {
        &.top {
            nav {
                button, .wp-block-navigation-item__label {
                    color: white;
                    &:hover {
                        color: var(--wp--preset--color--gold);
                    }
                }
            }
        }
    }

    @media (max-width: 781px) {
        &.top {
            .wp-block-navigation__responsive-container-open {
                color: white;
            }
        }
    }
    div .nav-menu {
        transition: background-color 300ms ease;

        svg#nav-search {
            g path {
                fill: black !important;
                transition: fill 300ms ease;
            }
        }
        svg#RIZZOLI_LARGE_LOGO_HOME_PAGE {
            transition: height, width 1s ease;
            g path {
                transition: fill 1s ease;
            }
        }
    }
    &:not(.scrolled) div .nav-menu {
        background-color: #F7F6F400 !important;

        svg#nav-search {
            g path {
                fill:#ffffff !important;
            }
        }
        svg#RIZZOLI_LARGE_LOGO_HOME_PAGE {
            width: 244px;
            height: 98px;
            g path {
                fill:#ffffff !important;
            }
        }
    }
}

/* this moves the button to the bottom of "hero, full width image" blocks */
.main-hero {
    background-color: black;
    .wp-block-cover__inner-container {
        position: absolute !important;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;

        .position-bottom {
            position: absolute;
            bottom: 50px;
        }
    }
}

body {
    .main-hero {
        img {
            transition: opacity 5s ease 900ms;
        }
        h2 {
            transition: opacity 6500ms ease;
        }
    }
    &.veiled {
        .main-hero {
            img {
                opacity: 0;
            }
            h2 {
                opacity: 0;
            }
        }
    }
}

.featured-event {
    .location-column {
        .event-date {
            p {
                margin: 0 !important;
            }
        }
    }
}


/* ------------------------------------------------------------------------------------------------------------------ */
/* MERCH PAGE ------------------------------------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------------------------------------------------ */
.merch-block {
    &.m340-363 {
        img {
            width: 340px;
            height: 363px;
        }
    }

    &.m505-673 {
        img {
            width: 505px;
            height: 673px;
        }
    }

    &.m500-500 {
        img {
            width: 500px;
            height: 500px;
        }
    }

    img {
        object-fit: cover;
    }
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* COMPONENT STYLING ------------------------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------------------------------------ */

.book-block-img, .hover-zoom {
    transition: scale 100ms ease-in-out;
    &:hover {
        scale: 1.05;
    }
}

a, button {
    transition: color 300ms ease;
}

/* button style for hover state */
.button-arrow-black {
    a {
        transition: color 500ms ease-in-out, background-color 500ms ease-in-out, border-color 500ms ease-in-out;
        img {
            transition: filter 500ms ease-in-out;
        }
        &:hover {
            background-color: black !important;
            color: #f7f6f4 !important;
            border-color: #f7f6f4 !important;
            img {
                filter: invert(1);
            }
        }
    }
}

.button-hover {
    a {
        transition: filter 500ms ease-in-out;
        img {
            transition: filter 500ms ease-in-out;
        }
        &:hover {
            filter: invert(1);
        }
    }
}

.gform_fields {
    overflow-x: clip;
}

/* Focus styles */
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}

/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
    text-decoration-thickness: 1px !important;
    text-underline-offset: .1em;
}

/*
 * Progressive enhancement to reduce widows and orphans
 * https://github.com/WordPress/gutenberg/issues/55190
 */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}
