/* ========================================
   ポートフォリオ一覧ページ
   ======================================== */

/* ページコンテナ */
.portfolios-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
}

/* ========================================
   ポートフォリオリスト
   ======================================== */
.portfolios-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    row-gap: 20px;
}
@media (max-width: 640px) {
.portfolios-list {
    row-gap:4px;
    overflow: hidden;
}
}
/* ========================================
   ポートフォリオカード
   ======================================== */
.portfolio-card{
    padding: 12px;
    width: 33.333333%;
}
@media (max-width: 740px) {
    .portfolio-card{
        width: 50%;
        padding: 8px;
    }
}
.portfolio-card__thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #fff;
    overflow: hidden;
    position: relative;
    border-radius: 6px;
    text-decoration: none;
}

.portfolio-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.portfolio-card__thumbnail:hover img{
    transform: scale(1.05);
}

/* オーバーレイ層：最初は透明 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 黒の半透明 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* 最初は見せない */
    transition: opacity 0.3s ease; /* ふわっと出す設定 */
  }
  
  /* ホバーした時にオーバーレイを表示 */
  .portfolio-card__thumbnail:hover .overlay {
    opacity: 1;
  }
  
  /* 文字の装飾 */
  .text {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    opacity: .8;
    text-align: center;
    border-radius: 4px;
    display: flex;
    align-items: center;
  }
  .text img{
    width: 16px;
    height: 16px;
    margin-right: 2px;
  }

.portfolio-card__thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 40px;
}

.portfolio-card__body {
    margin-top: 6px;
}

.portfolio-card__header {
    margin-bottom: 8px;
}

.portfolio-card__author {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: inherit;
}

.portfolio-card__author:hover .portfolio-card__nickname {
    opacity: .8;
}

.portfolio-card__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--fontcolor);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.portfolio-card__avatar .fa-user {
    color: #5c5c5c;
    font-size: 16px;
}

.portfolio-card__nickname {
    font-size: 12px;
    font-weight: 600;
    color: var(--fontcolor);
}
.portfolio-card__title a {
    text-decoration: none;
    overflow: hidden;
    display: -webkit-box;       /* 必須：要素をブロックからbox形式に変更 */
    -webkit-box-orient: vertical; /* 必須：垂直方向に並べる */
    -webkit-line-clamp: 2;      /* ここで表示したい行数を指定 */
    white-space: nowrap;     /* 改行を禁止する */
    overflow: hidden;        /* はみ出た部分を隠す */
    text-overflow: ellipsis; /* はみ出た部分を「...」にする */
}

/* ========================================
   空の状態
   ======================================== */
.portfolios-empty {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

/* ========================================
   ページネーション
   ======================================== */
.portfolios-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

/* ========================================
   FAB投稿ボタン
   ======================================== */
.portfolios-fab {
    position: fixed;
    right: 24px;
    bottom: 22px;
    z-index: 100;
    transition: bottom 0.3s ease;
}
.portfolios-fab.is-at-bottom {
    bottom: 90px;
}

/* ========================================
   ポートフォリオ詳細ページ
   ======================================== */
.portfolio-detail {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 0px 28px;
}

/* YouTube埋め込み */
.portfolio-detail__youtube {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 12px;
    margin-bottom: 56px;
    border-radius: 8px;
    overflow: hidden;
}

.portfolio-detail__youtube iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* メイン画像 */
.portfolio-detail__main-image {
    width: 100%;
    margin-top: 6px;
    margin-bottom: 32px;
    box-sizing: border-box;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
}

.portfolio-detail__main-image img {
    display: block;
    max-width: 100%;    /* 横長の場合：親の幅いっぱいで止まる */
    max-height: 735px;  /* 縦長の場合：この高さで止まる（お好みで600pxに変更可） */
    width: auto;        /* 縦長時に幅を自動で絞る（これで影が画像に密着する） */
    height: auto;       /* アスペクト比を維持 */
}

.portfolio-detail__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 60px;
}

.portfolio-detail__author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    text-decoration: none;
}

.portfolio-detail__author:hover {
    opacity: 0.8;
}

.portfolio-detail__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #bfbfbf;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-detail__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-detail__avatar .fa-user {
    color: #5c5c5c;
    font-size: 18px;
}

.portfolio-detail__nickname {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}
.portfolio-detail__header{
    margin-bottom: 32px;
}

.portfolio-detail__allWrap{
    max-width: 640px;
    margin: auto;
}
.portfolio-detail__actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.portfolio-detail__action-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    border: none;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: "Google Sans Flex", 'Noto Sans JP', 'Hiragino Sans', sans-serif;
}
.portfolio-detail__action-btn{
    font-size: 14px;
    color: #8a848c;
    line-height: 1;
}
.portfolio-detail__action-btn .likesCount,
.portfolio-detail__action-btn .commentsCount{
    width: 18px;
}
.portfolio-detail__action-btn.is-liked .material-symbols-outlined{
    font-variation-settings: 'FILL' 1;
    font-size: 22px;
}

/* タイトル */
.portfolio-detail__title {
    margin-bottom: 24px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.5;
}

/* 説明 */
.portfolio-detail__description {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 32px;
    color: var(--fontcolor2);
}

/* ハッシュタグ */
.portfolio-detail__hashtags {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.portfolio-detail__hashtag .material-symbols-outlined{
    font-size: 16px;
}
.portfolio-detail__hashtag {
    display: flex;
    align-items: center;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    color: #5c5b5b;
    border: solid 2px #e2dce25e;
    padding: .5em .8em .4em;
    border-radius: 6px;
    transition: all .1s;
}
.portfolio-detail__hashtag:hover{
    background-color: #f1f0f1;
}

/* セクション */
.kadai---sekai---taisei_wrap{
    margin-bottom: 28px;
    background-color: #e2dce221;
    padding: 32px 40px;
    border-radius: 8px;
}
.portfolio-detail__section {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 28px;
}
.portfolio-detail__section:last-child{
    margin-bottom: 0;
}
.portfolio-detail__section-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.portfolio-detail__section-title .material-symbols-outlined{
    color: var(--maincolor);
}

.portfolio-detail__section-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--fontcolor2);
    padding-left: 28px;
}

/* コメントセクション */
.portfolio-detail__comments {
    margin-top: 20px;
    scroll-margin-top: 150px;
}
.commentsTitle {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
/* コメント入力フォーム */
.portfolio-detail__comment-form {
    margin-bottom: 4px;

}
.portfolio-detail__comment-textarea {
    border: solid 1px #ddd;
    background-color: #fff;
    padding: 12px;
    border-radius: 4px;
    height: 100px;
}
.portfolio-detail__comment-form-actions {
    display: flex;
    justify-content: flex-end;
}
.portfolio-detail__comment-submit {
    padding: 0;
    width: 36px;
    height: 36px;
    background-color: #fff;
    border: 0;
    color: var(--btncolor);
}
.portfolio-detail__comment-submit:hover{
    background-color: #efefef;
    border: none;
}
.portfolio-detail__comment-submit .material-symbols-outlined{
     font-size: 22px;
}
/* コメント一覧 */
.portfolio-detail__comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portfolio-detail__comment-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.portfolio-detail__comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f2f2f2;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-detail__comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-detail__comment-avatar .fa-user {
    color: #5c5c5c;
    font-size: 16px;
}

.portfolio-detail__comment-body {
    flex: 1;
    min-width: 0;
}

.portfolio-detail__comment-header {
    margin-bottom: 2px;
}

.portfolio-detail__comment-nickname {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 6px;
}

.portfolio-detail__comment-content {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: var(--fontcolor2);
}

.portfolio-detail__comment-content--hidden {
    color: #999;
    font-style: italic;
}

.portfolio-detail__comment-like {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: none;
    font-size: 13px;
    color: #8a848c;
    cursor: pointer;
}
.portfolio-detail__comment-like .material-symbols-outlined{
    font-size: 15px;
}
.portfolio-detail__comment-like:hover {
    color: #e74c3c;
}

.portfolio-detail__comment-like.is-liked,
.portfolio-detail__comment-like.is-liked .material-symbols-outlined{
    font-variation-settings: 'FILL' 1;
    color: #e74c3c;
}

/* ========================================
   この人のポートフォリオ
   ======================================== */
.portfolio-other-portfolios {
    margin-left: auto;
    margin-right: auto;
    padding-top: 24px;
    max-width: 640px;
}

.portfolio-other-portfolios__title {
    font-size: 16px;
    font-weight: 500;
    color: #000;
    margin-bottom: 8px;
}

.portfolio-other-portfolios__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.portfolio-other-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.portfolio-other-card__thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.portfolio-other-card__thumbnail:hover img {
    transform: scale(1.05);
}

.portfolio-other-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 24px;
}

.portfolio-other-card__title {
    font-size: 14px;
    line-height: 1.3;
}
.more-link_wrap{
    text-align: center;
}
.portfolio-other-portfolios__more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 13px;
    text-decoration: none;
    margin-top: 16px;
    line-height: 1;
}
.portfolio-other-portfolios__more-link .material-symbols-outlined{
    color: var(--maincolor);
    font-size: 16px;
}
.portfolio-other-portfolios__more-link:hover {
    color: var(--maincolor);
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 768px) {
    .portfolios-page,
    .portfolio-detail {
        padding: 0;
    }
    .portfolios-fab {
        top: inherit;
        right: 8px;
        bottom: 90px;
    }
    .fab-post-btn {
        width: 56px;
        height: 56px;
        border-radius: 36px;
        padding: 0;
        box-shadow: 3px 3px 7px 0px rgba(0, 0, 0, 0.23);
    }
    .fab-post-btn__text{
        display: none;
    }
    .portfolio-detail__title{
        font-size: 20px;
        margin-bottom: 8px;
    }
    .portfolio-detail__header{
        margin-bottom: 24px;
    }
    .portfolio-detail__youtube {
        margin-bottom: 24px;
        margin-left: -16px;
        border-radius: 0;
        width: calc(100% + 32px);
    }
    .portfolio-detail__main-image{
        padding: 0;
        margin: 12px 0 24px;
        display: flex;
        justify-content: center;
    }
    .portfolio-detail__main-image img{
        border-radius: 0;
        box-shadow:none;
        width: 100%;
        max-height: 480px;
        object-fit: contain;
        display: block;
    }
    .portfolio-detail__avatar{
        width: 28px;
        height: 28px;
    }
    .portfolio-card__nickname{
        font-size: 10px;
    }
    .portfolio-detail__avatar .fa-user{
        font-size: 12px;
    }
    .portfolio-detail__action-btn{
        font-size: 13px;
        gap: 2px;
    }
    .portfolio-detail__action-btn .material-symbols-outlined{
        font-size: 20px;
    }
    .portfolio-detail__nickname{
        font-size: 13px;
        width: calc(100vw - 260px);
    }
    .portfolio-detail__author{
        gap: 4px;
    }
    .portfolio-detail__description{
        font-size: 15px;
        margin-bottom: 20px;
        line-height: 1.7;
    }
    .portfolio-detail__hashtag{
        font-size: 13px;
    }
    .portfolio-detail__section-title{
        font-size: 14px;
        margin-bottom: 0;
    }
    .portfolio-detail__section-content{
        font-size: 13px;
        padding-left: 22px;
    }
    .portfolio-detail__section{
        margin-bottom: 0;
        grid-template-columns:1fr;
        gap: 2px;
        margin-bottom: 1em;
        border-bottom: solid 1px #fff;
        padding-bottom: 8px;
    }
    .portfolio-detail__section:last-child{
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;    
    }
    .kadai---sekai---taisei_wrap{
        padding: 16px;
        margin-bottom: 16px;
    }
    .portfolio-detail__hashtags{
        margin-bottom: 16px;
    }
    .portfolio-detail__comments{
        margin-top: 20px;
    }
    .portfolio-detail__section-title .material-symbols-outlined{
        font-size: 18px;
    }

}

[x-cloak] {
    display: none !important;
}
