/* =========================
     Home – Portfolio
  ========================= */
  
  .home-portfolio {
    margin-top: 4rem;
  }

  .home-portfolio .portfolio-card {
    max-width: 280px;   /* ← 適度に制限 */
    margin: 0 auto;
    text-decoration: none;
}
  
  .home-portfolio .post-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 280px));
    gap:1.8rem;
  }
  
  .home-portfolio .thumb {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 12px; /* 角を少し丸める */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* 軽い影で浮き感 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
  }
  
  .home-portfolio .meta .title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.25rem;
    text-decoration: none;
  }

  /* トップページ ポートフォリオ ホバー */
    .home-portfolio .portfolio-card:hover img {
    filter: brightness(0.7);
    transition: filter 0.3s ease;
    }

    /* 元に戻る時の滑らかさ */
    .home-portfolio .portfolio-card img {
        transition: filter 0.3s ease;
    }

    /* =========================
   Home Portfolio – Mobile Scroll Override
========================= */

@media (max-width: 768px) {
    .home-portfolio .post-list {
      display: flex;              /* ← gridを完全に無効化 */
      gap: 1rem;
      overflow-x: auto;
      padding-bottom: 0.5rem;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
    }
  
    .home-portfolio .portfolio-card {
      flex: 0 0 70%;
      max-width: 70%;
      scroll-snap-align: start;
    }
  }
  
  @media (max-width: 480px) {
    .home-portfolio .portfolio-card {
      flex: 0 0 42%;
      max-width: 42%;
    }
  }
  
  /* =========================
     Portfolio Index
  ========================= */
  
  .portfolio-index .post-card {
    background: #fff;                 /* カード背景 */
    border-radius: 6px;               /* 角は控えめ */
    max-width: 260px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 16px 16px 8px 16px;      /* 上16px・左右16px・下8pxで白縁を調整 */
    display: flex;
    flex-direction: column;   /* 写真→meta */
    width: 100%;              /* グリッド内で幅いっぱい */
    }


    .portfolio-index .post-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    }

    .portfolio-index .thumb {
        width: 100%;
        aspect-ratio: 3 / 2;   /* 高さを幅に対して固定 */
        overflow: hidden;
        border-radius: 4px;               /* 写真自体の角は少しだけ丸く */
    }

    .portfolio-index .thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .portfolio-index .post-card:hover img {
        transform: scale(1.05);
    }

    .portfolio-index .meta {
        padding-top: 8px;
        text-align: center;
    }

    .portfolio-index .meta .title {
        font-family: 'DM Serif Display', serif;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--accent);
        margin-bottom: 0.2rem;
    }

    .portfolio-index .meta .date {
        font-size: 0.8rem;
        color: #777;
    }

    /* =========================
   Portfolio index (mobile grid)
    ========================= */

    @media (max-width: 768px) {
        .portfolio-index .post-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        overflow: visible;
        }
    
        .portfolio-index .post-card {
        flex: none;
        max-width: none;
        }
    }

    /* =========================
   Portfolio Single Page
    ========================= */

    .portfolio-single {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
  }
  
  .portfolio-header {
    text-align: center;
    margin-bottom: 3rem;
  }
  
  .portfolio-title {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
  }
  
  .portfolio-lead {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #555;
    letter-spacing: 0.04em;
  }

  .portfolio-lead .horse-name {
    font-weight: 600;          /* 少しだけ太く */
    color: #4a4a4a;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-right: 0.1em;
  }

  .portfolio-lead .separator {
    color: #aaa;
    margin: 0 0.3em;
  }

  .portfolio-lead .lead-line {
    display: block;
  }

  @media (max-width: 768px) {
    .portfolio-lead {
      display: flex;
      flex-direction: column;
      gap: 0.9rem;
    }
  
    .portfolio-lead .lead-line {
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 1.25;
    }
  
    .portfolio-lead .separator {
        display: none; /* ← | を消す */
      }
    
    .portfolio-lead .horse-name {
        font-size: 1.2rem;
        font-weight: 600;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }
    
    .portfolio-lead .lead-line {
        font-size: 0.95rem; /* 血統側 */
        color: #666;
        white-space: nowrap; /* 血統は1行固定 */
    }
}

  .portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
  }

  @media (max-width: 768px) {
    .portfolio-gallery {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.8rem; /* スマホなので少し詰める */
    }
  }
  
  .portfolio-gallery img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 0;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
  }
  
  .portfolio-gallery img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }

  .portfolio-gallery .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.portfolio-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.portfolio-gallery .overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 真ん中にセンタリング */
    color: #ebddaf;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.portfolio-gallery .overlay .horse {
    font-size: 1.1rem;              /* 日付より少し大きい */
    font-weight: 600;
    color: #f1e6c6;                 /* 今の #ebddaf より少しだけ明るい */
    letter-spacing: 0.04em;
}

.portfolio-gallery .overlay .date {
    font-size: 0.8rem;
}

.portfolio-gallery .overlay .race {
    font-size: 1rem;
    font-weight: 600;
}

/* =========================
   Hover effect (PC only)
========================= */
@media (hover: hover) and (pointer: fine) {
    .portfolio-gallery .gallery-item:hover img {
      transform: scale(1.05);
      filter: brightness(0.7);
    }
  
    .portfolio-gallery .gallery-item:hover .overlay {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.05);
    }
  }