@charset "UTF-8";

/* ==========================================
   タイムライン タブ (和文化5カテゴリ)
   ========================================== */
.timeline-tabs {
    display: flex;
    overflow-x: auto;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0 5px;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(10px);
}

.timeline-tabs::-webkit-scrollbar {
    display: none;
}

.t-tab {
    background: none;
    border: none;
    color: var(--text-sub);
    padding: 12px 18px;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.t-tab.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
    font-weight: bold;
}

/* ==========================================
   タイムライン (Post)
   ========================================== */
.post {
    background-color: var(--bg-surface);
    margin-bottom: 15px;
    border-bottom: 1px solid #222;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.post-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-author {
    font-size: 0.9rem;
    font-weight: 500;
}

.post-date {
    font-size: 0.7rem;
    color: var(--text-sub);
}

.post-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.65rem;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    padding: 2px 6px;
    border-radius: 3px;
}

.post-badge-pr {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.65rem;
    border: 1px solid #444;
    color: #888;
    padding: 2px 6px;
    border-radius: 3px;
}

.post-body {
    display: flex;
    cursor: pointer;
    align-items: stretch;
}

.post-image-half {
    width: 60%;
    display: flex;
    background-color: #000;
    position: relative;
}

.post-image-half img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4/5;
    object-fit: contain;
    display: block;
}

.pr-link-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
}

.post-washi-half {
    width: 40%;
    background-color: #f4f1eb;
    color: #2c2c2c;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-image: url('https://www.transparenttextures.com/patterns/rice-paper.png');
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 2;
    letter-spacing: 2px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
    max-height: 350px;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
}

.action-group-left {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 5px;
}

.action-btn .material-symbols-outlined {
    font-size: 1.2rem;
}

/* ==========================================
   モーダル共通
   ========================================== */
.detail-modal,
.compose-modal,
.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 480px;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.detail-modal.open,
.compose-modal.open,
.crop-modal.open {
    transform: translateY(0);
}

.icon-btn,
.close-btn,
.submit-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

.submit-btn {
    color: var(--color-gold);
    font-weight: bold;
    font-size: 1rem;
}

/* ==========================================
   詳細モーダル
   ========================================== */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #222;
    background: rgba(10, 10, 10, 0.9);
}

.detail-content-scroll {
    flex: 1;
    overflow-y: auto;
}

.detail-image-area {
    background-color: #000;
}

.detail-image-area img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.detail-info-area {
    padding: 20px 15px;
}

.detail-washi-area {
    background-color: #f4f1eb;
    color: #2c2c2c;
    padding: 35px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('https://www.transparenttextures.com/patterns/rice-paper.png');
    border-radius: 6px;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.06);
}

.washi-poem-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 2.2;
    letter-spacing: 3px;
    margin: 0 auto;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
    max-height: 350px;
}

.detail-author-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.detail-author-info {
    flex: 1;
}

.detail-author-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.detail-post-date {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.detail-category-row {
    margin: 20px 0 25px;
    font-size: 0.85rem;
    color: var(--text-sub);
    border-bottom: 1px dashed #222;
    padding-bottom: 15px;
}

.category-val {
    color: var(--color-gold);
    font-weight: bold;
    margin-left: 4px;
}

.category-val.pr-color {
    color: #888;
}

.detail-tabs,
.m-tabs {
    display: flex;
    border-bottom: 1px solid #333;
}

.d-tab,
.m-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-sub);
    padding: 12px 0;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.d-tab.active,
.m-tab.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
    font-weight: bold;
}

.dtab-content,
.mtab-content {
    display: none;
    padding: 15px 0;
}

.dtab-content.active,
.mtab-content.active {
    display: block;
}

.long-comment-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ccc;
    white-space: pre-wrap;
    margin-top: 5px;
}

.reply-card-washi {
    display: flex;
    margin-bottom: 15px;
}

.reply-card-washi img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.reply-user {
    font-size: 0.85rem;
    font-weight: bold;
}

.reply-date {
    font-size: 0.7rem;
    color: var(--text-sub);
}

.reply-text-washi {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.reply-input-area-washi {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.washi-input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid #333;
    color: var(--text-main);
    padding: 10px;
    border-radius: 4px;
}

/* ==========================================
   詠む（投稿）モーダル & 蔵登録モーダル
   ========================================== */
.compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-surface);
    border-bottom: 1px solid #222;
}

.compose-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.compose-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.compose-preview-block {
    display: flex;
    align-items: stretch;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
}

.compose-image-half {
    width: 60%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    aspect-ratio: 4 / 5;
}

.compose-image-half img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#upload-placeholder {
    text-align: center;
}

.change-photo-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.compose-washi-half {
    width: 40%;
    background-color: #f4f1eb;
    background-image: url('https://www.transparenttextures.com/patterns/rice-paper.png');
    position: relative;
}

.washi-textarea-vertical {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 2;
    padding: 15px;
    color: #2c2c2c;
    word-break: break-all;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.washi-textarea-vertical:focus {
    outline: none;
}

.washi-char-counter {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #888;
    font-size: 0.7rem;
    font-family: var(--font-sans);
    background: rgba(244, 241, 235, 0.8);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 5;
}

.compose-opt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #222;
}

.opt-label {
    font-size: 0.9rem;
}

.opt-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.opt-select {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--color-gold);
    font-size: 0.9rem;
    padding-right: 20px;
    text-align: right;
    cursor: pointer;
}

.opt-select:focus {
    outline: none;
}

.opt-icon {
    position: absolute;
    right: 0;
    pointer-events: none;
    color: var(--color-gold);
    font-size: 1.2rem;
}

/* ==========================================
   マイページ (庵)
   ========================================== */
.mypage-custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.mypage-header-title {
    text-align: center;
}

.mypage-header-title .kanji {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--color-gold);
}

.mypage-header-title .kana {
    font-size: 0.6rem;
    color: var(--text-sub);
    letter-spacing: 2px;
}

.mypage-profile-area {
    padding: 0 20px 20px;
}

.mp-top {
    display: flex;
    align-items: center;
}

.mp-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.mp-info {
    flex: 1;
}

.mp-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.mp-handle {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.mp-stats {
    display: flex;
    justify-content: space-between;
    background: var(--bg-surface);
    padding: 15px;
    border-radius: 8px;
}

.mp-stat {
    text-align: center;
    flex: 1;
}

.mp-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-sub);
    margin-bottom: 5px;
}

.mp-stat-num {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-gold);
}

.my-bonsai-card {
    display: flex;
    background: var(--bg-surface);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    align-items: center;
}

.my-bonsai-img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
}

.my-bonsai-info {
    flex: 1;
}

.mb-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.mb-detail {
    font-size: 0.75rem;
    color: var(--text-sub);
}

/* ==========================================
   巡（探す）画面
   ========================================== */
.search-section {
    padding: 15px;
    background: var(--bg-surface);
}

.search-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-sub);
}

.search-input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid #333;
    padding: 12px 12px 12px 40px;
    border-radius: 20px;
    color: var(--text-main);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-gold);
}

.meguri-section-title {
    font-size: 1rem;
    margin: 20px 15px 10px;
    color: var(--color-gold);
}

.tags-container {
    padding: 0 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bonsai-tag {
    background: var(--bg-surface);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #333;
}

.history-item {
    display: flex;
    background: var(--bg-surface);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.history-thumbnail img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 12px;
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.history-date {
    font-size: 0.7rem;
    color: var(--text-sub);
    margin-bottom: 3px;
}

.history-text {
    font-size: 0.85rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-metrics {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.7rem;
    color: var(--text-sub);
}

/* ==========================================
   マイページ メニューモーダル (規約等)
   ========================================== */
.menu-list-washi {
    display: flex;
    flex-direction: column;
    background-color: #f4f1eb;
    background-image: url('https://www.transparenttextures.com/patterns/rice-paper.png');
    padding: 10px 0;
    height: 100%;
}

.menu-item-washi {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s;
}

.menu-item-washi:last-child {
    border-bottom: none;
}

.menu-item-washi:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-item-washi span {
    font-weight: 500;
}

.menu-item-washi .material-symbols-outlined {
    color: var(--color-gold);
    font-size: 1.2rem;
}