/* トップ専用CSS。共通body/header/layoutは style.css が担当。 */

/* ======================================================
   ① トップページ専用デザイン
   index.php 内だけで使用
====================================================== */


/* ==============================
   共通カード調整
============================== */

.home-top.card,
.home-news.card,
.home-recent.card {
    background: #ffffff;

    border:
        1px solid rgba(191, 219, 254, .48);

    box-shadow:
        0 14px 34px rgba(30, 64, 175, .11);
}


/* ==============================
   サービス紹介
============================== */

.home-top.card {
    position: relative;

    padding: 36px 38px 34px 52px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #fffdf9 0%,
            #fffaf1 55%,
            #fff6e8 100%
        );

    border:
        1px solid rgba(251, 146, 60, .24);

    border-radius: 20px;

    box-shadow:
        0 16px 38px rgba(30, 64, 175, .12);
}


/* 左側のオレンジ線 */
.home-top.card::before {
    content: "";

    position: absolute;

    top: 24px;
    bottom: 24px;
    left: 24px;

    width: 4px;

    background:
        linear-gradient(
            180deg,
            #f97316,
            #fb923c
        );

    border-radius: 999px;
}


.home-top-grid {
    width: 100%;
}


.home-intro {
    width: 100%;
}


.home-intro .lead {
    margin: 0 0 14px;

    color: #16213c;

    font-size: 1.42rem;
    font-weight: 750;
    line-height: 1.5;

    letter-spacing: .035em;
}


.home-intro p {
    margin: 8px 0;

    color: #334155;

    font-size: .96rem;
    line-height: 1.9;
}


.home-intro strong {
    color: #1e293b;

    font-weight: 700;

    text-decoration: none;
}


/* ==============================
   お知らせ
============================== */

.home-news.card {
    padding: 26px 30px;
}


.home-news h2 {
    position: relative;

    margin: 0 0 18px;
    padding: 0 0 15px 42px;

    color: #172033;

    font-size: 1.12rem;
    font-weight: 750;

    border-bottom:
        1px solid rgba(148, 163, 184, .28);
}


/* お知らせアイコン */
.home-news h2::before {
    content: "●";

    position: absolute;
    top: -2px;
    left: 0;

    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #60a5fa
        );

    border-radius: 50%;

    font-size: 9px;

    box-shadow:
        0 7px 16px rgba(37, 99, 235, .24);
}

/* ======================================================
   お知らせ本文表示
====================================================== */

.news-list {
    display: flex;
    flex-direction: column;
}


.news-item {
    padding: 16px 2px;

    border-bottom:
        1px solid rgba(148, 163, 184, .24);
}


.news-item:first-child {
    padding-top: 0;
}


.news-item:last-child {
    border-bottom: none;
}


.news-date {
    margin: 0 0 8px;

    color: #64748b;

    font-size: .82rem;
    font-weight: 500;

    letter-spacing: .025em;
}


.news-content {
    color: #334155;

    font-size: .92rem;
    line-height: 1.8;

    white-space: normal;

    overflow-wrap: anywhere;
}


.news-more {
    margin: 16px 0 0;

    text-align: right;
}


.news-more a {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #2563eb;

    font-size: .86rem;
    font-weight: 650;

    text-decoration: none;
}


.news-more a::after {
    content: "→";
}


.news-more a:hover {
    opacity: .7;
}


/* ==============================
   最近の投稿
============================== */

.home-recent.card {
    padding: 26px 30px 22px;
}


.home-recent h2 {
    position: relative;

    margin: 0 0 10px;
    padding: 0 0 15px 42px;

    color: #172033;

    font-size: 1.12rem;
    font-weight: 750;
    letter-spacing: .02em;

    border-bottom:
        1px solid rgba(148, 163, 184, .28);
}


/* 投稿アイコン */
.home-recent h2::before {
    content: "✎";

    position: absolute;
    top: -2px;
    left: 0;

    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #60a5fa
        );

    border-radius: 50%;

    font-size: 15px;

    box-shadow:
        0 7px 16px rgba(37, 99, 235, .24);
}


.recent-list {
    display: flex;
    flex-direction: column;
}


.recent-item {
    padding: 0;

    border-bottom:
        1px solid rgba(148, 163, 184, .27);
}


.recent-item:last-child {
    border-bottom: none;
}


.recent-item a {
    min-height: 47px;

    padding: 9px 2px;

    display: grid;

    grid-template-columns:
        90px
        110px
        minmax(0, 1fr);

    align-items: center;
    column-gap: 16px;

    color: inherit;

    text-decoration: none;

    transition:
        background-color .15s ease,
        padding-left .15s ease;
}


.recent-item a:hover {
    padding-left: 8px;

    background:
        rgba(239, 246, 255, .72);
}


/*
 * PHP上はmeta内に
 * typeと日付が入っているため、
 * contentsを使ってグリッド直下として扱う
 */
.recent-meta {
    display: contents;
}


/* Drops / Poolsラベル */
/* 投稿種別共通 */
.recent-type {
    width: 88px;

    padding: 5px 12px;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    border-radius: 999px;

    font-size: .78rem;
    font-weight: 700;
    line-height: 1;

    text-transform: capitalize;
}


/* デフォルト：Drops */
.recent-type {
    color: #16715f;

    background: #e5f7ee;

    border:
        1px solid rgba(34, 197, 94, .14);
}


/* Drops */
.recent-type-drops {
    color: #16715f;

    background: #e5f7ee;

    border:
        1px solid rgba(34, 197, 94, .14);
}


/* Pools */
.recent-type-pools {
    color: #2459b8;

    background: #e6f0ff;

    border:
        1px solid rgba(59, 130, 246, .18);
}
/* Pools */
.recent-item:has(.recent-type:first-child) {
    --dummy: 0;
}


/*
 * PHPでtypeを小文字出力しているため、
 * classだけでは種類判定できない。
 * 後ほどPHP側でtypeクラスを追加するとさらに綺麗になる。
 */


/* 日付 */
.recent-meta > span:last-child {
    color: #64748b;

    font-size: .82rem;
    letter-spacing: .025em;
}


/* Poolsタイトル */
.recent-title {
    min-width: 0;

    margin: 0;

    color: #1e293b;

    font-size: .91rem;
    font-weight: 650;
    line-height: 1.5;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* 本文 */
.recent-text {
    min-width: 0;

    margin: 0;

    color: #334155;

    font-size: .88rem;
    line-height: 1.5;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/*
 * Poolにタイトルがある場合、
 * タイトルと本文が両方グリッドへ入るため、
 * 本文は表示しない。
 */
.recent-title + .recent-text {
    display: none;
}


/* Drops / Pools導線 */
.recent-links {
    display: flex;
    justify-content: center;
    gap: 28px;

    margin-top: 18px;
    padding-top: 15px;

    border-top:
        1px solid rgba(148, 163, 184, .20);
}


.recent-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: #2563eb;

    font-size: .84rem;
    font-weight: 650;

    text-decoration: none;
}


.recent-links a::after {
    content: "→";
}


.recent-links a:hover {
    opacity: .7;
}


/* 投稿なし */
.recent-empty {
    margin: 16px 0 0;

    color: #94a3b8;

    font-size: .88rem;
}

/* ======================================================
   最近の投稿直下 協賛広告（5:1）
====================================================== */
.home-sponsor-ad-slot {
    min-height: 1px;
    margin: 22px 0 0 -40px;
    width: 100%;
}

.home-sponsor-ad {
    --sponsor-button-width: 104px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sponsor-button-width);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(191, 219, 254, .48);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(30, 64, 175, .10);
    width:100%;
}

.home-sponsor-ad-media {
    position: relative;
    min-width: 0;
    overflow: hidden;
    aspect-ratio: 5 / 1;
    background: #f8fafc;
}

.home-sponsor-ad-label {
    position: absolute;
    z-index: 1;
    top: 5px;
    left: 5px;
    max-width: calc(100% - 10px);
    padding: 2px 6px;
    overflow: hidden;
    color: #64748b;
    background: rgba(255, 255, 255, .8);
    border-radius: 999px;
    font-size: 9px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.home-sponsor-ad-link,
.home-sponsor-ad-image {
    display: block;
    width: 100%;
    height: 100%;
}

.home-sponsor-ad-image {
    object-fit: cover;
}

.home-sponsor-ad-button {
    display: grid;
    min-height: 48px;
    place-items: center;
    padding: 8px;
    color: #fff;
    background: #d16a9c;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.home-sponsor-ad-button:hover {
    background: #bd5889;
}

@media (max-width: 520px) {
    .home-sponsor-ad {
        --sponsor-button-width: 72px;
    }

    .home-sponsor-ad-button {
        padding: 6px;
        font-size: 11px;
    }
}


/* ==============================
   タブレット・スマホ
============================== */

@media (max-width: 900px) {

    .home-top.card,
    .home-news.card,
    .home-recent.card {
        margin-bottom: 20px;

        border-radius: 18px;

        box-shadow:
            0 10px 24px rgba(30, 64, 175, .10);
    }


    .home-top.card {
        margin-top: 8px;

        padding: 28px 21px 27px 34px;
    }


    .home-top.card::before {
        top: 20px;
        bottom: 20px;
        left: 16px;

        width: 3px;
    }


    .home-intro .lead {
        font-size: 1.18rem;
    }


    .home-intro p {
        font-size: .92rem;
        line-height: 1.8;
    }


    .home-news.card,
    .home-recent.card {
        padding: 24px 20px;
    }

    .news-more {
        text-align: left;
    }


    .recent-item a {
        min-height: auto;

        padding: 14px 2px;

        grid-template-columns:
            76px
            minmax(0, 1fr);

        row-gap: 7px;
        column-gap: 10px;
    }


    .recent-type {
        width: 72px;

        padding: 5px 8px;
    }


    .recent-meta > span:last-child {
        grid-column: 2;
    }


    .recent-title,
    .recent-text {
        grid-column: 1 / -1;
    }


    .recent-links {
        justify-content: flex-start;
        gap: 20px;
    }
}
/* ======================================================
   ⑦ 税理士ログインリンクここから
====================================================== */

.accountant-login-link {
    margin: 18px 4px 0;

    text-align: right;
}

.accountant-login-link a {
    color: #94a3b8;

    font-size: .72rem;

    text-decoration: none;
}

.accountant-login-link a:hover {
    color: #64748b;

    text-decoration: underline;
}

/* ======================================================
   ⑦ 税理士ログインリンクここまで
====================================================== */
/* ======================================================
   REPSUMリンク
====================================================== */

.home-repsum-link {
    margin: 18px 0 24px;
}

.home-repsum-link a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 20px 24px;

    border: 1px solid rgba(214, 180, 76, .55);
    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #171717 0%,
            #231d0d 100%
        );

    color: #ffffff;

    text-decoration: none;

    box-shadow:
        0 12px 28px rgba(15, 23, 42, .14);

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.home-repsum-link a:hover {
    transform: translateY(-2px);

    box-shadow:
        0 16px 34px rgba(15, 23, 42, .20);
}

.home-repsum-main {
    min-width: 0;
}

.home-repsum-title {
    margin-bottom: 5px;

    color: #f2dc88;

    font-size: 1.2rem;
    font-weight: 800;
}

.home-repsum-text {
    color: #e5e7eb;

    font-size: .88rem;
    line-height: 1.6;
}

.home-repsum-arrow {
    flex: 0 0 auto;

    color: #f2dc88;

    font-size: 1.6rem;
    font-weight: 700;
}


/* スマホ */
@media (max-width: 600px) {

    .home-repsum-link a {
        padding: 18px;
    }

    .home-repsum-title {
        font-size: 1.08rem;
    }

    .home-repsum-text {
        font-size: .82rem;
    }
}
