/* Hub-only styles. Honors Pixel overrides & Bootstrap variables. */
/* Tokens */
:root {
  /* Existing */
  --hub-border: var(--brand-gold, #b08a48);

  /* === Compatibility tokens for old hub CSS ===
     Map old variables to Bootstrap/custom values so nothing falls back to grey.
  */
  --color-bg: #fff;
  --color-text: var(--bs-body-color, #000);
  --color-accent: var(--brand-gold, #b08a48);
 

  /* Radii, spacing, motion, shadow used by old rules */
  --radius-8: 0.5rem;
  --space-8: 0.5rem;
  --space-10: 0.5rem;
  --space-16: 1rem;
  --space-20: 1.25rem;
  --content-max-width: 1200px;
  --dur-quick: .15s;
  --easing-standard: ease;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.06);
}

/* Feature buttons (rendered into #hubNav by hubLoader.js) */
/* Align Hub row spacing with PixelTest */
/* Hub secondary nav — apply Pixel gap to both container and inner wrapper */
/* Desktop: pill row */
@media (min-width: 601px) {
  #hubNav,
  #hubNav .nav,
  #hubNav > ul,
  #hubNav > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem !important;           /* match Pixel template pill spacing */
    justify-content: flex-start !important;
  }
}

/* Mobile: tile grid (Hub-only hook to beat globals) */
@media (max-width: 600px) {
  #hubNav.hub-tiles,
  #hubNav.hub-tiles .nav,
  #hubNav.hub-tiles > ul,
  #hubNav.hub-tiles > div {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
    grid-auto-rows: minmax(116px, 1fr) !important;
    gap: 10px !important;
    align-content: start !important;
    width: 100% !important;
  }

  /* Every item type becomes a tile and fills its cell */
  #hubNav.hub-tiles .hub-btn,
  #hubNav.hub-tiles .nav-pills .nav-link,
  #hubNav.hub-tiles button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    text-align: center !important;
    border: 1px solid var(--hub-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--bs-body-color) !important;
    box-sizing: border-box !important;
  }
}

/* Keep Pixel container margins only on #hubNav itself */
#hubNav {
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

/* Normalize child margins and UL defaults so gap is authoritative */
#hubNav > *,
#hubNav .nav > *,
#hubNav > ul > *,
#hubNav > div > * {
  margin: 0 !important;
}

#hubNav > ul {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
}

/* Match Pixel small-pill spec for Hub secondary nav buttons */
/* Desktop: pills */
@media (min-width: 601px) {
  #hubNav .hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.48rem !important;
    font-size: 0.84rem !important;
    line-height: 1.2 !important;
    min-height: 30px !important;
    border: 1px solid var(--hub-border);
    border-radius: 0.5rem !important;
    background-color: #fff;
    color: var(--bs-body-color);
    text-decoration: none;
    font-weight: 500;
    box-sizing: border-box !important;
    background-clip: padding-box !important;
    transition: box-shadow .15s ease, transform .06s ease;
  }
}

/* Mobile: tiles */
@media (max-width: 600px) {
  #hubNav .hub-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;              /* fill tile cell */
    padding: 0.5rem !important;
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;       /* wrap labels */
    text-align: center !important;
    border: 1px solid var(--hub-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--bs-body-color) !important;
    box-sizing: border-box !important;
  }
}

#hubNav .hub-btn:focus {
  box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb,176,138,72), .25);
  text-decoration: none;
}
#hubNav .hub-btn.active {
  background-color: rgba(var(--bs-primary-rgb,176,138,72), .08);
  border-color: var(--hub-border);
}


/* Normalize child margins so Pixel gap values apply 1:1 */
#hubNav > * {
  margin: 0 !important;
}

/* Two-column area — let Bootstrap handle layout; keep only spacing */
#mainContainer {
  margin-top: 0.75rem;
}
#leftColumn, #rightColumn {
  min-width: 0;
}
#app {
  min-height: 320px;
}



/* Right rail sections (Journal / Projects / Focus Goals) */
/* Notes → remove the outer card from the right-rail container that hosts the pills */
#rightColumn #projectList.notes-rail-host,
#rightColumn #projectList.notes-rail-host.rail,
#rightColumn #projectList.notes-rail-host.rc-rail-grid {
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
/* Notes: when Notes borrows the Project rail, remove the outer card box */
#projectList.notes-rail-host.rail{
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.rail__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}
.rail__chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* When a rail is switched to brick grid, flatten the wrapper so chips become grid items */
#rightColumn .rc-rail-grid .rail__chips {
  display: contents !important;
  gap: 0 !important;
}
.rail__chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px dashed var(--hub-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #fff;
}
.rail__chip-title {
  font-weight: 600;
  margin: 0;
}
.rail__chip-sub {
  font-size: 0.875rem;
  color: var(--bs-secondary-color,#000);
  margin: 0;
}

/* Projects list */
.project-list:not(.rc-rail-grid) {
  border: 1px solid var(--hub-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.75rem;
}

/* Focus goals container placeholder (loader may mount inside) */
#focusGoals {
  margin-top: 1rem;
}

/* Hub Assistant basic layout (kept minimal; loader handles behavior) */
.chat {
  border: 1px solid var(--hub-border);
  border-radius: 0.5rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.chat__title {
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--hub-border);
  margin: 0;
}
.chat__messages {
  padding: 0.75rem;
  flex: 1 1 auto;
  overflow: auto;
}
.chat__msg {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
  background: #fff;
}
.chat__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--hub-border);
}
.chat__input {
  flex: 1 1 auto;
}

/* Utilities */
.u-hidden { display: none !important; }

/* Footer secondary nav — keep compact grid on mobile/tablet only */
@media (max-width: 768px) {
  /* Support either <footer>… or .site-footer wrappers with .secondary-nav */
  footer .secondary-nav .nav,
  .site-footer .secondary-nav .nav,
  footer .nav.nav-pills {
    display: flex !important;
    flex-direction: row !important;   /* defeat any column stack */
    flex-wrap: wrap !important;       /* wrap into a grid */
    align-items: center !important;
    justify-content: center !important;
    gap: 0.24rem !important;          /* match hub pill spacing */
  }

  footer .secondary-nav .nav .nav-link,
  .site-footer .secondary-nav .nav .nav-link,
  footer .nav.nav-pills .nav-link {
    width: auto !important;           /* kill any 100% width rule */
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}


/* Responsive: Bootstrap’s .row/.col-* already handle the two-column layout */
@media (min-width: 992px) {
  /* Opt-in equal columns for hub pages */
  #mainContainer.equal-5050{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;                /* keeps a small gutter */
  }

  /* Neutralize Bootstrap column widths inside the opt-in container */
  #mainContainer.equal-5050 > #leftColumn,
  #mainContainer.equal-5050 > #rightColumn{
    width: auto !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
  }
}

/* === Restored module styles from hubold.css (tokenized) === */

/* Feature buttons baseline, outside #hubNav scoping (some modules reuse .hub-btn) */
.hub-btn {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 400;
  border-radius: var(--radius-8);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: background-color var(--dur-quick) var(--easing-standard);
}

/* Journal */
.journal { padding: var(--space-16); }

.journal__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.journal__title { margin: 0; }

.journal__field {
  width: 100%;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-8);
  padding: 8px 12px;
  font-size: 16px;
  background: var(--color-bg);
  margin-bottom: 15px;
}

.journal__textarea {
  width: 100%;
  min-height: 60vh;
  resize: vertical;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-8);
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  background: var(--color-bg);
}

.journal__status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-accent);
  text-align: left;
}

/* Notes */
.notes { padding: var(--space-16); }

.notes__title   { display: block; margin: 0 0 8px; }
.notes__composer{ display: block; clear: both; margin-bottom: 14px; }

.notes__name {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 56px;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  padding: 12px;
  background: var(--color-bg);
  box-sizing: border-box;
  margin-bottom: 8px;
}

.notes__textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 220px;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  padding: 12px;
  background: var(--color-bg);
  box-sizing: border-box;
  margin-bottom: 8px;
}


.notes__row {
  border: 0;
  padding: 0;
  border-radius: 0;
  margin-bottom: 14px;
  background: transparent;
}

.notes__edit {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 300px;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  padding: 12px;
  background: var(--color-bg);
  box-sizing: border-box;
  resize: vertical;
}



.notes__row-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.notes__time     { color: var(--color-muted); font-size: 12px; }
.notes__actions  { display: flex; gap: 8px; }

/* To-Do: keep row tight on small screens and ensure input uses rail styles */
.todo-form .todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.todo-form .todo-row #todo-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-8);
  background: var(--color-bg);
}

/* Chips under mini calendar (kept minimal; avoid duplicate definitions) */
.rail__chip {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-8);
  background: var(--color-bg);
}
.rail__chip-title { font-weight: 600; font-size: 12px; line-height: 1.2; display: block; }
.rail__chip-sub   { font-size: 11px; line-height: 1.2; color: var(--color-muted); display: block; }

/* Tag Search panel (separate from calendar) */
.tagsearch__title {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tagsearch__field {
  display: block;
  margin-bottom: 0.75rem;
}

.tagsearch__input {
  display: block;
  width: 100%;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--hub-border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  min-height: 2.25rem;
  box-sizing: border-box;
}

.tagsearch__controls {
  display: block;
  margin-top: 0.5rem;
}

.tagsearch__controls .hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}
/* Journal: remove the outer rail card box */
#journalList.rail{
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

/* Tighten the Journal title since there’s no card padding now */
#journalList .rail__title{
  margin: 0 0 0.5rem 0 !important;
}


