/* =====================================================================
   LOCATIONS PAGE — map cards and the add/edit location editor
   (loaded only by locations.html, after base.css)
   ===================================================================== */

/* ---------- LOCATIONS ---------- */
.locations-section { padding: 60px var(--gutter) 100px; }

.locations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 30px; max-width: 1300px; margin: 0 auto; }

.loc-card {
    background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border);
    display: flex; flex-direction: column; position: relative; transition: box-shadow 0.3s, transform 0.3s;
}

.loc-card:hover { box-shadow: var(--shadow-hover); }

.loc-card.featured { border: 2px solid var(--primary); }

.loc-map { position: relative; aspect-ratio: 4 / 3; background: #e9e5df; }

.loc-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.loc-map::before { content: 'Loading map…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #999; font-size: 0.95rem; }

.loc-body { padding: 24px 24px 26px; display: flex; flex-direction: column; gap: 14px; flex: 1; }

.loc-badge {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 4px 12px; border-radius: 50px;
}

.loc-title { font-size: 1.35rem; font-weight: 600; line-height: 1.3; color: var(--text-dark); }

.loc-details { display: flex; flex-direction: column; gap: 9px; }

.loc-row { display: flex; align-items: flex-start; gap: 10px; color: var(--text-muted); font-size: 1rem; line-height: 1.45; }

.loc-row i { color: var(--primary); font-size: 1.2rem; margin-top: 1px; flex-shrink: 0; }

.loc-row a { color: var(--text-dark); font-weight: 500; border-bottom: 1px solid transparent; transition: 0.2s; word-break: break-word; }

.loc-row a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.loc-row .label { color: #999; margin-right: 4px; }

.loc-row.address { color: var(--text-dark); font-weight: 500; }

.loc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }

.btn-pill {
    flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 18px; border-radius: 50px; font-weight: 600; font-size: 0.98rem; transition: 0.25s; cursor: pointer; border: 2px solid transparent;
}

.btn-pill i { font-size: 1.15rem; }

.btn-pill.primary { background: var(--primary); color: #fff; }

.btn-pill.primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

.btn-pill.outline { border-color: #e2dcd5; color: var(--text-dark); background: #fff; }

.btn-pill.outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.loc-tools {
    display: none; position: absolute; top: 12px; right: 12px; z-index: 5; gap: 6px;
    background: rgba(255,255,255,0.96); padding: 6px; border-radius: 50px; box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

body.editing-active .loc-tools { display: flex; }

.loc-tools button {
    width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; cursor: pointer;
    font-size: 19px; color: var(--text-dark); display: inline-flex; align-items: center; justify-content: center; transition: 0.2s;
}

.loc-tools button:hover { background: var(--bg-light); color: var(--primary); }

.loc-tools button[data-action="delete"] { color: #c90000; }

.loc-tools button[data-action="delete"]:hover { background: #fdecec; }

.loc-tools button:disabled { opacity: 0.3; cursor: default; background: transparent; }

body.editing-active .loc-card .loc-map iframe { pointer-events: none; }

.add-tile {
    display: none; min-height: 320px; border: 2px dashed var(--primary); border-radius: var(--radius);
    background: rgba(129, 20, 25, 0.04); color: var(--primary); cursor: pointer; transition: 0.25s;
    flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 30px;
}

.add-tile i { font-size: 3rem; }

.add-tile strong { font-size: 1.2rem; }

.add-tile span { color: var(--text-muted); font-size: 0.95rem; max-width: 260px; line-height: 1.45; }

.add-tile:hover { background: rgba(129, 20, 25, 0.09); transform: translateY(-3px); }

body.editing-active .add-tile { display: flex; }

.empty-state { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 40px 0; font-size: 1.1rem; }

/* ---------- LOCATION EDITOR MODAL ---------- */
.loc-editor { max-width: 920px; padding: 0; display: flex; flex-direction: column; }

.loc-editor-head { padding: 28px 32px 0; }

.loc-editor-head h3 { margin-bottom: 4px; }

.loc-editor-head p { color: var(--text-muted); font-size: 0.98rem; }

.loc-editor-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 22px 32px 10px; }

.search-field { position: relative; }

.search-field i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 20px; color: #999; pointer-events: none; }

.search-field input { padding-left: 42px !important; font-weight: 500; }

.step-num { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; align-items: center; justify-content: center; margin-right: 6px; vertical-align: 1px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.two-col .input-group { margin-bottom: 0; }

.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-light); border-radius: 8px; cursor: pointer; font-size: 15px; margin-top: 16px; }

.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); }

details.advanced { margin-top: 14px; font-size: 14px; color: var(--text-muted); }

details.advanced summary { cursor: pointer; font-weight: 500; }

details.advanced .input-group { margin-top: 10px; }

details.advanced textarea { min-height: 70px; font-size: 13px; font-family: monospace; }

.preview-col { display: flex; flex-direction: column; gap: 10px; }

.preview-label { font-weight: 600; font-size: 14px; }

.preview-map { position: relative; flex: 1; min-height: 320px; border-radius: 12px; overflow: hidden; background: #eeeae5; border: 1px solid var(--border); }

.preview-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.preview-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #999; text-align: center; padding: 20px; font-size: 0.95rem; line-height: 1.45; }

.preview-empty i { font-size: 2.6rem; color: #ccc; }

.preview-link { font-size: 13.5px; color: var(--primary); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; }

.preview-link:hover { text-decoration: underline; }

.preview-link.hidden { visibility: hidden; }

.loc-editor-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 16px 32px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.loc-editor-foot .form-feedback { flex: 1 1 100%; }

.loc-editor-foot .btn-save, .loc-editor-foot .btn-cancel { width: auto; margin: 0; padding: 12px 26px; font-size: 1rem; }

.btn-cancel { background: #fff; border: 1px solid #ddd; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--text-dark); }

.btn-cancel:hover { border-color: #999; }

.foot-spacer { flex: 1; }

@media (max-width: 768px) {
    .locations-section { padding: 40px var(--gutter) 70px; }
    .locations-grid { gap: 22px; }
    .loc-map { aspect-ratio: 16 / 10; }
    .loc-body { padding: 20px 18px 22px; }
    .loc-title { font-size: 1.2rem; }
    .loc-editor { padding: 0; max-height: 95vh; }
    .loc-editor-head { padding: 24px 20px 0; }
    .loc-editor-body { grid-template-columns: 1fr; gap: 18px; padding: 18px 20px 10px; }
    .preview-col { order: -1; }
    .preview-map { min-height: 200px; }
    .loc-editor-foot { padding: 14px 20px; }
    .loc-editor-foot .btn-save, .loc-editor-foot .btn-cancel { flex: 1; }
    .foot-spacer { display: none; }
}

@media (max-width: 480px) {
    .two-col { grid-template-columns: 1fr; gap: 0; }
    .two-col .input-group { margin-bottom: 16px; }
}

/* Live editing on this page's photo header: white dashed outline (as designed) */
.page-locations .hero .editable[contenteditable="true"] { border-color: rgba(255,255,255,0.8); background: rgba(0,0,0,0.15); }
.page-locations .hero .editable[contenteditable="true"]:focus { background: rgba(0,0,0,0.3); }

/* Hero photo (path is relative to this css/ folder) */
.page-locations .hero { --hero-img: url('../images/hero.jpg'); }
