.giglist {
    --pic-width: 320px;
    --pic-height: 440px;
    --background: whitesmoke;
    --header-color: #303030;
    --header-text: white;
}


.giglist>.gigs .gig .gigpic>img.expand-image {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: black;
    object-fit: contain;
    z-index: 3000;
    scale: 0.97;
}


.giglist {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.49;
}


.giglist {
    background-color: var(--background);
}

.giglist * {
    box-sizing: border-box;
}



.giglist {
    margin: 0 auto;
    max-width: 96vw;
}

.giglist>.gigs {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 20px;
    padding: 10px;
    color: black;
}

.giglist:not(.strip)>.gigs {
    flex-wrap: wrap;
}

.gigpic>img {
    width: var(--pic-width);
    max-width: 100%;
    transition: all 0.3s;
}

.gigpic>img:hover {
    transform: scale(1.01);
}

.gig>div {
    width: var(--pic-width);
    object-fit: contain;
}

.giglist.align-bottom {
    &>.gigs {
        align-items: flex-end;
    }

    .gigpic>img {
        height: auto;
    }
}


.giglist.align-center {
    &>.gigs {
        align-items: center;
    }

    .gigpic>img {
        height: auto;
    }
}


.giglist.align-stretch {
    &>.gigs {
        align-items: stretch;
    }

    .gigpic>img {
        height: auto;
    }
}

.giglist.align-top {
    &>.gigs {
        align-items: flex-start;
    }

    .gigpic>img {
        height: auto
    }
}

.giglist.align-base {
    &>.gigs {
        align-items: baseline;
    }

    .gigpic>img {
        height: auto
    }
}

.giglist.align-cover {
    .gigpic>img {
        object-fit: cover;
        height: var(--pic-height);
    }
}

.giglist.align-columns {
    .gigs {
        gap: 2%;
    }

    .gig>div {
        width: 100%;
    }

    .gig>.gigpic>img {
        width: 100%;
    }

    .gig {
        margin: 20px 0;
    }
}



.giglist .controls {
    text-align: right;
    position: fixed;
    bottom: 5px;
    right: 15px;
    background-color: transparent;
    z-index: 2000;
}

.giglist .controls>label,
.giglist button {
    padding: 6px;
    color: white;
    background-color: dodgerblue;
    border-radius: 5px;
    border: 0;
}

.giglist .controls>label *,
.giglist .controls>label {
    font-size: smaller;
    margin: 2px 2px 0 2px;
}

.giglist:not(.editing) .alignment-control {
    display: none;
}

.giglist button:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid blue;
    font-weight: bold;
}

.giglist.editing .gig-field {
    border: 1px solid grey;
}


.giglist.editing #editButton {
    border: 1px solid red;
    background-color: yellow;
    color: black;
}

.giglist:not(.editing) .unlessEditing {
    display: none;
}

.giglist.editing .prop-show {
    display: none;
}

.giglist.editing .prop-edit {
    display: block !important;
}

.prop-edit {
    font-size: small;
}

.giglist.edit-in-progress #editButton {
    background-color: red;
    color: pink;
}

.gig {
    background-color: white;
    color: black;
    position: relative;
    border: 1px solid black;
    border-radius: 10px;
    /* box-shadow: 5px 5px lightgray; */
    overflow: clip;
}

.gig>.prop-show:first-child {font-weight: bold;
    color: var(--header-text);
    background-color: var(--header-color);
    padding: 4px 10px;
    box-shadow: 0 1px var(--header-color);
    z-index: 2;
    position: relative;
}

.giglist:not(.strip) .gig {
    overflow: hidden;
}

.giglist.strip {
    position: relative;
    max-width: 100%;
}

.giglist.strip>.gigs {
    overflow: scroll;
    scrollbar-width: none;
}

.giglist.strip>.controls {
    display: none;
}

.gig input {
    border: 0;
}

.dtstart,
.dtend {
    width: 8em;
}

.gig .emoji {
    height: 1em;
}

.gig>div {
    padding: 0 6px;
}

.gig-title {
    font-size: large;
}

.gig-dtinfo {
    width: 100%;
}

.gig.onedate .gig-dtend-group {
    opacity: 0.5;
}

.gig.onedate.recurs .gig-dtend-group::after {
    content: "forever";
    font-size: small
}

.gig.locallink .gig-bookinglink-group {
    opacity: 0.2;
}

.invalid-field {
    outline: 1px solid red;
}

span.recurrence {
    font-size: small;
    text-wrap-mode: nowrap;
}

.venuebooking input {
    float: right;
}


.gig .bookbutton {
    float: right;
    background-color: var(--header-color) !important;
    border: 1px solid black;
    color: var(--header-text) !important;
    border-radius: 2px;
    position: relative;
}

.gig .bookbutton::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    height: 10px;
    width: 10px;
    border-top: 1px solid var(--header-text);
    border-right: 1px solid var(--header-text);
}

.giglist.editing .bookbutton {
    display: none;
}

.gigpic {
    position: relative;
    padding: 0;
    margin-top: -1px;
}

.gigpic>img {
    border-top: 1px solid lightgray;
    border-bottom: 1px solid lightgray;
    cursor: nesw-resize;
}

.gigpic>.overlay {
    position: absolute;
    top: 0;
    left: 0;
}

.gig-controls {
    position: absolute;
    top: 20px;
    right: 0;
    display: flex;
    justify-content: flex-end;
}

.delete-button {
    inset: 1px solid red;
}

.prop-edit>* {
    margin: 0 4px;
    padding: 4px;
}

pre {
    font-size: small;
}

/* Set this during clicked scroll in .horizontal .eventList.
    But don't set while dragging - bad effect.
*/
.smoothie {
    scroll-behavior: smooth;
}

@media (min-width: 700px) {
    .sa_scrollButton {
        font-size: 32px;
        font-weight: bold;
        position: absolute;
        top: 90px;
        width: 30px;
        height: 60px;
        color: rgb(80, 80, 80);
        cursor: pointer;
        /*border: 3px solid rgb(196, 196, 196);
            box-shadow: 0 0 0 2px rgb(255,255,255);*/
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 0;
        user-select: none;
        text-align: center;
        vertical-align: middle;
        line-height: 60px;
    }

    .sa_scrollerLeft {
        left: auto;
        right: 0;
        margin-right: -15px;
    }

    .sa_scrollerRight {
        left: 0;
        right: auto;
        margin-left: -15px;
    }

    .sa_horizontal_activities {
        position: relative;
    }
}

@media (max-width: 700px) {
    .sa_scrollButton {
        display: none;
    }

    .giglist.strip .gigs>.gig:not(:first-child) {
        display: none;
    }
}

/* Gig content display */
.gig-content-wrapper {
    position: relative;
}

.gig-content-wrapper:has(.gig-content:empty) {
    display: none;
}

.gig-content {
    padding: 6px;
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre-line;
    cursor: pointer;
}

.gig-content:empty {
    display: none;
}

.gig-content-full {
    display: none;
    cursor: default;
}

.gig-content-full[data-locallink="true"] {
    cursor: pointer;
}

.gig-content-wrapper.expanded .gig-content-full {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 50vh;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px 4px 0 0;
    padding: 12px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-line;
}

/* Show expanded content on hover for devices that support it */
@media (hover: hover) {
    .giglist:not(.editing) .gig-content-wrapper:hover .gig-content-full {
        display: block;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        overflow-y: auto;
        background-color: white;
        border: 1px solid #ccc;
        border-radius: 4px 4px 0 0;
        padding: 12px;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
        z-index: 100;
        font-size: 0.9em;
        line-height: 1.5;
        white-space: pre-line;
    }
}

.giglist.editing .gig-content-wrapper {
    display: block !important;
}

.giglist.editing .gig-content {
    cursor: pointer;
    background-color: #f5f5f5;
    border: 1px dashed #ccc;
}

.giglist.editing .gig-content:empty {
    display: block;
}

.giglist.editing .gig-content:empty::before {
    content: "Add description...";
    color: #999;
    font-style: italic;
}

.giglist.editing .gig-content:hover {
    background-color: #e8f4fc;
    border-color: #69c;
}

.giglist.editing .gig-content-full {
    display: none !important;
}

/* ***** Pending-approval flag (admin only) ***** */

.gig:has(.gig-pending) {
    border-color: #cc0000;
    box-shadow: 0 0 0 2px #cc0000;
}

.gig-pending {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background-color: #cc0000;
    color: white;
    padding: 4px 8px;
    font-size: small;
    font-weight: bold;
}

.gig-pending-label {
    line-height: 1.2;
}

.giglist button.gig-approve-button {
    background-color: white;
    color: #cc0000;
    border: 1px solid white;
    font-weight: bold;
    white-space: nowrap;
    flex: 0 0 auto;
}

.giglist button.gig-approve-button:hover {
    background-color: #ffe8e8;
    border: 1px solid white;
}

.gig-pending-buttons {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.giglist button.gig-reject-button {
    background-color: transparent;
    color: white;
    border: 1px solid white;
    font-weight: bold;
    white-space: nowrap;
    flex: 0 0 auto;
}

.giglist button.gig-reject-button:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border: 1px solid white;
}

/* Rejected event (admin only): grey flag instead of red. Placed after the
   .gig:has(.gig-pending) rule so it wins for a rejected gig (which carries
   both classes). */
.gig:has(.gig-rejected) {
    border-color: #666;
    box-shadow: 0 0 0 2px #666;
}

.gig-pending.gig-rejected {
    background-color: #666;
}

/* Fixed banner shown at the top of the window while any event awaits approval
   (admin only). Clicking it scrolls the first pending event into view. */
.gigio-pending-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background-color: #cc0000;
    color: white;
    text-align: center;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.gigio-pending-banner:hover {
    background-color: #b00000;
}

/* Transient toast (e.g. "Copied organizer email…" after Reject) */
.gigio-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 12px);
    z-index: 100000;
    max-width: 90vw;
    background-color: #222;
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.gigio-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ***** Submission page ([gigiau_submit]) ***** */

.gigio-submit {
    font-family: 'Roboto', sans-serif;
    max-width: 640px;
    margin: 0 auto;
    color: #222;
}

.gigio-submit * {
    box-sizing: border-box;
}

.gigio-submit h2 {
    margin: 0 0 12px;
}

.gigio-submit-status {
    padding: 0;
}

.gigio-submit-status:not(:empty) {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.95em;
}

.gigio-submit-status.error {
    background-color: #fdecea;
    color: #a12622;
    border: 1px solid #f5c2c0;
}

.gigio-submit-status.success {
    background-color: #eafaf0;
    color: #1c6b3c;
    border: 1px solid #b7e4c7;
}

.gigio-submit .gigio-field {
    display: block;
    margin-bottom: 14px;
}

.gigio-submit .gigio-field > span {
    display: block;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.gigio-submit input[type="text"],
.gigio-submit input[type="email"],
.gigio-submit input[type="password"],
.gigio-submit input[type="url"],
.gigio-submit input[type="datetime-local"],
.gigio-submit input[type="date"],
.gigio-submit input[type="file"],
.gigio-submit select {
    width: 100%;
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 1em;
    background-color: white;
}

.gigio-submit button {
    padding: 9px 16px;
    color: white;
    background-color: dodgerblue;
    border: 0;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}

.gigio-submit button:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Submit button greyed while the event form isn't valid yet (still clickable,
   so a click can explain what's missing). */
.gigio-submit button.gigio-submit-btn.gigio-btn-disabled {
    background-color: #b0b0b0;
    cursor: not-allowed;
}

.gigio-submit button.gigio-submit-btn.gigio-btn-disabled:hover {
    box-shadow: none;
}

/* Submit in flight: grey the button and show an activity cursor. */
.gigio-submit button.gigio-submit-btn:disabled {
    background-color: #b0b0b0;
    cursor: progress;
    box-shadow: none;
}

.gigio-submit.gigio-busy,
.gigio-busy .gigio-submit button {
    cursor: progress;
}

.gigio-submit button.gigio-secondary {
    background-color: transparent;
    color: dodgerblue;
    text-decoration: underline;
    padding: 6px 4px;
}

.gigio-submit button.gigio-danger {
    background-color: #cc0000;
}

.gigio-submit-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.gigio-submit-topbar .gigio-who {
    font-size: 0.9em;
    color: #555;
}

.gigio-submit fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px;
    margin: 0 0 18px;
}

.gigio-submit legend {
    font-weight: bold;
    padding: 0 6px;
}

/* Gentle hint that the start date is in the past (needs an end date today or
   later). Not a hard error — the real check happens on Submit. */
.gigio-submit input.gigio-old-date {
    outline: 2px solid #cc0000;
    outline-offset: 1px;
}

/* My events list */
.gigio-my-events {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
}

.gigio-my-event {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
}

.gigio-event-form {
    padding: 0 20px 40px 20px;
    background-color: whitesmoke;
    border-radius: 4px;
}

.gigio-my-event img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex: 0 0 auto;
    background: #f0f0f0;
}

.gigio-my-event .gigio-my-event-main {
    flex: 1 1 auto;
    min-width: 0;
}

.gigio-my-event .gigio-my-event-title {
    font-weight: bold;
}

.gigio-my-event .gigio-my-event-meta {
    font-size: 0.85em;
    color: #666;
}

.gigio-status-badge {
    display: inline-block;
    font-size: 0.75em;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.gigio-status-badge.pending {
    background-color: #fff0e0;
    color: #b5651d;
    border: 1px solid #f0c08a;
}

.gigio-status-badge.approved {
    background-color: #eafaf0;
    color: #1c6b3c;
    border: 1px solid #b7e4c7;
}

.gigio-status-badge.rejected {
    background-color: #fdecea;
    color: #a12622;
    border: 1px solid #f5c2c0;
}

.gigio-my-event-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.gigio-submit button.gigio-delete-event {
    color: #cc0000;
}

.gigio-account {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}

.gigio-account .gigio-change-pw-form {
    max-width: 320px;
}