/* Button base styles in editor */
.wp-block-uthsc-button a.button {
    vertical-align: middle;
    margin: 0 0 0.2rem 0;
    padding: 0.85em 1em;
    transition: background-color 0.25s ease-out, color 0.25s ease-out;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    color: #fefefe;
}

/* Colors taken from foundation/uthsc brand colors */
.wp-block-uthsc-button a.button,
.wp-block-uthsc-button a.button.primary {
    background-color: #115740;
}

.wp-block-uthsc-button a.button.secondary {
    background-color: #4D4D4F;
}

.wp-block-uthsc-button a.button.accent {
    background-color: #b94700;
}

/* Hover on button*/
.button:hover, .button:focus {
    background-color: #024734 !important;
    color: #fefefe; 
}
.button.primary:hover, .button.primary:focus {
    background-color: #024734 !important;
    color: #fefefe; 
}

.button.secondary:hover, .button.secondary:focus {
    background-color: #3d3d3f !important;
    color: #fefefe; 
}

.button.accent:hover, .button.accent:focus {
    background-color: #a53c00 !important;
    color: #fefefe;
}


/* Hollow button variants */
.wp-block-uthsc-button a.button.hollow {
    background-color: transparent;
    border-width: 2px;
}

.wp-block-uthsc-button a.button.hollow,
.wp-block-uthsc-button a.button.hollow.primary {
    border:2px solid #115740;
    color: #115740;
}

.wp-block-uthsc-button a.button.hollow.secondary {
    border: 2px solid #4D4D4F;
    color: #4D4D4F;
}

.wp-block-uthsc-button a.button.hollow.accent {
    border: 2px solid #b94700;
    color: #b94700;
}
/* Hollow button: hover */
.wp-block-uthsc-button a.button.hollow:hover,
.wp-block-uthsc-button a.button.hollow:focus {
    background-color: transparent !important;
    border-color: #024734;
    color: #024734 !important;
}
.wp-block-uthsc-button a.button.hollow.primary:hover,
.wp-block-uthsc-button a.button.hollow.primary:focus {
    background-color: transparent !important;
    border-color: #024734;
    color: #024734 !important;
}

.wp-block-uthsc-button a.button.hollow.secondary:hover,
.wp-block-uthsc-button a.button.hollow.secondary:focus {
    background-color: transparent !important;
    border-color: #3d3d3f;
    color: #3d3d3f !important;
}

.wp-block-uthsc-button a.button.hollow.accent:hover,
.wp-block-uthsc-button a.button.hollow.accent:focus {
    background-color: transparent !important;
    border-color: #a53c00;
    color: #a53c00 !important;
}

/* Size options */
.wp-block-uthsc-button a.button.tiny {
    font-size: 0.6rem !important;
    padding: 0.75em 1em !important;
}
.wp-block-uthsc-button a.button.small {
    font-size: 0.75rem !important;
    padding: 0.8em 1em !important;
}
.wp-block-uthsc-button a.button.large {
    font-size: 1.25rem !important;
    padding: 0.9em 1.25em !important;
}

/* Expanded (full width) */
.wp-block-uthsc-button a.button.expanded {
    display: block;
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

/* Disabled */
.wp-block-uthsc-button a.button.disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* Alignment for button-group wrapper (from previous) */
.wp-block-uthsc-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.wp-block-uthsc-button.align-center {
    align-items: center;
}
.wp-block-uthsc-button.align-right {
    align-items: flex-end;
}

/* Optional float clears for older alignments */
.wp-block-uthsc-button.alignleft {
    float: left;
}
.wp-block-uthsc-button.alignright {
    float: right;
}
.wp-block-uthsc-button.aligncenter {
    margin-left: auto;
    margin-right: auto;
    clear: both;
}
/* Transition for the button URL link */
.block-editor-link-control,
.block-editor-url-input__container,
.wp-block-uthsc-button .block-editor-url-input { 
    animation: spreadOut 1s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    overflow: hidden !important; /* Prevents content from spilling during growth */
    white-space: nowrap !important; /* Keeps the input from jumping */
}

.wp-block-uthsc-button .block-editor-url-input {
    position: relative;
    overflow: visible !important;
}

.wp-block-uthsc-button .block-editor-url-input__container,
.wp-block-uthsc-button .block-editor-link-control {
    position: absolute;
    top: calc(100% + 0.15rem);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    z-index: 20;
}

@keyframes spreadOut {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%; /* Or the specific max-width of the popover */
        opacity: 1;
    }
}