/* space.css — single space page (space.php).
   Neo-brutalist detail page matching the spaces directory: thick black borders,
   hard offset shadows, white cards directly on the wallpaper background (7.jpg).
   Fonts: PubliFluor (display, all-caps), FluxischElse (micro-labels), Gabarito (body). */

/* Page background = images/backgrounds/7.jpg (overrides spaces.css 1.jpg) */
body {
    background-image: url('../images/backgrounds/7.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #e5dcc9;
}

/* ---- Layout shell ---- */
.sp-single {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.sp-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    column-gap: 48px;
    row-gap: 36px;
    align-items: start;
    grid-template-areas:
        "head gallery"
        "body gallery"
        "comments similar";
}

.sp-head          { grid-area: head; min-width: 0; }
.sp-gallery-zone  { grid-area: gallery; min-width: 0; }
.sp-body          { grid-area: body; min-width: 0; }
.sp-comments      { grid-area: comments; min-width: 0; }
.sp-similar       { grid-area: similar; min-width: 0; }

/* ---- HEAD zone ---- */
.sp-head-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sp-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 3px solid #000;
    background: #9fbc99;
    box-shadow: 3px 3px 0 0 #000;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #000;
}

.sp-head-title {
    font-family: 'PubliFluor', Arial, sans-serif;
    font-size: 46px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.02;
    color: #ffffff;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    overflow-wrap: break-word;
    word-break: break-word;
}

.sp-head-city {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #dedede;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-head-city::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbff00;
    flex: none;
}

/* ---- GALLERY zone (right column) ---- */
.sp-gallery {
    border: 3px solid #000;
    border-radius: 8px;
    box-shadow: 8px 8px 0 0 #000;
    background: #1A1A1A;
    padding: 18px;
    margin-bottom: 22px;
}

.sp-gallery-main {
    width: 100%;
    height: 440px;
    border: 3px solid #000;
    background: #FFF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.sp-gallery-placeholder {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    font-family: 'FluxischElse', Arial, sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    color: #888;
}

.sp-gallery-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.25;
}

.sp-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.sp-thumb {
    width: 84px;
    height: 64px;
    flex: none;
    border: 3px solid #000;
    background: #FFF;
    overflow: hidden;
    cursor: pointer;
    padding: 2px;
    box-sizing: border-box;
    opacity: 0.75;
    transition: opacity 0.15s ease, transform 0.05s ease;
}

.sp-thumb.is-active {
    opacity: 1;
    box-shadow: 2px 2px 0 0 #000;
    transform: translate(-1px, -1px);
}

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

/* ---- Details card (schedule/instagram/address) ---- */
.sp-details {
    border: 3px solid #000;
    background: #FFF;
    box-shadow: 8px 8px 0 0 #000;
    padding: 8px 0;
}

.sp-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 20px;
    border-bottom: 2px solid #000;
}

.sp-detail-row:last-child {
    border-bottom: none;
}

.sp-detail-row-label {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
    flex: none;
}

.sp-detail-row-value {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    text-align: right;
    min-width: 0;
    overflow-wrap: break-word;
}

a.sp-detail-row-value {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---- BODY zone (left column) ---- */
.sp-detail-block {
    border: 3px solid #000;
    background: #FFF;
    box-shadow: 4px 4px 0 0 #000;
    padding: 22px;
    margin-bottom: 22px;
}

.sp-detail-block h2 {
    font-family: 'PubliFluor', Arial, sans-serif;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-detail-block p {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #222;
    white-space: pre-line;
    margin: 0;
}

/* Tags */
.sp-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.sp-tag-chip {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: #000;
    color: #FFF;
    padding: 8px 12px;
}

/* Action bar */
.sp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 4px;
}

.sp-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 20px;
    border: 3px solid #000;
    background: #FFF;
    box-shadow: 4px 4px 0 0 #000;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.sp-action-btn:hover {
    background: #EAF205;
}

.sp-save-btn.is-saved {
    background: #9fbc99;
}

.sp-action-btn .sp-ext-ic {
    flex: none;
}

.sp-cta-www {
    background: #EAF205;
}

.sp-cta-www:hover {
    background: #FFF;
}

.sp-cta-edit:hover {
    background: #FF5C00;
    color: #FFF;
}

/* ---- Section labels (comments + similar) ---- */
.sp-section-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.92);
    background: rgba(0,0,0,0.55);
    border: 2px solid #000;
    padding: 8px 14px;
    margin-bottom: 14px;
    box-shadow: 3px 3px 0 0 #000;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.sp-section-label span + span {
    color: rgba(255,255,255,0.6);
}

/* ---- COMMENTS zone ---- */
.sp-comments-list {
    display: flex;
    flex-direction: column;
}

.sp-comment-item {
    background: #FFF;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 0 #000;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.sp-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sp-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #000;
}

.sp-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.sp-comment-ui {
    flex: 1;
    min-width: 0;
}

.sp-comment-username {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.sp-comment-username:hover {
    text-decoration: underline;
}

.sp-comment-time {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.68rem;
    color: #888;
}

.sp-comment-body {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.88rem;
    color: #222;
    line-height: 1.55;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.sp-comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sp-comment-act {
    background: none;
    border: none;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #666;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.sp-comment-act:hover {
    color: #000;
}

.sp-comment-act.liked {
    color: #5f8f5a;
}

.sp-comment-like-count {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.7rem;
    color: #666;
}

.sp-comment-replies {
    margin-left: 46px;
    border-left: 3px solid #000;
    padding-left: 16px;
}

.sp-comment-replies .sp-comment-item {
    background: #f4eee6;
    box-shadow: 2px 2px 0 0 #000;
}

.sp-comment-replies .sp-comment-avatar {
    width: 28px;
    height: 28px;
}

.sp-view-replies,
.sp-more-replies {
    background: none;
    border: none;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #666;
    cursor: pointer;
    padding: 0;
    margin-top: 6px;
    transition: color 0.2s;
}

.sp-view-replies {
    margin-left: 46px;
}

.sp-more-replies {
    margin-left: 62px;
}

.sp-view-replies:hover,
.sp-more-replies:hover {
    color: #5f8f5a;
}

.sp-show-more {
    display: block;
    margin: 10px auto 4px;
    background: none;
    border: 2px solid #000;
    padding: 8px 16px;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 1.2px;
    color: #000;
    background: #FFF;
    cursor: pointer;
    transition: background 0.2s;
}

.sp-show-more:hover {
    background: #EAF205;
}

.sp-add-comment-area {
    padding-top: 6px;
}

.sp-add-comment-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFF;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 0 #000;
    padding: 12px 18px;
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sp-add-comment-trigger:hover {
    background: #EAF205;
    color: #000;
}

.sp-no-comments {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.4);
    border: 2px solid #000;
    padding: 18px;
    text-align: center;
}

.sp-no-comments button {
    color: #EAF205;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
}

/* ---- SIMILAR spaces zone ---- */
.sp-similar-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sp-similar-card {
    display: flex;
    gap: 14px;
    padding: 12px;
    background: #FFF;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 0 #000;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, transform 0.05s ease;
}

.sp-similar-card:hover {
    background: #EAF205;
}

.sp-similar-thumb {
    width: 96px;
    height: 72px;
    flex: none;
    border: 2px solid #000;
    overflow: hidden;
    background: #f4eee6;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.sp-similar-thumb-ph {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
}

.sp-similar-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.sp-similar-cat {
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5f8f5a;
}

.sp-similar-name {
    font-family: 'PubliFluor', Arial, sans-serif;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.15;
    color: #000;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-similar-city {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.72rem;
    color: #666;
}

.sp-similar-empty {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.4);
    border: 2px solid #000;
    padding: 18px;
    text-align: center;
}

/* ---- Photo lightbox ---- */
.sp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 15000;
    background: rgba(0,0,0,0.88);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.sp-modal.show {
    display: flex;
}

.sp-modal-content {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    border: 3px solid #000;
    box-shadow: 0 0 0 6px #EAF205;
    background: #FFF;
}

.sp-modal-image {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.sp-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    border: 3px solid #000;
    border-radius: 50%;
    background: #EAF205;
    color: #000;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

/* ---- Add comment modal (light) ---- */
.sp-comment-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 15000;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sp-comment-modal.show {
    display: flex;
}

.sp-comment-box {
    width: 100%;
    max-width: 480px;
    background: #f4eee6;
    border: 3px solid #000;
    box-shadow: 8px 8px 0 0 #000;
    overflow: hidden;
}

.sp-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 2px solid #000;
}

.sp-comment-title {
    font-family: 'PubliFluor', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
}

.sp-comment-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    color: #000;
}

.sp-comment-body {
    padding: 16px 18px;
}

.sp-comment-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 3px solid #000;
    background: #FFF;
    padding: 12px;
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.9rem;
    color: #222;
    resize: vertical;
    min-height: 90px;
}

.sp-comment-textarea:focus {
    outline: none;
    box-shadow: 3px 3px 0 0 #000;
}

.sp-comment-char-count {
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.72rem;
    color: #888;
    text-align: right;
    margin-top: 6px;
}

.sp-comment-char-count.over {
    color: #FF5757;
}

.sp-comment-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 2px solid #000;
}

.sp-comment-cancel,
.sp-comment-submit {
    border: 3px solid #000;
    padding: 10px 18px;
    font-family: 'FluxischElse', Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    background: #FFF;
    color: #000;
}

.sp-comment-cancel:hover {
    background: #FFF;
}

.sp-comment-submit {
    background: #EAF205;
}

.sp-comment-submit:hover {
    background: #9fbc99;
}

.sp-comment-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0,0,0,0.92);
    color: #fff;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: 'Gabarito', Arial, sans-serif;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s ease;
    z-index: 20000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Mobile / tablet (single column) ---- */
@media (max-width: 1080px) {
    .sp-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "gallery"
            "body"
            "comments"
            "similar";
        row-gap: 28px;
        padding: 0 6px;
    }

    .sp-head-title {
        font-size: 34px;
    }

    .sp-gallery-main {
        height: 320px;
    }

    .sp-comment-replies {
        margin-left: 26px;
    }
}

@media (max-width: 480px) {
    .sp-single {
        padding: 0 12px 60px;
    }

    .sp-head-title {
        font-size: 28px;
    }

    .sp-gallery {
        padding: 12px;
    }

    .sp-gallery-main {
        height: 240px;
    }

    .sp-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 16px;
    }

    .sp-detail-row-value {
        text-align: left;
    }

    .sp-actions {
        flex-direction: column;
    }

    .sp-action-btn {
        width: 100%;
        justify-content: center;
    }

    .sp-comment-replies {
        margin-left: 16px;
        padding-left: 10px;
    }

    .sp-view-replies {
        margin-left: 26px;
    }

    .toast {
        right: 16px;
        left: 16px;
        bottom: 90px;
    }
}