/**
 * 記事詳細ページ用CSS（特集・お知らせ共通）
 * post.css
 * 
 * 共通パーツ（page-header, breadcrumb, pagination）は common.css を参照
 */

/* パンくずリストの上書き（長いタイトル用） */
.breadcrumb-list .current {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   記事ページレイアウト
   ============================================ */
.post-page {
    padding: 50px 0 80px;
}

.post-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* サイドバーなしの場合 */
.post-page-single .container {
    max-width: 1040px;
}

.post-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 50px;
}

/* ============================================
   記事ヘッダー
   ============================================ */
.post-header {
    margin-bottom: 40px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.post-category {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.post-date {
    font-family: var(--font-en);
    font-size: 12px;
    color: var(--color-text-light);
    letter-spacing: 0.05em;
}

.post-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 20px;
}

.post-excerpt {
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text-light);
    margin: 0 0 25px;
}

.post-thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   目次
   ============================================ */
.toc {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f8f8;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--color-text-light);
}

.toc-label {
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #999;
}

.toc-title {
    font-size: 15px;
    font-weight: 700;
}

.toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-list > li {
    margin-bottom: 12px;
}

.toc-list > li:last-child {
    margin-bottom: 0;
}

.toc-list > li > a {
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.6;
}

.toc-list > li > a:hover {
    text-decoration: underline;
}

.toc-sub-list {
    margin: 8px 0 0 0;
    padding: 0 0 0 20px;
    list-style: none;
}

.toc-sub-list li {
    margin-bottom: 6px;
}

.toc-sub-list li:last-child {
    margin-bottom: 0;
}

.toc-sub-list li a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
}

.toc-sub-list li a:hover {
    text-decoration: underline;
}

/* TOCサブリストは番号なし（post-content ol liのスタイルを上書き） */
.post-content ol.toc-sub-list li {
    padding-left: 16px;
    counter-increment: none;
    margin-bottom: 0;
}

.post-content ol.toc-sub-list li::before {
    content: "–";
    width: auto;
    height: auto;
    background: none;
    color: #999;
    font-size: 13px;
    font-weight: 400;
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}

/* ============================================
   記事本文
   ============================================ */
.post-content {
    min-width: 0;
}

.post-content-full {
    max-width: 100%;
}

.post-content section {
    margin-bottom: 50px;
}

/* 見出し h2〜h6 */
.post-content h2 {
    font-size: 22px;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-text);
    margin: 40px 0 25px;
}

.post-content h2:first-child {
    margin-top: 0;
}

.post-content h3 {
    font-size: 18px;
    font-weight: 700;
    padding-left: 15px;
    border-left: 3px solid var(--color-text);
    margin: 40px 0 20px;
}

.post-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 30px 0 15px;
}

.post-content h5 {
    font-size: 14px;
    font-weight: 700;
    margin: 25px 0 12px;
}

.post-content h6 {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-light);
    margin: 20px 0 10px;
}

/* 段落 */
.post-content p {
    font-size: 15px;
    line-height: 2;
    margin: 0 0 1.5em;
}

/* 強調 */
.post-content strong {
    font-weight: 700;
}

.post-content em {
    font-style: italic;
}

.post-content mark {
    background: #fff59d;
    padding: 2px 4px;
}

/* リンク */
.post-content a {
    color: var(--color-text);
    text-decoration: underline;
    transition: opacity 0.2s;
}

/* 順序なしリスト */
.post-content ul {
    margin: 0 0 1.5em;
    padding-left: 0;
    list-style: none;
}

.post-content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.8;
}

.post-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--color-text);
}

/* 順序ありリスト */
.post-content ol {
    margin: 0 0 1.5em;
    padding-left: 0;
    list-style: none;
    counter-reset: ol-counter;
}

.post-content ol li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 2;
    counter-increment: ol-counter;
}

.post-content ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 0px;
    width: 20px;
    height: 20px;
    background: #333;
    color: var(--color-white);
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 定義リスト */
.post-content dl {
    margin: 0 0 1.5em;
    border: 1px solid var(--color-border);
}

.post-content dt {
    padding: 12px 15px;
    background: var(--color-bg);
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
}

.post-content dd {
    padding: 15px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    border-bottom: 1px solid var(--color-border);
}

.post-content dd:last-child {
    border-bottom: none;
}

/* テーブル */
.table-wrap {
    overflow-x: auto;
    margin: 0 0 1.5em;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0 0 1.5em;
}

.post-content table caption {
    text-align: left;
    font-weight: 700;
    padding-bottom: 10px;
}

.post-content table th,
.post-content table td {
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.post-content table th {
    background: var(--color-bg);
    font-weight: 700;
    white-space: nowrap;
}

.post-content table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* 引用 */
.post-content blockquote {
    margin: 0 0 1.5em;
    padding: 25px 30px;
    border-left: 4px solid var(--color-text);
    background: var(--color-bg);
}

.post-content blockquote p {
    font-size: 15px;
    font-style: italic;
    margin-bottom: 10px;
}

.post-content blockquote p:last-of-type {
    margin-bottom: 0;
}

.post-content blockquote cite {
    display: block;
    font-size: 12px;
    color: var(--color-text-light);
    font-style: normal;
    margin-top: 10px;
}

/* 画像 */
.post-content figure {
    margin: 0 0 1.5em;
}

.post-content figure img {
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
}

.post-content figcaption {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 8px;
    text-align: center;
}

.post-figure {
    margin: 30px 0;
}

/* 画像ギャラリー */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 1.5em;
}

.post-gallery figure {
    margin: 0;
}

.post-gallery img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ボックス（info / warning） */
.info-box {
    margin: 0 0 1.5em;
    padding: 20px 25px;
    border-radius: 8px;
}

.info-box-info {
    background: #f0f7ff;
    border: 1px solid #cce0ff;
}

.info-box-warning {
    background: #fff8f0;
    border: 1px solid #ffe0b3;
}

.info-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.info-box-title::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* info アイコン（i マーク） */
.info-box-info .info-box-title::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
}

/* warning アイコン（三角 ! マーク） */
.info-box-warning .info-box-title::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

.info-box-content {
    font-size: 14px;
    line-height: 1.8;
}

/* 埋め込み店舗カード */
.embedded-shop-card {
    margin: 0 0 1.5em;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.embedded-shop-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shop-card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.shop-card-image {
    width: 120px;
    flex-shrink: 0;
}

.shop-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-card-body {
    flex: 1;
    padding: 15px 20px;
}

.shop-card-category {
    display: inline-block;
    font-size: 11px;
    color: var(--color-text-light);
    margin-bottom: 5px;
}

.shop-card-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 5px;
}

.shop-card-address {
    font-size: 12px;
    color: var(--color-text-light);
    margin: 0;
}

/* コードブロック */
.post-content pre {
    margin: 0 0 1.5em;
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}

.post-content code {
    font-family: 'Consolas', 'Monaco', monospace;
}

.post-content p code {
    background: var(--color-bg);
    padding: 2px 6px;
    font-size: 13px;
}

/* 注意・補足ボックス */
.post-box {
    margin: 0 0 1.5em;
    padding: 20px;
    border: 1px solid var(--color-border);
}

.post-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.post-box p {
    margin: 0;
    font-size: 14px;
}

.post-box-info {
    background: #e3f2fd;
    border-color: #2196f3;
}

.post-box-info .post-box-title {
    color: #1976d2;
}

.post-box-warning {
    background: #fff3e0;
    border-color: #ff9800;
}

.post-box-warning .post-box-title {
    color: #f57c00;
}

/* 関連リンク */
.post-related-links {
    margin: 30px 0;
    padding: 20px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

.post-related-links h4 {
    font-size: 14px;
    margin: 0 0 12px;
}

.post-related-links ul {
    margin: 0;
}

.post-related-links li {
    margin-bottom: 5px;
}

/* ============================================
   記事フッター
   ============================================ */
.post-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.post-tags-header {
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

.post-tags-content {
    margin-bottom: 30px;
}

.tag-label {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
}

.post-tag {
    padding: 5px 12px;
    background: var(--color-bg);
    font-size: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.2s;
}

.post-tag:hover {
    background: var(--color-border);
    color: var(--color-white);
}

.post-share {
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-share .share-label {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
}

.post-share-btns {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--color-text);
    border-color: var(--color-text);
    color: var(--color-white);
}

/* ============================================
   前後記事ナビゲーション
   ============================================ */
.post-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.post-nav-prev,
.post-nav-next {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-decoration: none;
    color: var(--color-text);
    transition: opacity 0.2s;
}

.post-nav-prev:hover,
.post-nav-next:hover {
    opacity: 0.6;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
}

.post-nav-title {
    font-size: 14px;
    line-height: 1.5;
}

.post-nav-back {
    align-self: center;
    padding: 10px 20px;
    border: 1px solid var(--color-border);
    font-size: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
}

.post-nav-back:hover {
    background: var(--color-text);
    border-color: var(--color-text);
    color: var(--color-white);
}

/* ============================================
   サイドバー
   ============================================ */
.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    border: 1px solid var(--color-border);
}

.widget-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.widget-label {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
}

.widget-title {
    font-size: 13px;
    font-weight: 700;
}

/* 著者ウィジェット */
.author-widget .widget-header {
    padding: 12px 20px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.author-name {
    font-size: 14px;
    font-weight: 700;
}

.author-role {
    font-family: var(--font-en);
    font-size: 10px;
    color: var(--color-text-light);
    letter-spacing: 0.05em;
}

.author-bio {
    padding: 0 20px 15px;
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
}

/* 関連特集ウィジェット */
.related-posts {
    padding: 15px;
}

.related-post-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    transition: opacity 0.2s;
}

.related-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-post-item:first-child {
    padding-top: 0;
}

.related-post-item:hover {
    opacity: 0.7;
}

.related-post-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.related-post-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.related-post-date {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--color-text-light);
}

/* ランキングウィジェット */
.ranking-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ranking-list li {
    border-bottom: 1px solid var(--color-border);
}

.ranking-list li:last-child {
    border-bottom: none;
}

.ranking-list a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.2s;
}

.ranking-list a:hover {
    background: var(--color-bg);
}

.ranking-num {
    font-family: var(--font-en);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-light);
    line-height: 1;
}

.ranking-title {
    font-size: 13px;
    line-height: 1.5;
}

/* カテゴリウィジェット */
.category-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-list li {
    border-bottom: 1px solid var(--color-border);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 13px;
    transition: background 0.2s;
}

.category-list a:hover {
    background: var(--color-bg);
}

.category-list .count {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--color-text-light);
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 968px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .post-sidebar {
        order: 1; /* メインコンテンツの後に表示 */
    }
}

@media (max-width: 768px) {
    .post-page {
        padding: 30px 0 60px;
    }

    .post-page .container {
        padding: 0 15px;
    }

    .breadcrumb-list {
        overflow-x: auto;
        white-space: nowrap;
    }

    .post-category {
        padding: 4px 12px 3px;
    }

    .post-thumbnail {
        aspect-ratio: 16 / 11;
    }

    .post-header {
        margin-bottom: 20px;
    }

    .post-title {
        font-size: 20px;
    }

    .post-excerpt {
        font-size: 14px;
    }

    .post-tags-content {
        margin-bottom: 20px;
    }

    .post-tag {
        padding: 4px 5px;
        font-size: 10px;
    }

    .toc {
        padding: 20px;
    }

    .post-content h2 {
        font-size: 19px;
    }

    .post-content h3 {
        font-size: 16px;
    }

    .post-content p,
    .post-content ul li,
    .post-content ol li {
        font-size: 14px;
    }

    .post-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-nav {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .post-nav-back {
        order: -1;
        justify-self: center;
    }

    .post-nav-next {
        text-align: left;
    }

    .post-nav-next .post-nav-label {
        order: 1;
    }
}
