:root {
  --header-height: 64px;
  --color-navy: #AE3B4A;
  --color-navy-dark: #8B2E3A;
  --color-gold: #ecbb0a;
  --color-cream: #f7f1ef;
  --color-paper: #fbfaf7;
  --color-ink: #2a1c1e;
  --color-muted: #6e6a62;
  --color-line: #eadfdc;
  --color-grey: #929497;
  --font-title: "Noto Sans TC", sans-serif;
  --font-serif: "Noto Serif TC", "Noto Sans TC", serif;
  --font-body: "Noto Sans TC", sans-serif;
  --panel-width-left: 300px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-soft: 0 10px 30px rgba(42, 28, 30, 0.12);
  --news-cream: #f7f1ef;
  --news-ink: #8B2E3A;
  --news-muted: #6e6a62;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
  font-family: var(--font-body);
  color: var(--color-ink);
  overflow: hidden;
  background: #111;
}

button,
input,
select {
  font-family: inherit;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-line);
  box-shadow: 0 1px 0 rgba(236, 187, 10, 0.55);
  z-index: 2000;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-height) + env(safe-area-inset-top));
}

.site-nav-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 20px;
}

.site-brand {
  --brand-en-size: 13px;
  --brand-en-gap: 3px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
  line-height: 1;
}

.site-brand-zh-img {
  display: block;
  height: 44px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-logos .logo {
  height: 32px;
}

.site-brand-en {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--brand-en-gap);
  font-family: "Bebas Neue", "Noto Sans TC", sans-serif;
  color: #111;
  letter-spacing: 0.06em;
  white-space: nowrap;
  font-size: var(--brand-en-size);
  line-height: 1;
  min-width: 0;
}

.navbar-brand-text {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-navy-dark);
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
}

button {
  touch-action: manipulation;
}

.panel-backdrop {
  display: none;
}

.nav-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-line);
  background: #fff;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.nav-menu-btn span {
  display: block;
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--color-navy-dark);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-menu-btn span:nth-child(1) { top: 13px; }
.nav-menu-btn span:nth-child(2) { top: 20px; }
.nav-menu-btn span:nth-child(3) { top: 27px; }

.nav-menu-btn[aria-expanded="true"] span:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}

.nav-menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-menu-btn[aria-expanded="true"] span:nth-child(3) {
  top: 20px;
  transform: rotate(-45deg);
}

.nav-drawer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.app-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-page-link {
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  font-size: 14px;
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  cursor: pointer;
}

.nav-page-link:hover {
  color: var(--color-navy-dark);
  background: #f3f1eb;
}

.nav-page-link.active {
  color: #fff;
  background: var(--color-navy);
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--color-line);
}

.nav-logos {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 28px;
  filter: grayscale(1);
  opacity: 0.85;
  transition: filter 0.2s, opacity 0.2s;
}

.geopark-logo {
  height: 42px;
}

.logo:hover {
  filter: none;
  opacity: 1;
}

.lang-container {
  display: flex;
  gap: 6px;
}

.languages {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eceae4;
  color: var(--color-navy-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.languages.active {
  background: var(--color-gold);
  color: var(--color-navy-dark);
}

.nav-backdrop {
  display: none;
}

/* --- MAP --- */
#viewDiv {
  position: absolute;
  top: calc(var(--header-height) + env(safe-area-inset-top));
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0;
  margin: 0;
}

/* --- LEFT SIDEBAR --- */
.sidebar-left {
  position: absolute;
  top: calc(var(--header-height) + env(safe-area-inset-top));
  left: 0;
  width: min(var(--panel-width-left), 86vw);
  height: calc(100% - var(--header-height) - env(safe-area-inset-top));
  background: var(--color-paper);
  z-index: 1000;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease;
  border-right: 1px solid var(--color-line);
}

.panel-collapsed {
  transform: translateX(-100%);
}

.menu-tab {
  position: absolute;
  top: 50%;
  right: -36px;
  transform: translateY(-50%);
  z-index: 1001;
}

.btn-toggle {
  background: var(--color-navy);
  color: #fff;
  border: none;
  width: 36px;
  height: 64px;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: var(--shadow-soft);
}

#panelScrollContent {
  height: 100%;
  overflow-y: auto;
  padding: 20px 18px 28px;
}

.archive-entry-btn {
  width: 100%;
  margin: 0 0 18px;
  padding: 11px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  min-height: 44px;
}

.archive-entry-btn:hover,
.archive-entry-btn:focus {
  background: var(--color-navy-dark);
}

.section-title {
  border-bottom: 1px solid var(--color-line);
  margin: 0 0 12px;
  padding-bottom: 8px;
}

.section-title h2 {
  font-family: var(--font-title);
  color: var(--color-navy-dark);
  font-size: 15px;
  letter-spacing: 0.08em;
  margin: 0;
  font-weight: 800;
}

.section-title.mt-4 {
  margin-top: 22px;
}

.opacity-row {
  padding: 0 2px 8px;
}

#opacitySlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
}

#opacitySlider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: #e6ddd9;
  border-radius: 999px;
  border: none;
}

#opacitySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  background: var(--color-navy);
  border-radius: 50%;
  border: 2px solid #fff;
  margin-top: -5px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#opacitySlider::-moz-range-track {
  width: 100%;
  height: 8px;
  background: #e6ddd9;
  border-radius: 999px;
  border: none;
}

#opacitySlider::-moz-range-thumb {
  height: 18px;
  width: 18px;
  background: var(--color-navy);
  border-radius: 50%;
  border: 2px solid #fff;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.geo-btn {
  background: #fff;
  border: 1px solid var(--color-line);
  color: var(--color-ink);
  padding: 10px 8px;
  min-height: 44px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

.geo-btn:hover,
.geo-btn:focus {
  background: var(--color-navy);
  color: #fff;
  border-color: var(--color-navy);
}

.landsd-logo {
  height: 36px;
  width: auto;
  display: block;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 6px;
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

body.tab-repository .landsd-logo,
body.tab-copyright .landsd-logo {
  display: none;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-ink);
  cursor: pointer;
}

.layer-item:hover {
  background: #f3efe6;
}

.layer-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-navy);
  cursor: pointer;
}

.layer-item label {
  cursor: pointer;
}

/* --- MAP DOCK --- */
#layerToggleContainer {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: left 0.35s ease;
}

.map-dock-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.96);
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-soft);
}

.map-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  color: var(--color-navy-dark);
  font-family: inherit;
  white-space: nowrap;
}

.map-dock-btn:hover,
.map-dock-btn:focus-visible {
  background: var(--news-cream);
  outline: none;
}

.map-dock-btn-layers[aria-expanded="true"] {
  background: var(--color-navy);
  color: #fff;
}

.map-dock-btn-layers[aria-expanded="true"] .map-layers-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.map-dock-icon {
  flex-shrink: 0;
}

.map-dock-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.map-dock-btn-layers[aria-expanded="true"] .map-dock-chevron {
  transform: rotate(180deg);
}

.map-layers-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-line);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.map-layers-panel {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--color-line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 12px 14px 14px;
  min-width: 220px;
  max-width: min(92vw, 320px);
}

.map-layers-panel-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.map-layer-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-layer-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--color-line);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-navy-dark);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.map-layer-chip:hover {
  border-color: var(--color-navy);
  background: var(--news-cream);
}

.map-layer-chip:has(input:checked) {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #fff;
}

.map-layer-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.map-dock-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  min-height: 40px;
  padding: 4px 0;
}

.map-dock-sep {
  width: 1px;
  height: 20px;
  background: var(--color-line);
  flex-shrink: 0;
}

#resetViewBtn span {
  pointer-events: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d8d3c8;
  transition: .2s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--color-navy);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* --- ARCHIVE PANEL --- */
.news-archive-panel {
  position: absolute;
  top: calc(var(--header-height) + env(safe-area-inset-top));
  left: 0;
  width: min(820px, 56vw);
  height: calc(100% - var(--header-height) - env(safe-area-inset-top));
  background: var(--news-cream);
  z-index: 1500;
  transform: translateX(-105%);
  transition: transform 0.22s ease, width 0.22s ease;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.news-archive-panel.open {
  transform: translateX(0);
}

.news-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.news-view[hidden] {
  display: none !important;
}

.news-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 6px;
  flex-shrink: 0;
}

.news-view-header h2 {
  font-family: var(--font-serif);
  color: var(--news-ink);
  font-size: 28px;
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.news-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 4px;
}

.news-text-btn,
.news-icon-btn,
.news-clear-all {
  background: none;
  border: none;
  color: var(--news-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 10px;
  min-height: 40px;
  border-radius: 8px;
}

.news-text-btn:hover,
.news-icon-btn:hover,
.news-clear-all:hover {
  background: #efe8d8;
}

.news-search-block {
  padding: 8px 24px 0;
  flex-shrink: 0;
}

.news-field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--news-muted);
  margin-bottom: 6px;
}

.news-search-box {
  display: flex;
  border: 1px solid var(--color-line);
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
}

.news-search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--color-ink);
  min-width: 0;
}

.news-search-btn {
  width: 48px;
  background: var(--color-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-filter-row {
  padding: 10px 24px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.news-filter-row:empty,
.news-filter-row[hidden] {
  display: none;
  padding: 0;
}

.news-type-filters {
  padding: 12px 24px 0;
  flex-shrink: 0;
}

.news-type-filters[hidden] {
  display: none;
}

.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--color-line);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--color-ink);
  border-radius: 999px;
}

.news-chip-x {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--news-muted);
  padding: 0 2px;
}

.news-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px 8px;
  font-size: 13px;
  color: var(--news-muted);
  flex-shrink: 0;
}

.news-sort,
.repo-place-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--news-muted);
}

.news-sort select,
.repo-place-label select {
  border: 1px solid var(--color-line);
  background: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--news-ink);
  cursor: pointer;
  outline: none;
  max-width: 200px;
  border-radius: 999px;
  padding: 6px 10px;
}

.news-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 16px;
  padding: 0 24px 32px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

.news-card,
.repo-card {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  content-visibility: auto;
  contain-intrinsic-size: 220px;
}

.news-card[hidden] {
  display: none;
}

.news-card-thumb,
.repo-card-thumb,
.news-card-placeholder,
.repo-card-placeholder {
  width: 100%;
  height: 128px;
  object-fit: cover;
  object-position: top;
  background: #e8e2d2;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 16px rgba(28, 43, 39, 0.08);
}

.news-card-meta,
.repo-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--news-muted);
  gap: 8px;
}

.news-card-title,
.repo-card-title {
  margin-top: 4px;
  font-family: var(--font-serif);
  color: var(--news-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.news-card:hover .news-card-title,
.repo-card:hover .repo-card-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-card-placeholder,
.repo-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--news-ink);
  font-size: 13px;
  font-weight: 700;
}

.news-detail-placeholder {
  height: 220px;
  max-width: 100%;
}

.news-detail-text,
.repo-detail-text {
  white-space: pre-line;
  color: #333;
  font-size: 15px;
  line-height: 1.8;
  margin: 12px 0 8px;
}

.news-empty,
.repo-empty {
  grid-column: 1 / -1;
  color: var(--news-muted);
  padding: 24px 0;
}

.news-detail-view {
  overflow-y: auto;
}

.news-detail-media,
.repo-detail-media {
  position: relative;
  background: #ece6d8;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

#newsDetailImage,
#repoDetailImage {
  max-width: 100%;
  max-height: 52vh;
  object-fit: contain;
  cursor: zoom-in;
}

.news-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  color: var(--news-ink);
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  line-height: 1;
}

.news-nav-arrow.prev { left: 8px; }
.news-nav-arrow.next { right: 8px; }

.news-detail-counter {
  text-align: center;
  color: var(--news-muted);
  font-size: 13px;
  padding: 8px 0 0;
}

.news-detail-body {
  padding: 16px 24px 40px;
}

#newsDetailHeadline,
#repoDetailHeadline {
  font-family: var(--font-serif);
  color: #8a1f24;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.35;
}

#newsDetailMeta,
#newsDetailPermission,
#repoDetailMeta,
#repoDetailPermission {
  color: #444;
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 8px;
}

/* --- TAB VIEWS --- */
body.tab-repository #viewDiv,
body.tab-copyright #viewDiv {
  pointer-events: none;
}

body.tab-repository #optionPanel,
body.tab-repository #layerToggleContainer,
body.tab-repository #newsArchivePanel,
body.tab-repository #panelBackdrop,
body.tab-copyright #optionPanel,
body.tab-copyright #layerToggleContainer,
body.tab-copyright #newsArchivePanel,
body.tab-copyright #panelBackdrop {
  visibility: hidden !important;
  pointer-events: none !important;
}

#appViewRepo,
#appViewCopyright {
  display: none !important;
  position: absolute;
  top: calc(var(--header-height) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  z-index: -1;
  pointer-events: none !important;
  visibility: hidden;
  -webkit-overflow-scrolling: touch;
}

body.tab-repository #appViewRepo,
body.tab-copyright #appViewCopyright {
  display: block !important;
  pointer-events: auto !important;
  visibility: visible;
  z-index: 1100;
}

#appViewRepo {
  background: var(--news-cream);
}

#appViewCopyright {
  background: #f7f6f2;
}

#imageModal {
  display: none;
  position: fixed;
  z-index: 3000;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  pointer-events: none;
}

#imageModal[style*="display: block"] {
  pointer-events: auto;
}

.modal-content {
  margin: 48px auto 0;
  display: block;
  width: 90%;
  max-width: 1000px;
  max-height: 86vh;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copyright-wrap {
  max-width: 820px;
  margin: 28px auto 60px;
  background: #fff;
  padding: 32px;
  border-radius: var(--radius);
  color: var(--color-ink);
  line-height: 1.7;
}

.copyright-wrap h1,
.copyright-wrap h2 {
  color: var(--color-navy-dark);
  font-weight: 800;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 10px;
  margin: 28px 0 16px;
}

.copyright-wrap h1 {
  margin-top: 0;
  font-size: 32px;
}

/* --- REPOSITORY --- */
.repo-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.repo-header h1 {
  font-family: var(--font-serif);
  color: var(--color-navy-dark);
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 12px;
  line-height: 1.15;
}

.repo-lead {
  color: var(--color-muted);
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.75;
  max-width: 44em;
}

.repo-search-block {
  max-width: 560px;
  margin-bottom: 18px;
}

.repo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 8px;
}

.repo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repo-pill {
  border: 1px solid var(--color-line);
  background: #fff;
  color: var(--news-ink);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
  border-radius: 999px;
}

.repo-pill.active {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #fff;
}

.repo-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.repo-meta-row {
  padding-left: 0;
  padding-right: 0;
}

.repo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px 16px;
}

.repo-card-thumb,
.repo-card-placeholder {
  height: 140px;
}

.repo-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.repo-detail-header h2 {
  font-family: var(--font-serif);
  color: var(--news-ink);
  font-size: clamp(22px, 4vw, 32px);
  margin: 0;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.repo-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.repo-detail-media {
  margin: 0;
  min-height: 280px;
}

#repoDetailImage {
  max-height: 70vh;
}

.repo-text-placeholder {
  width: 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--news-ink);
  font-weight: 700;
}

.repo-detail-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--news-muted);
  margin: 0 0 8px;
}

.repo-map-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--color-navy);
  font-weight: 700;
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
}

#panelScrollContent,
.news-card-grid,
#appViewRepo,
#appViewCopyright {
  overscroll-behavior: contain;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* --- TABLET / PHONE --- */
@media (max-width: 1100px) {
  .news-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-brand {
    gap: 10px;
    --brand-en-size: 12px;
  }
}

@media (max-width: 900px) {
  .site-brand {
    gap: 8px;
    --brand-en-size: 11px;
  }
  .site-brand-en { letter-spacing: 0.04em; }

  .nav-menu-btn {
    display: block;
  }

  .nav-drawer {
    position: absolute;
    top: calc(var(--header-height) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 2;
    background: #fff;
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 12px;
    padding: 16px 18px 20px;
    max-height: calc(100dvh - var(--header-height) - env(safe-area-inset-top));
    overflow-y: auto;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  body.nav-open .nav-drawer {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .nav-backdrop {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 43, 39, 0.32);
    z-index: 1990;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  body.nav-open .nav-backdrop {
    display: block;
    pointer-events: auto;
    opacity: 1;
  }

  .app-tabs {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-page-link {
    text-align: left;
    padding: 12px 14px;
    min-height: 44px;
  }

  .nav-divider {
    display: none;
  }

  .nav-logos {
    justify-content: flex-start;
    min-width: 0;
    padding-top: 0;
  }

  .nav-logos .logo {
    height: 26px;
  }

  .nav-logos .geopark-logo {
    height: 34px;
  }

  .lang-container {
    justify-self: end;
    flex-shrink: 0;
  }

  .repo-detail-layout {
    grid-template-columns: 1fr;
  }

  .repo-toolbar,
  .repo-toolbar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .news-sort select,
  .repo-place-label select {
    max-width: none;
    width: 100%;
  }

  .repo-main {
    padding: 20px 16px 48px;
  }

  .copyright-wrap {
    margin: 16px 12px 40px;
    padding: 22px 18px;
  }

  .copyright-wrap h1 {
    font-size: 26px;
  }
}

@media (max-width: 720px) {
  .news-archive-panel {
    width: 100%;
  }

  .news-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
    padding: 0 16px 28px;
  }

  .news-view-header,
  .news-search-block,
  .news-filter-row,
  .news-type-filters,
  .news-meta-row,
  .news-detail-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .news-view-header h2 {
    font-size: 22px;
  }

  body.news-open #layerToggleContainer,
  body.news-open #panelBackdrop {
    display: none !important;
  }

  .sidebar-left {
    width: min(100%, 320px);
    max-width: 86vw;
  }

  .panel-backdrop:not([hidden]) {
    display: block;
    position: absolute;
    top: calc(var(--header-height) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 43, 39, 0.32);
    z-index: 999;
  }

  #layerToggleContainer {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: calc(100% - 24px);
  }

  .map-dock-bar {
    width: max-content;
    max-width: 100%;
  }

  .map-layers-panel {
    width: min(280px, calc(100vw - 32px));
  }

  .map-dock-btn {
    font-size: 14px;
    padding: 8px 16px;
  }

  .map-dock-sep {
    display: block;
  }

  #viewDiv .esri-ui-bottom-left,
  #viewDiv .esri-ui-bottom-right {
    bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 480px) {
  .news-card-grid,
  .repo-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
  }
}
