/* Responsive 3-column shell (X-style).
   <768px: mobile top nav + footer; left/right columns hidden.
   768–1023px: icon-only left nav, no right rail.
   1024–1279px: icon-only left nav, right rail visible.
   >=1280px: full left nav (icons + labels) and both side columns.
   Sticky / grid utilities are not in the compiled tailwind.css sheet. */


/* Home feed tabs (Verse of the Hour / Following / For You) — phones and desktop. */
.home-tabs {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgb(255 255 255 / 0.15);
  background-color: rgb(15 23 42 / 0.88);
  background-image: linear-gradient(135deg, rgb(15 23 42 / 0.92) 0%, rgb(30 27 75 / 0.88) 50%, rgb(76 29 149 / 0.55) 100%);
  backdrop-filter: blur(12px);
}
.home-tab {
  flex: 1 1 0;
  text-align: center;
  padding: 0.65rem 0.35rem;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  text-decoration: none;
  color: rgb(156 163 175);
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.home-tab:hover { color: rgb(252 211 77); }
.home-tab.is-on {
  color: rgb(252 211 77);
  border-bottom-color: rgb(245 158 11);
}
@media (min-width: 640px) {
  .home-tab { font-size: 0.95rem; padding: 0.75rem 0.5rem; }
}

.desk-left,
.desk-right,
.desk-only { display: none; }

/* Narrow desktop / tablet: icon-only left nav, no right rail. */
@media (min-width: 768px) {
  #site-topnav,
  #site-footer { display: none !important; }

  .desk-shell {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1rem;
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 0.75rem 0 0.35rem;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    align-items: start;
  }

  .desk-left {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: visible;
    padding: 0.75rem 0 1.25rem;
    align-items: center;
  }

  .desk-mid { min-width: 0; padding-bottom: 3rem; }

  /* Left nav */
  .desk-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
  }
  .desk-brand:hover { opacity: 0.9; text-decoration: none; }
  .desk-brand-name {
    font-size: 1.25rem;
    font-weight: 900;
    color: rgb(252 211 77);
  }
  .desk-scribes { margin: 0.5rem 0 0; font-size: 0.875rem; color: rgb(252 211 77); }
  .desk-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 1.1rem;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .desk-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.9rem;
    min-height: 44px;
    border-radius: 9999px;
    color: rgb(252 211 77);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    line-height: 1.2;
    position: relative;
  }
  .desk-nav-item:hover { background: rgb(245 158 11 / 0.15); color: rgb(251 191 36); text-decoration: none; }
  .desk-nav-item.is-on { background: rgb(255 255 255 / 0.1); }
  .desk-nav-ico { width: 1.35rem; height: 1.35rem; flex-shrink: 0; }
  .desk-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 9999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
  }
  .desk-badge[hidden],
  .desk-badge.hidden { display: none !important; }
  .desk-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgb(245 158 11);
    box-shadow: 0 0 20px rgba(251, 158, 11, 0.45);
    flex-shrink: 0;
  }
  .desk-weave {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-image: linear-gradient(to right, #f59e0b, #ea580c);
    color: #000;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(251, 158, 11, 0.4);
  }
  .desk-weave .desk-nav-ico { width: 1.35rem; height: 1.35rem; }
  .desk-weave:hover { text-decoration: none; color: #000; }
  .desk-signed { margin: 0.75rem 0 0; color: rgb(156 163 175); font-size: 0.875rem; }
  .desk-account { margin-top: 0.5rem; position: relative; flex-shrink: 0; }
  .desk-account summary {
    list-style: none;
    cursor: pointer;
    color: rgb(252 211 77);
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    position: relative;
  }
  .desk-account summary::-webkit-details-marker { display: none; }
  .desk-account a,
  .desk-account button.desk-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    min-height: 44px;
    color: rgb(252 211 77);
    font-weight: 700;
    text-decoration: none;
    border-radius: 9999px;
    font-size: 0.95rem;
  }
  .desk-account a:hover,
  .desk-account button.desk-switch:hover { background: rgb(245 158 11 / 0.15); text-decoration: none; }
  .desk-account a.desk-logout { color: rgb(252 165 165); }
  .desk-account form { margin: 0; }
  .desk-account button.desk-switch {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
  }

  /* Reading mode switcher (last item in the signed-in left nav). */
  .desk-theme { width: 100%; position: relative; }
  .desk-theme > summary { list-style: none; cursor: pointer; }
  .desk-theme > summary::-webkit-details-marker { display: none; }
  .desk-theme-menu { padding: 0.25rem 0.15rem 0.35rem; }
  .desk-theme-menu form { margin: 0; }
  .desk-theme-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.9rem;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: rgb(252 211 77);
    font-weight: 700;
    font-size: 0.95rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 9999px;
  }
  .desk-theme-menu button:hover { background: rgb(245 158 11 / 0.15); }
  /* overflow-y: auto on .desk-nav would otherwise clip a right-opening menu. */
  .desk-nav:has(.desk-theme[open]) { overflow: visible; }

  /* Right rail (shown from 1024px). */
  .desk-search {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.7rem 1rem;
    min-height: 44px;
    background: rgb(255 255 255 / 0.08);
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: 9999px;
    color: rgb(229 231 235);
    font-size: 1rem;
    font-family: Georgia, serif;
    outline: none;
  }
  .desk-search:focus { border-color: #fbbf24; }
  .desk-rail-card {
    background: rgb(255 255 255 / 0.08);
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: 20px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
  }
  .desk-rail-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 900;
    color: rgb(252 211 77);
  }
  .desk-trend-list { list-style: none; padding: 0; margin: 0; }
  .desk-trend-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.85rem;
  }
  .desk-trend-list a {
    color: rgb(252 211 77);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
  }
  .desk-wtf-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.7rem; }
  .desk-wtf-row { display: flex; align-items: center; gap: 0.6rem; }
  .desk-wtf-row .meta { min-width: 0; flex: 1; }
  .desk-wtf-row .meta p { margin: 0; line-height: 1.25; }
  .desk-follow-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 0.9rem;
    border-radius: 9999px;
    border: 0;
    cursor: pointer;
    background-image: linear-gradient(to right, #f59e0b, #ea580c);
    color: #000;
    font-weight: 700;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    text-decoration: none;
  }
  .desk-follow-btn:hover { color: #000; text-decoration: none; }
  .desk-rail-footer { padding-top: 0.25rem; color: rgb(156 163 175); font-size: 0.875rem; }
  .desk-rail-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin: 0.5rem 0; }
  .desk-rail-footer a { color: rgb(252 211 77); font-weight: 700; text-decoration: none; }
  .desk-rail-footer a:hover { color: rgb(253 230 138); }

  /* Compact verse picker under the home tabs. */
  .desk-picker-wrap { margin: 0.75rem 0 1rem; }
  .desk-picker-wrap .flex.flex-col.sm\:flex-row { gap: 0.55rem; padding: 0.45rem; }
  .desk-picker-wrap .verseweave-input,
  .desk-picker-wrap select {
    min-height: 44px;
    padding: 0.45rem 0.7rem;
    font-size: 1rem;
  }
  .desk-picker-wrap button[type="submit"] {
    font-size: 1.05rem;
    padding: 0.4rem 1.15rem;
  }

  /* Prev/Next under the Verse of the Hour card (desktop). Same look as weave.html. */
  .verse-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
  }
  .verse-nav-prev,
  .verse-nav-next {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    min-height: 44px;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
  }
  .verse-nav-prev {
    background: rgb(255 255 255 / 0.1);
    color: rgb(252 211 77);
    border: 2px solid transparent;
  }
  .verse-nav-prev:hover { background: rgb(255 255 255 / 0.2); border-color: rgb(252 211 77); text-decoration: none; }
  .verse-nav-next {
    background-image: linear-gradient(to right, #f59e0b, #ea580c);
    color: #000;
    border: 0;
    box-shadow: 0 8px 25px rgba(251, 158, 11, 0.4);
  }
  .verse-nav-next:hover { color: #000; text-decoration: none; }
  .verse-nav .ref { font-size: 0.95rem; font-weight: 400; }

  /* Sign-in pages: keep today's mobile card, use the site background once the shell appears. */
  body.account-page {
    display: flex;
    flex-direction: column;

    background-image: var(--page-image, linear-gradient(135deg, #0f172a 0%, #1e1b4b 30%, #4c1d95 70%, #0f172a 100%));
    background-attachment: fixed;
    color: rgb(229 231 235);
  }
}

/* Icon-only left nav (768–1279px). */
@media (min-width: 768px) and (max-width: 1279px) {
  .desk-nav-label,
  .desk-brand-name,
  .desk-scribes,
  .desk-signed,
  .desk-account-caret { display: none !important; }

  .desk-brand {
    justify-content: center;
    gap: 0;
    width: 4.5rem;
  }
  .desk-brand img {
    width: 40px;
    height: 40px;
  }

  .desk-nav {
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.75rem;
    scrollbar-width: none;
  }
  .desk-nav::-webkit-scrollbar { display: none; }

  .desk-nav-item {
    justify-content: center;
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.45rem;
    gap: 0;
  }

  .desk-badge {
    position: absolute;
    top: 0.05rem;
    right: -0.1rem;
    margin-left: 0;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.2rem;
    font-size: 0.625rem;
    z-index: 1;
  }

  .desk-weave {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    margin-top: 0.6rem;
    border-radius: 9999px;
    font-size: 0;
    align-self: center;
  }

  .desk-account { width: 4.5rem; }
  .desk-account summary {
    justify-content: center;
    width: 2.75rem;
    min-width: 2.75rem;
    margin: 0 auto;
    padding: 0.25rem;
  }
  .desk-account-menu {
    position: absolute;
    left: calc(100% + 0.4rem);
    bottom: 0;
    width: 16.5rem;
    max-width: calc(100vw - 5.5rem);
    max-height: min(70vh, 28rem);
    overflow-y: auto;
    z-index: 50;
    padding: 0.4rem;
    background: rgb(15 23 42 / 0.97);
    border: 1px solid rgb(245 158 11 / 0.4);
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  }

  .desk-theme { display: flex; justify-content: center; }
  .desk-theme-menu {
    position: absolute;
    left: calc(100% + 0.4rem);
    bottom: 0;
    width: 12rem;
    max-width: calc(100vw - 5.5rem);
    z-index: 50;
    padding: 0.4rem;
    background: rgb(15 23 42 / 0.97);
    border: 1px solid rgb(245 158 11 / 0.4);
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  }
}

/* Medium desktop: keep icon-only left nav, show the right rail. */
@media (min-width: 1024px) {
  .desk-hide { display: none !important; }
  .desk-only { display: block; }
  .desk-only-flex { display: flex !important; }

  .desk-shell {
    grid-template-columns: 4.5rem minmax(0, 1fr) 20rem;
    gap: 1.5rem;
    padding: 0 1.25rem;
  }

  .desk-right {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 0.75rem 0 1.25rem;
    scrollbar-width: thin;
  }

  /* Home tab typography is a bit roomier on desktop. */
  .home-tab {
    padding: 1rem 0.75rem;
    font-size: 1.05rem;
  }

  /* Home already drew a trending sidebar from 1024px; the right rail replaces it. */
  .tn-aside { display: none !important; }
}

/* Wide desktop: full left nav with labels. */
@media (min-width: 1280px) {
  .desk-shell {
    grid-template-columns: 16.5rem minmax(0, 1fr) 20rem;
  }

  .desk-left {
    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
  }
  .desk-left:has(.desk-theme[open]) { overflow: visible; }
  .desk-theme-menu {
    margin: 0.15rem 0 0.25rem;
    padding: 0.25rem;
    background: rgb(15 23 42 / 0.6);
    border: 1px solid rgb(245 158 11 / 0.3);
    border-radius: 1rem;
  }
}

/* X-style shared profile header (ministries, user profiles, groups). */
.x-profile-page {
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
}
.x-profile-flash {
  margin: 0.75rem 1rem 0;
}
.x-profile {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
}
.x-profile-banner {
  position: relative;
  width: 100%;
  height: 10rem;
  overflow: hidden;
  background-color: rgb(30 27 75);
}
@media (min-width: 640px) {
  .x-profile-banner { height: 13rem; }
}
.x-profile-banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.x-profile-banner-fallback {
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to right, rgb(245 158 11 / 0.40), rgb(234 88 12 / 0.30), rgb(107 33 168 / 0.60));
}
.x-profile-body {
  padding: 0 1rem 1.1rem;
}
.x-profile-avatar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem 0.85rem;
  min-width: 0;
}
.x-profile-avatar,
.x-profile-monogram {
  display: block;
  box-sizing: border-box;
  width: 5.5rem;
  height: 5.5rem;
  margin-top: -2.75rem;
  flex: 0 0 auto;
  border-radius: 9999px;
  border: 4px solid rgb(245 158 11);
  background-color: rgb(15 23 42);
  box-shadow: 0 0 30px rgb(251 158 11 / 0.45);
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.x-profile-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.85rem;
  line-height: 1;
  color: rgb(252 211 77);
  text-transform: uppercase;
  user-select: none;
}
@media (min-width: 640px) {
  .x-profile-avatar,
  .x-profile-monogram {
    width: 8rem;
    height: 8rem;
    margin-top: -4rem;
    border-width: 5px;
  }
  .x-profile-monogram { font-size: 2.5rem; }
}
.x-profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 11rem;
  min-width: 0;
  padding-top: 0.7rem;
}
.x-profile-actions .x-follow-count { display: none; }
.x-profile-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  width: 100%;
  margin: 0.85rem 0 0;
  min-width: 0;
  color: rgb(252 211 77);
  font-weight: 900;
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.x-profile-name-text {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}
@media (min-width: 640px) {
  .x-profile-name { font-size: 2rem; }
}
.x-profile-handle,
.x-profile-sub {
  margin: 0.15rem 0 0;
  color: rgb(156 163 175);
  font-size: 0.95rem;
  overflow-wrap: break-word;
  word-break: normal;
}
.x-profile-bio {
  margin: 0.75rem 0 0;
  color: rgb(229 231 235);
  font-size: 0.98rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: normal;
}
.x-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin: 0.7rem 0 0;
  color: rgb(156 163 175);
  font-size: 0.9rem;
  overflow-wrap: break-word;
  word-break: normal;
}
.x-profile-meta a {
  color: rgb(252 211 77);
  font-weight: 700;
}
.x-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0.65rem 0 0;
}
.x-profile-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.15rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: rgb(156 163 175);
}
.x-profile-counts a {
  color: rgb(209 213 219);
  text-decoration: none;
  font-weight: 700;
}
.x-profile-counts a:hover { color: rgb(252 211 77); text-decoration: underline; }
.x-profile-counts strong {
  color: rgb(255 255 255);
  font-weight: 800;
  margin-right: 0.25rem;
}
.x-profile-contact {
  margin: 0.9rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}
.x-profile-tabs {
  margin-top: 0;
}
.x-profile-panel {
  min-width: 0;
  width: 100%;
  padding: 0.75rem 0 1.5rem;
}
.x-profile-about {
  padding: 1rem 1rem 1.5rem;
  min-width: 0;
}
