/*
 * core.css — shared by all 6 sites (inc/brand-layer.php enqueues it first, handle
 * "hotelpicks-main"; inline CSS from inc/editorial.php and inc/mp-charts.php attaches to
 * that handle). Contents: reset, design tokens, base typography, the article-body
 * components the article agents write (contract §3 — the class names are a stable
 * interface) and the components core PHP prints (breadcrumb, updated badge, editor card).
 * Site chrome (header, footer, home, cards, archive, single layout) is NOT here:
 * brands/<slug>/brand.css, or assets/css/core-layout.css for a brand without one.
 * Brands restyle anything here from brand.css (loaded after this file) — override the
 * tokens in :root first. See docs/BRAND_LAYER.md.
 */

/* ---------- Reset / Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

:root {
    --bg:        #fafafa;
    --bg-alt:    #f4f1ea;
    --kinari:    #e8e0d3;
    --kinari-d:  #d4cebf;
    --text:      #1d1d1d;
    --text-mid:  #555;
    --text-low:  #999;
    --ai:        #25405a;  /* 藍 indigo */
    --ai-light:  #4a6580;
    --line:      #d4cebf;
    --max:       1120px;
    --font-body:    'Noto Sans JP', -apple-system, 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', sans-serif;
    --font-display: 'Shippori Mincho', serif;
}

body {
    background: var(--bg); color: var(--text);
    font-family: var(--font-body);
    font-weight: 300; line-height: 1.85;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--ai); }

img { max-width: 100%; height: auto; display: block; }

.screen-reader-text {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); border: 0;
}

/* ---------- Article body (single.php wraps the_content() in .article-body) ---------- */
.article-body {
    max-width: 720px; margin: 0 auto; padding: 30px 0 60px;
    font-size: 15px; line-height: 2;
}
.article-body p { margin-bottom: 1.4em; }
.article-body h2 {
    font-family: var(--font-display); font-size: 22px;
    font-weight: 500; letter-spacing: 0.05em; margin: 2em 0 0.8em;
    padding-top: 0.8em; border-top: 1px solid var(--line);
}
.article-body h3 {
    font-family: var(--font-display); font-size: 17px;
    font-weight: 500; margin: 1.6em 0 0.6em;
}

/* Breadcrumb */
.breadcrumb { font-size: 11px; color: var(--text-low); margin: 28px 0 8px; letter-spacing: 0.05em; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: '›'; padding-right: 6px; color: var(--text-low); }
.breadcrumb a { color: var(--text-mid); }
.breadcrumb a:hover { color: var(--ai); }
.breadcrumb li[aria-current] { color: var(--text); }

/* Last-updated badge (hotelpicks_show_updated_badge) */
.updated-badge {
    display: inline-block; padding: 2px 8px; font-size: 10px;
    background: #f4ecdf; color: var(--ai); border-radius: 3px;
    letter-spacing: 0.05em; margin-left: 6px;
}

/* ============ HotelPicks comparison table (.hp-compare) ============
   The 7-column table must escape .article-narrow's 760 px so Japanese
   text doesn't get squashed. We keep the table's natural display
   (display:table) — earlier attempts that flipped to display:block
   broke the row/cell semantics. Instead we use a positioning trick
   to break out of the narrow column while keeping the table intact. */

.article-body .hp-compare {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    /* expand to viewport width (minus side gutter) up to the container cap */
    width: min(calc(100vw - 56px), 1120px);
    margin-top: 18px;
    margin-bottom: 28px;
    border-collapse: collapse;
    line-height: 1.6;
    /* Use auto layout so the long "1行特徴" cell can absorb leftover width */
    table-layout: auto;
}
.article-body .hp-compare th,
.article-body .hp-compare td {
    padding: 10px 12px;
    white-space: nowrap;        /* short columns stay on one line */
    vertical-align: top;
}
.article-body .hp-compare td:last-child,
.article-body .hp-compare th:last-child {
    /* the "1行特徴" cell must wrap when needed */
    white-space: normal;
    min-width: 240px;
    max-width: 360px;
}

@media (max-width: 760px) {
    /* On phones the breakout trick yields nothing — fall back to natural
       width inside the narrow column with a smaller font. */
    .article-body .hp-compare {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
        font-size: 11px;
    }
    .article-body .hp-compare th,
    .article-body .hp-compare td {
        padding: 6px 6px;
    }
}

/* Editor card (hotelpicks_editor_card_html) */
.author-card {
    display: flex; gap: 16px; padding: 20px; background: var(--paper, #fbf9f5);
    border-radius: 8px; margin: 24px 0 36px; border: 1px solid var(--line);
}
.author-avatar img, .author-avatar .avatar-img { width: 64px; height: 64px; border-radius: 50%; display: block; }
.author-name-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.author-name { font-family: var(--font-display); font-size: 15px; }
.author-role { font-size: 10px; letter-spacing: 0.2em; color: var(--text-low); }
.author-bio { font-size: 12px; color: var(--text-mid); line-height: 1.8; margin: 0; }

/* TOC (if easy-table-of-contents plugin activated) */
#toc_container { border: 1px solid var(--line); background: var(--paper, #fbf9f5); padding: 16px 20px; margin: 28px 0; border-radius: 4px; }
#toc_container .toc_title { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.15em; color: var(--text-mid); margin-bottom: 8px; text-transform: uppercase; }
#toc_container ul { font-size: 13px; }
#toc_container a { color: var(--ai); }

/* ---------- Brand article boxes (contract §3) ----------
   <div class="mp-box mp-box--{facts|kids|onsen|stay|design}">
     <p class="mp-box__title">…</p><dl class="mp-box__list"><dt>項目</dt><dd>値</dd>…</dl>
   </div>
   Neutral base only — each brand.css gives its own box its look. */
.mp-box {
    margin: 1.6em 0; padding: 16px 20px;
    background: var(--paper, #fbf9f5); border: 1px solid var(--line); border-radius: 4px;
    font-size: 14px; line-height: 1.8;
}
.mp-box .mp-box__title {
    margin: 0 0 8px; font-size: 12px; font-weight: 700;
    letter-spacing: 0.08em; color: var(--ai);
}
.mp-box .mp-box__list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.mp-box .mp-box__list dt { color: var(--text-mid); font-weight: 400; }
.mp-box .mp-box__list dd { margin: 0; }
@media (max-width: 640px) {
    .mp-box .mp-box__list { grid-template-columns: 1fr; gap: 0; }
    .mp-box .mp-box__list dd { margin-bottom: 6px; }
}
