/* Invitation Website Builder — wedding category (modern pass) */

.iw-side-toggle-wrapper {
    margin-bottom: 22px;
}

.iw-side-toggle-label {
    display: block;
    font-size: var(--iw-fs-caption);
    font-weight: var(--iw-fw-semibold);
    color: var(--iw-ink);
}

.iw-side-toggle-sub {
    font-size: var(--iw-fs-small);
    font-weight: var(--iw-fw-regular);
    color: var(--iw-muted);
    margin: 4px 0 12px;
    line-height: 1.5;
}

/* Segmented control — a soft sliding-style active state, groom/bride emoji
   next to each label. */
.iw-side-toggle {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: var(--iw-surface-sunken);
    border: 1px solid var(--iw-border);
    border-radius: 12px;
}

.iw-side-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    padding: 9px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--iw-fs-caption);
    font-weight: var(--iw-fw-semibold);
    color: var(--iw-muted);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.iw-side-btn-icon {
    font-size: 15px;
    line-height: 1;
}

.iw-side-btn.active {
    background: var(--iw-surface);
    color: var(--iw-accent-dark);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.iw-partners-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 4px;
}

/* Whoever is "first" per the Bride Side/Groom Side toggle shows first here
   too — same side-swap idea as everywhere else in the theme (names, cards,
   tokens), not just a fixed groom-then-bride order. */
.iw-groom-section {
    order: 1;
}

.iw-bride-section {
    order: 2;
}

.iw-partners-wrapper.bride-first .iw-groom-section {
    order: 2;
}

.iw-partners-wrapper.bride-first .iw-bride-section {
    order: 1;
}

.iw-partner-section {
    padding-top: 4px;
}

/* Micro section label — same scale as .iw-event-form-header h4 below, so
   every "quiet section heading" in the form reads at one consistent size. */
.iw-partner-section-header {
    font-size: var(--iw-fs-micro);
    font-weight: var(--iw-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--iw-accent-dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--iw-accent-tint-strong);
}

/* A real joined "input group" — one shared border/background with a thin
   internal divider, rather than two separate boxed inputs sitting next to
   each other with a gap (which reads as unrelated fields, not a pair). */
.iw-family-split {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    gap: 5px;
}

.iw-family-split:focus-within {
    border-color: var(--iw-accent);
    box-shadow: 0 0 0 4px rgba(255, 92, 130, 0.12);
}

.iw-family-split .iw-input {
    border: none;
    border-radius: 0;
    /* longhand only — "background: transparent" shorthand would reset
       background-image too, deleting the custom select arrow below */
    background-color: transparent;
}

.iw-family-split .iw-input:focus {
    box-shadow: none;
}

/* Qualified with .iw-family-split so specificity matches (and, being later
   in source, wins) the "border: none" reset on .iw-family-split .iw-input
   above — otherwise the divider border would be silently overridden. */
.iw-family-split .iw-family-prefix {
    flex: 0 0 128px;
    border-right: 1.5px solid var(--iw-input-border);
    /* select.iw-input already reserves 38px of right padding for the arrow */
}

.iw-family-split .iw-family-names {
    flex: 1;
    min-width: 0;
}

/* Small phones: 128px prefix + name side-by-side gets too cramped to type
   in comfortably, so stack them instead — divider moves to the bottom edge. */
@media (max-width: 400px) {
    .iw-family-split {
        flex-direction: column;
    }

    .iw-family-split .iw-family-prefix {
        flex: 1 1 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1.5px solid var(--iw-input-border);
    }
}

/* ---------------------------------------------------------------
   Events
--------------------------------------------------------------- */

.iw-events-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--iw-muted);
    font-size: var(--iw-fs-caption);
    font-weight: var(--iw-fw-regular);
    border: 1.5px dashed var(--iw-accent-tint-strong);
    border-radius: 14px;
    margin-bottom: 16px;
}

.iw-events-empty p {
    margin: 0;
}

.iw-event-block {
    border: 1px solid var(--iw-border);
    border-left: 3px solid var(--iw-accent);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--iw-surface-sunken);
}

.iw-event-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-weight: var(--iw-fw-semibold);
    font-size: var(--iw-fs-caption);
    color: var(--iw-ink);
}

.iw-event-summary-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iw-event-edit-btn,
.iw-delete-event-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--iw-fs-small);
    font-weight: var(--iw-fw-semibold);
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--iw-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.iw-event-edit-btn:hover {
    background: var(--iw-accent-tint);
    color: var(--iw-accent-dark);
}

.iw-delete-event-btn:hover {
    background: #ffe3e3;
    color: #e0334f;
}

.iw-event-summary-body {
    padding: 0 14px 14px;
}

.iw-event-summary-name {
    font-weight: var(--iw-fw-semibold);
    color: var(--iw-ink);
    font-size: var(--iw-fs-secondary);
}

.iw-event-summary-meta,
.iw-event-summary-venue {
    font-size: var(--iw-fs-small);
    font-weight: var(--iw-fw-regular);
    color: var(--iw-muted);
    margin-top: 3px;
}

.iw-event-form {
    padding: 16px 14px;
    background: var(--iw-surface);
}

.iw-event-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.iw-event-form-header h4 {
    margin: 0;
    font-size: var(--iw-fs-micro);
    font-weight: var(--iw-fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--iw-muted);
}

.iw-add-event-btn {
    width: 100%;
    padding: 13px;
    border: 1.5px dashed #ffb8ca;
    border-radius: 12px;
    background: transparent;
    color: var(--iw-accent-dark);
    font-family: inherit;
    font-weight: var(--iw-fw-semibold);
    font-size: var(--iw-fs-secondary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.iw-add-event-btn:hover {
    background: var(--iw-accent-tint);
    border-color: var(--iw-accent);
}

.iw-event-done-btn {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    background: var(--iw-accent);
    color: #fff;
}

/* ---------------------------------------------------------------
   Couple Photos
--------------------------------------------------------------- */

.iw-couple-photos {
    display: flex;
    gap: 20px;
}

.iw-photo-uploader {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.iw-photo-uploader .iw-field-label {
    margin-bottom: 10px;
}

.iw-photo-avatar {
    width: 110px;
    height: 110px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--iw-surface-sunken);
    border: 1.5px dashed var(--iw-input-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--iw-muted);
    transition: opacity 0.15s ease;
}

.iw-photo-avatar svg {
    width: 32px;
    height: 32px;
}

.iw-photo-avatar.has-photo {
    border-style: solid;
    border-color: var(--iw-border);
}

.iw-photo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iw-photo-avatar.iw-photo-loading {
    opacity: 0.5;
}

.iw-photo-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.iw-photo-upload-btn,
.iw-photo-change-btn {
    background: var(--iw-surface);
    color: var(--iw-accent-dark);
    border: 1.5px solid var(--iw-accent);
    padding: 9px 16px;
    font-size: var(--iw-fs-small);
}

.iw-photo-upload-btn:hover,
.iw-photo-change-btn:hover {
    background: var(--iw-accent-tint);
}

.iw-photo-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--iw-fs-small);
    font-weight: var(--iw-fw-semibold);
    color: #e0834f;
    padding: 4px 8px;
}

.iw-photo-delete-btn:hover {
    text-decoration: underline;
}

.iw-photo-hint {
    margin: 8px 0 0;
    font-size: var(--iw-fs-micro);
    color: var(--iw-muted);
}

/* ---------------------------------------------------------------
   "Steps:" instruction box (e.g. Venue Details' Google Maps link help)
--------------------------------------------------------------- */

.iw-venue-highlights-input {
    resize: none;
}

.iw-steps-box {
    margin-top: 10px;
    padding: 14px 16px;
    background: #eef1fc;
    border-radius: 10px;
}

.iw-steps-box-title {
    margin: 0 0 6px;
    font-size: var(--iw-fs-caption);
    font-weight: var(--iw-fw-semibold);
    color: var(--iw-ink);
}

.iw-steps-box-list {
    margin: 0;
    padding-left: 18px;
    font-size: var(--iw-fs-caption);
    color: var(--iw-ink-soft);
    line-height: 1.6;
}

.iw-steps-box-list a {
    color: var(--iw-accent-dark);
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .iw-steps-box {
        background: rgba(120, 130, 255, 0.12);
    }
}

/* ---------------------------------------------------------------
   Background Music — sample vs custom radio cards + the "Select
   from Library" / "Upload Audio File" pair shown under "custom"
--------------------------------------------------------------- */

.iw-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.iw-radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--iw-surface-sunken);
    border: 1.5px solid var(--iw-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.iw-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.iw-radio-dot {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--iw-input-border);
    background: var(--iw-surface);
    position: relative;
    transition: border-color 0.15s ease;
}

.iw-radio-dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--iw-accent);
    transform: scale(0);
    transition: transform 0.15s ease;
}

.iw-radio-label {
    font-size: 14px;
    font-weight: var(--iw-fw-medium);
    color: var(--iw-ink-soft);
}

.iw-radio-card.active {
    background: var(--iw-accent-tint);
    border-color: var(--iw-accent);
}

.iw-radio-card.active .iw-radio-dot {
    border-color: var(--iw-accent);
}

.iw-radio-card.active .iw-radio-dot::after {
    transform: scale(1);
}

.iw-radio-card.active .iw-radio-label {
    color: var(--iw-accent-dark);
    font-weight: var(--iw-fw-semibold);
}

.iw-music-custom-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--iw-border);
}

.iw-or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--iw-muted);
    font-size: var(--iw-fs-small);
    font-weight: var(--iw-fw-semibold);
}

.iw-or-divider::before,
.iw-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--iw-border);
}

.iw-music-upload-status {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.iw-music-upload-status:empty {
    display: none;
}

.iw-music-upload-filename {
    font-size: var(--iw-fs-caption);
    color: var(--iw-ink-soft);
}

/* Preview play button + filename sit on one row; the Change button (below,
   unaffected) keeps its existing centered-column placement. */
.iw-music-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iw-music-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1.5px solid var(--iw-input-border);
    border-radius: 50%;
    background: var(--iw-surface);
    color: var(--iw-ink-soft);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.iw-music-play-btn:hover {
    border-color: var(--iw-accent);
    color: var(--iw-accent);
}

.iw-music-play-btn.is-playing {
    background: var(--iw-accent);
    border-color: var(--iw-accent);
    color: #ffffff;
}

.iw-music-change-btn {
    flex-shrink: 0;
    padding: 5px 14px;
    border: none;
    border-radius: 999px;
    background: #ff7396;
    color: #ffffff;
    font-family: inherit;
    font-size: var(--iw-fs-small);
    font-weight: var(--iw-fw-semibold);
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.iw-music-change-btn:hover {
    opacity: 0.85;
}

/* ---------------------------------------------------------------
   Photo Gallery
--------------------------------------------------------------- */

.iw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.iw-gallery-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--iw-border);
    background: var(--iw-surface-sunken);
}

.iw-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.iw-gallery-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(20, 20, 30, 0.55);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.iw-gallery-remove-btn:hover {
    background: #e0334f;
}

.iw-gallery-add-tile {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1.5px dashed var(--iw-input-border);
    background: var(--iw-surface-sunken);
    color: var(--iw-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-size: var(--iw-fs-micro);
    font-weight: var(--iw-fw-medium);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.iw-gallery-add-tile:hover {
    background: var(--iw-accent-tint);
    border-color: var(--iw-accent);
    color: var(--iw-accent-dark);
}

.iw-gallery-add-icon {
    font-size: 20px;
    line-height: 1;
    font-weight: var(--iw-fw-regular);
}

@media (prefers-color-scheme: dark) {
    .iw-event-block { background: var(--iw-surface-sunken); }
    .iw-event-form { background: var(--iw-surface); }
}
