/*
 * Entra ID・サービスプリンシパル・Managed Identity 解説ページ 専用スタイル
 * ページ固有・外部CSS（サイト共通 site.css を上書きしすぎない範囲で .eid-page 配下に限定）。
 * 配色: Entra ID=青 / Service Principal=紫 / Managed Identity=オレンジ。
 * レスポンシブ: PC 2〜3カラム / スマホ 1カラム。表は横スクロール＋狭幅でカード化。
 */

.eid-page {
    --eid-blue: #1d4ed8;
    --eid-blue-bg: #eff4ff;
    --eid-blue-bd: #c9d8ff;
    --eid-purple: #7c3aed;
    --eid-purple-bg: #f6f1ff;
    --eid-purple-bd: #e2d3ff;
    --eid-orange: #ea580c;
    --eid-orange-bg: #fff4ec;
    --eid-orange-bd: #ffd8bf;
    --eid-ink: #1f2937;
    --eid-muted: #55617a;
    --eid-line: #e4e9f2;
    --eid-soft: #f7f9fc;
    --eid-radius: 16px;
    --eid-shadow: 0 10px 30px rgba(24, 39, 75, 0.08);
    --eid-shadow-sm: 0 4px 14px rgba(24, 39, 75, 0.06);
    color: var(--eid-ink);
    background: #ffffff;
    line-height: 1.85;
}

.eid-shell {
    max-width: 1080px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 32px);
}

.eid-page section {
    padding-block: clamp(40px, 6vw, 72px);
}

.eid-page h2 {
    font-size: clamp(1.5rem, 3.4vw, 2.15rem);
    line-height: 1.35;
    margin: 0 0 .6em;
    letter-spacing: .01em;
}

.eid-page h3 {
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    line-height: 1.45;
    margin: 0 0 .5em;
}

.eid-page p {
    margin: 0 0 1em;
}

.eid-eyebrow {
    display: inline-block;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--eid-blue);
    background: var(--eid-blue-bg);
    border: 1px solid var(--eid-blue-bd);
    border-radius: 999px;
    padding: .3em 1em;
    margin-bottom: 1rem;
}

.eid-section-head {
    max-width: 760px;
    margin: 0 auto clamp(24px, 4vw, 44px);
    text-align: center;
}

.eid-section-head p {
    color: var(--eid-muted);
    margin: 0;
}

/* ===== パンくず ===== */
.eid-breadcrumb {
    background: var(--eid-soft);
    border-bottom: 1px solid var(--eid-line);
    font-size: .85rem;
}

.eid-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35em .6em;
    align-items: center;
    max-width: 1080px;
    margin-inline: auto;
    padding: .8em clamp(16px, 4vw, 32px);
}

.eid-breadcrumb li {
    display: flex;
    align-items: center;
    gap: .6em;
    color: var(--eid-muted);
}

.eid-breadcrumb li + li::before {
    content: "›";
    color: #9aa6bd;
}

.eid-breadcrumb a {
    color: var(--eid-blue);
    text-decoration: none;
}

.eid-breadcrumb a:hover {
    text-decoration: underline;
}

.eid-breadcrumb [aria-current="page"] {
    color: var(--eid-ink);
    font-weight: 600;
}

/* ===== ヒーロー ===== */
.eid-hero {
    background:
        radial-gradient(1200px 400px at 15% -10%, var(--eid-blue-bg), transparent 60%),
        radial-gradient(1000px 380px at 90% 0%, var(--eid-orange-bg), transparent 55%),
        #ffffff;
    border-bottom: 1px solid var(--eid-line);
}

.eid-hero h1 {
    font-size: clamp(1.7rem, 4.6vw, 2.7rem);
    line-height: 1.35;
    margin: .2em 0 .5em;
    letter-spacing: .01em;
}

.eid-hero-lead {
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    color: #33405a;
    max-width: 820px;
}

.eid-hero-lead strong {
    color: var(--eid-ink);
}

/* 3行で理解カード */
.eid-tldr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: clamp(24px, 3vw, 36px);
}

.eid-tldr-card {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-top: 4px solid var(--c, var(--eid-blue));
    border-radius: 14px;
    padding: 20px 18px;
    box-shadow: var(--eid-shadow-sm);
}

.eid-tldr-card .eid-chip {
    margin-bottom: .6em;
}

.eid-tldr-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: .3em;
    color: var(--c, var(--eid-blue));
}

.eid-tldr-card span {
    color: var(--eid-muted);
    font-size: .95rem;
}

.eid-c-blue { --c: var(--eid-blue); }
.eid-c-purple { --c: var(--eid-purple); }
.eid-c-orange { --c: var(--eid-orange); }

/* 色ラベルのチップ */
.eid-chip {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    font-size: .78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .28em .9em;
    color: var(--c, var(--eid-blue));
    background: color-mix(in srgb, var(--c, var(--eid-blue)) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--c, var(--eid-blue)) 32%, #fff);
}

.eid-chip .eid-dot {
    width: .6em;
    height: .6em;
    border-radius: 50%;
    background: var(--c, var(--eid-blue));
}

/* ===== 汎用パネル ===== */
.eid-panel {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: var(--eid-radius);
    padding: clamp(22px, 3vw, 34px);
    box-shadow: var(--eid-shadow-sm);
}

.eid-alt {
    background: var(--eid-soft);
}

/* 結論の注意カード */
.eid-callout {
    border-radius: var(--eid-radius);
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--eid-blue-bd);
    background: var(--eid-blue-bg);
    display: grid;
    gap: 14px;
}

.eid-callout-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: .5em;
}

.eid-callout ul {
    margin: 0;
    padding-left: 1.2em;
    display: grid;
    gap: .4em;
}

.eid-callout-warn {
    border-color: var(--eid-orange-bd);
    background: var(--eid-orange-bg);
}

/* ===== 図（figure）＋ズーム ===== */
.eid-figure {
    margin: clamp(20px, 3vw, 32px) 0 0;
}

.eid-figure-zoom {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    border: 1px solid var(--eid-line);
    border-radius: var(--eid-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--eid-shadow);
    cursor: zoom-in;
}

.eid-figure-zoom img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    aspect-ratio: 1672 / 941;
    object-fit: cover;
}

.eid-zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: .78rem;
    font-weight: 600;
    color: #fff;
    background: rgba(20, 28, 46, .72);
    border-radius: 999px;
    padding: .32em .9em;
    pointer-events: none;
}

.eid-figure-zoom:focus-visible {
    outline: 3px solid var(--eid-blue);
    outline-offset: 2px;
}

figcaption.eid-figcaption {
    margin-top: .8em;
    font-size: .9rem;
    color: var(--eid-muted);
    line-height: 1.7;
}

/* ===== 3カラム/2カラム グリッド ===== */
.eid-grid {
    display: grid;
    gap: 18px;
}

.eid-grid-3 { grid-template-columns: repeat(3, 1fr); }
.eid-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* 用語比較カード */
.eid-def-card {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-left: 4px solid var(--c, var(--eid-blue));
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--eid-shadow-sm);
}

.eid-def-card h3 {
    color: var(--c, var(--eid-blue));
    display: flex;
    align-items: center;
    gap: .5em;
}

.eid-def-card ul {
    margin: 0;
    padding-left: 1.2em;
    color: var(--eid-muted);
    display: grid;
    gap: .35em;
}

.eid-memo {
    margin-top: 1em;
    font-size: .9rem;
    font-weight: 600;
    color: var(--c, var(--eid-blue));
    background: color-mix(in srgb, var(--c, var(--eid-blue)) 8%, #fff);
    border-radius: 10px;
    padding: .6em .8em;
}

/* 汎用ポイントカード（アイコン付き） */
.eid-point {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--eid-shadow-sm);
}

.eid-point .eid-ico {
    font-size: 1.6rem;
    line-height: 1;
    display: block;
    margin-bottom: .5em;
}

.eid-point h3 {
    font-size: 1.08rem;
}

.eid-point p {
    color: var(--eid-muted);
    margin: 0;
    font-size: .95rem;
}

/* ===== 比較表 ===== */
.eid-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--eid-line);
    border-radius: var(--eid-radius);
    box-shadow: var(--eid-shadow-sm);
}

.eid-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    background: #fff;
}

.eid-table caption {
    caption-side: top;
    text-align: left;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--eid-ink);
    background: var(--eid-soft);
    border-bottom: 1px solid var(--eid-line);
}

.eid-table th,
.eid-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--eid-line);
    font-size: .95rem;
}

.eid-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    font-size: .9rem;
}

.eid-table thead .eid-th-sp { color: var(--eid-purple); }
.eid-table thead .eid-th-mi { color: var(--eid-orange); }

.eid-table th[scope="row"] {
    font-weight: 600;
    color: var(--eid-ink);
    background: var(--eid-soft);
    white-space: nowrap;
}

.eid-table tbody tr:last-child th,
.eid-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== ステップ / 番号付きフロー ===== */
.eid-steps {
    list-style: none;
    counter-reset: eid-step;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.eid-steps li {
    counter-increment: eid-step;
    position: relative;
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: 14px;
    padding: 18px 18px 18px 68px;
    box-shadow: var(--eid-shadow-sm);
}

.eid-steps li::before {
    content: counter(eid-step);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--eid-blue);
    color: #fff;
    font-weight: 700;
}

/* フロー矢印表現（例示） */
.eid-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5em;
    font-weight: 600;
    background: var(--eid-soft);
    border: 1px dashed var(--eid-line);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 .6em;
    font-size: .95rem;
}

.eid-flow span {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: 8px;
    padding: .3em .7em;
}

.eid-flow .eid-arrow {
    border: none;
    background: none;
    color: var(--eid-blue);
    font-weight: 700;
    padding: 0 .1em;
}

/* ===== 判断フロー ===== */
.eid-decision {
    display: grid;
    gap: 14px;
}

.eid-decision .eid-q {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-left: 4px solid var(--eid-blue);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--eid-shadow-sm);
}

.eid-decision .eid-q strong {
    display: block;
    margin-bottom: .4em;
}

.eid-decision .eid-ans {
    display: flex;
    gap: .6em;
    flex-wrap: wrap;
    color: var(--eid-muted);
    font-size: .95rem;
}

.eid-badge-yes,
.eid-badge-no {
    font-weight: 700;
    border-radius: 6px;
    padding: .1em .6em;
    font-size: .82rem;
}

.eid-badge-yes { color: #0f7b3f; background: #e6f6ec; }
.eid-badge-no { color: #9a3412; background: var(--eid-orange-bg); }

/* 推奨順位リスト */
.eid-rank {
    counter-reset: eid-rank;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.eid-rank li {
    counter-increment: eid-rank;
    display: flex;
    align-items: baseline;
    gap: .7em;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: 10px;
}

.eid-rank li::before {
    content: counter(eid-rank);
    flex: none;
    width: 1.6em;
    height: 1.6em;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--eid-blue-bg);
    color: var(--eid-blue);
    font-weight: 700;
    font-size: .82rem;
}

/* ===== 危険/推奨 対比 ===== */
.eid-vs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.eid-vs-bad,
.eid-vs-good {
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid;
}

.eid-vs-bad {
    background: #fff5f5;
    border-color: #f6c9c9;
}

.eid-vs-good {
    background: #f0faf3;
    border-color: #bfe6cd;
}

.eid-vs h4 {
    margin: 0 0 .5em;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .4em;
}

.eid-vs-bad h4 { color: #b91c1c; }
.eid-vs-good h4 { color: #0f7b3f; }

.eid-vs ul {
    margin: 0;
    padding-left: 1.2em;
    display: grid;
    gap: .4em;
    color: var(--eid-muted);
    font-size: .95rem;
}

/* ===== details（誤解 / FAQ / Portal） ===== */
.eid-accordion {
    display: grid;
    gap: 12px;
}

.eid-details {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: 12px;
    box-shadow: var(--eid-shadow-sm);
    overflow: hidden;
}

.eid-details > summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 48px 16px 18px;
    font-weight: 600;
    position: relative;
}

.eid-details > summary::-webkit-details-marker {
    display: none;
}

.eid-details > summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: var(--eid-blue);
    line-height: 1;
}

.eid-details[open] > summary::after {
    content: "–";
}

.eid-details > summary:focus-visible {
    outline: 3px solid var(--eid-blue);
    outline-offset: -3px;
}

.eid-details-body {
    padding: 0 18px 18px;
    color: var(--eid-muted);
}

.eid-details-body p:last-child {
    margin-bottom: 0;
}

/* ===== Portal 確認カード ===== */
.eid-portal-card {
    background: #fff;
    border: 1px solid var(--eid-line);
    border-top: 4px solid var(--c, var(--eid-blue));
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--eid-shadow-sm);
}

.eid-portal-card h3 {
    color: var(--c, var(--eid-blue));
}

.eid-path {
    font-size: .88rem;
    background: var(--eid-soft);
    border: 1px solid var(--eid-line);
    border-radius: 8px;
    padding: .6em .8em;
    margin-bottom: 1em;
    color: var(--eid-ink);
}

.eid-portal-card ul {
    margin: 0;
    padding-left: 1.2em;
    color: var(--eid-muted);
    display: grid;
    gap: .3em;
    font-size: .93rem;
}

/* ===== セキュリティ推奨 箇条書き ===== */
.eid-check {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 22px;
}

.eid-check li {
    position: relative;
    padding-left: 1.7em;
    color: #33405a;
}

.eid-check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #0f7b3f;
    font-weight: 700;
}

/* ===== 関連記事カード ===== */
.eid-related {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.eid-related-card {
    display: flex;
    flex-direction: column;
    gap: .4em;
    background: #fff;
    border: 1px solid var(--eid-line);
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--eid-shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}

.eid-related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--eid-shadow);
}

.eid-related-card .eid-related-cat {
    font-size: .78rem;
    font-weight: 700;
    color: var(--eid-blue);
}

.eid-related-card strong {
    font-size: 1.05rem;
}

.eid-related-card span {
    color: var(--eid-muted);
    font-size: .92rem;
}

/* ===== CTA / メタ ===== */
.eid-cta {
    text-align: center;
    background:
        radial-gradient(900px 300px at 50% 0%, var(--eid-blue-bg), transparent 60%),
        var(--eid-soft);
    border-top: 1px solid var(--eid-line);
    border-bottom: 1px solid var(--eid-line);
}

.eid-btn {
    display: inline-block;
    background: var(--eid-blue);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    border-radius: 999px;
    padding: .85em 2em;
    box-shadow: 0 8px 20px rgba(29, 78, 216, .28);
}

.eid-btn:hover { background: #1a44be; }

.eid-meta {
    color: var(--eid-muted);
    font-size: .85rem;
    text-align: center;
    border-top: 1px dashed var(--eid-line);
    padding-top: 1.5em;
    margin-top: 1.5em;
}

/* ===== 画像拡大モーダル（軽量Lightbox） ===== */
.eid-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 4vw, 40px);
    background: rgba(15, 22, 40, .82);
}

.eid-modal.is-open {
    display: flex;
}

.eid-modal-dialog {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eid-modal-img {
    width: 100%;
    height: auto;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.eid-modal-caption {
    color: #eef2fb;
    text-align: center;
    font-size: .9rem;
    margin: 0;
}

.eid-modal-close {
    position: absolute;
    top: -14px;
    right: -6px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #1f2937;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

.eid-modal-close:focus-visible {
    outline: 3px solid var(--eid-blue);
    outline-offset: 2px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 900px) {
    .eid-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .eid-tldr { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .eid-page { line-height: 1.8; }
    .eid-grid-3,
    .eid-grid-2,
    .eid-vs,
    .eid-check {
        grid-template-columns: 1fr;
    }
    .eid-modal-close {
        top: 6px;
        right: 6px;
    }
}

/* ===== モーション配慮 ===== */
@media (prefers-reduced-motion: reduce) {
    .eid-related-card {
        transition: none;
    }
}
