/* ============================================================
   life-detail.css — 記錄生活內頁專屬樣式（個人創作者風格）
   ------------------------------------------------------------
   命名規則：BEM（block__element--modifier）
   ============================================================ */

/* ===== 主容器 ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}

/* ===== 文章卡片 ===== */
.post__card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--color-border);
}

/* ===== 主圖區域（16:9） ===== */
.post__gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-dark);
    overflow: hidden;
}
.post__gallery:has(.post__gallery-grid) {
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
}
.post__gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}
.post__gallery-grid img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}
@media (max-width: 600px) {
    .post__gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.post__slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: #fff;
    background-image: linear-gradient(145deg, #1e293b, #334155);
    transition: opacity 0.35s ease;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
}
.post__slide--active {
    opacity: 1;
    pointer-events: auto;
}
.post__slide-emoji {
    font-size: 96px;
    opacity: 0.85;
}
.post__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post__gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 18px;
    border-radius: 30px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}
.post__gallery-badge i {
    color: #f43f5e;
}
.post__gallery-counter {
    position: absolute;
    bottom: 16px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 16px;
    border-radius: 30px;
    z-index: 5;
    letter-spacing: 0.5px;
}

/* ===== 縮略圖導航 ===== */
.post__thumb-nav {
    padding: 16px 20px 20px;
    background: #fafafa;
    border-top: 1px solid var(--color-border);
}
.post__thumb-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.post__thumb-arrow {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}
.post__thumb-arrow:hover:not(.post__thumb-arrow--disabled) {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.25);
    transform: scale(1.05);
}
.post__thumb-arrow--disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.post__thumb-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-width: 0;
}
.post__thumb-track {
    display: flex;
    gap: 12px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.post__thumb-item {
    flex: 0 0 auto;
    width: 120px;
    aspect-ratio: 16 / 9;
    background-image: linear-gradient(145deg, #1e293b, #334155);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.post__thumb-item:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.post__thumb-item--active {
    border-color: var(--color-btn);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    transform: scale(1.04);
}
.post__thumb-emoji {
    font-size: 28px;
    opacity: 0.8;
}
.post__thumb-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post__thumb-index {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 0 8px;
    border-radius: 10px;
    color: #fff;
}

/* ===== 文章內容 ===== */
.post__body {
    padding: 28px 36px 24px;
}
.post__meta-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--color-gray);
}
.post__date i {
    margin-right: 6px;
}
.post__location i {
    margin-right: 6px;
    color: var(--color-primary);
}
.post__tags {
    display: flex;
    gap: 6px;
}
.post__tags span {
    background: var(--color-bg-light);
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-primary);
    font-weight: 500;
}
.post__title {
    font-size: 30px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 12px;
    line-height: 1.3;
}
.post__content {
    font-size: 16px;
    color: var(--color-gray);
    line-height: 1.9;
    margin-bottom: 20px;
}
.post__content p {
    margin-bottom: 14px;
}
.post__content p:last-child {
    margin-bottom: 0;
}

/* ===== 互動列 ===== */
.post__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
}
.post__action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: 0.25s;
    font-family: inherit;
}
.post__action-btn:hover {
    background: var(--color-bg-light);
    color: var(--color-primary);
}
.post__action-btn--liked {
    background: var(--color-bg-light);
    color: var(--color-primary);
}
.post__action-btn i {
    font-size: 16px;
}
.post__action-btn--liked i {
    color: #f43f5e;
}
.post__action-count {
    font-weight: 400;
    color: var(--color-gray);
}
.post__share-group {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.post__share-group a {
    color: var(--color-gray);
    font-size: 18px;
    transition: var(--transition);
}
.post__share-group a:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ===== 前後導航 ===== */
.post__nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.post__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}
.post__nav-link:hover {
    border-color: var(--color-btn);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.post__nav-link--prev {
    flex: 1;
    justify-content: flex-start;
}
.post__nav-link--next {
    flex: 1;
    justify-content: flex-end;
}
.post__nav-label {
    color: var(--color-gray);
    font-weight: 400;
    font-size: 12px;
}
.post__nav-title {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post__nav-arrow {
    font-size: 18px;
    color: var(--color-primary);
}

/* ===== 留言區 ===== */
.comment__section {
    margin-top: 32px;
    background: #fff;
    border-radius: 20px;
    padding: 28px 36px 32px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--color-border);
}
.comment__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.comment__header h3 {
    font-size: 20px;
    font-weight: 700;
}
.comment__header h3 i {
    color: var(--color-primary);
    margin-right: 8px;
}
.comment__header h3 span {
    font-size: 14px;
    color: var(--color-gray);
    font-weight: 400;
}
.comment__input {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.comment__input-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.comment__input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.comment__input-wrap textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}
.comment__input-wrap textarea:focus {
    border-color: var(--color-btn);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.comment__input-row {
    display: flex;
    justify-content: flex-end;
}
.comment__input-row button {
    background: var(--color-btn);
    color: #fff;
    border: none;
    padding: 8px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.comment__input-row button:hover {
    background: var(--color-primary);
    transform: scale(1.02);
}
.comment__item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}
.comment__item:last-child {
    border-bottom: none;
}
.comment__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #475569;
    flex-shrink: 0;
}
.comment__body {
    flex: 1;
}
.comment__name {
    font-weight: 600;
    font-size: 14px;
}
.comment__name small {
    font-weight: 400;
    color: var(--color-gray);
    font-size: 12px;
    margin-left: 10px;
}
.comment__body p {
    font-size: 14px;
    color: var(--color-gray);
    line-height: 1.6;
    margin: 4px 0 6px;
}
.comment__actions {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--color-gray);
}
.comment__actions span {
    cursor: pointer;
    transition: var(--transition);
}
.comment__actions span:hover {
    color: var(--color-primary);
}
.comment__actions i {
    margin-right: 4px;
}
.comment__more {
    text-align: center;
    margin-top: 16px;
}
.comment__more button {
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 8px 32px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-gray);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.comment__more button:hover {
    border-color: var(--color-btn);
    color: var(--color-primary);
}

/* ===== 相關推薦 ===== */
.post__related {
    margin-top: 40px;
}
.post__related h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.post__related h3 i {
    color: var(--color-primary);
}
.post__related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.post__related-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--color-border);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.post__related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-btn);
}
.post__related-thumb {
    aspect-ratio: 16 / 9;
    background-image: linear-gradient(145deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
}
.post__related-info {
    padding: 12px 16px 14px;
}
.post__related-info h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post__related-meta {
    font-size: 12px;
    color: var(--color-gray);
    margin-top: 4px;
}

/* ===== 響應式 ===== */
@media (max-width: 992px) {
    .post__body {
        padding: 24px 24px 20px;
    }
    .comment__section {
        padding: 24px 24px 28px;
    }
    .post__title {
        font-size: 26px;
    }
    .post__thumb-item {
        width: 100px;
    }
    .post__thumb-arrow {
        flex: 0 0 36px;
        height: 36px;
        font-size: 14px;
    }
}
@media (max-width: 768px) {
    .post__thumb-item {
        width: 80px;
    }
    .post__thumb-nav {
        padding: 12px 14px 16px;
    }
    .post__thumb-arrow {
        flex: 0 0 32px;
        height: 32px;
        font-size: 12px;
    }
    .post__thumb-container {
        gap: 6px;
    }
}
@media (max-width: 600px) {
    .container {
        padding: 16px 12px 40px;
    }
    .post__body {
        padding: 18px 16px 16px;
    }
    .post__title {
        font-size: 22px;
    }
    .post__content {
        font-size: 15px;
    }
    .post__meta-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .post__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .post__share-group {
        margin-left: 0;
        justify-content: center;
    }
    .post__action-btn {
        justify-content: center;
    }
    .post__nav {
        flex-direction: column;
    }
    .post__nav-link {
        justify-content: center;
        width: 100%;
    }
    .post__nav-title {
        max-width: 120px;
    }
    .comment__section {
        padding: 18px 16px 22px;
    }
    .comment__input {
        flex-direction: column;
        align-items: stretch;
    }
    .comment__input-avatar {
        display: none;
    }
    .post__related-grid {
        grid-template-columns: 1fr 1fr;
    }
    .post__thumb-item {
        width: 64px;
    }
    .post__thumb-arrow {
        flex: 0 0 28px;
        height: 28px;
        font-size: 11px;
    }
    .post__thumb-container {
        gap: 4px;
    }
    .post__slide-emoji {
        font-size: 56px;
    }
    .post__thumb-emoji {
        font-size: 18px;
    }
}
