/* Tokinanaka 1.5 performance layer */

/* Equal-height cards are handled entirely by CSS: no layout-measuring JavaScript. */
.posts{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:2rem 4%;
  align-items:stretch;
}
.posts__item{
  width:100% !important;
  min-width:0;
  height:100%;
  margin-bottom:0 !important;
  display:flex;
  flex-direction:column;
}
.posts__item-title{overflow-wrap:anywhere;}
.posts__item-description{
  flex:1 1 auto;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:5;
  overflow:hidden;
}
@media (max-width:767px){
  .posts{grid-template-columns:minmax(0,1fr);gap:2rem 0;}
}

/* Responsive real images instead of CSS background images. */
.posts__item .posts__item-thumb,
.related-post__item .related-post__item-thumb,
.widget-recent-post__thumbnail,
.top-post__thumb{
  overflow:hidden;
}
.posts__item .posts__item-thumb img,
.related-post__item .related-post__item-thumb img,
.widget-recent-post__thumbnail img,
.top-post__thumb img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}
.posts__item .posts__item-thumb img{position:absolute;inset:0;}
.posts__item .posts__item-thumb--hover{position:relative;z-index:2;}
.top-post__thumb{position:relative;}
.top-post__thumb img{position:absolute;inset:0;}
.top-post__thumb::after{z-index:1;}
.top-post__description{z-index:2;}
.related-post__item .related-post__item-thumb{position:relative;}
.widget-recent-post__thumbnail{display:block;}

/* Native sticky replaces Foundation JS. */
@media (min-width:768px){
  .post__sidebar .sticky,
  .post__sidebar .sticky-content{
    position:sticky;
    top:90px;
  }
  body.admin-bar .post__sidebar .sticky,
  body.admin-bar .post__sidebar .sticky-content{top:122px;}
}
@media (max-width:767px){
  .post__sidebar .sticky,
  .post__sidebar .sticky-content{position:static;}
}

/* Skip most rendering work for category sections well below the viewport. */
@supports (content-visibility:auto){
  .tnk-home-category-section{
    content-visibility:auto;
    contain-intrinsic-size:auto 760px;
  }
}

/* Reserve advertising space to reduce CLS. */
.tnk-home-ad{
  min-height:250px;
  contain:layout paint;
}
.tnk-home-ad--infeed_1,
.tnk-home-ad--infeed_2,
.tnk-home-ad--single-mgid{min-height:300px;}
.tnk-home-ad__placeholder{
  min-height:inherit;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Font Awesome 6 for theme pseudo-elements after removing bundled FA4. */
.site-header__social-button li a::before,
.site-header__social-button li a[href$="/feed/"]::before,
.site-header__social-button li a[href^="mailto:"]::before,
.posts__item .posts__item-meta time::before,
.posts__item .posts__item-meta .category::before,
.post__tags li a::before,
.related-post__item .related-post__item-date::before,
.widget_categories .widgettitle::before,
.widget_categories .cat-item::before,
.widget_recent_entries .widgettitle::before,
.tokimeki_recent_posts .widgettitle::before,
.widget-recent-post__post-date::before{
  font-family:"Font Awesome 6 Free" !important;
  font-weight:900 !important;
}
.site-header__social-button li a[href*="x.com"]::before,
.site-header__social-button li a[href*="twitter.com"]::before,
.site-header__social-button li a[href*="facebook.com"]::before,
.site-header__social-button li a[href*="instagram.com"]::before{
  font-family:"Font Awesome 6 Brands" !important;
  font-weight:400 !important;
}

/* WordPress header image is now a real img. */
.site-header__image .header-image{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

.site-header__search-button,
.site-header__social-call{
  appearance:none;
  border:0;
  padding:0;
  background:transparent;
  font:inherit;
}

/* YouTube – Font Awesome 6 Brands */
.site-header__social-button li a[href*="youtube.com"],
.site-header__social-button li a[href*="youtu.be"]{
  background:#ff0000 !important;
}
.site-header__social-button li a[href*="youtube.com"]::before,
.site-header__social-button li a[href*="youtu.be"]::before{
  font-family:"Font Awesome 6 Brands" !important;
  font-weight:400 !important;
  content:"\f167" !important;
}

/* Legacy YouTube icon classes occasionally used by widgets/content. */
.fa-youtube,
.fa-youtube-play,
.fa-youtube-square{
  font-family:"Font Awesome 6 Brands" !important;
  font-weight:400 !important;
}
.fa-youtube::before,
.fa-youtube-play::before,
.fa-youtube-square::before{
  content:"\f167" !important;
}

/* Tokinanaka 1.5.4 – MGID layout stability */
.tnk-home-ad--single-mgid,
.single [data-widget-id="377264"]{
  min-height:280px;
}

.widget [data-widget-id="1849810"],
.site-footer [data-widget-id="1849810"]{
  display:block;
  width:100%;
  min-height:250px;
  box-sizing:border-box;
}

@media (max-width:767px){
  .tnk-home-ad--single-mgid,
  .single [data-widget-id="377264"]{
    min-height:320px;
  }

  .widget [data-widget-id="1849810"],
  .site-footer [data-widget-id="1849810"]{
    min-height:300px;
  }
}
