.gmaps-tabs { font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.gmaps-tabs [role="tablist"] {
display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid #e5e7eb; margin-bottom: .5rem;
}
.gmaps-tabs [role="tab"] {
appearance: none; background: transparent; border: 0; padding: .6rem .9rem; margin: 0;
cursor: pointer; color: #374151; border-bottom: 2px solid transparent; border-radius: .5rem .5rem 0 0;
}
.gmaps-tabs [role="tab"][aria-selected="true"] { color: #111827; border-color: #111827; font-weight: 600; }
.gmaps-tabs [role="tab"]:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; border-radius: .5rem; }
.gmaps-tabs [role="tabpanel"] { padding: .25rem 0; }
.gmaps-tabs .map-frame {
width: 100%; aspect-ratio: 16 / 9; min-height: 300px; border: 0; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
/* Optional: contain overflowing content in small containers */
.gmaps-tabs .panel-wrap { overflow: hidden; border-radius: 10px; }
(function () {
document.querySelectorAll('.gmaps-tabs').forEach(function init(container) {
const tabs = container.querySelectorAll('[role="tab"]');
const panels = container.querySelectorAll('[role="tabpanel"]');
function activateTab(tab) {
tabs.forEach(function (t) {
const selected = t === tab;
t.setAttribute('aria-selected', selected ? 'true' : 'false');
t.tabIndex = selected ? 0 : -1;
const panel = container.querySelector('#' + t.getAttribute('aria-controls'));
if (panel) {
panel.hidden = !selected;
if (selected) {
const iframe = panel.querySelector('iframe[data-src]');
if (iframe && !iframe.src) { iframe.src = iframe.dataset.src; }
}
}
});
tab.focus();
}
tabs.forEach(function (tab, idx) {
tab.addEventListener('click', function () { activateTab(tab); });
tab.addEventListener('keydown', function (e) {
let newIdx = null;
if (e.key === 'ArrowRight') newIdx = (idx + 1) % tabs.length;
else if (e.key === 'ArrowLeft') newIdx = (idx - 1 + tabs.length) % tabs.length;
else if (e.key === 'Home') newIdx = 0;
else if (e.key === 'End') newIdx = tabs.length - 1;
if (newIdx !== null) { e.preventDefault(); activateTab(tabs[newIdx]); }
});
});
// Ensure only the first panel is visible initially
panels.forEach((p, i) => p.hidden = i !== 0);
});
})();
Book now