:root {
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #172b34;
  --muted: #647780;
  --border: #d8e1e5;
  --accent: #247c72;
  --accent-soft: #e7f2f0;
  --shadow: 0 8px 24px rgba(28, 52, 61, 0.08);
  --radius: 18px;
}

.atlas-navigation { margin-top: 5px; font-size: 14px; }
.atlas-navigation a { color: var(--accent); text-underline-offset: 3px; }
.hydro-overview .river-overview { grid-column: 1 / -1; }
.river-sources { font-size: 13px; color: var(--muted); }
.river-sources summary { cursor: pointer; color: var(--accent); margin-bottom: 10px; }
.contact-page main { max-width: 940px; margin: 24px auto; padding: 0 20px 40px; }
.contact-page h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 12px; }
.contact-page h2 { font-size: 22px; color: var(--accent); margin-top: 0; }
.contact-page .contact-intro { color: var(--muted); max-width: 720px; }
.contact-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-top: 22px; box-shadow: var(--shadow); }
.contact-methods { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-methods a, .contact-actions button { display: inline-block; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 8px; color: var(--accent); background: white; text-decoration: none; font: inherit; cursor: pointer; }
.contact-methods a:hover, .contact-actions button:hover { background: var(--accent-soft); }
.contact-form { display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #aebfc5; border-radius: 8px; background: white; color: var(--text); font: inherit; font-weight: 400; }
.contact-form textarea { resize: vertical; min-height: 170px; }
.contact-form .contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-help { font-size: 14px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-actions button.primary { color: white; background: var(--accent); }
.contact-actions button:disabled { opacity: .6; cursor: wait; }
.contact-page :focus-visible { outline: 3px solid #e58b36; outline-offset: 3px; }
.contact-page #contact-status { min-height: 1.5em; color: var(--accent); margin: 0; }
.contact-page #file-list { margin: 0; padding-left: 22px; overflow-wrap: anywhere; }
.contact-page .site-footer { text-align: center; padding: 20px; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) {
  .contact-page main { padding: 0 12px 28px; margin-top: 20px; }
  .contact-card { padding: 18px; }
  .contact-form .contact-row { grid-template-columns: 1fr; }
  .contact-actions button { width: 100%; }
}


/* =========================================
   GENERAL
   ========================================= */

* {
  box-sizing: border-box;
}


html,
body {
  margin: 0;
  padding: 0;
}


body {
  background: var(--bg);
  color: var(--text);
  font-family:
    Arial,
    "Noto Sans Armenian",
    sans-serif;
  line-height: 1.5;
}


button,
input {
  font: inherit;
}


/* =========================================
   HEADER
   ========================================= */

header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 24px 34px;
}


header h1 {
  margin: 0 0 4px;
  font-size: 32px;
  line-height: 1.2;
}


header p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}


/* =========================================
   MAIN ATLAS
   ========================================= */

.atlas-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  align-items: start;
}


/* =========================================
   SIDEBAR
   ========================================= */

.sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}


.sidebar h2 {
  margin: 0 0 16px;
  font-size: 22px;
}


.sidebar h3 {
  margin: 22px 0 12px;
  font-size: 17px;
}


/*
  Կարևոր.
  Ձախ մենյուի տարրերը նորից
  դասավորում ենք ուղղահայաց։
*/

.sidebar label {
  display: block;
  color: var(--text);
}


.sidebar label + label {
  margin-top: 8px;
}


#search {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: #ffffff;
  color: var(--text);

  outline: none;
}


#search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}


.type-filter {
  margin-right: 9px;
  vertical-align: middle;
  transform: scale(1.08);
}


#status {
  margin-top: 20px;
  padding: 12px 14px;

  background: #e8f5f8;
  border-radius: 12px;

  font-size: 14px;
}


/* =========================================
   OBJECT LIST
   ========================================= */

#object-items {
  list-style: none;

  padding: 0;
  margin: 12px 0 0;

  max-height: 390px;
  overflow-y: auto;
}


.object-item {
  display: flex;
  flex-direction: column;
  gap: 2px;

  padding: 10px 4px;

  border-bottom: 1px solid #edf1f3;

  cursor: pointer;
}


.object-item:hover {
  color: var(--accent);
}


.object-name {
  font-weight: 700;
}


.object-meta {
  color: var(--muted);
  font-size: 13px;
}


/* =========================================
   MAP PANEL
   ========================================= */

.map-panel {
  min-width: 0;

  background: var(--panel);

  border: 1px solid var(--border);
  border-radius: var(--radius);

  overflow: hidden;

  box-shadow: var(--shadow);
}


.map-toolbar {
  min-height: 58px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding: 12px 20px;

  border-bottom: 1px solid var(--border);
}


.map-toolbar h2 {
  margin: 0;
  font-size: 21px;
}


#map-count {
  color: var(--muted);
  font-size: 14px;
}


#map {
  width: 100%;

  height: calc(100vh - 170px);
  min-height: 560px;
}


/* =========================================
   LEAFLET TOOLTIP
   ========================================= */

/* Override Leaflet's default nowrap so long object details stay inside. */
.leaflet-tooltip.object-hover-tooltip {
  box-sizing: border-box;
  width: 320px;
  max-width: calc(100vw - 32px);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;

  padding: 12px 14px;

  background: rgba(255, 255, 255, 0.97);

  border: 1px solid #d1dade;
  border-radius: 10px;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);

  color: var(--text);
}


.object-hover-tooltip::before {
  display: none;
}


.popup-title {
  margin-bottom: 7px;

  font-weight: 700;
  font-size: 16px;
}


.popup-row {
  margin-top: 3px;
  font-size: 13px;
}


/* =========================================
   OBJECT DETAILS
   ========================================= */

.object-details {
  position: relative;

  margin: 24px;

  background: var(--panel);

  border: 1px solid var(--border);
  border-radius: 16px;

  overflow: hidden;
}


.details-close {
  position: absolute;

  z-index: 10;

  top: 12px;
  right: 12px;

  width: 38px;
  height: 38px;

  border: 0;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.92);

  color: var(--text);

  font-size: 25px;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


.details-close:hover {
  background: #ffffff;
}


.details-content {
  padding: 26px;
}


.details-type {
  margin-bottom: 5px;

  color: var(--accent);

  font-size: 13px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.04em;
}


#details-name {
  margin: 0 0 20px;
  font-size: 28px;
}


/* =========================================
   DETAILS DATA
   ========================================= */

.details-data {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 12px;

  margin-bottom: 22px;
}


.detail-field {
  padding: 12px 14px;

  background: #f6f9fa;

  border: 1px solid #e4eaed;
  border-radius: 10px;
}


.detail-label {
  display: block;

  margin-bottom: 3px;

  color: var(--muted);

  font-size: 12px;
}


.detail-value {
  display: block;

  font-size: 15px;
  font-weight: 700;
}


.details-description {
  margin: 18px 0 24px;

  font-size: 16px;
  line-height: 1.7;
}


/* =========================================
   PHOTO GALLERY
   ========================================= */

.details-photo {
  width: 100%;
  min-height: 0;

  background: #eef3f5;
}


.details-photo-placeholder {
  width: 100%;
  min-height: 0;

  display: block;

  background: #eef3f5;
}


.details-photo-placeholder
> div:first-child
> img {

  width: 100% !important;

  height: 330px !important;
  max-height: 330px !important;

  object-fit: cover !important;
  object-position: center !important;

  display: block !important;
}


/* =========================================
   PHOTO CREDIT
   ========================================= */

.photo-credit {
  width: 100%;

  min-height: 38px;

  padding: 8px 16px;

  display: flex;

  align-items: center;
  justify-content: flex-end;

  flex-wrap: wrap;

  gap: 5px 12px;

  background: #f7f9fa;

  border-top: 1px solid var(--border);

  color: var(--muted);

  font-size: 12px;
  line-height: 1.4;

  text-align: right;

  overflow: visible;
}


.photo-credit span {
  min-width: 0;

  font-size: 12px;
  font-weight: 400;

  white-space: normal;
}


.photo-credit a {
  flex: 0 0 auto;

  color: var(--accent);

  font-size: 12px;
  font-weight: 700;

  text-decoration: none;

  white-space: nowrap;
}


.photo-credit a:hover {
  text-decoration: underline;
}


/* =========================================
   PHOTO THUMBNAILS
   ========================================= */

.details-photo-placeholder
> div:last-child:not(:first-child) {

  padding: 12px 16px !important;

  gap: 9px !important;

  background: #f4f7f8 !important;

  border-top:
    1px solid var(--border) !important;
}


.details-photo-placeholder
> div:last-child:not(:first-child)
button {

  width: 90px !important;
  min-width: 90px !important;

  height: 60px !important;

  border-radius: 8px !important;

  box-shadow: none;

  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease;
}


.details-photo-placeholder
> div:last-child:not(:first-child)
button:hover {

  opacity: 1 !important;

  transform: translateY(-1px);
}


.details-photo-placeholder
> div:last-child:not(:first-child)
button img {

  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
}


/* =========================================
   SOURCES
   ========================================= */

.details-sources {
  margin-top: 24px;

  padding-top: 20px;

  border-top: 1px solid var(--border);
}


.details-sources h3 {
  margin: 0 0 12px;

  font-size: 18px;
}


.source-item {
  padding: 12px 0;

  border-bottom: 1px solid #edf1f3;
}


.source-item:last-child {
  border-bottom: 0;
}


.source-title {
  font-weight: 700;
}


.source-meta {
  margin-top: 3px;

  color: var(--muted);

  font-size: 12px;
}


.source-link {
  display: inline-block;

  margin-top: 5px;

  color: var(--accent);

  font-size: 13px;
  font-weight: 700;

  text-decoration: none;
}


.source-link:hover {
  text-decoration: underline;
}


/* =========================================
   FOOTER
   ========================================= */

footer {
  padding: 20px 28px 30px;

  color: var(--muted);

  text-align: center;

  font-size: 13px;
}


/* =========================================
   TABLET
   ========================================= */

@media (max-width: 1000px) {

  .atlas-layout {
    grid-template-columns:
      280px minmax(0, 1fr);

    gap: 16px;

    padding: 16px;
  }


  .details-data {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .details-photo-placeholder
  > div:first-child
  > img {

    height: 300px !important;
    max-height: 300px !important;
  }
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 760px) {

  header {
    padding: 20px;
  }


  header h1 {
    font-size: 26px;
  }


  .atlas-layout {
    display: block;
    padding: 12px;
  }


  .sidebar {
    margin-bottom: 16px;
  }


  #object-items {
    max-height: 250px;
  }


  #map {
    height: 520px;
    min-height: 420px;
  }


  .object-details {
    margin: 12px;
  }


  .details-content {
    padding: 20px;
  }


  .details-data {
    grid-template-columns: 1fr;
  }


  .details-photo-placeholder
  > div:first-child
  > img {

    height: 260px !important;
    max-height: 260px !important;
  }


  .photo-credit {
    justify-content: flex-start;
    text-align: left;
  }


  .details-photo-placeholder
  > div:last-child:not(:first-child)
  button {

    width: 82px !important;
    min-width: 82px !important;

    height: 56px !important;
  }
}

/* Compact header leaves more room for the national map. */
header.site-header {
  padding: 10px 20px;
}
header.site-header h1 {
  margin: 0 0 2px;
  font-size: 26px;
  line-height: 1.15;
}
header.site-header p {
  font-size: 14px;
  line-height: 1.3;
}
.atlas-layout {
  padding: 12px;
  gap: 16px;
}
.map-toolbar {
  min-height: 38px;
  padding: 6px 14px;
}
.map-toolbar h2 {
  font-size: 19px;
}
@media (max-width: 760px) {
  header.site-header { padding: 8px 12px; }
  header.site-header h1 { font-size: 23px; }
  header.site-header p { font-size: 13px; }
}

/* Dense controls and smaller gaps leave more space for the map. */
header.site-header { padding: 8px 16px; }
header.site-header h1 { font-size: 25px; margin-bottom: 1px; }
header.site-header p { font-size: 13px; }
.atlas-layout {
  grid-template-columns: 250px minmax(0, 1fr);
  padding: 8px;
  gap: 8px;
}
.sidebar { padding: 12px; font-size: 14px; line-height: 1.3; }
.sidebar h2 { margin: 0 0 10px; font-size: 18px; }
.sidebar h3 { margin: 12px 0 6px; font-size: 15px; }
.sidebar label + label { margin-top: 4px; }
.sidebar #search { padding: 7px 9px; margin-top: 4px; font-size: 14px; border-radius: 8px; }
.sidebar .region-box { margin-top: 8px; }
.sidebar .region-box select { padding: 6px 8px; font-size: 14px; border-radius: 8px; }
.sidebar .filter-option { line-height: 1.35; }
.sidebar .type-filter { margin-right: 6px; transform: none; }
.sidebar #status { margin-top: 10px; padding: 8px; font-size: 12px; }
.sidebar #water-layer-controls { gap: 4px !important; margin-top: 8px !important; }
.sidebar #water-layer-controls button { font-size: 11px !important; padding: 5px 6px !important; }
.sidebar #object-items { margin-top: 6px; max-height: 280px; }
.sidebar .object-item { padding: 7px 2px; }
.sidebar .object-meta { font-size: 12px; }
.map-toolbar { min-height: 34px; padding: 4px 12px; }
.map-toolbar h2 { font-size: 18px; }
@media (max-width: 1000px) and (min-width: 761px) {
  .atlas-layout { grid-template-columns: 230px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .atlas-layout { display: block; padding: 8px; }
  .sidebar { margin-bottom: 8px; }
}


/* Tsovinar emblem and responsive atlas header. */
header.site-header .site-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}
header.site-header .site-logo-link {
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
}
header.site-header .site-logo-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
header.site-header .site-logo {
  display: block;
  width: 136px;
  height: auto;
}
header.site-header .site-header-copy { min-width: 0; }
@media (max-width: 760px) {
  header.site-header .site-header-inner { gap: 12px; }
  header.site-header .site-logo { width: 100px; }
  header.site-header .site-title { font-size: 21px; line-height: 1.25; }
}
@media (max-width: 420px) {
  header.site-header .site-header-inner { gap: 10px; }
  header.site-header .site-logo { width: 80px; }
  header.site-header .site-title { font-size: 18px; }
  header.site-header .site-subtitle { font-size: 12px; }
}
