/*
Theme Name: Blink Block
Author: Elaine Malone
Author URI: https://marketingmalone.com/
Description: A custom block theme created for the Blink Collective rebrand. 
Requires at least: 6.9
Tested up to: 7.0
Requires PHP: 8.0
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blink-block
*/

:root {
    /* 1. Map WordPress Preset Variables to Semantic Names */
    --bg-color: var(--wp--preset--color--alabaster-silk);
    --text-color: var(--wp--preset--color--charcoal-slate);
    --accent: var(--wp--preset--color--soft-blush);
    --border: var(--wp--preset--color--muted-pebble);

    /* 2. Fallback Hex Codes (Synchronized with theme.json) */
    --charcoal: #292929;
    --steel: #7a7a80;
    --pebble: #d0cdd0;
    --alabaster: #fcfbfb;
    --oyster: #d4abb3;
    --blush: #efdcde;
}

/* Global Styles using the Palette */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

a {
    color: var(--text-color);
}

/* WP Button: Primary (Fill) */
.wp-block-button.is-style-fill .wp-block-button__link {
    background-color: var(--text-color); /* Charcoal */
    color: var(--bg-color); /* Alabaster */
    transition: all 0.3s ease;
}

.wp-block-button.is-style-fill .wp-block-button__link:hover {
    background-color: var(--accent); /* Soft Blush */
    color: var(--text-color);
}

/* WP Button: Ghost (Outline) */
.is-style-outline .wp-block-button__link {
    background-color: transparent;
    /* border: 1px solid var(--text-color) !important; */
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 15px 35px;
    transition: all 0.3s ease;
}

.is-style-outline .wp-block-button__link:hover {
    background-color: var(--accent);
    /* border-color: var(--accent) !important; */
    border-color: var(--accent);
    color: var(--text-color);
}

/* WP Button: Secondary Blush */
.is-style-secondary .wp-block-button__link {
    background-color: var(--accent);
    color: var(--text-color);
    border: 1px solid var(--accent) !important;
    transition: all 0.3s ease;
}

.is-style-secondary .wp-block-button__link:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-color: var(--bg-color) !important;
}

/* Apply this class to the Group block that wraps your Columns */
.service-grid-native {
    background-color: var(--wp--preset--color--alabaster-silk);
    border-top: 1px solid var(--wp--preset--color--muted-pebble);
    border-bottom: 1px solid var(--wp--preset--color--muted-pebble);
}

/* Target the native columns inside our wrapper */
.service-grid-native .wp-block-column {
    padding: 60px 40px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-right: 1px solid var(--wp--preset--color--muted-pebble);
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
}

.service-grid-native .wp-block-column:hover {
    background-color: var(--wp--preset--color--soft-blush);
}

/* Remove the border from the very last column */
.service-grid-native .wp-block-column:last-child {
    border-right: none;
}

/* Force the "Number" to the top and "Description" to the bottom */
.service-grid-native .wp-block-column p:last-child {
    margin-top: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Mobile: Remove vertical borders and stack */
@media (max-width: 782px) {
    .service-grid-native .wp-block-column {
        border-right: none;
        border-bottom: 1px solid var(--wp--preset--color--muted-pebble);
    }
}

/* Eyebrow Style for Paragraphs */
p.is-style-eyebrow {
    font-size: var(--wp--preset--font-size--x-small);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: block;
    opacity: 0.8;
}

/* Faded Style for Paragraphs */
p.is-style-faded {    
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: var(--wp--preset--font-size--x-small);
    text-transform: uppercase;
    color: var(--text-color);
    letter-spacing: 0.25em;
    opacity: 0.5;
}

/* --- Form Grid System --- */
.blink-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem; /* Space between the two columns */
    margin-bottom: 2.5rem; /* Space between rows */
}

.blink-form .column-half {
    flex: 1 1 calc(50% - 1.25rem); /* Exactly half minus the gap */
}

.blink-form .column-full {
    flex: 1 1 100%;
}

/* --- Form Groups & CF7 Wrappers --- */
.blink-form .form-group {
    margin-bottom: 0; 
    position: relative;
}

/* CF7 wraps inputs in a span. We must force it to behave like a block. */
.wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* --- Labels --- */
.blink-form .form-label {
    display: block;
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: var(--wp--preset--font-size--xx-small); /* Uses your "Meta" size */
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--wp--preset--color--charcoal-slate);
}

/* --- Inputs & Textareas --- */
.blink-form .form-control {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--wp--preset--color--muted-pebble);
    padding: 15px 0;
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: var(--wp--preset--font-size--small); /* Uses your "Body Base" size */
    color: var(--wp--preset--color--charcoal-slate);
    transition: border-color 0.3s ease;
    outline: none;
    border-radius: 0; /* Prevents iOS from rounding input corners */
    -webkit-appearance: none;
    appearance: none;
}

.blink-form .form-control:focus {
    border-bottom-color: var(--wp--preset--color--charcoal-slate);
}

.blink-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* --- Submit Button --- */
.blink-form .btn-submit {
    background-color: var(--wp--preset--color--charcoal-slate);
    color: var(--wp--preset--color--alabaster-silk);
    border: none;
    font-family: var(--wp--preset--font-family--montserrat);
    font-weight: 500;
    font-size: var(--wp--preset--font-size--xx-small);
    letter-spacing: 0.15em;
    padding: 1.25rem 2.5rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.blink-form .btn-submit:hover {
    background-color: var(--wp--preset--color--soft-blush);
    color: var(--wp--preset--color--charcoal-slate);
}

/* --- CF7 Specific Validation & Feedback --- */
.wpcf7-not-valid-tip {
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: var(--wp--preset--font-size--xx-small);
    color: #D32F2F; /* Deep Red for errors */
    margin-top: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* The success/error box at the bottom */
.wpcf7-form .wpcf7-response-output {
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: var(--wp--preset--font-size--small); /* Uses "Body Small" */
    border: 1px solid var(--wp--preset--color--charcoal-slate) !important;
    margin: 2rem 0 0 0 !important;
    border-radius: 0 !important;
    padding: 20px !important;
}

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    .blink-form .form-row {
        gap: 0;
    }
    
    .blink-form .column-half {
        flex: 1 1 100%;
        margin-bottom: 2.5rem; /* Restores vertical spacing when stacked */
    }
    
    .blink-form .column-half:last-child {
        margin-bottom: 0; 
    }
}

/* --- Talent Archive Card --- */
.talent-item-card {
    background-color: var(--wp--preset--color--alabaster-silk);
    transition: background-color 0.3s ease;
    height: 100%;
}

.talent-item-card:hover {
    background-color: var(--wp--preset--color--soft-blush);
}

/* Image Wrapper Settings */
.image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Force the WP Featured Image to behave */
.image-wrapper figure.talent-img {
    margin: 0;
    height: 100%;
}

.image-wrapper figure.talent-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.6s ease;
}

.talent-item-card:hover figure.talent-img img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

/* --- Social Stats Overlay --- */
.social-overlay {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 44, 50, 0.80);
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--wp--preset--color--alabaster-silk);
    margin: 0 !important;
    pointer-events: none; 
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.talent-item-card:hover .social-overlay {
    opacity: 1;
}

.social-stat-group {
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.talent-item-card:hover .social-stat-group {
    transform: translateY(0);
}

/* Typography for Overlay */
.stat-value {
    font-family: var(--wp--preset--font-family--serif);
    font-size: 2rem;
    margin-bottom: 0;
    color: var(--wp--preset--color--alabaster-silk);
}

.stat-platform {
    font-size: var(--wp--preset--font-size--xx-small);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.7;
    margin-top: 5px;
    color: var(--wp--preset--color--alabaster-silk);
}

/* Hide the platform label if the stat value is empty */
.stat-value:empty + .stat-platform {
    display: none;
}
.stat-value:empty {
    display: none;
}

/* --- Meta Info (Name & Niche) --- */
.talent-name a {
    text-decoration: none;
    color: inherit;
}

.talent-niche {
    font-size: var(--wp--preset--font-size--xx-small);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.5;
    font-weight: 500;
    margin-top: 0;
}

/* --- Talent Profile Flicking Image --- */
.hero-blink-wrapper {
    width: 100%; 
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: var(--wp--preset--color--muted-pebble);
}

.hero-blink-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: 50% 15%;
    transition: opacity 0.2s ease-in-out; /* The 200ms shutter speed */
}

.hero-blink-image.shutter-close {
    opacity: 0;
}

/* Remove spacing caused by WP injected paragraph tags around the shortcode */
.hero-blink-wrapper p, 
.hero-blink-wrapper + p {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Ensure the wrapper itself doesn't have any hidden margins */
.hero-blink-wrapper {
    margin: 0 !important;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: var(--wp--preset--color--muted-pebble);
}

/* -- Clickable Card -- */
/* 1. Make the parent card the positioning boundary */
.clickable-card {
    position: relative; 
    cursor: pointer; 
}

/* 2. Stretch the link inside to cover the whole card */
.clickable-card a::after {
    content: "";
    position: absolute;
    inset: 0; 
    z-index: 1; 
}

/* --- Client Logo Grid: Responsive Overrides --- */

/* Tablet: Force 4 columns */
@media (max-width: 1024px) and (min-width: 768px) {
    .client-logo-grid.wp-block-post-template,
    .client-logo-grid .wp-block-post-template {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px; /* Adjust spacing if needed */
    }
}

/* Mobile: Force 3 columns (Change the '3' to '2' if logos are too small) */
@media (max-width: 767px) {
    .client-logo-grid.wp-block-post-template,
    .client-logo-grid .wp-block-post-template {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px; 
    }
}

/* --- Footer --- */
footer {
    margin-block-start: 0px;
}

/* --- Hide Empty ACF Bindings --- */
/* 1. Hides standalone empty paragraphs (like niches or stat sources) */
p:empty { 
    display: none !important; 
}

/* 2. Hides the entire column (and labels) if the ACF stat inside it is empty */
.hide-wrapper:has(.bound-val:empty) { 
    display: none !important; 
}