/* Resort entry layout – Skookum Glacier style */
:root {
  --resort-location-color: #5b8fb4;
  --resort-title-color: #1a365d;
  --resort-subtitle-color: #5b8fb4;
  --resort-stats-bg: #e8f0f7;
  --resort-stats-label: #2c5282;
  --resort-body-color: #2d3748;
  --resort-footer-color: #718096;
  --resort-edit-border: #cbd5e0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--resort-body-color);
  background: #fff;
  margin: 0;
  padding: 60px 5% 2rem 5%;
  line-height: 1.5;
  width: 100%;
  max-width: none;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  body {
    padding: 56px 1rem 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 56px 0.75rem 1rem 0.75rem;
  }
}

.resort-auth-header {
  margin-top: 0;
  margin-bottom: 1rem;
  padding: 8px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.resort-browse-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--resort-subtitle-color);
  text-decoration: none;
}
.resort-browse-link:hover {
  text-decoration: underline;
}

.resort-auth-widget {
  font-size: 0.9rem;
  color: var(--resort-footer-color);
}

.resort-auth-widget a {
  color: var(--resort-title-color);
  text-decoration: none;
}

.resort-auth-widget a:hover {
  text-decoration: underline;
}

.resort-auth-user {
  margin-right: 0.5rem;
}

.resort-auth-disabled {
  color: var(--resort-footer-color);
  font-style: italic;
}

.resort-entry {
  margin-bottom: 2.5rem;
}

.resort-header {
  margin-bottom: 1rem;
}

.resort-location {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--resort-location-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.2rem 0;
}

.resort-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--resort-title-color);
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.resort-subtitle {
  font-size: 0.95rem;
  color: var(--resort-subtitle-color);
  margin: 0;
  font-weight: 500;
}

.resort-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
  margin: 1rem 0;
}
.resort-layout.resort-map-expanded {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}
.resort-layout.resort-map-expanded .resort-content {
  order: 2;
}
.resort-layout.resort-map-expanded .resort-map {
  order: 1;
  position: static;
  width: 100%;
}
.resort-layout.resort-map-expanded .resort-map-gl-wrap,
.resort-layout.resort-map-expanded .resort-map-static {
  min-height: 70vh;
}
.resort-layout.resort-map-expanded .resort-map-static {
  height: 70vh;
  min-height: 400px;
  align-items: stretch;
}
.resort-layout.resort-map-expanded .resort-map-static .resort-map-static-img {
  flex: 1;
  min-height: 0;
}
.resort-layout.resort-map-expanded .resort-map-gl {
  height: 70vh;
  min-height: 400px;
}
.resort-layout.resort-map-expanded .resort-map-static-img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}
@media (max-width: 720px) {
  .resort-layout {
    grid-template-columns: 1fr;
  }
  .resort-layout.resort-map-expanded .resort-map-gl {
    height: 60vh;
    min-height: 320px;
  }
  .resort-layout.resort-map-expanded .resort-map-static {
    height: 60vh;
    min-height: 320px;
  }
  .resort-title {
    font-size: 1.5rem;
  }
  .resort-map-gl {
    height: 240px;
  }
}

@media (max-width: 480px) {
  .resort-title {
    font-size: 1.35rem;
  }
  .resort-stats {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }
  .resort-auth-header {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }
}

.resort-content {
  min-width: 0;
}

.resort-map {
  margin: 0;
  position: sticky;
  top: 1rem;
}
.resort-map img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--resort-edit-border);
}
.resort-map figcaption {
  font-size: 0.8rem;
  color: var(--resort-footer-color);
  margin-top: 0.35rem;
}

.resort-map-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.resort-map-toggle {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--resort-edit-border);
  width: fit-content;
}
.resort-map-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--resort-footer-color);
  background: #f8fafc;
  border: 1px solid var(--resort-edit-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.resort-map-expand-btn:hover {
  background: #e8f0f7;
  color: var(--resort-title-color);
}
.resort-map-expand-btn .bi {
  font-size: 1rem;
}
.resort-layout.resort-map-expanded .resort-map-expand-btn {
  background: #e8f0f7;
  color: var(--resort-title-color);
}

.resort-map-tab {
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--resort-footer-color);
  background: #f8fafc;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.resort-map-tab + .resort-map-tab {
  border-left: 1px solid var(--resort-edit-border);
}
.resort-map-tab:hover {
  background: #e8f0f7;
  color: var(--resort-title-color);
}
.resort-map-tab--active {
  background: var(--resort-title-color);
  color: #fff;
}
.resort-map-tab--active:hover {
  background: #2c5282;
  color: #fff;
}

.resort-map-gl-wrap {
  position: relative;
  width: 100%;
}

.resort-map-legend {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 10;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 10px;
  max-height: 140px;
  overflow-y: auto;
}
.resort-map-legend h3 { margin: 0 0 4px 0; font-size: 11px; }
.resort-map-legend .resort-legend-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.resort-map-legend .resort-legend-swatch {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.resort-map-legend .resort-legend-line {
  width: 16px;
  height: 4px;
  min-width: 16px;
  min-height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
}
/* Colors via classes so legend still works when CSP strips inline styles */
.resort-map-legend .resort-legend-line--easy { background: #22c55e; }
.resort-map-legend .resort-legend-line--intermediate { background: #2563eb; }
.resort-map-legend .resort-legend-line--advanced { background: #1a1a1a; }
.resort-map-legend .resort-legend-line--expert { background: #991b1b; }
.resort-map-legend .resort-legend-swatch--lift { background: #dc2626; }
.resort-map-legend .resort-legend-row-lift { margin-top: 6px; }

.resort-map-tooltip {
  position: fixed;
  z-index: 9999;
  padding: 6px 10px;
  background: #1e293b;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: none;
  max-width: 260px;
}
.resort-map-tooltip strong { display: block; margin-bottom: 2px; }

.resort-map-gl {
  width: 100%;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--resort-edit-border);
}

.resort-map-static {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}

.resort-map-static-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.resort-osm-note {
  font-size: 0.78rem;
  color: var(--resort-footer-color);
  margin: -0.5rem 0 0.75rem 0;
  line-height: 1.4;
}

.resort-osm-link {
  color: var(--resort-subtitle-color);
  text-decoration: none;
}
.resort-osm-link:hover {
  text-decoration: underline;
}

.resort-data-callout {
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0.75rem 0 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 4px solid;
  max-width: 42rem;
}
.resort-data-callout--flagged {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}
.resort-data-callout--refresh {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af;
}
.resort-data-callout--hidden {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #4b5563;
}
.resort-data-callout--finished {
  background: #d1fae5;
  border-color: #059669;
  color: #065f46;
}

.resort-trail-breakdown,
.resort-meta {
  font-size: 0.85rem;
  color: var(--resort-body-color);
  margin: 0 0 0.5rem 0;
}
.resort-meta {
  margin-bottom: 1rem;
}

.resort-stats {
  background: var(--resort-stats-bg);
  padding: 0.9rem 1rem;
  margin: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.5rem 1.5rem;
}

.resort-stat {
  font-size: 0.9rem;
}

.stat-label {
  font-weight: 600;
  color: var(--resort-stats-label);
  margin-right: 0.35rem;
}

.stat-value {
  color: var(--resort-body-color);
}

.resort-body {
  font-size: 1rem;
  color: var(--resort-body-color);
  margin: 1rem 0;
}

.resort-body p {
  margin: 0 0 0.85em 0;
}

.resort-body p:last-child {
  margin-bottom: 0;
}

.resort-body-first::first-letter {
  float: left;
  font-size: 3.2rem;
  line-height: 0.9;
  font-weight: 700;
  color: var(--resort-title-color);
  margin-right: 0.15rem;
  padding-top: 0.05rem;
}

.resort-body .drop-cap {
  float: left;
  font-size: 3.2rem;
  line-height: 0.9;
  font-weight: 700;
  color: var(--resort-title-color);
  margin-right: 0.15rem;
  padding-top: 0.05rem;
}

.resort-footer {
  margin-top: 1.5rem;
  padding-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--resort-footer-color);
}

.resort-page-num {
  font-weight: 600;
}

.resort-collection {
  margin-left: 0.35rem;
}

/* Edit section */
.resort-edit {
  border-top: 1px solid var(--resort-edit-border);
  padding-top: 1.5rem;
}

.resort-edit-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--resort-stats-label);
  margin: 0 0 0.5rem 0;
}

.resort-workflow-hint {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.45;
  margin: 0 0 0.75rem 0;
  max-width: 42rem;
}
.resort-workflow-hint strong { color: #333; }
.resort-char-count {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 0.5rem 0;
}
.resort-char-count-over { color: #c53030; font-weight: 600; }
.resort-edit-source {
  display: block;
  width: 100%;
  max-width: 42rem;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid var(--resort-edit-border);
  border-radius: 4px;
  resize: vertical;
}

.resort-edit-source:focus {
  outline: none;
  border-color: var(--resort-subtitle-color);
  box-shadow: 0 0 0 2px rgba(91, 143, 180, 0.2);
}

.resort-edit-revision-comment {
  margin: 0.75rem 0 0.5rem 0;
}
.resort-edit-revision-comment label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--resort-footer-color);
  margin-bottom: 0.25rem;
}
.resort-revision-comment-input {
  width: 100%;
  max-width: 32rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.resort-edit-btn {
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: var(--resort-title-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.resort-edit-btn:hover {
  background: #2c5282;
}

.resort-edit-btn:active {
  transform: scale(0.98);
}

.resort-edit-details {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--resort-edit-border);
}
.resort-edit-details-summary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--resort-title-color);
  cursor: pointer;
  list-style: none;
}
.resort-edit-details-summary::-webkit-details-marker { display: none; }
.resort-osm-actions-wrap.resort-edit-details {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0;
}

.resort-customize-facts {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--resort-edit-border);
}
.resort-customize-facts-summary {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--resort-title-color);
  cursor: pointer;
  list-style: none;
}
.resort-customize-facts-summary::-webkit-details-marker { display: none; }
.resort-fact-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.35rem 1rem;
  margin: 0.75rem 0 0.5rem 0;
}
.resort-fact-checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.resort-fact-checkbox input { flex-shrink: 0; }
.resort-customize-facts-actions { margin-top: 0.75rem; }
.resort-customize-facts-actions .resort-edit-btn { margin-right: 0.5rem; }
.resort-edit-btn-secondary {
  background: var(--resort-edit-border);
  color: var(--resort-body-color);
}
.resort-edit-btn-secondary:hover { background: #b0bcc8; }
.resort-btn-hide { background: var(--resort-edit-border); color: var(--resort-body-color); }
.resort-btn-hide:hover { background: #b0bcc8; }
.resort-btn-unhide { background: #2563eb; color: #fff; }
.resort-btn-unhide:hover { background: #1d4ed8; }
.resort-admin-hide-actions { margin-top: 0.5rem; }
.resort-admin-hide-actions .resort-edit-btn { margin-right: 0.5rem; }
.resort-admin-category-wrap { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.resort-admin-category-label { font-size: 0.9rem; color: var(--resort-body-color, #374151); }
.resort-admin-category-select { padding: 0.35rem 0.5rem; font-size: 0.9rem; border: 1px solid var(--resort-edit-border, #cbd5e0); border-radius: 4px; background: #fff; }
.resort-admin-status-actions { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.resort-admin-status-actions .resort-edit-btn { margin-right: 0.25rem; }
.resort-btn-finished { background: #059669; color: #fff; }
.resort-btn-finished:hover { background: #047857; }
.resort-btn-lock { background: #7c3aed; color: #fff; }
.resort-btn-lock:hover { background: #6d28d9; }

/* Revisions and comments */
.resort-revisions,
.resort-comments {
  border-top: 1px solid var(--resort-edit-border);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.resort-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--resort-stats-label);
  margin: 0 0 0.5rem 0;
}

.resort-list {
  font-size: 0.9rem;
  color: var(--resort-body-color);
}

.resort-list-empty {
  color: var(--resort-footer-color);
  font-style: italic;
  margin: 0.5rem 0;
}

.resort-region-list {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--resort-edit-border);
}

.resort-region-links {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.resort-region-links li {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
}

.resort-region-links li:last-child {
  border-bottom: none;
}

.resort-region-links a {
  color: var(--resort-title-color);
  text-decoration: none;
}

.resort-region-links a:hover {
  text-decoration: underline;
}

.resort-revision-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
}

.resort-revision-time {
  color: var(--resort-footer-color);
  margin-right: 0.5rem;
}

.resort-revision-user {
  font-weight: 500;
  color: var(--resort-title-color);
}

.resort-revision-status {
  font-size: 0.85em;
  margin-left: 0.35rem;
}
.resort-revision-status-pending { color: #b8860b; }
.resort-revision-status-accepted { color: #2e7d32; }
.resort-revision-status-rejected { color: #c62828; }

.resort-revision-action {
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f5f5f5;
}
.resort-revision-action:hover {
  background: #e8e8e8;
}
.resort-revision-accept { border-color: #2e7d32; color: #2e7d32; }
.resort-revision-accept:hover { background: #e8f5e9; }
.resort-revision-reject { border-color: #c62828; color: #c62828; }
.resort-revision-reject:hover { background: #ffebee; }

.resort-revision-view-diff {
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #90a4ae;
  background: #fff;
  color: #546e7a;
}
.resort-revision-view-diff:hover { background: #eceff1; }

.resort-revision-diff {
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  padding: 0.75rem;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow-x: auto;
}
.resort-diff-pre {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre;
  word-break: normal;
}
.resort-diff-add { color: #2e7d32; background: #e8f5e9; display: block; }
.resort-diff-remove { color: #c62828; background: #ffebee; display: block; }
.resort-diff-context { color: #546e7a; display: block; }

.resort-comment-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
}

.resort-comment-meta {
  font-size: 0.8rem;
  color: var(--resort-footer-color);
}

.resort-comment-content {
  margin: 0.25rem 0 0 0;
}

.resort-comment-form {
  margin-top: 1rem;
}

.resort-comment-input {
  display: block;
  width: 100%;
  max-width: 32rem;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--resort-edit-border);
  border-radius: 4px;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.resort-comment-input:focus {
  outline: none;
  border-color: var(--resort-subtitle-color);
}
