/* ============================================================
   InfoBrazil — Photo Upload Slots
   These styles appear both on the front-end (visitor view)
   and in the WP Admin edit screen.
   ============================================================ */

/* Base slot */
.ib-photo-slot {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.2);
}

/* When it has a real image */
.ib-photo-slot.has-image {
    border-style: solid;
    border-color: rgba(0, 156, 59, 0.5);
}

/* The background image layer */
.ib-photo-slot-preview {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    border-radius: 10px;
}
.ib-photo-slot:hover .ib-photo-slot-preview {
    transform: scale(1.04);
}

/* Dark overlay so the UI labels are readable */
.ib-photo-slot-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 10px;
    transition: background 0.2s;
}
.ib-photo-slot.has-image .ib-photo-slot-overlay {
    background: rgba(0, 0, 0, 0.3);
}
.ib-photo-slot:hover .ib-photo-slot-overlay {
    background: rgba(0, 0, 0, 0.55);
}

/* The placeholder "click to add" UI (hidden when image exists) */
.ib-photo-slot-placeholder {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    pointer-events: none;
}
.ib-photo-slot-placeholder .ib-slot-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.6;
    display: block;
}
.ib-photo-slot-placeholder .ib-slot-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
    font-family: 'DM Sans', sans-serif;
}
.ib-photo-slot-placeholder .ib-slot-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    font-family: 'DM Sans', sans-serif;
}

/* "Change photo" button (shown when image exists) */
.ib-photo-slot-change {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.ib-photo-slot.has-image .ib-photo-slot-change {
    display: block;
}
.ib-photo-slot-change:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Remove button (small X in corner) */
.ib-photo-slot-remove {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    background: rgba(220, 50, 50, 0.85);
    color: #fff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
}
.ib-photo-slot.has-image .ib-photo-slot-remove {
    display: block;
}

/* City card specific — taller slot */
.ib-city-card .ib-photo-slot {
    height: 210px;
    min-height: 210px;
    border-radius: 18px;
    border-width: 2px;
}

/* Attraction / beach card slot */
.ib-attraction-photo .ib-photo-slot {
    height: 130px;
    min-height: 130px;
    border-radius: 10px;
}

/* Hero slot — full width */
.ib-hero-photo-slot .ib-photo-slot {
    min-height: 480px;
    border-radius: 0;
    border: none;
}

/* Front-end: hide the upload UI, show the image cleanly */
body:not(.wp-admin) .ib-photo-slot {
    cursor: default;
    border-style: none;
}
body:not(.wp-admin) .ib-photo-slot-placeholder {
    display: none;
}
body:not(.wp-admin) .ib-photo-slot-change,
body:not(.wp-admin) .ib-photo-slot-remove {
    display: none !important;
}
body:not(.wp-admin) .ib-photo-slot-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 55%, rgba(0,0,0,0.05) 100%);
}

/* Admin bar offset */
.wp-admin .ib-photo-slot:hover {
    border-color: #009c3b;
}
