/* Compact tool/logo row (use {{< icon-row >}} instead of gallery for small SVGs) */

.article-entry .post-icon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin: 12px 0 20px;
  width: 100%;
  max-width: 100%;
}

.article-entry .post-icon-row img,
.article-entry .post-icon-row a img {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  display: inline-block !important;
  margin: 0 !important;
  padding: 4px;
  box-sizing: content-box;
  border-radius: 8px;
  opacity: 1 !important;
  background: var(--color-wrap, transparent);
}

.article-entry .post-icon-row a {
  display: inline-flex;
  line-height: 0;
}

@media (min-width: 480px) {
  .article-entry .post-icon-row {
    gap: 14px 24px;
  }

  .article-entry .post-icon-row img,
  .article-entry .post-icon-row a img {
    width: 52px !important;
    height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
  }
}

/* Blog post tables: layout, wrapping, and readable columns (overrides Reimu max-content tables) */

.article-entry .table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  width: 100%;
  max-width: 100%;
}

.article-entry .table-wrapper table,
.article-entry > table {
  display: table;
  width: max-content !important;
  max-width: none !important;
  min-width: 100% !important;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
}

/* Before Reimu's client-side wrapper runs, let direct markdown tables scroll too. */
.article-entry > table {
  display: block;
  overflow-x: auto;
}

.article-entry .table-wrapper thead,
.article-entry > table thead {
  display: table-header-group;
}

.article-entry .table-wrapper tbody,
.article-entry > table tbody {
  display: table-row-group;
}

.article-entry .table-wrapper tr,
.article-entry > table tr {
  display: table-row;
}

.article-entry .table-wrapper th,
.article-entry .table-wrapper td,
.article-entry > table th,
.article-entry > table td {
  display: table-cell;
  padding: 8px 12px;
  vertical-align: top;
  text-align: left;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  border-bottom: 1px solid var(--color-border, rgba(128, 128, 128, 0.35));
}

.article-entry .table-wrapper th,
.article-entry > table th {
  font-weight: bold;
  border-bottom-width: 3px;
}

/* Keep multi-column data tables readable: scroll horizontally instead of squeezing cells into vertical text. */
.article-entry .table-wrapper table:has(thead tr > *:nth-child(3)) th:first-child,
.article-entry .table-wrapper table:has(thead tr > *:nth-child(3)) td:first-child,
.article-entry > table:has(thead tr > *:nth-child(3)) th:first-child,
.article-entry > table:has(thead tr > *:nth-child(3)) td:first-child {
  width: auto;
}

/* Respect markdown align-right (e.g. |---:|) */
.article-entry .table-wrapper th[style*="text-align:right"],
.article-entry .table-wrapper td[style*="text-align:right"],
.article-entry > table th[style*="text-align:right"],
.article-entry > table td[style*="text-align:right"] {
  text-align: right;
}

@media (max-width: 767px) {
  .article-entry .table-wrapper th,
  .article-entry .table-wrapper td,
  .article-entry > table th,
  .article-entry > table td {
    padding: 8px 10px;
    font-size: 0.95em;
  }
}

/* Footer: "Powered by Hugo Theme.Reimu" → Colophon */

#footer .footer-powered-wrap {
  margin: 8px 0;
}

#footer .footer-powered-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none !important;
  color: var(--grey-9);
  background: var(--red-5-5);
  border: 1px solid var(--red-4);
  box-shadow: var(--shadow-meta);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
  letter-spacing: 0.01em;
}

#footer .footer-powered-link:hover {
  text-decoration: none !important;
  color: var(--grey-9);
  background: var(--red-5);
  border-color: var(--red-2);
  box-shadow: 0 2px 14px var(--color-red-3-shadow);
  transform: translateY(-1px);
}

#footer .footer-powered-brand {
  color: var(--red-1);
  font-weight: 600;
}

#footer .footer-powered-muted {
  opacity: 0.88;
}

/* Hero post subtitle: graceful multi-line overflow */
#subtitle {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ONGEKI menu / footer / loader icons — slightly larger than Reimu defaults */
.main-nav-icon,
.sidebar-menu-icon {
  font-size: 28px;
}

/* PNG icons: Reimu stacks opacity on link wrap + icon (0.8 × 0.8) for font glyphs */
.main-nav-link-wrap:has(.main-nav-icon > img) {
  opacity: 1;
}

.main-nav-icon:has(> img) {
  opacity: 1;
}

.sidebar-menu-icon:has(> img) {
  opacity: 1;
}

.sidebar-menu-link-wrap.link-active:has(.sidebar-menu-icon > img) {
  opacity: 1;
}

.main-nav-icon img,
.sidebar-menu-icon img {
  display: block;
  opacity: 1;
  filter: brightness(1) saturate(1) contrast(0.7);
}

.sidebar-menu-link-wrap.link-active .sidebar-menu-icon img {
  filter: brightness(1) saturate(1) contrast(0.7)
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.main-nav-icon::before,
.sidebar-menu-icon::before {
  font-size: 28px;
}

.footer-info-sep {
  width: 28px;
  height: 28px;
}

.sidebar-top .sidebar-top-taichi {
  width: 54px;
  height: 54px;
}

#loader .loading-taichi img,
#loader .loading-taichi svg {
  width: 220px;
  height: 220px;
}

#loader .spinner-box .loading-word {
  top: calc(50% + 155px);
}
