.top-header {
  background: #f2f2f2;
  border-bottom: 1px solid #e4e4e4;
  padding: 8px 16px;
}

.top-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #d5e3d8;
  color: #123628;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.brand-logo-wrap {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.brand-logo-wrap .custom-logo-link {
  display: inline-flex;
  line-height: 0;
}

.brand-logo-wrap .custom-logo {
  display: block;
  width: auto;
  max-height: 46px;
}

.search-pill {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d6d6d6;
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 40px;
}

.search-pill input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #2b2b2b;
  font-size: 14px;
  padding: 0 8px;
}

.search-pill button {
  border: none;
  background: #243127;
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.search-pill button:hover {
  background: #1a261d;
}

.search-pill .search-suggestions {
  top: calc(100% + 6px);
  z-index: 130;
}

.top-nav {
  display: flex;
  gap: 16px;
  font-weight: 600;
  font-size: 14px;
}

.top-nav a {
  color: #222;
  text-decoration: none;
}

.top-nav a:hover {
  text-decoration: underline;
}

.trek-page {
  max-width: 1180px;
}

.breadcrumb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  color: #304a3d;
}

.back-link {
  font-weight: 700;
  text-decoration: underline;
  color: #173024;
}

.crumb-sep {
  color: #667a71;
}

.crumb-current {
  font-weight: 700;
}

.title-block {
  margin-bottom: 14px;
}

.title-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 20px;
  align-items: center;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.section-tabs a {
  color: #34463e;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
}

.section-tabs a:hover {
  background: #ecf5f0;
  text-decoration: none;
}

.gallery-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.gallery-main,
.gallery-thumb {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ecf0ed;
}

.gallery-main {
  min-height: 400px;
}

.gallery-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

.gallery-thumb {
  min-height: 195px;
}

.gallery-main img,
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  padding: 16px;
}

.gallery-placeholder.small {
  min-height: 80px;
}

.trail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.fact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.fact-label {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  margin-bottom: 4px;
}

.fact-value {
  font-size: 20px;
  font-weight: 700;
}

.content-sections {
  display: grid;
  gap: 12px;
}

.section-card {
  scroll-margin-top: 70px;
}

.description-content p:first-child {
  margin-top: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.gallery-grid-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
}

.gallery-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-block-title {
  margin: 0 0 10px;
  font-size: 17px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  max-width: 920px;
}

.media-embed {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 440px;
}

.media-embed iframe,
.media-embed video,
.media-embed object,
.media-embed embed {
  width: 100%;
  height: 248px;
  display: block;
  border: 0;
}

.media-link {
  display: block;
  padding: 14px;
  font-size: 13px;
  word-break: break-all;
}

.ai-summary-card {
  margin-bottom: 12px;
}

.markdown-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.markdown-action-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: #243127;
  background: #f8f4ea;
}

.markdown-action-link:hover {
  text-decoration: none;
  border-color: #cebfa6;
}

.markdown-render h2,
.markdown-render h3,
.markdown-render h4 {
  margin: 16px 0 8px;
}

.markdown-render p {
  margin: 0 0 8px;
}

.markdown-render ul {
  margin: 0 0 8px 20px;
}

@media (max-width: 900px) {
  .top-header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-pill {
    order: 3;
    flex: 1 1 100%;
  }

  .top-nav {
    order: 2;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
  }

  .gallery-section {
    grid-template-columns: 1fr;
  }

  .gallery-main {
    min-height: 250px;
  }

  .gallery-side {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .trail-facts {
    grid-template-columns: 1fr;
  }

  .title-meta-line {
    font-size: 16px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .top-nav {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .brand-logo-wrap .custom-logo {
    max-height: 40px;
  }
}

/* ── Comments Section ── */

.comments-section {
  margin-top: 24px;
}

.comments-section .section-title {
  margin-bottom: 20px;
}

/* Comment list */
.comment-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-item .children {
  list-style: none;
  margin: 12px 0 0;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-avatar img {
  border-radius: 50%;
  display: block;
}

.comment-author {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.comment-author a {
  color: var(--text);
  text-decoration: none;
}

.comment-author a:hover {
  color: var(--accent);
}

.comment-date {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.comment-text {
  font-size: 15px;
  line-height: 1.6;
}

.comment-text p:first-child {
  margin-top: 0;
}

.comment-text p:last-child {
  margin-bottom: 0;
}

.comment-awaiting {
  font-size: 13px;
  color: #b26900;
  background: #fef3e1;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0;
}

.comment-actions {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.comment-actions a {
  color: var(--accent);
  font-weight: 600;
}

.comment-actions a:hover {
  text-decoration: underline;
}

.comment-navigation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
}

/* Comment form */
#reply-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

#reply-title small a {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 95, 0.1);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .form-submit {
  margin: 4px 0 0;
}

.comment-submit-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.comment-submit-btn:hover {
  background: #236949;
}

.comment-form .logged-in-as {
  font-size: 13px;
  color: var(--muted);
}

.comment-form .logged-in-as a {
  color: var(--accent);
  font-weight: 600;
}

.comment-form .comment-notes {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.comments-closed {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .comment-header {
    gap: 8px;
  }

  .comment-avatar img {
    width: 36px;
    height: 36px;
  }

  .comment-item .children {
    padding-left: 14px;
  }
}
