:root {
  --content-max-width: 1600px; /* ここを大きくする */
}

/* 本文サイズ調整 */
.page {
  font-size: large;
}

@media (max-width: 47.99em) {
  body {
    overflow-x: hidden;
  }

  .page {
    font-size: medium;
  }
}

@media (min-width: 64em) {
  .sidebar {
    width: calc(160px - 1em) !important;
  }

  .page {
    width: calc(100% - 160px) !important;
    max-width: var(--content-max-width) !important;
    padding-inline-end: 160px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    min-width: 0;
  }
}

@media (min-width: 80em) {
  .sidebar {
    width: calc(240px - 1em) !important;
  }

  .page {
    width: calc(100% - 240px) !important;
    padding-inline-end: 240px !important;
    box-sizing: border-box !important;
    min-width: 0;
  }
}

@media (min-width: 64em) {
  .cv-page .sidebar__right {
    position: static !important;
    float: none !important;
    width: auto !important;
    margin-inline-end: 0 !important;
    padding-inline-start: 0 !important;
  }
}

.cv-page .page__content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cv-page .toc header {
  display: block;
}

.cv-page .toc .nav__title.cv-toc-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.cv-page .toc .nav__title.cv-toc-trigger:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.cv-page .toc.is-collapsed .toc__menu {
  display: none;
}

.cv-timeline-edu {
  width: 100%;
  display: table;
}
.cv-timeline-edu td:nth-child(1) {
  width: 10%;
  font-size: smaller;
}
.cv-timeline-edu th:nth-child(2),
.cv-timeline-edu td:nth-child(2) {
  width: 90%;
  font-size: small;
}

.cv-timeline-license {
  width: 90% !important;
  margin-left: auto;
  margin-right: auto;
}
.cv-timeline-license th:nth-child(1),
.cv-timeline-license td:nth-child(1) {
  width: 20%;
  font-size: small;
}
.cv-timeline-license th:nth-child(2),
.cv-timeline-license td:nth-child(2) {
  width: 80%;
  font-size: small;
}

.cv-timeline-research {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  display: table;
}
.cv-timeline-research td:nth-child(1) {
  width: 15%;
  font-size: small;
}
.cv-timeline-research th:nth-child(2),
.cv-timeline-research td:nth-child(2) {
  width: 85%;
  font-size: small;
}

.cv-timeline-edu table,
.cv-timeline-license table,
.cv-timeline-research table {
  width: 100% !important;
  table-layout: fixed !important;
  display: table !important;
  margin-left: auto;
  margin-right: auto;
}

.post-pagination-actions {
  clear: both;
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.post-pagination-actions .btn {
  white-space: nowrap;
}

.post-pagination-newer {
  display: block;
  width: 50%;
  margin-bottom: 0;
  text-align: right;
}

@media (max-width: 47.99em) {
  .post-pagination-newer {
    width: 100%;
  }
}

.post-back-top-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.post-pagination-back {
  display: inline-block;
  width: auto;
  box-sizing: border-box;
  text-align: center;
}

.post-tag-list {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.post-tag-list-label {
  font-weight: 600;
  margin-right: 0.35rem;
}

.post-tag-link,
.blog-tag-link {
  display: inline-block;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid #b6b6b6;
  border-radius: 999px;
  text-decoration: none;
}

.post-tag-link:hover,
.blog-tag-link:hover,
.blog-tag-link.is-active {
  background-color: #e2e4e5;
  text-decoration: none;
}

.blog-active-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background-color: #e2e4e5;
  font-size: 0.9em;
}

.blog-list-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

@media (max-width: 47.99em) {
  .blog-list-controls {
    gap: 0.5rem;
  }

  .blog-list-controls select {
    width: 100%;
  }
}

.blog-filter-hidden {
  display: none !important;
}

.blog-post-data {
  display: none;
}

.blog-pagination {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

.blog-list-item {
  margin-bottom: 1rem;
}

.blog-list-title {
  margin-bottom: 0.25rem;
}

.blog-list-meta {
  margin: 0 0 0.25rem 0;
}

.blog-list-tags {
  margin: 0;
}

.blog-list-empty {
  margin: 0;
}

@media (max-width: 47.99em) {
  .cv-timeline-edu,
  .cv-timeline-license,
  .cv-timeline-research {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cv-timeline-edu table,
  .cv-timeline-license table,
  .cv-timeline-research table {
    min-width: 340px;
    width: 340px !important;
    table-layout: auto !important;
  }

  .cv-timeline-edu th,
  .cv-timeline-edu td,
  .cv-timeline-license th,
  .cv-timeline-license td,
  .cv-timeline-research th,
  .cv-timeline-research td {
    font-size: 0.85rem !important;
  }

  .cv-timeline-edu td:nth-child(1),
  .cv-timeline-license td:nth-child(1),
  .cv-timeline-research td:nth-child(1) {
    white-space: nowrap;
  }
}

/* ============================================================
   埋め込みコンポーネント: YouTube / X(Twitter) / 商品カード
   ============================================================ */

/* --- YouTube: レスポンシブ 16:9 ラッパー --- */
.embed-responsive {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  overflow: hidden;
  margin: 1.5rem 0;
  border-radius: 0.375rem;
}

.embed-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- X (Twitter) 埋め込み: 中央寄せ --- */
.tweet-embed {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.tweet-embed .twitter-tweet {
  max-width: 550px !important;
}

/* --- 商品カード --- */
.product-card {
  display: flex;
  gap: 1rem;
  border: 1px solid #d0d0d0;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  transition: box-shadow 0.2s ease;
  background-color: var(--background-color, #fff);
}

.product-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.product-card__image {
  flex: 0 0 auto;
  width: 120px;
}

.product-card__image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
}

.product-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-card__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  width: fit-content;
}

.product-card__badge--amazon {
  background-color: #ff9900;
  color: #111;
}

.product-card__badge--rakuten {
  background-color: #bf0000;
  color: #fff;
}

.product-card__badge--other {
  background-color: #555;
  color: #fff;
}

.product-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.product-card__title a {
  text-decoration: none;
}

.product-card__title a:hover {
  text-decoration: underline;
}

.product-card__description {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #b12704;
}

.product-card__btn {
  margin-top: auto;
  align-self: flex-start;
}

@media (max-width: 37.4em) {
  .product-card {
    flex-direction: column;
  }

  .product-card__image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
}

/* Custom author sidebar icon: Qiita — fa-fw と幅・配置を合わせる */
img.icon-qiita {
  display: inline-block;
  width: 1.25em; /* .fa-fw と同じ固定幅 */
  height: 1em;
  vertical-align: -0.15em;
  object-fit: contain;
  text-align: center; /* fa-fw と同じ中央揃え */
  border: none;
}
