/* Experience presentation and admin tools share sizing, not editing controls. */
[hidden] { display: none !important; }
body.experience-is-open { overflow: hidden; }
#experienceModal { padding: clamp(8px, 2vw, 24px); }
#experienceModal .experience-modal-panel {
  display: flex; flex-direction: column; gap: 0; padding: 0;
  width: min(860px, 100%); max-height: calc(100dvh - 48px); min-width: 0;
  overflow: hidden; border-radius: 20px;
}
.experience-modal-toolbar {
  display: flex; flex: 0 0 auto; align-items: center; gap: 12px;
  min-height: 60px; padding: 9px 16px; background: var(--cream);
  border-bottom: 1px solid var(--line);
}
#experienceModal .modal-close { position: static; margin-left: auto; flex: 0 0 38px; height: 38px; width: 38px; }
.popup-step { font: 600 12px/1.5 var(--sans); color: var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-back { flex: 0 0 auto; border: 0; background: none; color: var(--green); font: 600 12px/1.5 var(--sans); padding: 9px 0; cursor: pointer; }
.experience-modal-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.experience-cover { isolation: isolate; position: relative; display: grid; place-items: center; min-height: min(490px, 68dvh); padding: 60px 32px; overflow: hidden; background: #244b46; }
.experience-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px); transform: scale(1.03); z-index: -2; }
.experience-cover-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #12262270, #122622d9); z-index: -1; }
.experience-cover-copy { width: min(600px, 100%); text-align: center; color: #fffaf3; }
.experience-cover-copy .eyebrow { color: #f4cda5; }
#experienceModal #modalExperienceTitle { color: #fffaf3; font-size: clamp(32px, 4vw, 54px); line-height: 1.07; margin: 16px 0; overflow-wrap: anywhere; }
#modalExperienceDescription { font: 400 15px/1.7 var(--sans); max-width: 52ch; margin: 0 auto 26px; color: #fffaf3; }
#modalExperienceDescription[contenteditable="true"]:empty::before { content: attr(data-placeholder); opacity: .7; }
.cover-edit { position: absolute; right: 16px; top: 16px; background: #fffaf3; color: #244b46; border: 0; border-radius: 20px; padding: 9px 14px; cursor: pointer; }
.cover-delete { position: absolute; left: 16px; top: 16px; background: #fffaf3; color: #9b3c2f; border: 0; border-radius: 20px; padding: 9px 14px; cursor: pointer; }
.experience-details { padding: clamp(18px, 3vw, 32px); }
#experienceModal .community-viewer { display: block; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; }
.subitem-heading { text-align: center; max-width: 60ch; margin: 0 auto 20px; }
#experienceModal #communityName { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; margin: 9px 0; }
#experienceModal #communityText { font: 400 14px/1.75 var(--sans); margin: 0; }
#experienceModal .experience-modal-gallery { min-height: 0; height: auto; aspect-ratio: 16 / 8; width: 100%; max-height: 310px; border-radius: 12px; box-shadow: none; background: #ebe6dc; }
#experienceModal .experience-modal-gallery::after { display: none; }
#experienceModal .experience-modal-gallery img { position: absolute; inset: 0; height: 100%; width: 100%; opacity: 1; filter: none; transform: none; object-fit: cover; transition: none; pointer-events: none; }
.gallery-empty { display: grid; place-items: center; position: absolute; inset: 0; width: 100%; height: 100%; border: 1px dashed #244b4660; border-radius: 12px; background: #f4f0e7; color: #244b46; font: 600 14px/1.5 var(--sans); margin: 0; padding: 24px; text-align: center; }
button.gallery-empty { cursor: pointer; }
.experience-photo-thumbnails { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.experience-photo-thumbnails button { width: 64px; aspect-ratio: 4/3; border: 2px solid transparent; border-radius: 7px; padding: 2px; background: none; cursor: pointer; overflow: hidden; }
.experience-photo-thumbnails button[aria-pressed="true"] { border-color: var(--copper); }
.experience-photo-thumbnails img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.subitem-photo-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.subitem-photo-tools button { background: none; border: 0; text-decoration: underline; color: var(--green); font: 500 12px/1.5 var(--sans); cursor: pointer; padding: 8px 0; }
#clearSubitemPhotos { color: #80574c; }
#deleteSubExperience { color: #9b3c2f; }
#experienceModal .community-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#experienceModal .community-actions #deleteSubExperience { margin-left: auto; border: 1px solid #9b3c2f; border-radius: 999px; padding: 8px 12px; background: #fff; color: #9b3c2f; font: 700 11px/1.4 var(--sans); cursor: pointer; }
.community-actions button:disabled { opacity: .4; cursor: default; }
.subitem-create { margin-top: 20px; text-align: center; }
.subitem-create button { border: 1px dashed #244b4660; padding: 12px 22px; border-radius: 8px; background: none; color: var(--green); cursor: pointer; font: 600 13px/1.5 var(--sans); }
.experience-admin-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; margin-top: 18px; padding: 12px 22px; border: 1px solid var(--copper); border-radius: 999px; background: var(--copper); color: #fff; cursor: pointer; font: 700 12px/1.4 var(--sans); letter-spacing: .04em; box-shadow: 0 8px 20px rgba(80, 45, 27, .15); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.experience-admin-add:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(80, 45, 27, .2); background: #a94f31; }
.experience-admin-add:focus-visible { outline: 3px solid #244b46; outline-offset: 3px; }
.experience-admin-add[hidden] { display: none !important; }
.experience-toolbar-add { flex: 0 0 auto; white-space: nowrap; }
.preview-toolbar .experience-toolbar-add { min-height: 38px; padding: 9px 13px; font-size: 10px; }
.image-library-field { display:flex; align-items:center; flex-wrap:wrap; gap:10px; min-width:220px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fffdf9; }
.image-library-field > span { flex:1 0 100%; color:var(--green); font:700 11px/1.4 var(--sans); letter-spacing:.08em; text-transform:uppercase; }
.image-library-field img { width:76px; height:58px; object-fit:cover; border-radius:6px; background:#eee8de; }
.image-library-thumbnails { display:flex; flex-wrap:wrap; gap:6px; min-height:10px; }
.image-library-thumbnails img { width:52px; height:40px; border-radius:5px; object-fit:cover; }
.upload-thumb-name { position:absolute; inset:auto 0 0; overflow:hidden; padding:4px 6px; background:linear-gradient(transparent,rgba(0,0,0,.72)); color:#fff; font:500 10px/1.3 var(--sans); text-overflow:ellipsis; white-space:nowrap; }
#uploadTool.single-image-picker .photo-picker-actions { display:none; }
.empty-subitems { text-align: center; padding: 40px 20px; font-size: 14px; }
.experience-booking { padding: 20px 28px; border-top: 1px solid var(--line); }
#experienceModal .experience-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
#experienceModal .btn { padding: 13px 20px; font-size: 11px; min-height: 42px; max-width: 100%; white-space: normal; }
#experienceModal .experience-options { grid-template-columns: 1fr 1fr auto; align-items: end; margin-top: 16px; padding-top: 16px; }
#experienceModal .experience-options label { font-size: 11px; }
#experienceModal .experience-options input { min-width: 0; width: 100%; }
/* The admin remains usable at 100% zoom without scaling the iframe. */
.admin-body { height: 100dvh; overflow: hidden; }
.admin-shell { grid-template-areas: "topbar topbar" "sidebar preview"; overflow: hidden; height: 100dvh; min-height: 0; grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.builder-topbar { display: flex; min-width: 0; min-height: 64px; padding: 10px 16px; gap: 12px; }
.builder-brand strong { font-size: 16px; white-space: nowrap; }
.builder-brand span, .builder-context { font-size: 11px; }
.admin-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-actions .btn { padding: 11px 14px; font-size: 10px; letter-spacing: .05em; }
.admin-sidebar { min-width: 0; overflow: auto; }
.admin-preview-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; height: auto; }
.preview-toolbar { flex: 0 0 auto; min-height: 54px; padding: 9px 14px; flex-wrap: wrap; gap: 8px; }
.preview-copy span { font-size: 11px; }
#previewIframe { flex: 1; min-height: 0; height: 100%; width: 100%; border: 0; }
:is(#uploadTool, #settingsTool).open { width: min(440px, calc(100vw - 24px)); right: 12px; top: 76px; max-height: calc(100dvh - 88px); display: flex; flex-direction: column; overflow: hidden; gap: 12px; }
#uploadTool .sidebar-tool-head, #uploadTool .sidebar-upload-btn, #uploadHint, .photo-picker-actions { flex: 0 0 auto; }
#uploadTool .upload-library { flex: 1 1 auto; min-height: 0; max-height: 44dvh; overflow: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.upload-thumb:disabled { opacity: .35; cursor: not-allowed; }
.upload-thumb.selected { border-color: var(--green); }
.photo-selection-number { position: absolute; right: 6px; top: 6px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font: 700 13px/1 var(--sans); box-shadow: 0 0 0 2px white; }
.photo-picker-actions { border-top: 1px solid var(--line); padding-top: 12px; }
.photo-picker-actions strong { display: block; font-size: 12px; margin-bottom: 12px; }
.photo-picker-actions > div { display: flex; justify-content: space-between; gap: 10px; }
.photo-picker-actions button { cursor: pointer; border: 0; border-radius: 7px; padding: 12px 16px; font: 600 12px/1.4 var(--sans); }
.photo-picker-actions button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) {
  :is(#uploadTool, #settingsTool).open { width: calc(100vw - 20px); right: 10px; top: 10px; max-height: calc(100dvh - 20px); }
  #uploadTool .upload-library { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .upload-thumb-name { font-size: 9px; }
}
@media (max-width: 1050px) {
  .site-header { flex-wrap: wrap; gap: 12px; padding: 14px 20px; }
  .nav-links { flex-wrap: wrap; gap: 14px; }
  .hero h1 { font-size: clamp(38px, 6vw, 68px); }
  .builder-context, .preview-copy span { display: none; }
}
@media (max-width: 650px) {
  #experienceModal .experience-modal-panel { max-height: calc(100dvh - 16px); border-radius: 14px; }
  .experience-cover { min-height: 400px; padding: 65px 22px 40px; }
  .experience-modal-toolbar { min-height: 54px; padding: 8px 12px; }
  .popup-step { display: none; }
  #experienceModal .experience-modal-gallery { aspect-ratio: 4/3; }
  .experience-booking { padding: 18px; }
  #experienceModal .experience-options { grid-template-columns: 1fr 1fr; }
  #experienceModal .experience-options .btn { grid-column: 1 / -1; }
  .admin-shell { grid-template-areas: "topbar" "sidebar" "preview"; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .builder-topbar { padding: 9px 10px; flex-wrap: wrap; }
  .builder-brand span, #resetLocal { display: none; }
  .save-status { display: block; font-size: 10px; max-width: 130px; white-space: normal; }
  .admin-sidebar { padding: 6px 10px; grid-column: 1; grid-row: 2; overflow: visible; border-right: 0; }
  .admin-brand, .sidebar-section h3 { display: none; }
  .sidebar-section { margin: 0; }
  .admin-nav { display: flex; gap: 8px; }
  .admin-sidebar .sidebar-btn { padding: 7px 12px; width: auto; min-height: 36px; font-size: 12px; }
  .admin-preview-pane { grid-column: 1; grid-row: 3; }
  .preview-toolbar { padding: 7px 10px; min-height: 45px; }
  .preview-copy { display: none; }
  .page-tabs { flex-wrap: wrap; gap: 4px; }
  .page-tabs button { padding: 7px 9px; font-size: 10px; }
  .preview-toolbar .experience-toolbar-add { padding: 7px 10px; min-height: 34px; font-size: 9px; }
  :is(#uploadTool, #settingsTool).open { top: 10px; max-height: calc(100dvh - 20px); z-index: 200; padding: 16px; }
  #uploadTool .upload-library { max-height: 55dvh; }
  .site-header .nav-links { display: none; }
  .site-header .nav-right { gap: 10px; }
  .site-header .nav-action { font-size: 10px; padding: 10px; }
  .site-header .brand { font-size: 19px; }
  .site-header { padding: 12px 16px; }
}

.editor-language {display:flex;align-items:center;gap:6px;font-size:12px;}
.editor-language select {max-width:110px;padding:7px;border:1px solid #ccd4d0;border-radius:6px;background:white;}
#translationNotice {max-width:230px;font-size:10px;color:#675943;}
.landing-language {display:flex;align-items:center;justify-content:flex-end;gap:14px;padding:14px 24px;background:var(--cream);}
.landing-language a {margin-right:auto;}
.landing-language button {border:0;background:none;padding:8px;color:var(--green);cursor:pointer;}
.landing-language button.active {text-decoration:underline;font-weight:bold;}
@media(max-width:650px){#translationNotice{max-width:180px;font-size:9px;}.preview-toolbar{justify-content:flex-start;}}

/* Integrated media workspace: tools, library, then the editable page. */
@media (min-width: 761px) {
  :is(.uploads-open, .settings-open) .admin-shell { grid-template-columns: minmax(430px, 34vw) minmax(0, 1fr); }
  :is(.uploads-open, .settings-open) .admin-sidebar { display: grid; grid-template-columns: 82px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0; padding: 0; height: 100%; overflow: hidden; }
  :is(.uploads-open, .settings-open) .admin-brand { grid-column: 1; padding: 18px; border: 0; }
  :is(.uploads-open, .settings-open) .sidebar-section { grid-column: 1; grid-row: 2; padding: 8px; }
  :is(.uploads-open, .settings-open) .sidebar-section h3 { display: none; }
  :is(.uploads-open, .settings-open) .admin-nav { display: grid; gap: 12px; }
  :is(.uploads-open, .settings-open) .admin-sidebar .sidebar-btn { display: grid; justify-items: center; gap: 7px; padding: 12px 4px; font-size: 10px; min-width: 0; border-radius: 12px; }
  :is(.uploads-open, .settings-open) :is(#uploadTool, #settingsTool).open { position: static; grid-column: 2; grid-row: 1 / -1; width: auto; height: 100%; max-height: none; inset: auto; border: 0; border-left: 1px solid #e7e9ec; border-radius: 0; background: #fff; box-shadow: none; padding: 22px 18px; gap: 16px; }
}
#uploadTool .upload-library { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; gap: 12px; }
#uploadTool .upload-thumb { aspect-ratio: 1; border-radius: 12px; }
#uploadTool .upload-thumb-name { font-size: 10px; }
#uploadTool .sidebar-upload-btn { justify-content: center; background: #244b46 !important; color: #fff !important; border: 0 !important; min-height: 48px; border-radius: 10px !important; }
#uploadTool .sidebar-upload-btn b { color: #fff; background: transparent; width: auto; flex-basis: auto; }
#uploadTool #uploadStatus:empty { display: none; }
#uploadTool .upload-library-filters { border-bottom: 1px solid #e7e9ec; padding-bottom: 8px; }
#uploadTool .upload-library-filters button { background: transparent; font-size: 12px; padding: 9px 10px; border-radius: 6px; }
#uploadTool .upload-library-filters button.active { background: #e9f1ee; }
.gallery-admin-add { display: block; margin: 0 auto 24px; cursor: pointer; }
@media (max-width: 760px) {
  :is(#uploadTool, #settingsTool).open { position: fixed; inset: 0 auto 0 0; width: min(420px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 20px; z-index: 300; }
  #uploadTool .upload-library { max-height: none; }
}

.gallery-edit-item { position: relative; }
.gallery-delete { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #ddd; background: white; color: #9e3434; font: 22px/1 sans-serif; cursor: pointer; z-index: 3; }
.gallery-picker-actions { flex: 0 0 auto; border-top: 1px solid #e1e5e2; padding-top: 14px; }
.gallery-picker-actions label { display: grid; gap: 7px; font: 600 12px/1.4 var(--sans); }
.gallery-picker-actions input { width: 100%; min-width: 0; border: 1px solid #cdd6d1; border-radius: 8px; padding: 12px; font: inherit; }
.gallery-picker-actions > div { display: flex; gap: 10px; justify-content: space-between; }
.gallery-picker-actions button { cursor: pointer; border-radius: 8px; padding: 12px; border: 1px solid #cdd6d1; }
#galleryGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 24px; }
.gallery-pagination button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #cbd4ce; background: white; color: var(--green); cursor: pointer; font-size: 20px; }
.gallery-pagination button:disabled { opacity: .35; cursor: default; }
@media (max-width: 600px) { #galleryGrid { grid-template-columns: 1fr; } }

.editor-preview-mode .image-editor-scope { position: relative; }
.image-change-trigger { position: absolute; z-index: 8; top: 12px; left: 12px; border: 1px solid #ccd8d2; border-radius: 8px; background: #fff; color: #244b46; padding: 10px 12px; cursor: pointer; font: 700 11px/1.2 var(--sans); box-shadow: 0 2px 12px #0002; }
.experience-card .image-change-trigger { top: 58px; }
@media (min-width: 761px) {
  :is(.uploads-open, .settings-open) .sidebar-section { align-self: start; }
  :is(.uploads-open, .settings-open) .admin-nav { align-content: start; height: auto; }
  :is(.uploads-open, .settings-open) .admin-sidebar .sidebar-btn { height: 80px; align-content: center; }
}
.editor-preview-mode .image-change-trigger { background: white; color: #244b46; border: 1px solid #ccd8d2; padding: 10px 12px; text-transform: none; letter-spacing: 0; }

.experience-draft-badge { position: absolute; z-index: 9; bottom: 12px; left: 12px; right: 12px; border-radius: 8px; background: #fff2d6; color: #71501d; padding: 10px; font: 600 11px/1.4 var(--sans); }

.popup-description-editor { margin: 12px auto 20px; max-width: 600px; text-align: center; }
#experienceModal .popup-description-control { background: #fff; color: #244b46; border: 1px solid #bfcfc6; border-radius: 8px; padding: 10px 14px; font: 700 12px/1.3 var(--sans); cursor: pointer; text-transform: none; letter-spacing: 0; }
#experienceModal .popup-description-input { display: block; margin-top: 12px; width: 100%; min-height: 120px; resize: vertical; border: 2px solid #b6cbbf; border-radius: 10px; background: white; color: #244b46; padding: 14px; font: 400 15px/1.6 var(--sans); box-sizing: border-box; }
.editor-preview-mode #modalExperienceDescription, .editor-preview-mode #communityText { min-height: 44px; cursor: text; }
