/*
Theme Name: unionfacts2025
*/

/* ==========================================================================
    From Ollie
   ========================================================================== */

/* 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--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--x-small);
    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;
    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: 0.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;
}

.wp-block-embed iframe {
    width: 100%;
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

@media (max-width: 600px) {
    .reverse-mobile {
        flex-direction: column-reverse;
    }
}

@media screen and (max-width: 820px) {
    .featured-unions {
        border: none !important;
        padding: var(--wp--preset--spacing--small) !important;
    }
}

/* ==========================================================================
   Additional Styles
   ========================================================================== */

/* Variables
---------------------------------------------------------------------------- */

:root {
    --transition: 0.15s ease-in-out;
    --transition-slow: 0.3s ease-in-out;
}

/* Scrolling
---------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
}

/* assuming header is fixed, add scroll offset based on header height + some spacing */
:target {
    scroll-margin-top: calc(var(--site-header--height-pinned) + var(--wp--preset--spacing--medium));
}

/* Typography
---------------------------------------------------------------------------- */

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

/* ==========================================================================
   Button Styles
   ========================================================================== */

.wp-block-button:not(.is-style-outline, .is-style-reverse-out-button) .wp-block-button__link {
    border: 2px solid transparent;
}

.wp-block-button {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
    text-transform: uppercase;
}

.wp-element-button--full {
    width: 100%;
}

.wp-block-button .wp-block-button__link {
    background-color: var(--wp--preset--color--main-accent);
    font-size: inherit;
    font-weight: inherit;
    transition: transform 0.15s ease-in-out;
}

.wp-block-button .wp-block-button__link:hover {
    text-decoration: none;
    transform: scale(1.02);
}

.wp-block-button__link,
.wp-element-button {
    transition: all 0.15s ease-in-out;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
    filter: brightness(110%);
}

/* Button - Outline Style
--------------------------------------------- */

.wp-block-button.is-style-outline .wp-block-button__link {
    border: none;
    background-color: transparent;
    border: 2px solid currentColor;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    color: var(--wp--preset--color--main) !important;
}

/* Button - Reverse Out Style
--------------------------------------------- */

.wp-block-button.is-style-reverse-out-button .wp-block-button__link {
    border: none;
    background-color: transparent;
    color: var(--wp--preset--color--base);
    border: 2px solid var(--wp--preset--color--base);
}

.wp-block-button.is-style-reverse-out-button .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--base);
    color: var(--wp--preset--color--main) !important;
}

/* Button - Secondary Style
--------------------------------------------- */

.is-style-secondary-button.wp-block-button .wp-block-button__link,
.is-style-secondary-button.wp-block-button .wp-element-button.wp-block-button__link,
.wp-element-button.is-style-secondary-button {
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--base);
}

.is-style-secondary-button.wp-block-button:hover .wp-block-button__link,
.is-style-secondary-button.wp-block-button:hover .wp-element-button.wp-block-button__link,
.wp-element-button.is-style-secondary-button:hover {
    background: var(--wp--preset--color--main-accent);
    color: var(--wp--preset--color--base);
}

/* Button - Tertiary Style
--------------------------------------------- */

.is-style-tertiary-button.wp-block-button .wp-block-button__link,
.is-style-tertiary-button.wp-block-button .wp-element-button.wp-block-button__link {
    background: var(--wp--preset--color--primary-accent);
    color: var(--wp--preset--color--base);
}

.is-style-tertiary-button.wp-block-button:hover .wp-block-button__link {
    background: var(--wp--preset--color--main-accent);
    color: var(--wp--preset--color--base);
}

/* ==========================================================================
   Link Caret Styles
   ========================================================================== */

:root :where(.is-style-caret-right-button .wp-element-button, .is-style-caret-down-button .wp-element-button) {
    color: var(--wp--preset--color--main-accent);
}

.is-style-caret-right-button .wp-element-button,
.is-style-caret-down-button .wp-element-button {
    background: none;
    font-weight: 700;
    line-height: 1;
    height: 1;
}

.is-style-caret-right-button .wp-element-button::after,
.is-style-caret-down-button .wp-element-button::after,
.post-item__link a::after {
    background-color: currentColor;
    mask: url("assets/icons/icon-caret-right-red.svg");
    mask-position: center;
    mask-size: 100%;
    mask-repeat: no-repeat;
    content: "";
    height: 1em;
    width: 1em;
}

.is-style-caret-right-button .wp-element-button,
.is-style-caret-down-button .wp-element-button,
.post-item__link a {
    padding: 0 1rem 0 0;
    position: relative;
    white-space: nowrap;
}

.is-style-caret-right-button .wp-element-button::after,
.is-style-caret-down-button .wp-element-button::after,
.post-item__link a::after {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease-in-out;
}

.is-style-caret-down-button .wp-element-button::after {
    transform: translateY(-50%) rotate(90deg);
}

.is-style-caret-right-button .wp-element-button:hover,
.is-style-caret-down-button .wp-element-button:hover,
.post-item__link a:hover {
    transform: none;
}

.is-style-caret-right-button .wp-element-button:hover::after,
.post-item__link a:hover::after {
    transform: translate(2px, -50%);
}

.is-style-caret-down-button .wp-element-button:hover::after {
    transform: translateY(calc(-50% + 2px)) rotate(90deg);
}

/* Generic Form Styles
---------------------------------------------------------------------------- */

.form--small {
    max-width: 360px;
}

.form--centered {
    margin: 0 auto;
}

.form__row + .form__row {
    margin-top: var(--wp--preset--spacing--x-small);
}

.form__action {
}

input:not([type="submit"]),
select,
textarea {
    border: 1px solid var(--wp--preset--color--secondary-accent);
    padding: var(--wp--preset--spacing--x-small) var(--wp--preset--spacing--small);
    width: 100%;
}

::placeholder {
    color: var(--wp--preset--color--main);
    font-size: var(--wp--preset--font-size--x-small);
}

/* Gravity Forms Styles
---------------------------------------------------------------------------- */

.gform_wrapper.gform-theme .gform_fields {
    gap: var(--wp--preset--spacing--medium);
}

.gform-footer {
    justify-content: center !important;
    margin-top: var(--wp--preset--spacing--large) !important;
}

.gfield_label,
.gform-field-label {
    color: inherit !important;
}

.gfield_label {
    font-weight: 700 !important;
}

.gform_wrapper .gfield .gfield_required {
    display: none;
}

.gform-theme--framework .gform_validation_errors {
    background-color: var(--wp--preset--color--base) !important;
}

.gfield--input-type-turnstile .gfield_validation_message {
    display: none;
}

.gform_wrapper .gfield input[type="email"],
.gform_wrapper .gfield input[type="text"],
.gform_wrapper .gfield input[type="number"],
.gform_wrapper .gfield input[type="tel"],
.gform_wrapper .gfield select {
    border: 1px solid var(--wp--preset--color--tertiary);
    border-radius: 4px;
    font-size: var(--wp--preset--font-size--x-small);
    line-height: 1;
    height: auto;
    padding: 1em;
}

.gform_button {
    background-color: var(--wp--preset--color--secondary) !important;
    font-family: var(--wp--preset--font-family--primary) !important;
    font-size: var(--wp--preset--font-size--small) !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    line-height: 1 !important;
    padding: 1em 2em !important;
    text-transform: uppercase !important;
    transition: all 0.1s ease-in-out !important;
}

.has-base-color .gform-icon {
    border-color: var(--wp--preset--color--base) !important;
    color: var(--wp--preset--color--base) !important;
}

.has-base-color .gform_validation_errors {
    border: 1px solid var(--wp--preset--color--base) !important;
    box-shadow: none !important;
}

.has-base-color .gform_submission_error {
    color: var(--wp--preset--color--base) !important;
}

.has-base-color .gfield_description {
    color: var(--wp--preset--color--base) !important;
}

/* Styles for imported content
---------------------------------------------------------------------------- */

.entry-content img.alignleft,
.entry-content img.alignright {
    margin-bottom: var(--wp--preset--spacing--small);
}

.entry-content img.alignright {
    float: right;
    margin-left: var(--wp--preset--spacing--small);
}

.entry-content img.alignleft {
    float: left;
    margin-right: var(--wp--preset--spacing--small);
}
