/*
 * 応募者側の作り直した画面（求人詳細・求人一覧・応募フォーム）の共通の土台。
 * 方向 1（ブランド帯 × 白カード）。部品の名前と分け方は docs/design/applicant-redesign/01-job-pages.md。
 *
 * - 色は --brand-*（BaseColorService::buildBrandPalette）と --cta / --cta-on だけを使う。
 *   濃い帯・見出し・ボタンの文字は白に固定し、地は --brand-deep にする（白文字 4.5:1 以上）。
 * - Bootstrap 3 と client-base.css の後に読む。どちらも html の文字の大きさ（10px）や
 *   header / footer / a の要素に効くため、部品は接頭辞 ap- の class で書き、大きさは rem ではなく px で書く。
 */

/* ベースカラー未設定の顧客の配色。既定の青 #0c57a0 から作った値（BaseColorService::BRAND_DEFAULT_BASE）。
   値を変えるときは Service の式を変える（tests/Unit/RecruitSite/BaseColorServiceTest がこの :root と照合する） */
:root {
    --brand-base: #0c57a0;
    --brand-deep: #0c57a0;
    --brand-deep-2: #296bab;
    --brand-ink: #14293d;
    --brand-ink-soft: #29527a;
    --brand-tint: #d3e1ee;
    --brand-tint-2: #eef3f8;
    --brand-marker: #86abd0;
    --brand-line: #9cb4c5;
    --brand-ink-line: #959fa8;
    --cta: #0b864f;
    --cta-on: #ffffff;
}

/* ---- ページ ---- */
/* Bootstrap 3 や client-base.css を読まない画面でも同じに見えるよう、要素の大きさの数え方をそろえる */
.ap-page,
.ap-page *,
.ap-page *::before,
.ap-page *::after {
    box-sizing: border-box;
}

/* client-base.css は body の高さを 100%（画面 1 枚分）にする。そのままだと、固定したヘッダーが 1 画面分で外れる */
.ap-page {
    height: auto;
    min-height: 100%;
    margin: 0;
    background: var(--brand-tint-2);
    color: #2a2d27;
    font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    text-align: left;
}

.ap-page a {
    color: inherit;
}

.ap-container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

.ap-icon {
    width: 18px;
    height: 18px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.ap-list > li {
    list-style: none;
}

/* JS で隠す（Bootstrap 3 の [hidden] は class の display に負けるので、class で隠す） */
.ap-is-hidden {
    display: none !important;
}

/* ---- ヘッダー（client-base.css の header は固定・高さ 90px なので、すべて上書きする） ---- */
.ap-header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: auto;
    height: auto;
    background: #ffffff;
    border-top: 4px solid var(--brand-base);
    border-bottom: 1px solid #eceee9;
}

.ap-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
}

/* ロゴが無い・読めないときは会社名を出す（is-broken は img の onerror が付ける） */
.ap-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 0;
    text-decoration: none;
}

.ap-page a.ap-brand:hover,
.ap-page a.ap-brand:focus {
    text-decoration: none;
}

.ap-brand__logo {
    display: block;
    max-width: 180px;
    max-height: 36px;
    width: auto;
    height: auto;
}

.ap-brand__name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--brand-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.ap-brand__name::before {
    content: "";
    flex: none;
    width: 6px;
    height: 22px;
    border-radius: 3px;
    background: var(--brand-base);
}

.ap-brand--logo .ap-brand__name,
.ap-brand.is-broken .ap-brand__logo {
    display: none;
}

.ap-brand.is-broken .ap-brand__name {
    display: inline-flex;
}

.ap-header__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
    color: var(--brand-ink-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.ap-header__link .ap-icon {
    width: 15px;
    height: 15px;
}

/* ---- 濃い帯（白文字。飾りは文字の地の濃さを下げない置き方にする） ---- */
.ap-band {
    position: relative;
    overflow: hidden;
    background: var(--brand-deep);
    color: #ffffff;
}

/* 左上の明るい円（deep-2 は白文字が 4.5:1 を切ることがある）。重なるのは、地を持つタグと大きな太字の職種名だけ */
.ap-band::before {
    content: "";
    position: absolute;
    left: -80px;
    top: -80px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--brand-deep-2);
}

/* 左上に小さな文字が来る帯では、明るい円を右上に置く（重なるのは大きな太字の見出しだけにする） */
.ap-band--deco-right::before {
    left: auto;
    right: -80px;
}

/* 右下の暗い円（地を暗くするだけなので、白文字はより読みやすくなる） */
.ap-band::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -160px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.14);
}

.ap-band > * {
    position: relative;
    z-index: 1;
}

/* ---- タグ ---- */
.ap-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ap-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.ap-pill .ap-icon {
    width: 13px;
    height: 13px;
    stroke-width: 2.4;
}

.ap-pill--type {
    background: var(--brand-deep);
    color: #ffffff;
}

.ap-pill--feat {
    background: var(--brand-tint);
    color: var(--brand-ink);
}

.ap-pill--feat .ap-icon {
    color: var(--brand-deep);
}

/* 帯の上: 雇用形態は白地、特徴は帯と同じ地に縁取り（半透明の白の地だと白文字が 4.5:1 を切る） */
.ap-band .ap-pill--type {
    background: #ffffff;
    color: var(--brand-deep);
}

.ap-band .ap-pill--feat {
    background: var(--brand-deep);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.ap-band .ap-pill--feat .ap-icon {
    color: var(--brand-marker);
}

/* ---- 要点（アイコン付きの行） ---- */
.ap-facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ap-facts > li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.ap-facts .ap-icon {
    margin-top: 2px;
    color: var(--brand-deep);
}

.ap-band .ap-facts .ap-icon {
    color: var(--brand-marker);
}

.ap-facts__label {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.ap-facts b {
    font-weight: 700;
}

/* ---- ボタン ---- */
.ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.ap-page a.ap-btn:hover,
.ap-page a.ap-btn:focus {
    text-decoration: none;
}

.ap-page .ap-btn--apply,
.ap-page .ap-btn--apply:hover,
.ap-page .ap-btn--apply:focus {
    background: var(--cta);
    color: var(--cta-on);
    box-shadow: 0 6px 14px -6px var(--cta);
}

.ap-page .ap-btn--tel,
.ap-page .ap-btn--ghost,
.ap-page .ap-btn--tel:hover,
.ap-page .ap-btn--ghost:hover {
    background: #ffffff;
    color: var(--brand-ink);
    box-shadow: inset 0 0 0 1.5px var(--brand-ink-line);
}

.ap-btn__stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}

.ap-btn__stack small {
    font-size: 11px;
    font-weight: 500;
}

.ap-btn:focus-visible {
    outline: 3px solid var(--brand-marker);
    outline-offset: 2px;
}

/* ---- 区画・見出し・カード ---- */
.ap-sec {
    padding: 26px 0 0;
}

.ap-sec-h {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--brand-deep);
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: 0.03em;
}

.ap-card {
    padding: 18px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px -12px rgba(0, 0, 0, 0.12);
}

.ap-text {
    margin: 0;
    overflow-wrap: anywhere;
}

/* ---- フッター（client-base.css の footer は黒地・大きな余白なので、すべて上書きする） ---- */
.ap-footer {
    position: static;
    width: auto;
    margin: 40px 0 0;
    padding: 22px 16px;
    background: #ffffff;
    border-top: 1px solid #eceee9;
    color: #5f6559;
    font-size: 12px;
    text-align: center;
}

.ap-footer a {
    color: var(--brand-ink);
    font-weight: 700;
}

/* ---- スマホの下に固定する電話・応募ボタン（モーダルの背景 1040 より下） ---- */
.ap-sticky {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e6e8e3;
}

.ap-sticky--apply-only {
    grid-template-columns: 1fr;
}

.ap-sticky.is-hidden {
    visibility: hidden;
}

.ap-sticky .ap-btn {
    min-height: 50px;
}

.ap-sticky .ap-btn--tel {
    padding: 10px 14px;
}

@media (min-width: 768px) {
    .ap-container {
        padding: 0 28px;
    }

    .ap-header__inner {
        min-height: 64px;
    }

    .ap-brand__logo {
        max-width: 220px;
        max-height: 44px;
    }

    .ap-sticky {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .ap-btn {
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .ap-btn:hover {
        transform: translateY(-1px);
    }
}
