/* Homepage — Style 1: Sidebar */

.s1-layout { display: grid; grid-template-columns: var(--rail) 1fr; gap: 30px; align-items: start; }

.s1-rail { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
.s1-cover { position: relative; width: 100%; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 22px 55px rgba(0,0,0,0.55); }
.s1-cover .status-flag { position: absolute; top: 11px; right: 11px; }
.s1-actions { display: flex; flex-direction: column; gap: 10px; }

.rail-meta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 16px; }
.meta-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.meta-row:last-child { border-bottom: 0; }
.meta-row .lbl { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.meta-row .lbl svg { color: var(--muted-2); }
.meta-row .val { margin-left: auto; font-weight: 700; font-size: 13.5px; }
.meta-row .val.ongoing { color: var(--good); display: inline-flex; align-items: center; gap: 6px; }
.meta-row .val.ongoing i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

.s1-content { min-width: 0; }
.s1-content .series-title { font-size: clamp(30px, 4vw, 46px); margin-top: 6px; }
.s1-content .genres { margin-top: 16px; }

/* Tabs */
.mangaops-tabs { display: flex; gap: 4px; margin: 22px 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px; width: fit-content; }
.mangaops-tabs .tab { border: 0; background: transparent; color: var(--muted); padding: 9px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700; transition: .16s; }
.mangaops-tabs .tab.on { background: var(--accent, #f0a92b); color: #1a1200; }
.mangaops-tabs .tab .count { font-size: 12px; opacity: .8; }
.panel { display: none; }
.panel.on { display: block; }

/* Chapter rows */
.ch-list { display: flex; flex-direction: column; gap: 8px; }
.ch-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, background .15s, transform .1s; }
.ch-row:hover { border-color: var(--accent, #f0a92b); background: var(--surface-2); transform: translateX(3px); }
.ch-thumb { width: 46px; height: 46px; border-radius: 8px; flex: none; border: 1px solid var(--line); background-size: cover; background-position: center; }
.ch-main { min-width: 0; display: flex; flex-direction: column; }
.ch-main .num { font-weight: 700; font-size: 14.5px; }
.ch-main .date { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ch-chev { margin-left: auto; color: var(--muted-2); flex: none; }
.ch-row:hover .ch-chev { color: var(--accent, #f0a92b); }
.ch-row.upcoming { border-style: dashed; opacity: .78; }
.ch-row.upcoming .ch-thumb { filter: grayscale(.4) opacity(.6); }
.ch-row.upcoming .num small { color: var(--accent, #f0a92b); font-weight: 700; font-size: 11px; margin-left: 8px; }
.ch-row.upcoming .date { color: var(--accent, #f0a92b); }

.mobile-only { display: none; }

@media (max-width: 880px) {
  /* Reading order on a phone.

     This used to put the whole content column first (order 1) and the rail
     second, so a reader landed on a search box and a chapter list before ever
     seeing which novel they were on - the title and cover sat BELOW the list.

     The two columns are dissolved with `display: contents` so their children
     can be ordered individually, giving the page one plain reading order:
     what this novel IS, then what you can read, then the FAQ (which lives
     outside this layout, in front-page.php, so it already lands last). */
  .s1-layout { grid-template-columns: 1fr; gap: 20px; }
  .s1-rail, .s1-content { display: contents; }

  /* --- the novel: cover and info --- */
  .s1-mtitle          { order: 1; }
  .s1-cover           { order: 2; max-width: 260px; aspect-ratio: 5/7; margin: 0 auto; }
  .s1-actions         { order: 3; max-width: 340px; width: 100%; margin: 0 auto; }
  .s1-content .genres { order: 4; }
  .rail-meta          { order: 5; }
  /* --- then the chapters --- */
  .mangaops-tabs      { order: 6; }
  .s1-content .panel  { order: 7; }

  /* `display: contents` drops the rail's own box, and with it the text-align
     it used to inherit from .s1-content. Centre the headline block explicitly
     rather than relying on a box that no longer exists. */
  .s1-mtitle, .s1-content .genres { text-align: center; }
  .s1-content .genres, .mangaops-tabs { justify-content: center; }
  .mangaops-tabs { width: 100%; }
  .mobile-only { display: block; }
  .desktop-only { display: none; }
  .s1-mtitle .series-title { font-size: clamp(26px, 7vw, 38px); margin-top: 6px; }
  .ch-row { text-align: left; }
  .rail-meta { margin-top: 4px; }
}
