/* =========================================================
   FILE: /css/fgh.archive.css
   SYSTEM: FGH v2
   PURPOSE: Archive + Menu Styling
   ========================================================= */

/* =========================================================
   MENU_DESKTOP WRAPPER
   ========================================================= */

.sidebar-section {
  border-top: 1px solid rgba(90, 52, 24, 0.25);
}

.archive-panel {
  padding: 5px;
  border-radius: 14px;
  background: rgba(216, 196, 154, 0.25);
  border: 1px solid rgba(90, 52, 24, 0.12);
}

/* =========================================================
   DESKTOP ARCHIVE — MINI PANEL APPEARANCE
   ========================================================= */

@media (min-width: 768px) {
  .archive-panel {
    padding: 10px 12px;
    background: rgba(216, 196, 154, 0.32);
    border: 1px solid rgba(90, 52, 24, 0.18);
    border-radius: 16px;

    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.35) inset,
      0 2px 6px rgba(0, 0, 0, 0.06);
  }

  .archive-list {
    padding: 2px;
  }
}

/* =========================================================
   DESKTOP ACCORDION
   ========================================================= */

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-month {
  border-radius: 12px;
}

.archive-month-header {
  font-weight: 700;
}

.archive-month summary {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  padding: 6px 10px;
  border-radius: 12px;

  opacity: 0.9;
  user-select: none;
  line-height: 1.1;

  transition:
    background 120ms ease,
    opacity 120ms ease;
}

.archive-month summary:hover {
  background: rgba(90, 52, 24, 0.08);
  opacity: 1;
}

.archive-month summary::-webkit-details-marker {
  display: none;
}

/* =========================================================
   POSTS — LEDGER
   ========================================================= */

.archive-month .month-posts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px 6px;
}

.archive-post-link,
.archive-month .month-posts a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;

  width: 100%;
  box-sizing: border-box;

  font-size: 0.8rem;
  line-height: 1.25;

  padding: 4px 8px;
  border-radius: 10px;

  text-decoration: none;
  color: #5a3418;
  opacity: 0.92;

  transition:
    background 120ms ease,
    opacity 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.archive-post-link:hover,
.archive-month .month-posts a:hover {
  background: rgba(90, 52, 24, 0.08);
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.archive-post-link.active,
.archive-month .month-posts a.active {
  background: rgba(90, 52, 24, 0.14);
  font-weight: 700;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.archive-month .post-title {
  min-width: 0;
  text-align: left;
  padding-left: 10px;
}

.archive-month .post-date {
  text-align: right;
  white-space: nowrap;
  opacity: 0.7;
}

/* =========================================================
   MOBILE DROPDOWNS
   ========================================================= */

.fgh-mobile-nav-row {
  width: 100%;
  display: flex;
  gap: 12px;
  justify-content: center; /* keeps pair centered */
  align-items: center;
}

/* ---------- wrapper ---------- */

.fgh-mobile-post-wrap {
  position: relative;
  flex: 0 0 auto; /* ⭐ prevents flex stretch drift */
  max-width: 320px; /* ⭐ 1.5× wider (260 → 390) */
}

/* ---------- REAL CONTROL ---------- */

.fgh-mobile-post-select {
  width: 100%;

  padding: 0.75rem 1rem;

  border-radius: 14px;
  border: 1px solid rgba(90, 52, 24, 0.25);
  background: rgba(216, 196, 154, 0.55);

  font-size: 1rem;
  line-height: 1.2;

  text-indent: -9999px;
  caret-color: #5a3418;

  position: relative;
  z-index: 1;
  background-clip: padding-box;
}

/* ---------- PROXY LABEL ---------- */

.fgh-mobile-post-proxy {
  position: absolute;

  left: 1rem;
  right: 2.2rem; /* preserves arrow click zone */
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  align-items: center;
  justify-content: center; /* ⭐ centers text */

  text-align: center; /* ⭐ center alignment */

  color: #5a3418;
  font-size: 1rem;
  line-height: 1.2;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  pointer-events: none;
  z-index: 2;
}

/* month select unchanged */

.fgh-mobile-month-select {
  flex: 0 0 auto; /* keeps centered alignment */
  max-width: 260px;

  padding: 0.75rem 1rem;

  border-radius: 14px;
  border: 1px solid rgba(90, 52, 24, 0.25);
  background: rgba(216, 196, 154, 0.55);

  color: #5a3418;
  font-size: 1rem;
}

/* =========================================================
   VISIBILITY AUTHORITY
   ========================================================= */

@media (max-width: 767px) {
  .archive-desktop,
  #desktop-archive {
    display: none !important;
  }

  .fgh-mobile-nav-row {
    display: flex;
  }
}

@media (min-width: 768px) {
  .archive-desktop,
  #desktop-archive {
    display: block;
  }

  .fgh-mobile-nav-row {
    display: none !important;
  }
}

/* =========================================================
   ARCHIVE INJECTOR PANEL
   ========================================================= */

@media (min-width: 768px) {
  .fgh-posts-box {
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(90, 52, 24, 0.18);
    background: rgba(216, 196, 154, 1);

    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.35) inset,
      0 2px 6px rgba(0, 0, 0, 0.06);
  }
}
