/*
Theme Name: Blockstar
Theme URI: https://peterrobinson.co.za/
Author: Peter Robinson
Author URI: https://peterrobinson.co.za/
Description: A modern WordPress block theme built for flexible, expressive websites.
Requires at least: 6.6
Requires PHP: 7.4
Version: 0.1.0
Text Domain: blockstar
*/

/* Heading typography */

h2.wp-block-heading {
    font-size: 2.25rem;
}

h3.wp-block-heading {
    font-size: 1.75rem;
}

h4.wp-block-heading {
    font-size: 1.5rem;
}

.wp-site-blocks>footer.wp-block-template-part {
    margin-block-start: 0;
}

.wp-block-site-title a:hover {
    color: inherit;
}

/* Navigation hover */
.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--muted);
}

/* Current page */
.wp-block-navigation .current-menu-item .wp-block-navigation-item__content.wp-block-navigation-item__content {
    color: var(--wp--preset--color--contrast);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
}

/* Latest Posts featured image links */
.wp-block-latest-posts__featured-image a {
    display: block;
    vertical-align: top;
}

.wp-block-latest-posts__featured-image a img {
    display: block;
    transition: opacity 0.2s ease;
}

.wp-block-latest-posts__featured-image a:hover img {
    opacity: 0.65;
}

.wp-block-latest-posts__post-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    margin-top: 1rem;
}

.wp-block-latest-posts__post-title:hover {
    text-decoration: underline;
}

.wp-block-latest-posts__post-date {
    display: block;
    font-size: 0.875rem;
    opacity: 0.65;
    margin-top: 0.5rem;
}

.wp-block-latest-posts__post-excerpt {
    margin-top: 1rem;
    line-height: 1.6;
}

@media (max-width: 781px) {

    /* Improve mobile content spacing */
    .wp-site-blocks main>.wp-block-group {
        padding-left: 20px;
        padding-right: 20px;
    }

}

/* Content links */
.wp-block-post-content a:not(.wp-element-button):not(.wp-block-latest-posts__post-title):not(.wp-block-latest-posts__featured-image a) {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: opacity 0.2s ease;
}

.wp-block-post-content a:not(.wp-element-button):not(.wp-block-latest-posts__post-title):not(.wp-block-latest-posts__featured-image a):hover {
    opacity: 0.65;
}

.wp-block-button__link,
.wp-element-button {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Global form field focus styling */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    textarea,
    select):focus {
    border-color: var(--wp--preset--color--contrast);
    outline: none;
    box-shadow: none;
}

/* Blog post excerpt spacing */
.wp-block-post-template .wp-block-post-title {
    margin-bottom: 5px;
}


/* ==========================================
   Blockstar - Contact Form
   ========================================== */

.qs-contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-top: 32px;
}

/* Two-column name/email row */
.qs-contact-form .qs-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Individual fields */
.qs-contact-form .qs-form-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Hide labels visually, retain accessibility */
.qs-contact-form .qs-form-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Inputs and textarea */
.qs-contact-form input,
.qs-contact-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #dedede;
    border-radius: 0;
    background: #fff;
    color: #171717;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.qs-contact-form input::placeholder,
.qs-contact-form textarea::placeholder {
    color: #777;
    opacity: 1;
}

/* Message field */
.qs-contact-form textarea {
    min-height: 160px;
    resize: vertical;
}

/* Focus states */
.qs-contact-form input:focus,
.qs-contact-form textarea:focus {
    border-color: #171717;
}

/* Submit button */
.qs-contact-form .qs-form-submit {
    align-self: flex-start;
    padding: 14px 26px;
    border: 1px solid #171717;
    border-radius: 0;
    background: #171717;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.2s ease,
        border-color 0.2s ease;
}

.qs-contact-form .qs-form-submit:hover {
    background: #444;
    border-color: #444;
}

.qs-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.qs-form-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: qs-form-spin 0.7s linear infinite;
    vertical-align: -2px;
}

@keyframes qs-form-spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Mobile */
@media (max-width: 600px) {
    .qs-contact-form .qs-form-row {
        grid-template-columns: 1fr;
    }

    .qs-contact-form {
        margin-top: 24px;
    }
}

/*
 * Quicksticks MVP compatibility workaround.
 *
 * Handles full-width block alignment when the active
 * theme uses useRootPaddingAwareAlignments.
 *
 * TODO: Implement WordPress-compatible global padding
 * and alignfull behaviour in the Quicksticks renderer.
 *
 * Remove these rules once native support is implemented.
 */

.wp-site-blocks .wp-block-post-content>.alignfull {
    box-sizing: border-box;

    width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px));

    max-width: none;

    margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px));
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px));

    padding-left: var(--wp--style--root--padding-left, 0px);
    padding-right: var(--wp--style--root--padding-right, 0px);
}

.wp-site-blocks>footer.wp-block-template-part {
    width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px));

    margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px));

    margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px));
}