/**
 * Author Profile Tool - Frontend CSS
 *
 * 承認済みデザイン:
 *   - ロゴは100×100px固定・白背景・object-fit: contain
 *   - グリッドはauto-fillで画面幅に応じて折り返し
 *   - セクション区切りは上罫線のみ
 */

/* ============================================================
 * プロフィール本体 [author_profile]
 * ============================================================ */

.apt-profile {
    /* 他プラグイン(RSBT/CVT)と同じコーラル */
    --apt-accent: #E07B5A;
    --apt-line: #E5E5E5;
    --apt-line-soft: #EDEDED;
    --apt-text-3: #767676;

    margin: 0 0 2em;
}

/* テーマ側のul/liスタイル(padding-left・マーカー・疑似要素)を打ち消す */
.apt-profile ul.apt-stat-grid,
.apt-profile ul.apt-photo-grid,
.apt-profile ul.apt-exp-grid,
.apt-profile ul.apt-card-grid,
.apt-profile ul.apt-link-list,
.apt-profile ul.apt-article-list,
.apt-profile ul.apt-sns-list {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
    text-indent: 0;
}

.apt-profile ul.apt-stat-grid > li,
.apt-profile ul.apt-photo-grid > li,
.apt-profile ul.apt-exp-grid > li,
.apt-profile ul.apt-card-grid > li,
.apt-profile ul.apt-link-list > li,
.apt-profile ul.apt-article-list > li,
.apt-profile ul.apt-sns-list > li {
    list-style: none;
    text-indent: 0;
    background: none;
}

.apt-profile ul.apt-stat-grid > li::before,
.apt-profile ul.apt-stat-grid > li::marker,
.apt-profile ul.apt-card-grid > li::before,
.apt-profile ul.apt-card-grid > li::marker,
.apt-profile ul.apt-photo-grid > li::before,
.apt-profile ul.apt-photo-grid > li::marker,
.apt-profile ul.apt-exp-grid > li::before,
.apt-profile ul.apt-exp-grid > li::marker,
.apt-profile ul.apt-link-list > li::before,
.apt-profile ul.apt-link-list > li::marker,
.apt-profile ul.apt-article-list > li::before,
.apt-profile ul.apt-article-list > li::marker,
.apt-profile ul.apt-sns-list > li::before,
.apt-profile ul.apt-sns-list > li::marker {
    content: none;
    display: none;
}

.apt-profile-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.1em;
}

.apt-profile-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.apt-profile-meta {
    min-width: 0;
}

.apt-profile-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.4;
}

.apt-profile-company {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

.apt-profile-desc {
    margin-bottom: 1.4em;
}

.apt-profile-desc p {
    font-size: 15px;
    line-height: 1.85;
    margin: 0 0 0.8em;
}

.apt-profile-desc p:last-child {
    margin-bottom: 0;
}

/* --- 数値カード --- */

.apt-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0 0 2em;
    padding: 0;
}

.apt-profile ul.apt-stat-grid > li.apt-stat-item {
    margin: 0;
    padding: 22px 26px;
    border: 1px solid var(--apt-line-soft);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 108px;
    box-sizing: border-box;
}

.apt-stat-label {
    display: block;
    font-size: 12px;
    color: var(--apt-text-3);
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
}

.apt-stat-value {
    display: block;
    line-height: 1.15;
}

.apt-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--apt-accent);
    letter-spacing: -0.01em;
}

.apt-stat-unit {
    font-size: 12px;
    color: var(--apt-text-3);
    margin-left: 3px;
}

@media screen and (min-width: 782px) {
    .apt-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    /* 個数が3個・2個のときは列数を合わせる */
    .apt-stat-grid:has(.apt-stat-item:nth-child(3):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .apt-stat-grid:has(.apt-stat-item:nth-child(2):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- 取材・契約の写真(リード直下) --- */

.apt-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    list-style: none;
    margin: 0 0 2em;
    padding: 0;
}

/* 枚数に応じて列数を変える */
.apt-photo-grid[data-count="1"] {
    grid-template-columns: minmax(0, 420px);
}

.apt-photo-grid[data-count="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.apt-photo-grid[data-count="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.apt-photo-item {
    margin: 0;
    padding: 0;
}

.apt-photo-figure {
    margin: 0;
}

.apt-photo-figure img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.apt-photo-cap {
    font-size: 11px;
    line-height: 1.55;
    color: #666;
    margin: 7px 0 0;
}

/* --- 経験リスト --- */

.apt-exp-cat {
    margin-bottom: 1.8em;
}

.apt-exp-cat-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.apt-exp-cat-title {
    font-size: 15px;
    font-weight: 700;
}

.apt-exp-cat-count {
    font-size: 13px;
    color: #888;
}

.apt-exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.apt-exp-item {
    text-align: center;
    margin: 0;
    padding: 0;
}

.apt-exp-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    box-sizing: border-box;
}

.apt-exp-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* ロゴ未登録の項目のみ、枠と背景を残して空白に見えないようにする */
.apt-exp-logo.is-noimg {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px;
}

.apt-exp-noimg {
    font-size: 11px;
    line-height: 1.35;
    color: #666;
    text-align: center;
    word-break: break-word;
}

.apt-exp-name {
    font-size: 11px;
    line-height: 1.35;
    color: #555;
    display: block;
    word-break: break-word;
}

/* --- 汎用セクション --- */

.apt-section {
    border-top: 1px solid #e5e5e5;
    padding-top: 1.2em;
    margin-bottom: 1.8em;
}

.apt-section-title {
    font-size: 17px;
    margin: 0 0 0.8em;
}

/* --- カードグリッド(アンケート・書いた記事 共通) --- */

.apt-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.apt-card-item {
    margin: 0;
}

.apt-card-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    border: 1px solid var(--apt-line-soft);
    border-radius: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

a.apt-card-link:hover .apt-card-title {
    text-decoration: underline;
}

.apt-card-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--apt-text-3);
    line-height: 1;
}

.apt-card-icon {
    display: block;
    flex-shrink: 0;
}

.apt-card-title {
    font-size: 13px;
    line-height: 1.6;
    color: inherit;
}

.apt-card-num {
    color: var(--apt-accent);
    font-weight: 700;
}

/* --- SNS --- */

.apt-sns-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.apt-sns-item {
    margin: 0;
}

.apt-sns-item a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    padding: 6px 16px 6px 12px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
}

.apt-sns-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.apt-sns-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.apt-sns-svg {
    display: block;
}

/* ブランドカラー */
.apt-sns-svg--facebook  { color: #1877F2; }
.apt-sns-svg--instagram { color: #E4405F; }
.apt-sns-svg--youtube   { color: #FF0000; }
.apt-sns-svg--x         { color: #000000; }
.apt-sns-svg--tiktok    { color: #010101; }
.apt-sns-svg--line      { color: #06C755; }
.apt-sns-svg--note      { color: #41C9B4; }
.apt-sns-svg--link      { color: #888888; }

.apt-sns-label {
    line-height: 1;
}

/* --- フッター --- */

.apt-profile-foot {
    border-top: 1px solid #e5e5e5;
    padding-top: 1em;
}

.apt-foot-line {
    font-size: 12px;
    color: #888;
    margin: 0 0 4px;
}

/* ============================================================
 * 著者ボックス [author_box]
 * ============================================================ */

.apt-box-widget {
    display: flex;
    gap: 14px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 16px 18px;
    margin: 2em 0;
    background: #fafafa;
}

.apt-box-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.apt-box-body {
    flex: 1;
    min-width: 0;
}

.apt-box-name {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
}

.apt-box-desc {
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    margin: 0 0 8px;
}

.apt-box-link {
    margin: 0;
}

.apt-box-link a {
    font-size: 13px;
}

/* ============================================================
 * スマホ調整
 * ============================================================ */

@media screen and (max-width: 480px) {
    .apt-profile ul.apt-stat-grid > li.apt-stat-item {
        padding: 16px 18px;
        min-height: 92px;
    }

    .apt-stat-num {
        font-size: 25px;
    }

    .apt-photo-grid,
    .apt-photo-grid[data-count="4"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .apt-photo-grid[data-count="1"] {
        grid-template-columns: 1fr;
    }

    .apt-card-grid {
        grid-template-columns: 1fr;
    }

    .apt-exp-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 10px;
    }

    .apt-exp-logo {
        width: 88px;
        height: 88px;
    }

    .apt-exp-logo.is-noimg {
        padding: 6px;
    }
}
