@charset "UTF-8";

/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template:   cocoon-master
Version:    1.1.3
*/

/************************************
** 子テーマ用のスタイルを書く
************************************/
/*必要ならばここにコードを書く*/

/************************************
** レスポンシブデザイン用のメディアクエリ
************************************/
/*1023px以下*/
@media screen and (max-width: 1023px){
  /*必要ならばここにコードを書く*/
}

/*834px以下*/
@media screen and (max-width: 834px){
  /*必要ならばここにコードを書く*/
}

/*480px以下*/
@media screen and (max-width: 480px){
  /*必要ならばここにコードを書く*/
}
241 +/* ============================================================                                                                                                                        242 +   記事一覧サムネイル 縦長化（上下1.25倍）
      243 +   元画像(縦長)を最大限表示                                                                                                                                                            244 +   ============================================================ */
      245 +figure.entry-card-thumb,
      246 +.entry-card-thumb.card-thumb {
      247 +    aspect-ratio: 2 / 2.5 !important;
      248 +    overflow: hidden !important;
      249 +    padding-top: 0 !important;
      250 +    height: auto !important;
      251 +    position: relative !important;
      252 +}
      253 +figure.entry-card-thumb img,
      254 +.entry-card-thumb img {
      255 +    position: absolute !important;
      256 +    inset: 0 !important;
      257 +    width: 100% !important;
      258 +    height: 100% !important;
      259 +    object-fit: cover !important;
      260 +    object-position: top center !important;
      261 +}
      262 +
356 +        // 記事一覧サムネイル: 横長クロップ → オリジナル縦長画像に差し替え                                                                                                        
   ── 357 +        document.querySelectorAll('figure.entry-card-thumb img').forEach(function(img) {                                                                                  ───────
      358 +            function swapSrc(attr) {                                                                                                                                                   359 +                var val = img.getAttribute(attr);
      360 +                if (val) {
      361 +                    img.setAttribute(attr, val.replace(/-\d+x\d+(\.\w+)$/, '$1'));
      362 +                }
      363 +            }
      364 +            swapSrc('src');
      365 +            swapSrc('data-src');
      366 +            img.removeAttribute('srcset');
      367 +            img.removeAttribute('data-srcset');
      368 +        });