/* =========================
   SCBC Youth Sunday School
   Manager + Public CSS
   (fluid layout + dual scrollbars)
   ========================= */

/* -------- Container / Header / Tabs / Buttons -------- */
/* Break out of theme's content container (full-bleed) */
.sws-breakout{
  width: 100vw;           /* fill the viewport width */
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Inner wrapper; keep content readable while allowing full-bleed sections */
.sws-wrap{
  padding-inline: 0.5rem; /* small side padding */
}

.sws-title{ margin:10px 0 20px; }

.sws-tabs{ margin:10px 0; }
.sws-tab{
  padding:.5rem 1rem;
  border:1px solid #ccc; border-radius:6px;
  background:#f6f6f6; cursor:pointer; margin-right:.5rem;
}
.sws-tab.is-active{ background:#0058a3; color:#fff; border-color:#0058a3; }

.sws-toolbar{
  margin:10px 0; display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}
.sws-btn{
  padding:.45rem .9rem;
  border:1px solid #ccc; border-radius:6px;
  background:#f6f6f6; cursor:pointer;
}
.sws-btn:hover{ background:#e9e9e9; }
.sws-chk{ display:inline-flex; align-items:center; gap:.4rem; }

/* -------- Tables -------- */
.sws-table{ width:100%; border-collapse:collapse; table-layout:auto; }
.sws-table th,.sws-table td{
  border:1px solid #e5e5e5; padding:.5rem; vertical-align:top;
}
.sws-table thead th{ background:#fafafa; }
.sws-empty{ text-align:center; color:#666; }

/* Inputs inside tables */
.sws-table input[type="text"],
.sws-table input[type="time"],
.sws-table input[type="date"],
.sws-table textarea{
  width:100%; box-sizing:border-box; font:inherit; padding:.35rem .45rem;
}

/* -------- List editor specifics -------- */
/* Wide note column */
#sws-list-table th.sws-wide,
#sws-list-table td.sws-note-cell{ width:48%; }

/* Topic / Location column minimums (can grow on wide screens) */
#sws-list-table th.sws-col-topic,
#sws-list-table td.sws-col-topic{ min-width:260px; }
#sws-list-table th.sws-col-loc,
#sws-list-table td.sws-col-loc{ min-width:220px; }

/* Scroll container: both axes + capped height (keeps horizontal bar visible) */
.sws-scroll-x{
  overflow: auto;                 /* both X + Y */
  max-height: 72vh;               /* keep in viewport height */
  border: 1px solid #eee;
  border-radius: 6px;
}

/* Top horizontal scrollbar (synced with the main scroll container) */
.sws-scroll-x-top{
  height: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 6px 0;
}
.sws-scroll-x-top .sws-spacer{ height:1px; }

/* -------- Week editor -------- */
.sws-note-row .sws-note-cell{ padding-top:.25rem; padding-bottom:.75rem; }
.sws-note-row .sws-note-text{ width:100%; min-height:160px; }
.sws-week-footer{ margin-top:10px; display:flex; gap:10px; }

/* -------- Pager -------- */
.sws-pager{ margin:10px 0; color:#666; }

/* -------- Highlight (Manager list) -------- */
/* Past rows => soft gray; next upcoming => warm amber */
tr.sws-row-past { background:#f2f2f2; color:#666; }
tr.sws-row-next { background:#fff4cc; }

/* -------- Public view -------- */
.sws-public .sws-table th,
.sws-public .sws-table td{ text-align:center; }
.sws-public .sws-table th.sws-note,
.sws-public .sws-table td.sws-note{ text-align:left; }

.sws-public .sws-week-block{
  padding:10px; border:1px solid #eee; border-radius:6px;
  margin:12px 0; background:#fff;
}
.sws-public .sws-week-block.sws-past{ background:#f7f7f7; }
.sws-public .sws-week-block.sws-past .sws-date{
  text-decoration: line-through; color:#888;
}
.sws-public .sws-week-block.sws-next{ background:#fff4cc; }

/* -------- Markdown help -------- */
.sws-md-help{ margin-top:10px; }
.sws-md-note{ color:#666; font-size:.95em; }

/* -------- Code & Markdown rendering fixes (CJK-safe) -------- */
/* Inline code: add CJK-capable fallbacks and allow wrapping */
.sws-note code,
.sws-public code,
.sws-table td code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
               "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei",
               "Noto Sans CJK TC", "Noto Sans CJK SC", "Source Han Sans TC", "Source Han Sans SC",
               monospace;
  white-space: pre-wrap;      /* wrap long lines */
  word-break: break-word;     /* allow CJK/long words to wrap */
  font-size: 0.95em;
  line-height: 1.5;
}

/* Fenced code blocks: used by mini_markdown() if you enable ```...``` support */
pre.sws-code{
  padding: .75rem 1rem;
  background: #f6f8fa;
  border-radius: 6px;
  overflow: auto;
  margin: .5rem 0;
}
pre.sws-code code{
  display:block;
  font: inherit;              /* inherit the same font stack */
  white-space: pre;           /* keep original whitespace in blocks */
}
