/*
Theme Name: Chicago 1924 Block Theme
Author: Pilot Digital
Author URI: http://pilotdigital.com
Tags: full-site-editing
Text Domain: chicago-1924-block
Requires at least: 5.8
Requires PHP: 7.4
Tested up to: 6.0
Version: 1.0.0

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

All files, unless otherwise stated, are released under the GNU General Public
License version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)
*/

/*--------------------------------------------------------------
# Global
--------------------------------------------------------------*/

:root {

    font-size: 1.125rem; /* 18px */
}

@media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

/* Typography
========================================================== */

body {
    text-rendering: optimizeLegibility;
}

.arrow-link,
.wp-block-query-pagination,
.wp-block-categories-list,
.wp-block-post-terms,
.wp-block-post-author,
.wp-block-post-date,
.wp-block-button__link,
.wp-block-quote cite,
form,
button,
.wp-block-search .wp-block-search__button,
input[type=button],
input[type="submit"],
.site-footer {
    font-family: var(--wp--preset--font-family--system);
}

/* Blockquotes ------------------------------------- */

.wp-block-quote p { 
    font-style: italic;
}

.wp-block-quote p:first-of-type::before {
    color: inherit;
    content: '\201C';
    display: inline-block;
    font-size: inherit;
    font-style: normal;
    text-indent: -0.5em;
}

::selection {
    background-color: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--foreground);
}

.wp-block-post-terms a {
    color: var(--wp--preset--color--tertiary);
}

.wp-block-post-title a,
.wp-block-image figcaption {
    color: var(--wp--preset--color--primary);
}

.has-foreground-background-color a,
.site-footer,
.site-footer a {
    color: white;
}

/*--------------------------------------------------------------
# Navigation
--------------------------------------------------------------*/

.wp-block-navigation .has-child:not(.open-on-click):hover > .wp-block-navigation__submenu-container,
.wp-block-navigation .has-child:where(:not(.open-on-click)):hover>.wp-block-navigation__submenu-container,
.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container {
    width: max-content;
}

.wp-block-navigation .wp-block-navigation__submenu-icon {
    margin-block-end: 0.3rem;
    height: 1.3rem;
    width: 1.3rem;
}

.wp-block-navigation .wp-block-navigation__submenu-icon svg {
    width: 50%;
}

.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    background-color: var(--wp--preset--color--neutral-100);
}

/* Links
============================================================= */

a {
    text-decoration-thickness: 0.08rem;
}

a:visited {
    text-decoration-style: solid;
}

:focus {
    outline: max(1px, 0.1rem) dotted;
    outline-offset: 0.15rem;
    outline-color: var(--wp--preset--color--foreground);
}

.has-foreground-background-color :focus {
    outline-color: white;
}

a:focus,
a:active,
.arrow-link a,
.wp-block-post-terms a,
a.wp-block-query-pagination-next,
a.wp-block-query-pagination-previous,
h2.arrow-link a,
h3.arrow-link a {
	text-decoration: none;
}

/* Stylized Link ----------------------------------- */

.arrow-link a,
a.wp-block-query-pagination-next,
a.wp-block-query-pagination-previous,
.wp-block-post-title a {
    position: relative;
}

.arrow-link a::after,
a.wp-block-query-pagination-next::after,
a.wp-block-query-pagination-previous::before,
.wp-block-post-title a::after {
    content: '\2794';
    display: inline-block;
    font-size: inherit;
    line-height: 0;
    transform: translateX(25%);
    transition: transform 0.2s ease-in-out;
    vertical-align: middle;
}

a.wp-block-query-pagination-previous::before {
    content: '\2794';
    margin-block-end: 0.2rem;
    transform: translateX(-25%) rotate(180deg);
}

.arrow-link a:hover::after,
a.wp-block-query-pagination-next:hover::after,
.wp-block-post-title a:hover::after {
    transform: translateX(55%);
}

a.wp-block-query-pagination-previous:hover::before {
    transform: translateX(-55%) rotate(180deg);
}

h2.arrow-link a,
h3.arrow-link a,
h4.arrow-link a {
    color: inherit;
}

/* Buttons
============================================================= */

button:not(.wp-block-social-link-anchor),
.wp-block-search .wp-block-search__button,
input[type="button"],
input[type="submit"],
.wp-block-button__link {
    background-color: var(--wp--preset--color--tertiary);
    border: 0;
    border-radius: 0.2rem;
    color: white;
    cursor: pointer;
    font-weight: 700;
    padding: 0.8rem 1.6rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

button.wp-block-navigation__responsive-container-open {
    padding: 0.4rem;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
    border: 0.12rem solid var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
}

button:hover,
.wp-block-search .wp-block-search__button:hover,
input[type="button"]:hover,
input[type="submit"]:not(#gform_submit_button_2):hover,
.wp-block-button__link:hover {
    transform: translateY(2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover {
    background-color: var(--wp--preset--color--primary);
    color: white;
}

/*--------------------------------------------------------------
# Layout & Spacing
--------------------------------------------------------------*/

.site-main,
.site-footer,
.wp-block-post-template .wp-block-post,
.wp-block-post-template .wp-block-post-title,
.wp-block-post-template .wp-block-post-date,
.wp-block-post-content > .has-background + .has-background,
main.block-editor-block-list__block,
.wp-block-quote > p:first-child,
.entry-header > h1 {
    margin-block-start: 0;
}

.site-header,
.site-footer {
    padding: 1rem 0;
}

.page .wp-block-post-content,
main > article > .entry-footer:not(:empty),
main > .has-grid-layout,
main > .wp-block-query,
.wp-block-post-content > .wp-block-group,
.wp-block-post-content > .wp-block-columns,
.wp-block-post-content > .wp-block-gallery,
.wp-block-post-content > .wp-block-quote,
.wp-block-post-content > h2:not(:first-child),
.wp-block-post-content > h3,
.wp-block-post-content > h4,
.wp-block-query > .wp-block-query-pagination {
    margin-block-start: calc(var(--wp--style--block-gap) * 2);
}

.wp-block-query > .wp-block-query-pagination,
.wp-block-post-content > :last-child:not(.has-background),
main > .has-grid-layout,
article > .entry-footer:last-child {
    margin-block-end: calc(var(--wp--style--block-gap) * 2);
}

.wp-block-group.has-background:not([style*="padding"]),
.wp-block-post-content > .wp-block-columns.has-background:not([style*="padding"]),
.site-footer > .wp-block-columns.has-background {
    /* Increase padding on Group or Columns block with a background color */
    padding-top: calc(var(--wp--style--block-gap) * 2);
    padding-bottom: calc(var(--wp--style--block-gap) * 2);
}

.wp-block-post-content > *:not(.alignfull),
.wp-block-post-content > .wp-block-group.has-background > * {
    padding-left: 1rem;
    padding-right: 1rem;
}

.wp-block-group.has-background:not([style*="padding"]),
.site-footer > .wp-block-columns.has-background {
    padding-left: 0;
    padding-right: 0;
}

.wp-block-gallery {
    margin-inline-start: 0;
    margin-inline-end: 0;
}

.wp-block-quote {
    padding-left: 1.5rem;
}

.interface-interface-skeleton__content,
.interface-interface-skeleton__content .wp-block-group.has-background:not([style*="padding"]) {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Flex
============================================================= */

.flex,
.wp-block-query .wp-block-post-template li.wp-block-post {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 1rem;
}

.wp-block-post-template li.wp-block-post > figure {
    flex: 0 0 40%;
}

.wp-block-post-template li.wp-block-post > .wp-block-group {
    flex: 1;
}

/* CSS Grid
============================================================= */

.site-header,
.site-footer,
main > header,
main > article > .entry-header,
main > article > .entry-footer,
.has-grid-layout {
    display: grid;
    grid-template-columns:
        [full-start] minmax(0, 1fr)
        [main-start] repeat(6, minmax(0, 10rem))
        [main-end] minmax(0, 1fr) [full-end];
    gap: 0 1rem;
}

.single-post main > article > .entry-header {
    grid-template-rows: auto max-content auto;
}

/* Grid Column Placement --------------------------- */

.site-header *,
.site-footer *,
main > header *,
main > article .entry-header *,
main > article .entry-footer *,
.has-grid-layout > * {
    grid-column: main;
}

.wp-block-site-logo {
    grid-column: 2 / span 2;
}

.wp-block-navigation {
    grid-column: 4 / span 6;
}

/* Grid Row Placement ------------------------------ */


/* Grid Alignment ---------------------------------- */

main > header > h1:not(:only-child),
main > article > .entry-header > h1:not(:only-child),
main > article > .entry-header > .wp-block-post-terms {
    align-self: end;
}

main > article > .entry-header > .wp-block-group {
    align-self: start;
}

main > article .entry-header > h1:only-child,
main > header > h1 {
    align-self: center;
}

/*--------------------------------------------------------------
# Elements
--------------------------------------------------------------*/

/* Lists
============================================================= */

li::marker {
    color: var(--wp--preset--color--tertiary);
}

/* Tables
============================================================= */

/* Forms
============================================================= */

input {
    accent-color: var(--wp--preset--color--tertiary);
}

form input,
form textarea,
form fieldset,
form select {
    border-radius: 0.2rem;
    border: 0.12rem solid var(--wp--preset--color--foreground);
    font-size: max(16px, 0.85rem);
    line-height: normal;
    padding: 0.8rem;
}

select {
    appearance: none;
    background-color: white;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path fill="slategray" d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>');
    background-position: calc(100% - 0.5rem) center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2em;
}

::placeholder {
    color: var(--wp--preset--color--neutral-500);
    font-weight: normal;
}

/* Gravity Froms ------------------------------------ */

.gform_wrapper .gfield_required {
    color: var(--wp--preset--color--tertiary);
}

/*--------------------------------------------------------------
# Content 
--------------------------------------------------------------*/

/* Headers
============================================================= */

.wp-block-site-logo img {
    width: 125px;
}

main > header,
main > article > .entry-header {
    min-height: 200px;
}

/* Posts
============================================================= */


/* Blocks
============================================================= */

.wp-block-query .wp-block-post > figure img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.wp-block-post-author + .wp-block-post-date::before {
    /* Add bullet between author and date */
    content: "\2022";
    padding: 0 0.25rem;
}

ul.wp-block-categories-list {
    display: flex;
    flex-flow: row wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    padding: 0;
}

ul.wp-block-categories-list li a {
    border: 0.1rem solid var(--wp--preset--color--quaternary);
    border-radius: 1.2rem;
    line-height: normal;
    padding: 0.3rem 0.8rem 0.2rem;
}

ul.wp-block-categories-list li a:hover {
    background-color: var(--wp--preset--color--quaternary);
    color: white;
}

/* Footer
============================================================= */


/*--------------------------------------------------------------
# Media Queries
--------------------------------------------------------------*/

@media screen and (min-width: 781px) {

    main > article > .entry-header h1,
    main > article > .entry-header div,
    main > header h1 {
        grid-column: 3 / span 4;
    }

    main > article > .entry-header h2,
    main > article > .entry-header p,
    main > header .wp-block-term-description,
    main > header p {
        grid-column: 4 / span 3;
    }
}

@media screen and (min-width: 1024px) {

    .has-grid-layout:not(.alignwide) > * {
        grid-column: 3 / span 4;
    }

    .site-header .wp-block-navigation {
        grid-column: 4 / span 4;
    }

    .page .wp-block-post-content,
    .wp-block-post-content > .wp-block-columns,
    .wp-block-post-content > .wp-block-group,
    .wp-block-post-content > h2:not(:first-of-type) {
        margin-block-start: calc(var(--wp--style--block-gap) * 3);
    }

    .wp-block-group.has-background:not([style*="padding"]),
    .wp-block-post-content > .wp-block-columns.has-background:not([style*="padding"]) {
        /* Increase padding on Group or Columns block with a background color */
        padding-top: calc(var(--wp--style--block-gap) * 3);
        padding-bottom: calc(var(--wp--style--block-gap) * 3);
    }
}

@media screen and (max-width: 1024px) {

    .wp-block-site-logo {
        grid-column: 2 / span 1;
    }

    .wp-block-navigation {
        grid-column: 3 / span 5;
        margin-inline-start: auto;
    }
}

@media screen and (max-width: 800px) and (min-width: 600px) {

    .site-header .wp-block-navigation {
        grid-column: 2 / span 6;
        grid-row: 2;
        margin-inline-start: 0;
        margin-block-start: 1rem;
    }
}

@media screen and (max-width: 768px) {

    .wp-block-post-content .wp-block-columns > .wp-block-column:nth-of-type(2):has(figure) {
        /* Reverse column order so images in second column come first */
        order: -1;
    }
}

@media screen and (max-width: 641px) {

    .wp-block-post-template li.wp-block-post {
        flex-direction: column;
    }

    .wp-block-post-template li.wp-block-post figure,
    .wp-block-post-template li.wp-block-post > .wp-block-group {
        flex: 1 1 100%;
        width: 100%;
    }
    
    .gform_wrapper.gravity-theme input:not([type=radio]):not([type=checkbox]):not([type=image]):not([type=file]) {
        line-height: normal;
    }
}

@media screen and (max-width: 600px) {

    .wp-block-site-logo {
        grid-column: 2 / span 2;
    }

    .wp-block-navigation {
        grid-column: 6 / 8;
    }
}
