/* Sidebar items — compact, one-line, truncated */
.sidebar-navigation .sidebar-item .sidebar-item-text {
  line-height: 1.4;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-navigation .sidebar-section .sidebar-item {
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

/* Navbar compact */
.navbar {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.9rem;
}

/* Right TOC spacing */
nav#TOC .nav-link {
  margin-left: 0.6rem;
}

nav#TOC > ul {
  padding-left: 0;
}

/* Code blocks */
pre.sourceCode {
  padding: 0.8rem 1rem;
}

/* Table listing — compact rows */
.quarto-listing table.table {
  font-size: 0.88rem;
}

.quarto-listing table.table td,
.quarto-listing table.table th {
  padding: 0.4rem 0.6rem;
  border-color: #292e42;
  white-space: nowrap;
}

.quarto-listing table.table td:nth-child(2) {
  white-space: normal;
  max-width: 500px;
}

.quarto-listing table.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Listing border */
.quarto-listing .list-group-item {
  border-color: #292e42;
}

/* Text highlight: ==marked text== in Quarto markdown */
mark {
  background-color: rgba(242, 216, 120, 0.18);
  color: #f5e094;
  padding: 0.05em 0.25em;
  border-radius: 3px;
}

/* Post footer — subscribe + share */
.post-footer-wrap {
  margin-top: 3rem;
  border-top: 1px solid #2d2d35;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.subscribe-box {
  background-color: #222228;
  border: 1px solid #2d2d35;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.subscribe-tagline {
  color: #edeae3;
  margin: 0;
  font-size: 0.93rem;
}

.subscribe-box small {
  color: #bfbbb4;
  font-size: 0.78rem;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  background-color: #1b1b1f;
  border: 1px solid #3d3d45;
  color: #edeae3;
  border-radius: 5px;
  padding: 0.38rem 0.75rem;
  font-size: 0.87rem;
  outline: none;
}

.subscribe-form input[type="email"]:focus {
  border-color: #f2d878;
}

.subscribe-form input[type="email"]::placeholder {
  color: #5a5650;
}

.subscribe-form button {
  background-color: #f2d878;
  color: #1b1b1f;
  border: none;
  border-radius: 5px;
  padding: 0.38rem 1.1rem;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.subscribe-form button:hover {
  background-color: #f7e898;
}

.share-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-label {
  color: #bfbbb4;
  font-size: 0.83rem;
}

.share-buttons {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: #222228;
  border: 1px solid #2d2d35;
  border-radius: 5px;
  color: #bfbbb4 !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}

.share-btn:hover {
  border-color: #f2d878;
  color: #f2d878 !important;
}

/* Language switcher */
#lang-switcher {
  position: fixed;
  top: 0;
  right: 0;
  padding: 0 16px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 9999;
}

#lang-label {
  color: #bfbbb4;
  font-size: 0.8rem;
  white-space: nowrap;
  margin-right: 3px;
  line-height: 1;
}

#lang-switcher button {
  background: none;
  border: 2px solid transparent;
  border-radius: 5px;
  font-size: 1.95rem;
  padding: 1px 3px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.15s, border-color 0.15s;
}

#lang-switcher button.lang-active {
  border-color: #f2d878;
  opacity: 1;
}

#lang-switcher button:hover {
  opacity: 1;
}

/* Bilingual content visibility */
[data-lang="en"] .lang-vi { display: none !important; }
[data-lang="vi"] .lang-en { display: none !important; }

/* Contact form */
.cf-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cf-field label {
  font-size: 0.85rem;
  color: #bfbbb4;
}

.cf-optional {
  color: #5a5650;
  font-size: 0.78rem;
}

.cf-form input[type="email"],
.cf-form input[type="text"],
.cf-form textarea {
  background-color: #1b1b1f;
  border: 1px solid #3d3d45;
  color: #edeae3;
  border-radius: 5px;
  padding: 0.42rem 0.75rem;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}

.cf-form input[type="email"]:focus,
.cf-form input[type="text"]:focus,
.cf-form textarea:focus {
  border-color: #f2d878;
}

.cf-form input[type="email"]::placeholder,
.cf-form input[type="text"]::placeholder,
.cf-form textarea::placeholder {
  color: #5a5650;
}

.cf-form input[type="file"] {
  color: #bfbbb4;
  font-size: 0.83rem;
  cursor: pointer;
}

.cf-form input[type="file"]::file-selector-button {
  background-color: #222228;
  border: 1px solid #3d3d45;
  color: #bfbbb4;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  margin-right: 0.6rem;
  transition: border-color 0.15s;
}

.cf-form input[type="file"]::file-selector-button:hover {
  border-color: #f2d878;
}

.cf-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cf-submit {
  background-color: #f2d878;
  color: #1b1b1f;
  border: none;
  border-radius: 5px;
  padding: 0.42rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.cf-submit:hover:not(:disabled) {
  background-color: #f7e898;
}

.cf-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cf-ok    { color: #7ecb7e; font-size: 0.85rem; }
.cf-error { color: #e07070; font-size: 0.85rem; }

/* Book pages (reads/) */
.book-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.book-stars {
  color: #f2d878;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.book-byline {
  color: #bfbbb4;
  font-size: 0.88rem;
}

.book-notes {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.book-notes p {
  margin: 0;
  line-height: 1.65;
  font-size: 0.95rem;
}

.book-notes strong {
  color: #f2d878;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

.book-section {
  border-left: 2px solid #2d2d35;
  padding-left: 0.85rem;
}

/* Reads listing — compact single-row table with locked column widths */
#listing-reads-listing table.quarto-listing-table {
  table-layout: fixed;
  width: 100%;
}

#listing-reads-listing td,
#listing-reads-listing th {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  vertical-align: middle;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Title column: fills remaining space */
#listing-reads-listing td:nth-child(1),
#listing-reads-listing th:nth-child(1) {
  width: auto;
}

/* Author column: fixed 200px */
#listing-reads-listing td:nth-child(2),
#listing-reads-listing th:nth-child(2) {
  width: 200px;
}

/* Read (year) column: wide enough for 4-digit year */
#listing-reads-listing td:nth-child(3),
#listing-reads-listing th:nth-child(3) {
  width: 72px;
}
