/* Home page: the reading desk on the left (now listening, today's quote), the shelves on the right:
   one shelf per author, as many books per shelf as the screen holds, a slide when there are more */
.tc { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 48px; align-items: start; padding: 30px 40px 60px; }

/* reading desk */
.tc-desk { position: sticky; top: calc(var(--top-h) + 30px); height: calc(100vh - var(--top-h) - 54px); display: flex; flex-direction: column; border-radius: 14px; padding: 28px 30px; background: radial-gradient(ellipse 70% 50% at 50% 28%, rgba(126, 88, 214, .35), transparent 70%), rgba(16, 18, 48, .6); border: 1px solid rgba(214, 182, 120, .28); }
.tc-k { font-size: 11.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.tc-now { display: flex; gap: 20px; margin-top: 16px; text-decoration: none; }
.tc-now .bk { --fw: 132px; width: 132px; flex: none; box-shadow: 8px 16px 32px rgba(0, 0, 0, .55), 0 0 40px var(--glow); }
.tc-now h2 { margin: 4px 0; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.15; color: #fff; }
.tc-now p { margin: 0; font-size: 14px; color: var(--lav-2); }
.tc-now .bar { display: block; height: 3px; margin: 12px 0 14px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) var(--p), rgba(255, 255, 255, .12) var(--p)); }
.tc-go { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; background: linear-gradient(180deg, #e8d09a, #c9a463); color: #1c1630; text-decoration: none; font: 600 14px var(--sans); }
.tc-go svg { width: 14px; height: 14px; }
.tc-also { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(214, 182, 120, .2); }
.tc-also[hidden] { display: none; }
.tc-also a { display: flex; align-items: center; gap: 12px; padding: 6px 0; text-decoration: none; color: var(--lav); }
.tc-also .bk { width: 30px; flex: none; padding: 0; }
.tc-also .bk .fr, .tc-also .bk-title, .tc-also .bk-author, .tc-also .bk-slg { display: none; }
.tc-also .bk-lotus { width: 16px; height: 16px; margin-top: 8px; }
.tc-also b { font-family: var(--display); font-size: 17px; font-weight: 600; color: #fff; }
.tc-also small { display: block; font-size: 12px; color: var(--lav-3); }
.tc-welcome p { margin: 12px 0 18px; font-size: 15px; line-height: 1.6; color: var(--lav-2); }
.tc-quote { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(214, 182, 120, .2); }

/* filter row: all, the four biggest authors, the rest in a popover; listening status at the end */
.tc-lib { min-width: 0; }
.tc-tabs { position: sticky; top: var(--top-h); z-index: 5; display: flex; align-items: center; gap: 8px; margin: 0 -12px 6px; padding: 12px; background: linear-gradient(180deg, rgba(7, 11, 30, .96) 70%, rgba(7, 11, 30, 0)); }
.tc-tab { padding: 7px 16px; border-radius: 999px; border: 1px solid rgba(214, 182, 120, .35); background: none; cursor: pointer; font: 14.5px var(--sans); color: var(--lav); }
.tc-tab:hover { color: #fff; border-color: rgba(214, 182, 120, .75); }
.tc-tab[aria-pressed="true"] { background: rgba(214, 182, 120, .2); border-color: var(--gold); color: #fff; }
.tc-more { position: relative; }
.tc-stm { margin-left: auto; }
.tc-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: 300px; padding: 10px; border-radius: 12px; border: 1px solid rgba(214, 182, 120, .4); background: rgba(14, 16, 42, .97); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.tc-pop[hidden] { display: none; }
.tc-stm .tc-pop { left: auto; right: 0; width: 220px; }
.tc-popq { width: 100%; margin-bottom: 6px; padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(214, 182, 120, .3); background: rgba(255, 255, 255, .04); font: 14px var(--sans); color: #fff; outline: 0; }
.tc-poplist { max-height: 300px; overflow: auto; }
.tc-poplist button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 8px 10px; border: 0; border-radius: 6px; background: none; cursor: pointer; font: 14.5px var(--sans); color: var(--lav); text-align: left; }
.tc-poplist button:hover { background: rgba(214, 182, 120, .14); color: #fff; }
.tc-poplist button[hidden] { display: none; }
.tc-poplist small { color: var(--lav-3); }
.tc-poplist [aria-pressed="true"] { color: var(--gold); }
.tc-poplist [aria-pressed="true"] > span::before { content: "✓ "; }

/* one shelf per author */
.tc-sec[hidden], .tc-sec.empty { display: none; }
.tc-au { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 0; font-family: var(--display); font-size: 22px; font-weight: 600; color: #fff; }
.tc-au small { font: 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--lav-3); }
.tc-au::after { content: ""; flex: 1; align-self: center; height: 1px; background: linear-gradient(90deg, rgba(214, 182, 120, .45), transparent); }
.tc-nav { order: 3; display: flex; align-items: center; gap: 8px; margin-left: 14px; }
.tc-nav[hidden] { display: none; }
.tc-cnt { font: 13px var(--sans); color: var(--lav-3); margin-right: 4px; }
.tc-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(214, 182, 120, .45); background: rgba(10, 13, 34, .5); cursor: pointer; font: 20px/1 var(--display); color: var(--gold); transition: background .2s, opacity .2s; }
.tc-nav button:hover:not(:disabled) { background: rgba(214, 182, 120, .2); color: #fff; }
.tc-nav button:disabled { opacity: .3; cursor: default; }
.tc-wall.one .tc-au { display: none; }

/* the shelf: a sliding track (room around it for the hover lift and shadow, which a scroll box would clip);
   one author picked = every book on wrapped rows. --per (books per row) is set from the screen width by trang-chu.js */
.tc-grid { --per: 4; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per) - 1) * 40px) / var(--per)); gap: 0 40px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 40px 60px 70px; margin: -40px -40px -70px; scroll-padding: 0 60px; clip-path: inset(0 20px); }
.tc-grid::-webkit-scrollbar { display: none; }
.tc-wall.one .tc-grid { grid-auto-flow: row; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); overflow: visible; padding: 0 20px; margin: 0; clip-path: none; }
.tc-grid > a, .tc-grid > .fill { position: relative; display: block; padding: 22px 0 40px; text-decoration: none; scroll-snap-align: start; }
.tc-grid > a[hidden] { display: none; }
.tc-grid > a::after, .tc-grid > .fill::after { content: ""; position: absolute; left: -20px; right: -20px; bottom: 16px; height: 14px; background: linear-gradient(180deg, #8a7146, #3a2d2a 35%, #100c22); pointer-events: none; }
.tc-grid .bk { z-index: 1; }
.tc-grid > a:hover .bk { transform: translateY(-8px); box-shadow: 8px 18px 34px rgba(0, 0, 0, .6), 0 0 34px var(--glow); }

/* listening progress: a gold bar and tag while listening, a green seal and tag when finished */
.tc-grid .pg { position: absolute; left: 14px; right: 2px; bottom: 40px; height: 4px; z-index: 3; background: rgba(0, 0, 0, .55); border-radius: 0 0 6px 0; overflow: hidden; }
.tc-grid .pg i { display: block; height: 100%; width: calc(var(--pg) * 1%); background: linear-gradient(90deg, #b08d57, #f0d898); }
.tc-grid .tagp { position: absolute; left: 50%; bottom: 27px; z-index: 4; margin-left: 4px; transform: translateX(-50%); white-space: nowrap; padding: 2px 10px; border-radius: 999px; font: 400 11.5px/1.4 var(--sans); letter-spacing: .05em; color: #eaf7ea; background: linear-gradient(180deg, #4f9a6a, #2f6e48); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.tc-grid .tagp.doing { color: #2a1d08; background: linear-gradient(180deg, #f3dfa8, #cfa65c); }
.tc-grid .seal { position: absolute; top: 10px; right: -10px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 400 16px var(--sans); color: #f2fbf2; background: radial-gradient(circle at 35% 30%, #7cc596, #3d8a5a 60%, #26603d); box-shadow: 0 4px 12px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(10, 40, 20, .35); }
.tc-grid > a.st-done .bk { filter: saturate(.85); }
.tc-grid .pg, .tc-grid .seal, .tc-grid .tagp { transition: translate .35s ease; }
.tc-grid > a:hover .pg, .tc-grid > a:hover .seal, .tc-grid > a:hover .tagp { translate: 0 -8px; }
.tc-empty { margin: 40px 0; text-align: center; font-size: 15.5px; color: var(--lav-2); }
.tc-empty[hidden] { display: none; }

/* search inside every book: paper sheets in place of the shelves */
.tc-res[hidden], .tc-wall[hidden] { display: none; }
.tc-status { margin: 10px 0 24px; font-size: 15.5px; color: var(--lav-2); }
.tc-status button { border: 0; background: none; cursor: pointer; font: inherit; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.tc-rbook { max-width: 920px; margin: 0 0 28px; padding: 28px 34px 16px; border-radius: 6px; border: 1px solid rgba(214, 182, 120, .38); background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.tc-rbook h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: .02em; }
.tc-rbook .n { margin: 2px 0 12px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #8a6a3a; }
.tc-hit { display: block; padding: 15px 0 14px; border-top: 1px solid rgba(110, 104, 95, .18); text-decoration: none; color: var(--ink); }
.tc-hit:hover { background: linear-gradient(90deg, transparent, rgba(214, 182, 120, .12), transparent); }
.tc-hit b { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.tc-hit span { font-family: "Alegreya", var(--serif); font-size: 17.5px; line-height: 1.6; }
.tc-hit mark { background: rgba(214, 182, 120, .38); color: inherit; border-radius: 2px; padding: 0 1px; }
.tc-more-hits { display: block; margin: 6px auto 0; padding: 10px 0; border: 0; background: none; cursor: pointer; font: 14px var(--sans); letter-spacing: .06em; color: var(--rose); }

/* saved for offline listening: a small cloud on the cover's top-left corner */
.tc-grid .cloud { position: absolute; top: 12px; left: -8px; z-index: 4; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: #d9f5e3; background: rgba(12, 30, 24, .9); border: 1px solid rgba(111, 207, 151, .7); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); transition: translate .35s ease; }
.tc-grid .cloud svg { width: 17px; height: 17px; }
.tc-grid > a:hover .cloud { translate: 0 -8px; }

/* ---------- light (paper) ---------- */
html[data-theme="light"] .tc-desk { background: radial-gradient(ellipse 70% 50% at 50% 28%, rgba(214, 182, 120, .22), transparent 70%), #fffaf2; border-color: #e6dcc9; box-shadow: 0 10px 30px rgba(90, 70, 30, .07); }
html[data-theme="light"] .tc-now h2, html[data-theme="light"] .tc-also b, html[data-theme="light"] .tc-au { color: #2a2622; }
html[data-theme="light"] .tc-now .bar { background: linear-gradient(90deg, #c9a35f var(--p), rgba(60, 40, 10, .12) var(--p)); }
html[data-theme="light"] .tc-now .bk { box-shadow: 6px 12px 24px rgba(60, 40, 10, .3); }
html[data-theme="light"] .tc-go { color: #fff; background: #9c7536; }
html[data-theme="light"] .tc-also, html[data-theme="light"] .tc-quote { border-top-color: #e6dcc9; }
html[data-theme="light"] .tc-tabs { background: linear-gradient(180deg, rgba(244, 239, 229, .97) 70%, rgba(244, 239, 229, 0)); }
html[data-theme="light"] .tc-tab { border-color: #d8ccb6; }
html[data-theme="light"] .tc-tab:hover { color: #2a2622; border-color: #9c7536; }
html[data-theme="light"] .tc-tab[aria-pressed="true"] { background: #fff; border-color: #9c7536; color: #2a2622; box-shadow: 0 2px 8px rgba(90, 70, 30, .1); }
html[data-theme="light"] .tc-pop { background: #fffaf2; border-color: #e3d9c6; box-shadow: 0 20px 50px rgba(60, 40, 10, .18); }
html[data-theme="light"] .tc-popq { color: #2a2622; background: #fff; border-color: #d8ccb6; }
html[data-theme="light"] .tc-poplist button:hover { background: #f3ebdc; color: #2a2622; }
html[data-theme="light"] .tc-au::after { background: linear-gradient(90deg, rgba(156, 117, 54, .45), transparent); }
html[data-theme="light"] .tc-nav button { background: #fff; border-color: #d8ccb6; color: #9c7536; }
html[data-theme="light"] .tc-nav button:hover:not(:disabled) { background: #f3ebdc; color: #2a2622; }
html[data-theme="light"] .tc-grid > a::after, html[data-theme="light"] .tc-grid > .fill::after { background: linear-gradient(180deg, #d4b27a, #a8834d 40%, #6e5130); box-shadow: 0 8px 14px rgba(90, 60, 20, .18); }
html[data-theme="light"] .tc-grid > a:hover .bk { box-shadow: 8px 18px 30px rgba(60, 40, 10, .35), 0 0 30px var(--glow); }
html[data-theme="light"] .tc-grid .cloud { color: #fff; background: #3f8a5c; border-color: #fff; box-shadow: 0 4px 10px rgba(30, 60, 40, .3); }
html[data-theme="light"] .tc-rbook { background: #fffaf2; border-color: #e3d9c6; box-shadow: 0 14px 40px rgba(60, 40, 10, .1); }

/* "Lời tĩnh lặng hôm nay": a classic frame (double gold rule, corner flourishes, a quotation mark on the top rule) */
.tc-quote { padding-top: 22px; }
.q-box { position: relative; display: block; margin-top: 12px; padding: 22px 26px 18px; text-align: center; text-decoration: none; color: inherit;
  border: 1px solid rgba(214, 182, 120, .55); background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(214, 182, 120, .07), transparent 70%); }
.q-box::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(214, 182, 120, .28); pointer-events: none; }
.q-box[href]:hover { border-color: var(--gold); }
.q-box[href]:hover .q-go { opacity: 1; }
.q-c { position: absolute; width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 1.3; }
.q-c circle { fill: var(--gold); stroke: none; }
.q-c:nth-of-type(1) { top: -1px; left: -1px; }
.q-c:nth-of-type(2) { top: -1px; right: -1px; transform: scaleX(-1); }
.q-c:nth-of-type(3) { bottom: -1px; left: -1px; transform: scaleY(-1); }
.q-c:nth-of-type(4) { bottom: -1px; right: -1px; transform: scale(-1); }
/* the quotation mark sits inside the frame: the desk behind is see-through, so nothing may patch the rule */
.q-mark { display: block; height: 30px; margin: -8px 0 4px; font: 600 52px/1 var(--display); color: var(--gold); opacity: .9; }
.q-t { margin: 0; font: italic 500 20px/1.42 var(--display); color: #f4efff; text-wrap: balance; }
.q-orn { display: block; width: 150px; height: 17px; margin: 14px auto 8px; fill: var(--gold); opacity: .85; }
.q-orn .ln { fill: none; stroke: var(--gold); stroke-width: .8; }
.q-box .q-src { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--lav-3); }
.q-go { display: block; margin-top: 8px; font-size: 12.5px; letter-spacing: .04em; color: var(--gold); opacity: .7; transition: opacity .25s; }
html[data-theme="light"] .q-box { border-color: rgba(156, 117, 54, .55); background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(214, 182, 120, .12), transparent 70%); }
html[data-theme="light"] .q-box::before { border-color: rgba(156, 117, 54, .3); }
html[data-theme="light"] .q-t { color: #2a2622; }

/* today's listening on the desk */
.tc-days { margin-top: 18px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(214, 182, 120, .25); font-size: 14px; color: var(--lav-2); display: flex; justify-content: space-between; gap: 10px; }
.tc-days[hidden] { display: none; }
.tc-days b { color: var(--gold); font-weight: 600; }
.q-pic { display: block; margin: 10px auto 0; border: 0; background: none; padding: 2px 6px; cursor: pointer; font: 12.5px var(--sans); color: var(--lav-3); text-decoration: underline; text-underline-offset: 3px; }
.q-pic:hover { color: var(--gold); }

/* ---------- narrower screens: the desk above the shelves ---------- */
.tc-poplist .tc-top, .tc-morebtn .lbl-m { display: none; }
@media (max-width: 1000px) {
  .tc-tabs > .tc-tab { display: none; }
  .tc-poplist .tc-top { display: flex; }
  .tc-morebtn .lbl-d { display: none; }
  .tc-morebtn .lbl-m { display: inline; }
  .tc-stm { margin-left: 0; }
  .tc { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px 16px 40px; }
  .tc-desk { position: static; height: auto; padding: 20px 20px 22px; }
  .tc-quote { margin-top: 18px; }
  .tc-tabs { top: var(--top-h); margin: 0 -16px 4px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; background: #070b1e; }
  html[data-theme="light"] .tc-tabs { background: #f4efe5; }
  .tc-tabs::-webkit-scrollbar { display: none; }
  .tc-tab { flex: none; }
  .tc-more { position: static; }
  .tc-pop { left: 16px; right: 16px; width: auto; }
  .tc-stm .tc-pop { left: auto; right: 16px; width: 220px; }
}
@media (max-width: 600px) {
  .tc-grid { gap: 0 22px; grid-auto-columns: calc((100% - (var(--per) - 1) * 22px) / var(--per)); padding: 30px 30px 60px; margin: -30px -30px -60px; scroll-padding: 0 30px; clip-path: inset(0 14px); }
  .tc-wall.one .tc-grid { padding: 0 8px; }
  .tc-now .bk { --fw: 96px; width: 96px; }
  .tc-now h2 { font-size: 21px; }
  .tc-au { font-size: 19px; }
  .tc-nav button { width: 30px; height: 30px; }
  .tc-au { flex-wrap: wrap; row-gap: 2px; }
  .tc-au::after { display: none; }
  .tc-au small, .tc-cnt { white-space: nowrap; }
  .tc-nav { margin-left: auto; }
}

.tc-offnote { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(240, 160, 128, .5); background: rgba(240, 160, 128, .08); font-size: 14.5px; color: #f3c6b4; }
html[data-theme="light"] .tc-offnote { color: #8a4a2e; background: #fbeee6; }
