/**
 * v7/post/real-estate.css — 부동산 전용 CSS
 *
 * 목록 masonry 오버레이, 필터, 상세보기 필드 정보, 지도,
 * 글쓰기/수정 폼 스타일을 포함한다.
 * Bootstrap 미사용. Web Awesome CSS 변수 활용.
 */

/* ============================================================ */
/* === 부동산 필터 === */
/* ============================================================ */
.re-filter-nav {
    padding: 0.5rem 0 0.75rem;
}

.re-filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.re-filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 140px;
}

.re-filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wa-color-neutral-500, #64748b);
    white-space: nowrap;
}

.re-filter-label i {
    font-size: 0.7rem;
}

.re-filter-select {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid var(--wa-color-neutral-300, #d1d5db);
    border-radius: 6px;
    background: #fff;
    color: var(--wa-color-neutral-700, #334155);
    cursor: pointer;
}

.re-filter-select:focus {
    outline: none;
    border-color: var(--wa-color-brand-500, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ============================================================ */
/* === 부동산 Masonry 오버레이 (상단: 지역/건물/침실) === */
/* ============================================================ */
.re-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    z-index: 5;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.2) 80%, transparent 100%);
}

.re-info-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.re-info-item i {
    font-size: 10px;
    opacity: 0.9;
}

.re-building-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 가격 배지 (좌측 하단) */
.re-price-badge {
    position: absolute;
    bottom: 50px;
    left: 8px;
    z-index: 5;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.re-price-badge i {
    font-size: 10px;
    margin-right: 2px;
}

.re-price-unit {
    font-weight: 400;
    font-size: 10px;
    opacity: 0.8;
}

/* ============================================================ */
/* === 부동산 상세보기 이미지 카로셀 (wa-carousel Gallery) === */
/* ============================================================ */
.re-gallery-wrapper {
    margin: 0.5rem 0;
    margin-bottom: 2.5rem;
    position: relative;
}

/* 카로셀 기본 설정 — 3:2 비율, 이미지 꽉 채움 */
.re-carousel {
    --aspect-ratio: 3 / 2;
    border-radius: 14px;
    overflow: hidden;
}

.re-carousel wa-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 네비게이션 버튼을 슬라이드 위에 오버랩 — grid 영역 통합 */
.re-carousel::part(base) {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas: 'slides' 'pagination';
}

.re-carousel::part(navigation-button-previous) {
    grid-area: slides;
    z-index: 10;
    align-self: center;
    justify-self: start;
    margin-left: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.re-carousel::part(navigation-button-next) {
    grid-area: slides;
    z-index: 10;
    align-self: center;
    justify-self: end;
    margin-right: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.re-carousel::part(navigation-button-previous):hover,
.re-carousel::part(navigation-button-next):hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

/* 하단 썸네일 — 50% 오버랩 (절반은 이미지 안, 절반은 아래로) */
.re-thumbnails {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    max-width: 90%;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.re-thumbnails::-webkit-scrollbar {
    display: none;
}

.re-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid transparent;
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.re-thumb:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.re-thumb.active {
    opacity: 1;
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--wa-color-brand-600, #2563eb), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.08);
}

/* 모바일: 썸네일 축소 */
@media (max-width: 640px) {
    .re-thumb {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }
    .re-thumbnails {
        bottom: -20px;
        gap: 0.3rem;
        padding: 0.2rem 0.35rem;
    }
    .re-gallery-wrapper {
        margin-bottom: 1.5rem;
    }
}

/* ============================================================ */
/* === 부동산 상세보기 필드 정보 === */
/* ============================================================ */
.re-detail-section {
    margin: 1rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.re-detail-group {
    padding: 0.75rem 0;
}

.re-detail-group + .re-detail-group {
    border-top: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.re-detail-group-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wa-color-neutral-600, #475569);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.re-detail-group-header i {
    font-size: 0.85rem;
    color: var(--wa-color-brand-600, #2563eb);
    width: 1.1rem;
    text-align: center;
}

.re-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 뱃지 공통 스타일 */
.re-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.15s ease;
}

.re-badge:hover {
    transform: translateY(-1px);
}

.re-badge i {
    font-size: 0.75rem;
    opacity: 0.85;
}

.re-badge strong {
    font-weight: 700;
}

/* 뱃지 색상 */
.re-badge-primary {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.re-badge-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.re-badge-info {
    background: #ecfeff;
    color: #155e75;
    border-color: #a5f3fc;
}

.re-badge-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.re-badge-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
}

.re-badge-neutral {
    background: white;
    color: var(--wa-color-neutral-700, #334155);
    border-color: var(--wa-color-neutral-200, #e2e8f0);
}

/* 주소 텍스트 */
.re-address-text {
    font-size: 0.85rem;
    color: var(--wa-color-neutral-700, #334155);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    background: white;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.re-address-text i {
    color: #dc2626;
    margin-right: 0.4rem;
    font-size: 0.9rem;
}

/* ============================================================ */
/* === Google Maps 지도 === */
/* ============================================================ */
.re-map-section {
    margin: 0.5rem 0 1rem;
}

.re-map-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 비율 */
    border-radius: 12px;
    overflow: hidden;
    background: var(--wa-color-neutral-100, #f1f5f9);
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.re-map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.re-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--wa-color-neutral-100, #f1f5f9);
    border-radius: 8px;
    color: var(--wa-color-neutral-400, #94a3b8);
}

.re-map-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.re-map-placeholder p {
    margin: 0;
    font-size: 0.85rem;
}

/* ============================================================ */
/* === 부동산 글쓰기/수정 폼 === */
/* ============================================================ */

/* 전체 래퍼 */
.re-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

/* 섹션 카드 */
.re-form-section {
    padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    transition: border-color 0.2s;
}

.re-form-section:focus-within {
    border-color: var(--wa-color-brand-300, #93c5fd);
}

/* 섹션 타이틀 */
.re-form-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--wa-color-neutral-800, #1e293b);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.re-form-title i {
    color: var(--wa-color-brand-600, #2563eb);
    font-size: 1rem;
}

/* 그리드 레이아웃 */
.re-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
}

@media (max-width: 640px) {
    .re-form-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
}

/* 필드 래퍼 */
.re-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.re-form-field.re-form-full {
    grid-column: 1 / -1;
}

/* 레이블 */
.re-form-field label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wa-color-neutral-600, #475569);
    letter-spacing: -0.01em;
}

.re-form-field label i {
    font-size: 0.78rem;
    color: var(--wa-color-brand-500, #3b82f6);
    width: 14px;
    text-align: center;
}

/* 필수 표시 */
.re-required {
    color: #ef4444;
    font-weight: 700;
    margin-left: 1px;
}

/* 입력 필드 공통 */
.re-form-field input,
.re-form-field select {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    border: 1px solid var(--wa-color-neutral-300, #d1d5db);
    border-radius: 8px;
    background: #fff;
    color: var(--wa-color-neutral-800, #1e293b);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}

.re-form-field input::placeholder {
    color: var(--wa-color-neutral-400, #94a3b8);
    font-size: 0.82rem;
}

.re-form-field input:focus,
.re-form-field select:focus {
    outline: none;
    border-color: var(--wa-color-brand-500, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* 힌트 텍스트 */
.re-form-hint {
    font-size: 0.7rem;
    color: var(--wa-color-neutral-400, #94a3b8);
    margin-top: 0.1rem;
}

/* select 드롭다운 커스텀 화살표 */
.re-form-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='M4.427 6.427l3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 6H4.604a.25.25 0 0 0-.177.427z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px;
    padding-right: 2rem;
    cursor: pointer;
}

/* number 입력 필드 스피너 숨김 (깔끔한 디자인) */
.re-form-field input[type="number"]::-webkit-inner-spin-button,
.re-form-field input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.re-form-field input[type="number"] {
    -moz-appearance: textfield;
}

/* 부동산 필드 에러 스타일 */
.re-field-has-error select,
.re-field-has-error input {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}
.re-field-has-error label {
    color: #dc2626;
}
.re-field-error {
    color: #dc2626;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    animation: re-field-error-shake 0.4s ease-in-out;
}
.re-field-error i {
    font-size: 0.85rem;
}
@keyframes re-field-error-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ============================================================ */
/* === 업소록 연락처 박스 (부동산 글 작성 페이지) === */
/* ============================================================ */
.re-company-contact-box {
    background: var(--wa-color-brand-95);
    border: 1px solid var(--wa-color-brand-90);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.re-company-contact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.re-company-contact-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--wa-color-brand-30);
}

.re-company-contact-title i {
    font-size: 0.95rem;
}

.re-company-contact-desc {
    font-size: 0.78rem;
    color: var(--wa-color-neutral-40);
    margin: 0 0 0.75rem;
    line-height: 1.55;
}

.re-company-contact-desc strong {
    color: var(--wa-color-brand-30);
    font-weight: 600;
}

.re-company-contact-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem 0.9rem;
    background: #fff;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--wa-color-neutral-95);
}

.re-company-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    min-height: 1.9rem;
}

.re-company-contact-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--wa-color-neutral-40);
    font-weight: 600;
    min-width: 72px;
    font-size: 0.75rem;
}

.re-company-contact-label i {
    color: var(--wa-color-brand-50);
    font-size: 0.85rem;
    width: 14px;
    text-align: center;
}

.re-company-contact-value {
    color: var(--wa-color-neutral-10);
    font-weight: 500;
    word-break: break-all;
}

.re-company-contact-empty {
    color: var(--wa-color-neutral-60);
    font-style: normal;
    font-weight: 400;
    font-size: 0.75rem;
}

/* ============================================================ */
/* === 작성자 연락처 카드 (부동산 글 보기 페이지) === */
/* ============================================================ */
.re-author-contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem;
}

.re-author-contact-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
    background: #fff;
    border: 1px solid var(--wa-color-neutral-90);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 56px;
}

a.re-author-contact-card {
    cursor: pointer;
}

a.re-author-contact-card:hover {
    border-color: var(--wa-color-neutral-80);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);
}

div.re-author-contact-card {
    cursor: default;
}

.re-author-contact-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wa-color-brand-95);
    color: var(--wa-color-brand-50);
    font-size: 0.95rem;
}

/* 카카오톡 카드 — 아이콘만 카카오 옐로우 */
.re-author-contact-card--kakao .re-author-contact-icon {
    background: #fef3c7;
    color: #d97706;
}

/* 텔레그램 카드 — 아이콘만 텔레그램 블루 */
.re-author-contact-card--telegram .re-author-contact-icon {
    background: #e0f2fe;
    color: #0284c7;
}

.re-author-contact-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.re-author-contact-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--wa-color-neutral-50);
    letter-spacing: 0.02em;
}

.re-author-contact-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--wa-color-neutral-10);
    word-break: break-all;
    line-height: 1.3;
}

/* 모바일: 2칼럼 그리드 */
@media (max-width: 600px) {
    .re-company-contact-fields {
        grid-template-columns: 1fr;
    }
    .re-company-contact-header {
        align-items: flex-start;
    }
    .re-author-contact-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    .re-author-contact-card {
        padding: 0.6rem 0.7rem;
        gap: 0.55rem;
        min-height: 52px;
    }
    .re-author-contact-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .re-author-contact-label {
        font-size: 0.65rem;
    }
    .re-author-contact-value {
        font-size: 0.82rem;
    }
}

/* 매우 작은 화면(<360px)은 1칼럼 폴백 */
@media (max-width: 359px) {
    .re-author-contact-cards {
        grid-template-columns: 1fr;
    }
}
