/* Parent wrapper to scope all alert styles and prevent conflicts */
.ct-alerts-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* Base alert wrapper */
.ct-alerts-wrapper .ct-alert {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    position: relative;
    
    /* CSS Variables with defaults */
    --ct-alert-bg-color: #ffab37;
    --ct-alert-text-color: #414141;
    --ct-alert-close-color: #ffffff;
    --ct-alert-button-bg: #ffffff;
    --ct-alert-button-text: #000000;
    --ct-alert-button-hover-bg: #f5f5f5;
    --ct-alert-button-hover-text: #000000;
    --ct-alert-padding-top: 16px;
    --ct-alert-padding-right: 24px;
    --ct-alert-padding-bottom: 16px;
    --ct-alert-padding-left: 24px;
    --ct-alert-max-width: 1200px;
    --ct-alert-border-radius: 0px;
    --ct-alert-heading-font-size: 17px;
    --ct-alert-brief-font-size: 14px;
    --ct-alert-button-font-size: 12px;
    
    color: var(--ct-alert-text-color);
    padding: var(--ct-alert-padding-top) var(--ct-alert-padding-right) var(--ct-alert-padding-bottom) var(--ct-alert-padding-left);
    background: var(--ct-alert-bg-color);
    border-radius: var(--ct-alert-border-radius);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
}

.ct-alerts-wrapper .ct-alert-content {
    width: 100%;
    max-width: var(--ct-alert-max-width);
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* Horizontal layout: main content in row, text left + button right */
.ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-content {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-main.ct-alert-main-row {
    flex: 1;
    min-width: 0;
}

.ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-read-more-inline {
    flex-shrink: 0;
}

/* When custom button spacing is set, override padding/border-radius; otherwise use theme (ct-button) */
.ct-alerts-wrapper .ct-alert-button-custom-spacing .ct-alert-layout-horizontal .ct-alert-read-more-inline .ct-alert-button,
.ct-alerts-wrapper .ct-alert-button-custom-spacing .ct-alert-read-more .ct-alert-button {
    padding: var(--ct-alert-button-padding-top) var(--ct-alert-button-padding-right) var(--ct-alert-button-padding-bottom) var(--ct-alert-button-padding-left);
    border-radius: var(--ct-alert-button-border-radius) !important;
}

.ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-read-more-inline .ct-alert-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ct-alert-button-bg);
    color: var(--ct-alert-button-text);
    font-size: var(--ct-alert-button-font-size);
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
}

.ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-read-more-inline .ct-alert-button:hover,
.ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-read-more-inline .ct-alert-button:focus-visible {
    background: var(--ct-alert-button-hover-bg);
    color: var(--ct-alert-button-hover-text);
}

/* Address section - separator + location + address (matches content max-width) */
.ct-alerts-wrapper .ct-alert-address-wrap {
    width: 100%;
    max-width: var(--ct-alert-max-width);
    margin-top: 12px;
}

.ct-alerts-wrapper .ct-alert-address-separator {
    width: 100%;
    height: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
}

.ct-alerts-wrapper .ct-alert-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ct-alert-text-color);
}

.ct-alerts-wrapper .ct-alert-address-icon {
    flex-shrink: 0;
}

.ct-alerts-wrapper .ct-alert-location-icon {
    width: 24px;
    height: 24px;
}

.ct-alerts-wrapper .ct-alert-address .ct-alert-address-link,
.ct-alerts-wrapper .ct-alert-address .ct-alert-address-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ct-alerts-wrapper .ct-alert-address .ct-alert-address-link {
    text-decoration: underline;
    color: inherit;
}

.ct-alerts-wrapper .ct-alert-address .ct-alert-address-link:hover {
    opacity: 0.9;
}

.ct-alerts-wrapper .ct-alert-heading {
    font-size: var(--ct-alert-heading-font-size);
    font-weight: 700;
    margin: 0;
    color: var(--ct-alert-text-color);
    line-height: 1.2;
}

.ct-alerts-wrapper .ct-alert-brief {
    font-size: var(--ct-alert-brief-font-size);
    line-height: 1.4;
    margin: 0;
    color: var(--ct-alert-text-color);
}

.ct-alerts-wrapper .ct-alert-brief p {
    margin: 0;
    font-weight: 400;
}

.ct-alerts-wrapper .ct-alert-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ct-alerts-wrapper .ct-alert-read-more {
    max-width: var(--ct-alert-max-width);
    width: 100%;
}

/* ct-button = Blocksy theme styles; ct-alert-button = our overrides (colors from settings). Padding/border-radius only when ct-alert-button-custom-spacing is set. */
.ct-alerts-wrapper .ct-alert-read-more .ct-alert-button,
.ct-alerts-wrapper .ct-alert-read-more-inline .ct-alert-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ct-alert-button-bg);
    color: var(--ct-alert-button-text);
    font-size: var(--ct-alert-button-font-size);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
    white-space: nowrap;
    margin: 0;
}

.ct-alerts-wrapper .ct-alert-read-more .ct-alert-button:hover,
.ct-alerts-wrapper .ct-alert-read-more .ct-alert-button:focus-visible {
    background: var(--ct-alert-button-hover-bg);
    color: var(--ct-alert-button-hover-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.ct-alerts-wrapper .ct-alert-close {
    background: none;
    border: none;
    color: var(--ct-alert-close-color);
    font-size: var(--ct-alert-close-size, 30px);
    line-height: 1;
    min-height: 10px;
    cursor: pointer;
    padding: 0px;
    transition: opacity 120ms ease;
    margin: 0;
    position: absolute;
    z-index: 10;
}

/* Position relative to outer container (.ct-alert) */
.ct-alerts-wrapper .ct-alert-close-outer {
    top: var(--ct-alert-close-top, 10px);
    right: var(--ct-alert-close-right, 15px);
}

/* Position relative to content container (.ct-alert-content) */
.ct-alerts-wrapper .ct-alert-close-content {
    position: absolute;
    top: var(--ct-alert-close-top, 10px);
    right: var(--ct-alert-close-right, 15px);
}

.ct-alerts-wrapper .ct-alert-close:hover,
.ct-alerts-wrapper .ct-alert-close:focus-visible {
    opacity: 0.75;
}

/* Reopen icon - shown when alert is closed and allow_reopen is on */
.ct-alerts-wrapper .ct-alert-reopen-icon {
    display: none;
    position: fixed;
    top: 0px;
    right: 24px;
    z-index: 999999;
    width: 56px;
    height: 56px;
    padding: 8px;
    border: none;
    border-radius: 0px 0px 5px 5px;
    background: var(--ct-alert-bg-color, #ffab37);
    color: var(--ct-alert-text-color, #414141);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.admin-bar .ct-alerts-wrapper .ct-alert-reopen-icon {
    top: 32px;
}
@media(max-width: 1024px){
    .ct-alerts-wrapper .ct-alert-reopen-icon {
        top: 80px;
        position: absolute;
    }
    .admin-bar .ct-alerts-wrapper .ct-alert-reopen-icon {
        position: absolute;
        top: 112px;
    }
}
.ct-alerts-wrapper .ct-alert-reopen-icon.ct-alert-reopen-icon-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-alerts-wrapper .ct-alert-reopen-icon:hover,
.ct-alerts-wrapper .ct-alert-reopen-icon:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ct-alerts-wrapper .ct-alert-reopen-icon-svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .ct-alerts-wrapper .ct-alert-button {
        width: 100%;
        justify-content: center;
    }

    .ct-alerts-wrapper .ct-alert-layout-horizontal .ct-alert-content {
        flex-direction: column;
    }
}
