/* 
 * Global stylesheet for modern CYA components 
 */

:root {
    /* Typography */
    --primary: #005968;
    --primary-hover: #007890;
    --primary-light: #88E0F5;
    --primary-extralight: #EEFBFF;
    --secondary: #BDB2A6;
    --secondary-dark: #978A7C;
    --secondary-light: #DFD8D1;
    --secondary-extralight: #F3F0EC;
    --cyan: #A5ECFD;
    --cyan-light: #D6F9FF;
}

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

.wp-grid-builder.wpgb-grid-1 .wpgb-viewport {
    height: unset !important;
}

.wp-grid-builder.wpgb-grid-1 .wpgb-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill,
            minmax(min(280px, 100%), 1fr));
    grid-gap: 1em;
}

.wp-grid-builder.wpgb-grid-1 .wpgb-masonry>article {
    position: relative;
    left: unset !important;
    top: unset !important;
    height: unset !important;
    width: 100% !important;
}

/* -------------------------------------
 * Yacht Specs
 * ------------------------------------- */

/* Thumbnail */
.card-yacht .wpgb-card-media-content {
    background-image: linear-gradient(transparent 50%, var(--primary));
}

.card-yacht .wpgb-card-media-content-bottom {
    display: flex !important;
    flex-direction: row;
    align-items: flex-end;
    padding: 1em !important;

}

.card-yacht .wpgb-card-media-content-bottom h2 {
    flex: 1;
    font-size: 0px !important;
    line-height: 1px !important;
}

.card-yacht .wpgb-card-media-content-bottom h2 a {
    color: #fff !important;
    font-size: 1.8rem;
    line-height: 0.8em !important;
}

/* Specs List */
.yacht-specs.yacht-specs__features .yacht-specs__feature-item {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 0.5em 0.5em;
    border: 1px solid var(--secondary-light);
    border-radius: 0.25rem;
    line-height: 1em;
}

.yacht-specs svg {
    width: 1em !important;
    height: 1em !important;
}

.yacht-specs__feature-item--pricing-inclusive {
    background: var(--cyan-light);
    color: var(--primary) !important;
    border-color: var(--cyan) !important;
}


.card-yacht .wpgb-card-body>[class*="wpgb-block"] {
    display: flex !important;
    flex-direction: column;
    gap: 0.5em;
    margin-bottom: 1rem !important;
}

.yacht-specs.yacht-specs__location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.yacht-specs__price-from {
    display: block;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    margin-bottom: 4px !important;
}

.yacht-specs__price-value {
    font-weight: bold !important;
}

.yacht-special-tag {
    position: absolute !important;
    top: 0.5rem;
    left: 0;
    padding: 0.25rem 0.5rem !important;
    background: var(--secondary-dark);
    color: #fff;
    text-transform: uppercase;
    font-size: 1rem !important;
    font-weight: bold;
}

/* -------------------------------------
 * WP Grid Builder Sidebar Facet Accordion Toggles
 * ------------------------------------- */

.wpgb-sidebar .wpgb-facet {
    margin-bottom: 1.5rem !important;
    padding-bottom: 0rem;
}

.wpgb-sidebar .wpgb-facet:not(:last-child) {
    border-bottom: 1px solid var(--secondary-light);
}

.wpgb-sidebar .wpgb-facet .wpgb-facet-title {
    margin-bottom: 1.5rem !important;
    line-height: 1em !important;
}

.wpgb-sidebar .wpgb-facet-title {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    padding: 0.5rem 0;
    user-select: none;
    transition: color 0.2s ease;
}

.wpgb-sidebar .wpgb-facet-title:hover {
    color: var(--primary-hover) !important;
}

/* Add focus outline for accessibility */
.wpgb-sidebar .wpgb-facet-title:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Chevron arrow on the right side */
.wpgb-sidebar .wpgb-facet-title::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease-in-out;
    margin-right: 6px;
    flex-shrink: 0;
}

/* Rotate chevron when facet is open */
.wpgb-sidebar .wpgb-facet.facet-open .wpgb-facet-title::after {
    transform: rotate(-135deg);
}

.wpgb-sidebar .wpgb-facet:not(.facet-open) fieldset {
    display: none !important;
}

.wpgb-sidebar .wpgb-facet.facet-open fieldset {
    display: block !important;
}

.wpgb-sidebar .wpgb-facet fieldset {
    margin-top: 1rem;
    animation: wpgbFadeIn 0.2s ease-out;
}

@keyframes wpgbFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .wpgb-facet:has(.wpgb-result-count) {
        text-align: right;
    }
}

/* Reset */
button.wpgb-button.wpgb-reset {
    background: var(--secondary-dark);
    max-width: max-content;
    text-transform: uppercase;
    font-size: 1rem;
    padding: 0.7em 1em;
}

button.wpgb-button.wpgb-reset:is(:hover, :focus-visible) {
    background: var(--secondary-light);
    color: var(--primary);
}

/* Search */
@media (min-width: 768px) {
    .wpgb-facet:has(.wpgb-search-facet) {
        flex-basis: 50% !important;
        max-width: 50% !important;
    }
}

fieldset:has(.wpgb-search-facet) {
    margin-bottom: 1rem !important;
}