/* CobbTalk homepage, modeled on discuss.flarum.org. See home.js. */

:root {
  --ct-peach-1: #e2522c;
  --ct-peach-2: #f39443;
  --ct-accent: #e8622f;
  --ct-accent-hover: #d4541f;
  --ct-head: var(--heading-color, #111827);
  --ct-text: var(--text-color, #374151);
  --ct-muted: var(--muted-color, #6b7280);
  --ct-soft: var(--control-bg, #e8edf3);
  --ct-line: rgba(127, 127, 127, .16);
}

/* ================= Band ================= */
.CTBand { position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, var(--ct-peach-1) 0%, var(--ct-peach-2) 100%); margin-bottom: 8px; }
.CTBand[hidden] { display: none; }
.CTBand .container { position: relative; z-index: 1; padding-top: 40px; padding-bottom: 40px; }
.CTBand--member .container { padding-top: 22px; padding-bottom: 24px; }
.CTBand-content { max-width: 620px; }
.CTBand h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.CTBand--member h1 { font-size: 27px; margin-bottom: 4px; }
.CTBand p { margin: 0 0 20px; font-size: 16.5px; line-height: 1.5; color: rgba(255, 255, 255, .95); }
.CTBand--member p { margin: 0; font-size: 15px; }
.CTBand-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.CTBand-join { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #c2410c !important; border: 0; border-radius: 4px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.CTBand-join:hover { background: #fff7f2; }
.CTBand-join:focus-visible, .CTBand-login:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.CTBand-login { color: #fff !important; font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; cursor: pointer; }
.CTBand-art, .CTFeature-art {
  position: absolute; top: 0; right: 0; bottom: 0; width: 46%; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='22' viewBox='0 0 26 22'%3E%3Cpath d='M3 2h11a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H9l-4 3v-3H3a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-size: 26px 22px; opacity: .22;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%); mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}

/* ================= Layout ================= */
.CTHome { margin: 0 0 8px; font-size: 15px; color: var(--ct-text); }
.CTHome *, .CTHome *::before, .CTHome *::after { box-sizing: border-box; }
.CTHome-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 36px; align-items: start; }
.CTHome a { text-decoration: none; }
.CTHome h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--ct-head); }
.CTBlock { margin-bottom: 34px; }
.CTSection-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.CTSection-head a, .CTRail h3 a { font-size: 13px; font-weight: 400; color: var(--ct-muted) !important; white-space: nowrap; }
.CTSection-head a:hover, .CTRail h3 a:hover { color: var(--ct-accent) !important; }
.CTSection-sub { margin: 4px 0 8px; font-size: 13.5px; line-height: 1.45; color: var(--ct-muted); }
.CTEmpty { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; font-size: 14px; color: var(--ct-muted); }
.CTEmpty > i { color: #16a34a; }
.CTAllHead { border-top: 1px solid var(--ct-line); margin: 4px 0 10px; padding-top: 22px; }

/* ================= Buttons ================= */
.CTBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 4px; border: 0; font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap; background: var(--body-bg, #fff); color: var(--ct-text) !important; }
.CTBtn:hover { filter: brightness(.97); }
.CTBtn:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: 2px; }
.CTBtn i { opacity: .8; }
.CTBtn--primary { background: var(--ct-accent); color: #fff !important; font-weight: 700; }
.CTBtn--primary i { opacity: 1; }
.CTBtn--primary:hover { background: var(--ct-accent-hover); filter: none; }
.CTBtn--small { padding: 7px 12px; font-size: 13px; }
.CTBtn--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--ct-line); margin-top: 10px; color: var(--ct-muted) !important; }
.CTBtn--outline:hover { color: var(--ct-accent) !important; box-shadow: inset 0 0 0 1px var(--ct-accent); filter: none; }
.CTEmpty .CTBtn { background: var(--ct-soft); }

/* ================= Featured banner ================= */
.CTFeature {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 26px 28px; margin-bottom: 26px; border-radius: 6px;
  background: radial-gradient(120% 160% at 0% 100%, rgba(232, 98, 47, .35) 0%, rgba(232, 98, 47, 0) 55%), #1c1512;
  color: #fff !important;
}
.CTFeature-art { width: 55%; opacity: .16; }
.CTFeature > span:not(.CTFeature-art) { position: relative; z-index: 1; }
.CTFeature-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f7a26f; }
.CTFeature-title { font-size: 22px; line-height: 1.25; font-weight: 700; color: #fff; max-width: 34em; }
.CTFeature-text { font-size: 14.5px; line-height: 1.5; color: rgba(255, 255, 255, .78); max-width: 40em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.CTFeature-cta { margin-top: 4px; font-size: 14px; font-weight: 700; color: #f7a26f; }
.CTFeature:hover .CTFeature-cta { text-decoration: underline; }

/* ================= Help card ================= */
.CTHelp { background: var(--ct-soft); border-radius: 6px; padding: 22px 24px; margin-bottom: 34px; }
.CTHelp h2 { margin-bottom: 6px; }
.CTHelp p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--ct-muted); }
.CTHelp-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= Discussion rows ================= */
.CTRows { list-style: none; margin: 0; padding: 0; }
.CTRow { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.CTRow-main { flex: 1 1 auto; min-width: 0; }
.CTRow-title { display: block; font-size: 16px; line-height: 1.3; color: var(--ct-head) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.CTRow-title:hover { color: var(--ct-accent) !important; }
.CTRow.is-unread .CTRow-title { font-weight: 700; }
.CTRow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; font-size: 12.5px; color: var(--ct-muted); min-width: 0; }
.CTRow-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.CTRow-by b { font-weight: 600; }
.CTRow-count { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 42px; font-size: 14px; color: var(--ct-muted) !important; }
.CTRow-count i { font-size: 15px; }
.CTRow-count:not(.is-zero) { color: var(--ct-text) !important; }
.CTRow-when { flex: 0 0 auto; font-size: 12px; color: var(--ct-muted); }
.CTAvatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.CTTag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; line-height: 1.5; color: #fff !important; background: var(--tag); white-space: nowrap; }
.CTTag i { font-size: 10px; }
.CTTag--sec { background: transparent; color: var(--ct-muted) !important; box-shadow: inset 0 0 0 1px var(--ct-line); font-weight: 500; }
.CTDate { flex: 0 0 36px; height: 36px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fde3d3; color: #b4431b; line-height: 1; }
.CTDate b { font-size: 13.5px; font-weight: 700; }
.CTDate small { font-size: 8.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-top: 2px; }

/* ================= Catch up ================= */
.CTCatch { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.CTCatch-item { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 4px; border: 0; font: inherit; font-size: 13.5px; cursor: pointer; background: var(--ct-soft); color: var(--ct-text) !important; }
.CTCatch-item i { color: var(--ct-muted); }
.CTCatch-item b { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--ct-accent); color: #fff; font-size: 11.5px; text-align: center; line-height: 18px; }
.CTCatch-item:hover { filter: brightness(.97); }

/* ================= Right rail ================= */
.CTRail { margin-bottom: 30px; font-size: 13.5px; }
.CTRail h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ct-muted); }
.CTRail h3 a { margin-left: auto; letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.CTRail-sub { margin: -4px 0 8px; font-size: 12.5px; color: var(--ct-muted); }
.CTStats { list-style: none; margin: 0; padding: 0; }
.CTStats li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.CTStat-label { display: inline-flex; align-items: center; gap: 9px; color: var(--ct-text); }
.CTStat-label i { width: 15px; text-align: center; color: var(--ct-muted); }
.CTStat-label i.CTStat-online { color: #16a34a; }
.CTStats b, .CTLeaders b { font-weight: 700; color: var(--ct-head); }
.CTLeaders { list-style: none; margin: 0; padding: 0; }
.CTLeaders li { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.CTLeaders-rank { width: 14px; color: var(--ct-muted); font-size: 12.5px; }
.CTLeaders .CTAvatar { width: 24px; height: 24px; font-size: 11px; }
.CTLeaders a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ct-text) !important; }
.CTLeaders a:hover { color: var(--ct-accent) !important; }
.CTMini { list-style: none; margin: 0; padding: 0; }
.CTMini li { display: flex; gap: 9px; padding: 6px 0; }
.CTMini .CTAvatar { width: 24px; height: 24px; font-size: 11px; margin-top: 1px; }
.CTMini div { min-width: 0; }
.CTMini a { display: block; font-weight: 600; line-height: 1.3; color: var(--ct-text) !important; }
.CTMini a:hover { color: var(--ct-accent) !important; }
.CTMini span { display: block; font-size: 12px; color: var(--ct-muted); margin-top: 2px; }

/* ================= Dark theme tweaks ================= */
[data-theme^="dark"] .CTDate { background: rgba(232, 98, 47, .18); color: #f7a26f; }
[data-theme^="dark"] .CTFeature { background: radial-gradient(120% 160% at 0% 100%, rgba(232, 98, 47, .3) 0%, rgba(232, 98, 47, 0) 55%), #2a1d17; }

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  .CTHome-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .CTHome-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 28px; border-top: 1px solid var(--ct-line); padding-top: 24px; }
}
@media (max-width: 767px) {
  .CTBand .container { padding-top: 24px; padding-bottom: 26px; }
  .CTBand--member .container { padding-top: 16px; padding-bottom: 18px; }
  .CTBand h1 { font-size: 26px; }
  .CTBand--member h1 { font-size: 22px; }
  .CTBand p { font-size: 15px; margin-bottom: 16px; }
  .CTBand-art { width: 60%; opacity: .14; }
  .CTHome { margin-top: 4px; }
  .CTFeature { padding: 20px; }
  .CTFeature-title { font-size: 19px; }
  .CTHelp { padding: 18px; margin-bottom: 28px; }
  .CTHelp-buttons { flex-direction: column; }
  .CTHelp-buttons .CTBtn { width: 100%; }
  .CTHelp-buttons .CTBtn--primary { order: 3; }
  .CTRow-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .CTBlock { margin-bottom: 28px; }
}
