/**
 * Frontend styles for column AI Studio shortcodes / blocks.
 *
 * Loaded on the frontend (single column page) via wp_enqueue_scripts.
 * Covers:
 *   - .callout / .callout-* (owl character speech bubble)
 *   - <table> inside .column-detail-body (article tables)
 *   - <mark> highlight inside article body
 *   - .cas-related-card ("あわせて読みたい" link card)
 *
 * Per-character color: render_callback puts inline `style="color:<hex>"` on
 * the outer .callout, so currentColor cascades down to icon border, arrow,
 * label background. --callout-icon-image is set per-instance on .callout-icon
 * to the character image URL.
 */

/* =====================================================
 * Callout (owl speech bubble)
 * ===================================================== */

.callout {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin: 28px 0;
    padding: 0;
    color: #2271b1; /* default accent if no character color set */
}

.callout-icon {
    flex-shrink: 0;
    width: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.callout-icon::before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: 2px solid currentColor;
    background-image: var(--callout-icon-image, none);
}

.callout-name {
    font-size: 12px;
    font-weight: 700;
    color: #1c1917;
    line-height: 1.3;
}

.callout-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 99px;
    color: #fff !important;
    background: currentColor;
    line-height: 1.4;
    margin-top: 2px;
}

.callout-body {
    flex: 1;
    position: relative;
    padding: 18px 22px;
    background: #fff;
    border: 2px solid currentColor;
    border-radius: 12px;
    color: #1c1917;
    font-size: 0.97rem;
    line-height: 1.85;
}

/* Tail: outer (border color) + inner (white fill) */
.callout-body::before {
    content: "";
    position: absolute;
    top: 24px;
    left: -14px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 14px 8px 0;
    border-color: transparent currentColor transparent transparent;
}
.callout-body::after {
    content: "";
    position: absolute;
    top: 26px;
    left: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 12px 6px 0;
    border-color: transparent #fff transparent transparent;
}

.callout-body p {
    margin: 0 0 10px;
    color: #1c1917;
}
.callout-body p:last-child { margin-bottom: 0; }

.callout-body strong { color: inherit; }
.callout-body a { color: currentColor; text-decoration: underline; }

/* Responsive: stack on narrow screens */
@media (max-width: 600px) {
    .callout { gap: 12px; }
    .callout-icon { width: 64px; }
    .callout-icon::before { width: 56px; height: 56px; }
    .callout-body { padding: 14px 16px; font-size: 0.93rem; }
    .callout-body::before { top: 18px; }
    .callout-body::after { top: 20px; }
}


/* =====================================================
 * Article table
 * ===================================================== */

.column-detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.93rem;
    background: #fff;
    border: 1px solid #E7E5E4;
    border-radius: 8px;
    overflow: hidden;
}

.column-detail-body table thead th {
    background: #FAFAF9;
    color: #1c1917;
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid #E7E5E4;
    font-size: 0.9rem;
}

.column-detail-body table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #F5F5F4;
    color: #44403C;
    vertical-align: top;
    line-height: 1.75;
}

.column-detail-body table tbody tr:last-child td {
    border-bottom: none;
}

.column-detail-body table tbody tr:nth-child(even) td {
    background: #FCFCFB;
}

.column-detail-body table strong { color: #1c1917; }

@media (max-width: 720px) {
    .column-detail-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .column-detail-body table thead th,
    .column-detail-body table tbody td {
        white-space: normal;
    }
}


/* =====================================================
 * <mark> highlight inside article body
 * ===================================================== */

.column-detail-body mark {
    background: linear-gradient(transparent 60%, rgba(255, 217, 102, 0.6) 60%);
    color: inherit;
    padding: 0 2px;
    font-weight: 500;
}


/* =====================================================
 * 「あわせて読みたい」related card
 * ===================================================== */

.cas-related-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin: 24px 0;
    background: #FAFAF9;
    border: 1px solid #E7E5E4;
    border-radius: 10px;
    text-decoration: none;
    color: #1c1917;
    transition: background 0.2s ease, transform 0.2s ease;
}
.cas-related-card:hover {
    background: #fff;
    transform: translateY(-1px);
}
.cas-related-card-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary, #2271b1);
    padding: 3px 10px;
    border: 1px solid currentColor;
    border-radius: 99px;
    flex-shrink: 0;
}
.cas-related-card-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #F5F5F4;
}
.cas-related-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cas-related-card-thumb-empty {
    background: #F5F5F4;
}
.cas-related-card-title {
    flex: 1;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.5;
    color: #1c1917;
}
.cas-related-card-arrow {
    flex-shrink: 0;
    font-size: 1.4rem;
    color: var(--primary, #2271b1);
    line-height: 1;
}
