/* Alaska Ports & Harbors Directory: public styles. Fonts are inherited from the theme. */
.aph-directory {
	--aph-harbor: #2D5016;
	--aph-port: #6B4226;
	--aph-ink: #1d2327;
	--aph-muted: #50575e;
	--aph-line: #d0d5da;
	--aph-bg: #ffffff;
	--aph-soft: #f4f6f2;
	--aph-focus: #0b5cad;
	--aph-gold: #c9a000;
	--aph-blue: #1f5fbf;
	position: relative;
	color: var(--aph-ink);
	font-family: inherit;
	line-height: 1.5;
	box-sizing: border-box;
}
.aph-directory *, .aph-directory *::before, .aph-directory *::after { box-sizing: inherit; }
.aph-directory :focus-visible { outline: 3px solid var(--aph-focus); outline-offset: 2px; }
.aph-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.aph-directory [hidden] { display: none !important; }

/* Filters */
.aph-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 12px; background: var(--aph-soft); border: 1px solid var(--aph-line); border-radius: 6px; margin-bottom: 12px; }
.aph-field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; flex: 1 1 170px; }
.aph-field--q { flex: 2 1 240px; }
.aph-field--check { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; min-width: 0; padding-bottom: 8px; }
.aph-field label { font-size: 0.85rem; font-weight: 600; color: var(--aph-ink); }
.aph-field--check label { font-weight: 400; }
.aph-input, .aph-select { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #757575; border-radius: 4px; background: #fff; color: var(--aph-ink); font: inherit; }

.aph-btn { min-height: 40px; padding: 6px 14px; border: 1px solid var(--aph-harbor); border-radius: 4px; background: var(--aph-harbor); color: #fff; font: inherit; cursor: pointer; }
.aph-btn:hover { background: #22400f; }
.aph-btn--ghost { background: #fff; color: var(--aph-harbor); }
.aph-btn--ghost:hover { background: var(--aph-soft); }

.aph-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.aph-count { margin: 0; font-weight: 600; }
.aph-toggle { display: inline-flex; gap: 0; }
.aph-toggle-btn { background: #fff; color: var(--aph-harbor); border-radius: 0; margin-left: -1px; }
.aph-toggle-btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.aph-toggle-btn:last-child { border-radius: 0 4px 4px 0; }
.aph-toggle-btn[aria-pressed="true"] { background: var(--aph-harbor); color: #fff; }

/* Map */
.aph-views { display: block; }
.aph-view--map { margin-bottom: 16px; }
.aph-map { width: 100%; border: 1px solid var(--aph-line); border-radius: 6px; z-index: 0; }
.aph-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.85rem; }
.aph-legend li { display: inline-flex; align-items: center; gap: 6px; }
.aph-key { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 3px solid transparent; background: #777; }
.aph-key--harbor { background: var(--aph-harbor); }
.aph-key--port { background: var(--aph-port); }
.aph-key--public { background: #fff; border-color: var(--aph-gold); }
.aph-key--private { background: #fff; border-color: #000; }
.aph-key--mixed { background: #fff; border-color: var(--aph-blue); }
.aph-key--approx { background: #fff; border: 2px dashed #333; }

.aph-marker { width: 24px; height: 24px; border-radius: 50%; border: 4px solid #777; background: #777; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.aph-marker--harbor { background: var(--aph-harbor); }
.aph-marker--port { background: var(--aph-port); }
.aph-own--public { border-color: var(--aph-gold); }
.aph-own--private { border-color: #000; }
.aph-own--mixed { border-color: var(--aph-blue); }
.aph-own--unknown { border-color: #888; }
.aph-marker--approx { outline: 2px dashed #222; outline-offset: 3px; }
.aph-tooltip { padding: 8px 10px; }
.aph-tip { font-size: 0.85rem; line-height: 1.35; }
.aph-tip-name { display: block; font-size: 0.95rem; }
.aph-tip-where, .aph-tip-kind { color: var(--aph-muted); }

/* Table */
.aph-table-wrap { overflow-x: auto; }
.aph-table, .aph-mini { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.aph-table th, .aph-table td, .aph-mini th, .aph-mini td { padding: 8px 10px; border-bottom: 1px solid var(--aph-line); text-align: left; vertical-align: top; }
.aph-table thead th, .aph-mini thead th { background: var(--aph-soft); white-space: nowrap; }
.aph-sort { all: unset; cursor: pointer; font-weight: 700; padding: 2px 0; }
.aph-sort:focus-visible { outline: 3px solid var(--aph-focus); outline-offset: 2px; }
.aph-open { color: var(--aph-harbor); font-weight: 600; text-decoration: underline; }
.aph-col-details { display: none; }
.aph-details-btn { min-height: 40px; padding: 4px 12px; border: 1px solid var(--aph-harbor); background: #fff; color: var(--aph-harbor); border-radius: 4px; font: inherit; cursor: pointer; }
.aph-empty, .aph-more { padding: 12px 0; margin: 0; }
.aph-approx-note { color: var(--aph-muted); margin-left: 2px; }
.aph-table-scroll { overflow-x: auto; margin: 6px 0 12px; }
.aph-mini caption { text-align: left; font-weight: 600; padding: 4px 0; }

/* Chips and tags */
.aph-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1px solid; vertical-align: middle; }
.aph-chip--verified { background: #e6f2dc; color: #1f4010; border-color: #2D5016; }
.aph-chip--auto { background: #eef0f2; color: #3c434a; border-color: #8c949c; }
.aph-chip--flagged { background: #fdecc8; color: #5c3d00; border-color: #8a5a00; }
.aph-tag { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 4px; background: var(--aph-soft); border: 1px solid var(--aph-line); font-size: 0.8rem; }
.aph-tag--harbor { border-color: var(--aph-harbor); color: var(--aph-harbor); }
.aph-tag--port { border-color: var(--aph-port); color: var(--aph-port); }

/* Panel */
.aph-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; z-index: 100000; background: var(--aph-bg); color: var(--aph-ink); border-left: 1px solid var(--aph-line); box-shadow: -4px 0 18px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.aph-panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--aph-line); background: var(--aph-soft); }
.aph-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; font-size: 0.85rem; }
.aph-crumbs li + li::before { content: "\203A"; margin: 0 6px; color: var(--aph-muted); }
.aph-close { min-width: 40px; min-height: 40px; border: 1px solid var(--aph-line); border-radius: 4px; background: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--aph-ink); }
.aph-linkbtn { all: unset; color: var(--aph-harbor); text-decoration: underline; cursor: pointer; }
.aph-linkbtn:focus-visible { outline: 3px solid var(--aph-focus); outline-offset: 2px; }
.aph-panel-body { overflow-y: auto; padding: 16px; flex: 1; }
.aph-title { margin: 0 0 6px; font-size: 1.4rem; line-height: 1.2; }
.aph-title:focus { outline: none; }
.aph-where, .aph-pop { margin: 4px 0; }
.aph-summary { margin: 8px 0; }
.aph-chips { margin: 4px 0; }
.aph-qlinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.aph-qlink { display: inline-block; min-height: 40px; padding: 8px 14px; border-radius: 4px; background: var(--aph-harbor); color: #fff !important; text-decoration: none; font-weight: 600; }
.aph-sec { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--aph-line); }
.aph-sec-title { margin: 0 0 8px; font-size: 1.05rem; }
.aph-dl { margin: 0 0 8px; }
.aph-dl-row { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--aph-line); }
.aph-dl-row dt { flex: 0 0 45%; font-weight: 600; color: var(--aph-muted); }
.aph-dl-row dd { flex: 1; margin: 0; }
.aph-obs-group h4 { margin: 10px 0 4px; font-size: 0.95rem; }
.aph-obs-list, .aph-reslist { list-style: none; margin: 0; padding: 0; }
.aph-obs-list li, .aph-reslist li { padding: 3px 0; }
.aph-obs-label { color: var(--aph-muted); margin-right: 6px; }
.aph-obs-val { font-weight: 700; border-bottom: 1px dotted var(--aph-muted); cursor: help; }
.aph-caveat, .aph-small { font-size: 0.82rem; color: var(--aph-muted); margin: 2px 0; }
.aph-caution { padding: 8px 10px; border-left: 4px solid #8a5a00; background: #fdf3dc; margin: 8px 0; }
.aph-contact { margin-bottom: 10px; }
.aph-pre { white-space: pre-line; }
.aph-loading { color: var(--aph-muted); }

@media (max-width: 900px) {
	.aph-dl-row dt { flex-basis: 50%; }
}

/* Phones: table collapses to name, community and a Details button; panel is a full-screen sheet. */
@media (max-width: 640px) {
	.aph-panel { width: 100vw; border-left: 0; }
	.aph-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.aph-table .aph-col-type, .aph-table .aph-col-bca, .aph-table .aph-col-reg, .aph-table .aph-col-ownl, .aph-table .aph-col-links { display: none; }
	.aph-table td.aph-col-details { display: table-cell; text-align: right; }
	.aph-filters { gap: 8px; }
	.aph-field { flex-basis: 100%; }
	.aph-toggle { width: 100%; }
	.aph-toggle-btn { flex: 1; }
}

@media (prefers-reduced-motion: no-preference) {
	.aph-panel.is-open { animation: aph-slide .18s ease-out; }
	@keyframes aph-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
