/* ==========================================================================
 * Tipota MAPS — look shared by every map
 *
 * Colours and sizes follow vacirca.com (Roboto is inherited from the theme, text #3b3d42,
 * blue buttons #2f6fa5, 5–8 px corners). Change the tokens below and every map follows.
 *
 * Sections: 1. tokens  2. "View" dropdown  3. layout (panel + map)  4. filter buttons
 *           5. map box  6. phones & tablets
 * Each map adds its own file (blog.css, pesca.css, uw.css, instagram.css) for dots, cards and lightboxes.
 * ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
	--tmaps-accent: #2f6fa5;        /* site blue (the "View" button on the blog page) */
	--tmaps-accent-dark: #265b88;
	--tmaps-subscribe: #42447e;     /* the Subscribe button of the blog page */
	--tmaps-subscribe-dark: #363866;
	--tmaps-ink: #3b3d42;           /* site text colour */
	--tmaps-muted: #6b7079;
	--tmaps-line: #dde3e9;
	--tmaps-panel: #f5f7fa;         /* left panel background */
	--tmaps-paper: #ffffff;         /* cards, popups */
	--tmaps-hover: #e9eff5;
	--tmaps-radius: 8px;
	--tmaps-shadow: 0 6px 24px rgba(10, 30, 40, .18);
	--tmaps-sea: #cfe3ec;           /* map background while tiles load */
}

.tmaps { width: 100%; color: var(--tmaps-ink); font-family: inherit; --tmaps-h: 700px; }
.tmaps *, .tmaps *::before, .tmaps *::after { box-sizing: border-box; }
.tmaps button:focus-visible, .tmaps a:focus-visible { outline: 2px solid var(--tmaps-accent); outline-offset: 2px; }

/* 2. Header: one row — title + map name on the left, Subscribe + "View" on the right (same look as the Elementor buttons) */
.tmaps-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 12px; }
.tmaps-head-text { min-width: 0; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.tmaps-h1 { margin: 0; padding: 0; font-size: 24px; font-weight: 400; letter-spacing: 2px; line-height: 1.15; text-transform: uppercase; color: var(--tmaps-ink); white-space: nowrap; }
.tmaps-sub { margin: 0; font-size: 24px; font-weight: 300; letter-spacing: 1px; line-height: 1.15; color: var(--tmaps-muted); white-space: nowrap; } /* the page name, same size as the title */
.tmaps-nav { display: flex; align-items: center; gap: 10px; margin: 0; flex: none; }
.tmaps-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 150px; box-sizing: border-box;
	margin: 0; padding: 9px 20px; border: 0; border-radius: 5px; color: #fff !important; text-decoration: none !important;
	font: inherit; font-size: 15px; font-weight: 400; line-height: 1.2; letter-spacing: 0; text-transform: none; cursor: pointer; box-shadow: none;
}
.tmaps-btn-sub { background: var(--tmaps-subscribe); }
.tmaps-btn-sub:hover, .tmaps-btn-sub:focus { background: var(--tmaps-subscribe-dark); }
.tmaps-dd { position: relative; }
.tmaps-dd-btn { background: var(--tmaps-accent); width: 100%; }
.tmaps-dd-btn:hover, .tmaps-dd-btn:focus { background: var(--tmaps-accent-dark); color: #fff; }
.tmaps-caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #fff; }
.tmaps-dd-menu {
	display: none; position: absolute; right: 0; min-width: 100%; top: calc(100% + 4px); z-index: 1200; text-align: left; white-space: nowrap;
	margin: 0; padding: 6px 0; list-style: none; background: var(--tmaps-paper); border: 1px solid var(--tmaps-line); border-radius: 6px; box-shadow: var(--tmaps-shadow);
}
.tmaps-dd.tmaps-open .tmaps-dd-menu { display: block; }
.tmaps-dd-menu li { margin: 0; padding: 0; list-style: none; }
.tmaps-dd-menu a { display: block; padding: 9px 18px; color: var(--tmaps-ink); font-size: 15px; text-decoration: none; }
.tmaps-dd-menu a:hover { background: var(--tmaps-hover); color: var(--tmaps-ink); }
.tmaps-dd-menu .tmaps-cur a { font-weight: 600; color: var(--tmaps-accent); }

/* 3. Layout: panel on the left, map on the right ---------------------------- */
.tmaps-body { display: grid; grid-template-columns: 250px 1fr; gap: 16px; width: 100%; }
.tmaps-panel { min-width: 0; padding: 14px; background: var(--tmaps-panel); border: 1px solid var(--tmaps-line); border-radius: var(--tmaps-radius); max-height: var(--tmaps-h); overflow: auto; }
.tmaps-title { margin: 0 0 2px; padding: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.2; color: var(--tmaps-ink); }
.tmaps-count { margin: 0 0 10px; font-size: .9rem; color: var(--tmaps-muted); }

/* 4. Filter buttons in the panel (one per category / species / kind) ------- */
.tmaps-chips { display: flex; flex-direction: column; gap: 4px; }
.tmaps-chips > button {
	display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 7px 10px; text-align: left;
	border: 1px solid transparent; border-radius: 8px; background: transparent; box-shadow: none;
	color: inherit; font: inherit; font-size: .95rem; line-height: 1.3; letter-spacing: 0; text-transform: none; cursor: pointer;
}
.tmaps-chips > button:hover { background: var(--tmaps-hover); }
.tmaps-chips > button[aria-pressed="true"] { background: var(--tmaps-paper); border-color: var(--tmaps-accent); }
.tmaps-chips > button i, .tmaps-chips > button .tm-dot { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; }
.tmaps-chips > button em, .tmaps-chips > button .tm-n { margin-left: auto; font-style: normal; font-size: .85rem; color: var(--tmaps-muted); font-variant-numeric: tabular-nums; }

/* 5. Map box ---------------------------------------------------------------- */
.tmaps-mapbox { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--tmaps-line); border-radius: var(--tmaps-radius); background: var(--tmaps-sea); isolation: isolate; }
.tmaps-map { width: 100%; height: var(--tmaps-h); background: var(--tmaps-sea); }
.tmaps-mapbox .leaflet-container { font: inherit; font-size: 13px; }
.tmaps-msg { position: absolute; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; margin: 0; background: rgba(255, 255, 255, .7); color: var(--tmaps-muted); }
.tmaps-msg[hidden] { display: none; }
/* numbered groups of dots (Leaflet.markercluster default icons) in the site blue */
.tmaps .marker-cluster-small, .tmaps .marker-cluster-medium, .tmaps .marker-cluster-large { background: rgba(47, 111, 165, .32); }
.tmaps .marker-cluster-small div, .tmaps .marker-cluster-medium div, .tmaps .marker-cluster-large div { background: rgba(47, 111, 165, .92); color: #fff; font-weight: 600; font-family: inherit; }
.tmaps .leaflet-control-layers, .tmaps .leaflet-bar { border-radius: 6px; }

/* Tracking page: the PredictWind map fills the box */
.tmaps-track-box { background: #e9eef2; }
.tmaps-track { display: block; width: 100%; height: var(--tmaps-h); border: 0; }
.tmaps-track-link { margin: 8px 0 0; text-align: right; font-size: 13px; }

/* 5a. Tipota's route and last position (shared by the maps that draw it through TMAPS.drawTrack) */
.tmaps .tmaps-boat { position: relative; width: 22px; height: 22px; }
.tmaps .tmaps-boat i { position: absolute; inset: 3px; box-sizing: border-box; border-radius: 50%; background: #ff5a1f; border: 2px solid #fff; }
.tmaps .tmaps-boat b { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #ff5a1f; animation: tmaps-ping 2.2s ease-out infinite; }
@keyframes tmaps-ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tmaps .tmaps-boat b { animation: none; opacity: .5; } }
/* list of the items of a group (shared) */
.tmaps .tmaps-list-pop .leaflet-popup-content-wrapper { padding: 0; border-radius: 10px; overflow: hidden; box-shadow: var(--tmaps-shadow); }
.tmaps .tmaps-list-pop .leaflet-popup-content { margin: 0; width: min(330px, calc(100vw - 70px)) !important; overflow: hidden; }
.tmaps .tmaps-list-h { padding: 10px 40px 8px 14px; border-bottom: 1px solid var(--tmaps-line); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tmaps-muted); }
.tmaps .tmaps-list ol { list-style: none; margin: 0; padding: 4px 0; max-height: min(360px, 55vh, calc(var(--tmaps-h, 70vh) - 150px)); overflow-y: auto; overflow-x: hidden; }
.tmaps .tmaps-list li { margin: 0; }
.tmaps .tmaps-list button { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; margin: 0; padding: 8px 14px; border: 0; background: transparent; color: var(--tmaps-ink); font: inherit; text-align: left; cursor: pointer; }
.tmaps .tmaps-list button > span { min-width: 0; }
.tmaps .tmaps-list button:hover { background: var(--tmaps-hover); }
.tmaps .tmaps-list img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #e7eef1; }
.tmaps .tmaps-list .tmaps-li-t { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; white-space: nowrap; overflow: hidden; }   /* one line; TMAPS.fitText cuts it at a word + … */
.tmaps .tmaps-list .tmaps-li-x { display: block; max-height: calc(1.35em * 2); overflow: hidden; font-size: 12.5px; line-height: 1.35; color: var(--tmaps-ink); margin-top: 2px; white-space: normal; overflow-wrap: anywhere; }   /* two lines at most, fitted at a word */
.tmaps .tmaps-list time { display: block; margin-top: 3px; font-size: 11px; color: var(--tmaps-muted); font-variant-numeric: tabular-nums; }

/* 5b. Tracking page: PredictWind in a frame */
.tmaps-frame { height: var(--tmaps-h); }
.tmaps-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.tmaps-frame-link { margin: 8px 0 0; text-align: right; font-size: 13px; }
.tmaps-frame-link a { color: var(--tmaps-accent); text-decoration: none; }

/* 6. Phones and tablets ------------------------------------------------------ */
@media (max-width: 820px) {
	.tmaps-head { gap: 10px; }
	.tmaps-head-text { width: 100%; justify-content: center; text-align: center; gap: 4px 12px; }
	.tmaps-h1 { font-size: 20px; }
	.tmaps-sub { font-size: 20px; white-space: normal; }
	.tmaps-sub { font-size: 15px; width: 100%; }
	.tmaps-nav { width: 100%; gap: 10px; }
	.tmaps-btn, .tmaps-dd { flex: 1 1 0; min-width: 0; }
	.tmaps-dd-menu { left: 0; }
	.tmaps-body { grid-template-columns: 1fr; gap: 12px; }
	.tmaps-panel { max-height: none; padding: 10px; }
	.tmaps-chips { flex-direction: row; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
	.tmaps-chips > button { width: auto; white-space: nowrap; border-color: var(--tmaps-line); background: var(--tmaps-paper); }
	.tmaps-chips > button em, .tmaps-chips > button .tm-n { margin-left: 4px; }
	.tmaps-map, .tmaps-frame { height: min(var(--tmaps-h), 70vh); }
}
@media (pointer: coarse) { .tmaps .leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 22px; } }

/* [tipota_header] alone (blog page): no map under it, keep a little air below */
.tmaps-header-only .tmaps-head { margin-bottom: 8px; }

/* the tile credit: small and discreet, but visible (Esri's terms) */
.tmaps .leaflet-control-attribution, .tmaps-posizione .leaflet-control-attribution { font-size: 9px; line-height: 1.4; padding: 1px 5px; color: #5b6572; background: rgba(255, 255, 255, .65); }
.tmaps .leaflet-control-attribution a { color: inherit; }

/* cards and lists keep the plugin's own type, whatever the theme does to buttons and headings */
.tmaps .leaflet-popup-content, .tmaps .leaflet-tooltip, .tmaps .leaflet-popup-content button, .tmaps .leaflet-popup-content time { text-transform: none; letter-spacing: 0; font-family: inherit; }
