/* Path: /css/work/style.css — Works detail page */

@charset "UTF-8";

/* PWA header: UA button chrome if common.css is stale / unversioned */
body.feed-page.works-page .header_pwa_install_btn {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    margin: 0;
}

/* ▼▼▼ ページレイアウト ▼▼▼ */
.works-page .works_top_margin {
    margin-top: 44px;
    transition: margin-top 0.3s ease;
}

.works-page #main_box {
    overflow-x: hidden;
    width: 100%;
    padding: 0 12px 72px;
    box-sizing: border-box;
}

.works_page {
    max-width: 720px;
    margin: 0 auto;
}

body.feed-page.works-page #main_box,
body.feed-page.works-page .works_top_margin {
    background-color: #f5f7fa;
}

/* ▼▼▼ 作品詳細カード ▼▼▼ */
.works_detail_card {
    margin-top: 8px;
}

.works_detail_title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.works_detail_body {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.works_detail_body img {
    max-width: 100%;
    height: auto;
}

.works_affiliate_footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
}

.works_creator_shop_footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
}

.works_creator_shop_footer + .works_affiliate_footer {
    margin-top: 16px;
}

.works_affiliate_footer_title,
.works_creator_shop_footer_title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7785;
    letter-spacing: 0.04em;
}

.works_affiliate_footer_list,
.works_creator_shop_footer_list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.works_affiliate_footer_list li,
.works_creator_shop_footer_list li {
    margin: 0 0 8px;
}

.works_affiliate_footer_list a,
.works_creator_shop_footer_list a {
    color: #1d4ed8;
    text-decoration: underline;
    word-break: break-all;
}

.works_affiliate_footer_list a:hover,
.works_creator_shop_footer_list a:hover {
    color: #1e40af;
}

/* ▼▼▼ アクションバー（いいね・コメント・シェア） ▼▼▼ */
.works_actions_inline {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
}

.works_actions_inline .feed_engagement_row {
    margin-top: 0;
}

.works_actions_card {
    padding: 14px 16px;
    margin-top: 8px;
}

.works_actions_card .feed_engagement_row {
    margin-top: 0;
}

/* ▼▼▼ ブック内 前へ / 次へ ▼▼▼ */
.works_book_nav {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.works_book_nav_block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.works_book_nav_book {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5c6b7a;
}

.works_book_nav_book a {
    color: inherit;
    text-decoration: none;
}

.works_book_nav_book a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.works_book_nav_links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.works_book_nav_link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    background: #fafbfc;
    color: #222;
    text-decoration: none;
}

.works_book_nav_link:hover {
    border-color: #c5d0db;
    background: #f3f6f9;
}

.works_book_nav_link--next {
    text-align: right;
    align-items: flex-end;
}

.works_book_nav_link_label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #5c6b7a;
}

.works_book_nav_link_title {
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.works_book_nav_slot--empty {
    display: block;
    min-height: 1px;
}

.works_book_nav + .works_affiliate_footer {
    margin-top: 16px;
}

.works_engagement_bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8ecf0;
    margin-bottom: 12px;
}

.works_icon_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 44px;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: #f0f4f8;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.15s ease, transform 0.12s ease;
}

.works_icon_btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.works_icon_btn.is_static {
    cursor: default;
}

.works_icon_count {
    font-size: 0.82rem;
    font-weight: 700;
    color: #555;
    line-height: 1;
}

.works_icon_btn_nice.is_active .works_icon_count {
    color: #555;
}

@media (hover: hover) {
    .works_icon_btn:not(.is_static):hover {
        background: #e4ebf3;
    }
}

.works_icon_btn:not(.is_static):active {
    transform: scale(0.97);
}

.feed_work_author .works_author_actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    flex-shrink: 0;
}

/* 作者行：フォロー・DM を同サイズ・同デザイン（背景なし）に統一 */
.feed_work_author .works_author_actions .works_icon_btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    gap: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    transition: background-color 0.15s ease, transform 0.12s ease;
}

.feed_work_author .works_author_actions .works_icon_btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

/* 未フォロー: 枠線のみ */
.feed_work_author .works_author_actions .works_icon_btn_follow:not(.is_active) img {
    filter: none;
    opacity: 0.85;
}

/* フォロー中: 塗りつぶしブルー */
.feed_work_author .works_author_actions .works_icon_btn_follow.is_active img {
    filter: brightness(0) saturate(100%) invert(76%) sepia(56%) saturate(1595%) hue-rotate(187deg) brightness(104%) contrast(102%);
    opacity: 1;
}

.feed_work_author .works_author_actions .works_icon_btn_dm img {
    filter: none;
    opacity: 0.85;
}

@media (hover: hover) {
    .feed_work_author .works_author_actions .works_icon_btn:hover {
        background: #f0f4f8;
    }

    .feed_work_author .works_author_actions .works_icon_btn_follow:not(.is_active):hover img,
    .feed_work_author .works_author_actions .works_icon_btn_dm:hover img {
        opacity: 1;
    }

    .feed_work_author .works_author_actions .works_icon_btn_follow.is_active:hover img {
        filter: brightness(0) saturate(100%) invert(68%) sepia(56%) saturate(1595%) hue-rotate(187deg) brightness(98%) contrast(102%);
    }
}

.feed_work_author .works_author_actions .works_icon_btn:active {
    transform: scale(0.97);
}

.works_toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.works_toolbar .works_action_btn {
    flex: 1 1 0;
    justify-content: center;
    min-width: 88px;
}

.works_toolbar .ui_state_message {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

.works_meta_box .book_tags_bookmark_icon {
    cursor: pointer;
}

.works_action_row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.works_comment_actions {
    margin-bottom: 0;
}

.works_action_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e0e6ed;
    border-radius: 999px;
    background: #fff;
    color: #444;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.works_action_btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.works_action_btn:not(.is_static):active {
    transform: scale(0.98);
    opacity: 0.9;
}

@media (hover: hover) {
    .works_action_btn:not(.is_static):hover {
        background: #f0f4f8;
        border-color: #d6eaf8;
    }

    .works_action_btn_primary:not(.is_static):hover {
        background: #1873cc;
        border-color: #1873cc;
    }
}

.works_action_btn_primary {
    background: #1E90FF;
    border-color: #1E90FF;
    color: #fff;
}

.works_action_btn.is_static {
    cursor: default;
}

.works_login_prompt {
    text-align: center;
    padding: 8px 0;
}

.works_login_prompt a {
    color: #1E90FF;
    text-decoration: none;
}

/* ▼▼▼ コメントセクション ▼▼▼ */
.works_comments_card {
    padding: 0;
    overflow: hidden;
}

.works_comments_card .works_sub_tab {
    margin: 0 -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.works_sub_tab .sub_tab_box {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    position: relative;
}

.works_sub_tab .sub_tab {
    font-size: 12px;
    padding: 10px 2px;
    line-height: 1.35;
    white-space: nowrap;
}

.works_sub_tab .sub_tab_count {
    margin-left: 3px;
    font-size: 11px;
}

@media (min-width: 480px) {
    .works_sub_tab .sub_tab {
        font-size: 13px;
        padding: 11px 4px;
    }

    .works_sub_tab .sub_tab_count {
        font-size: 12px;
    }
}

.works_sub_tab .sub_active_bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 33.333%;
    transition: transform 0.3s ease;
}

#timeline,
#works_share,
#works_sharecomm {
    padding: 0;
}

.works_tab_viewport {
    overflow: hidden;
    touch-action: pan-y;
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
}

.works_tab_track {
    display: flex;
    width: 300%;
    transition: transform 0.3s ease;
    will-change: transform;
    align-items: flex-start;
    min-height: inherit;
}

.works_tab_panel {
    flex: 0 0 33.333%;
    width: 33.333%;
    box-sizing: border-box;
    padding: 12px 16px 16px;
    min-height: calc(100vh - 220px);
    min-height: calc(100dvh - 220px);
}

.works_comment_item {
    margin-bottom: 10px;
}

.works_comment_item .search_comment_author {
    justify-content: space-between;
    margin-bottom: 6px;
}

.works_comment_item .search_comment_author > a:first-child {
    font-weight: 600;
    color: #222;
    text-decoration: none;
}

.works_comment_body {
    display: block;
    color: #333;
    text-decoration: none;
    line-height: 1.6;
}

.works_comment_restricted {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 0.88rem;
    color: #666;
}

.works_comment_restricted p {
    margin: 0;
}

.works_comment_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #666;
}

.works_comment_actions button {
    padding: 5px 12px;
    border: 1px solid #e0e6ed;
    border-radius: 999px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}

.works_reply_thread {
    margin-left: 12px;
    padding-left: 10px;
    border-left: 2px solid #e0e6ed;
}

.works_empty_comments {
    margin: 8px 0;
}

.works_share_user_list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.works_share_user_item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    text-decoration: none;
    color: #222;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.works_share_user_item:hover {
    background: #f5f8fb;
}

.works_share_user_name {
    font-weight: 600;
    font-size: 0.95rem;
}

.works_empty_share {
    margin: 8px 0;
}

.works_sharecomm_list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.works_empty_sharecomm {
    margin: 8px 0;
}

#more_sharecomm_button_works {
    text-align: center;
    margin-top: 12px;
}

#more_sharecomm_button_works button {
    padding: 8px 20px;
    border: 1px solid #d6eaf8;
    border-radius: 999px;
    background: #fff;
    color: #1E90FF;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

#more_button {
    text-align: center;
    margin-top: 12px;
}

#more_button button {
    padding: 8px 20px;
    border: 1px solid #d6eaf8;
    border-radius: 999px;
    background: #fff;
    color: #1E90FF;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* ▼▼▼ レガシー互換（flexbox 等） ▼▼▼ */
.flexbox {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.flex-item {
    width: fit-content;
}

.bold {
    font-weight: bold;
}

.marginleft5 {
    margin-left: 5px;
}

.marginleft15 {
    margin-left: 15px;
}

.margintop10 {
    margin-top: 10px;
}

.hovercss:hover {
    background-color: #e8f0fe;
}

.hovercss2:hover {
    background-color: #f0f4f8;
    cursor: pointer;
}

/* ▼▼▼ 画像アップロード・ドロップゾーン ▼▼▼ */
#drop_zone,
.drop_zone {
    border: 2px dashed #c5d0db;
    padding: 24px;
    margin: 12px 0;
    font-size: 0.9rem;
    color: #666;
    background-color: #fafbfc;
    text-align: center;
    border-radius: 10px;
}

.file_label {
    display: inline-block;
    padding: 8px 20px;
    color: #fff;
    background-color: #1E90FF;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

input[type="file"] {
    display: none;
}

.works-page td,
.works-page th {
    border: 1px solid #e0e6ed;
}

/* ▼▼▼ 画像モーダル ▼▼▼ */
html.modalset {
    overflow: hidden;
}

.thumb__items {
    display: flex;
    flex-flow: wrap;
    position: relative;
    z-index: 10;
    padding: 0;
    margin: 8px 0 0;
}

.thumb__items > li {
    flex: 0 1 25%;
    list-style: none;
    cursor: pointer;
    position: relative;
}

.thumb__items > li img {
    max-width: 100%;
    position: relative;
    vertical-align: bottom;
    border-radius: 4px;
}

.thumb__items > li:before {
    content: "";
    display: block;
    opacity: 0;
    background: rgba(0, 0, 0, 0.4);
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

@media (hover: hover) {
    .thumb__items > li:hover::before {
        opacity: 1;
    }
}

.shared_thumb__items {
    display: flex;
    flex-flow: wrap;
    position: relative;
    z-index: 10;
}

.shared_thumb__items > li {
    flex: 0 1 25%;
    list-style: none;
    cursor: pointer;
    position: relative;
}

.shared_thumb__items > li img {
    max-width: 100%;
    position: relative;
    vertical-align: bottom;
}

.modal {
    display: none;
    width: 100%;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
}

.modal-wrap {
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 20px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.modal-wrap:after {
    content: '';
    display: inline-block;
    vertical-align: middle;
    width: 1px;
    height: 100%;
}

.modal-overlay {
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(15, 23, 42, 0.75);
    width: 100%;
    height: 100%;
}

.modal__item {
    width: fit-content;
    max-width: 1200px;
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

.modal.visible {
    display: block;
}

.modal__item img {
    max-width: 80vw;
    max-height: 80vh;
    vertical-align: bottom;
    border-radius: 4px;
}

.modal__close {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    cursor: pointer;
}

.modal__prev,
.modal__next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    cursor: pointer;
}

.modal__prev {
    left: 12px;
}

.modal__next {
    right: 12px;
}

.fas,
.fas2 {
    width: 36px;
    height: 36px;
    cursor: pointer;
    object-fit: contain;
}

.fadein {
    animation: fadein .3s;
}

.fadeout {
    animation: fadeout .3s;
    animation-fill-mode: forwards;
}

@keyframes fadein {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeout {
    0% { opacity: 1; }
    100% { opacity: 0; display: none; }
}
