/* Magazine Page Base */
.magazine-page {
    font-family: "Noto Sans JP", sans-serif;
    color: #222;
    line-height: 1.8;
}

/*  Layout */
.magazine-layout {
    display: flex;
    gap: 40px;
    margin: 0 auto 150px;
    padding: 200px 60px 0; /* fixed header 対策 */
}

/*   Side Menu */
.side-menu {
    width: 280px;
    min-width: 280px;
    position: sticky;
    top: 90px;
    align-self: flex-start;
}

.side-menu ul {
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.side-menu li {
    position: relative;
    height: 56px;
    display: flex;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid #9c9c9c;
}

.side-menu li:first-of-type {
    border-top: 1px solid #9c9c9c;
    font-weight: 700;
}

.side-menu a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    color: #222;
    text-decoration: none;
}

.side-menu li.is-current a {
    color: #9c9c9c;
}

.side-menu li:not(.is-current)::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px 0;
    height: 4px;
    background: linear-gradient(to right, #ffd4c6, #EB5F51);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.side-menu li:not(.is-current):hover::after {
    transform: scaleX(1);
}

.side-menu a:hover {
    color: #e73424;
}

.side-menu-img-div {
	display: none;
}

/*  Main */
.magazine-main {
    flex: 1;
    max-width: 1920px;
}

/* Page Title */
.magazine-title {
    position: relative;
    font-size: 40px;
    font-weight: 700;
    padding-left: 32px;
    margin-bottom: 32px;
}

.magazine-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 48px;
    background: #EB5F51;
    border-radius: 12px;
}

/* Latest Issue */
.latest-issue {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 40px;
    padding: 22px 0 10px;
    align-items: center;
}

.latest-cover img {
    width: 100%;
    border: 1px solid #e6e6e6;
}

.latest-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.latest-lead {
    font-size: 16px;
    margin-bottom: 18px;
}

.latest-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.btn-primary {
    background: #EB5F51;
    color: #fff;
}

.btn-ghost {
    border: 1px solid #EB5F51;
    color: #EB5F51;
}

/*  Divider */
.section-divider {
    margin: 30px 0 26px;
    height: 1px;
    background: #EB5F51;
    opacity: 0.45;
}

/*  Back Number */
.back-title {
    font-size: 16px;
    font-weight: 700;
    color: #EB5F51;
    margin-bottom: 6px;
}

/* 年フィルター（リンクUI） */
.year-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.year-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    font-size: 12px;
    border-radius: 20px;
    border: 1px solid #aaa;
    background: #f7f7f7;
    color: #222;
    text-decoration: none;
    line-height: 1;
    transition: 0.15s;
}

.year-btn:hover {
    background: #222;
    color: #fff;
    border-color: #222;
}

.year-btn.is-active {
    background: #EB5F51;
    border-color: #EB5F51;
    color: #fff;
}

/*  Back Number（年号チップ） */
@media (max-width: 1024px) {
    .side-menu-years {
        padding: 0 16px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* ラベル */
    .side-menu-years .side-menu-label {
        flex: 0 0 100%;
        font-size: 12px;
        font-weight: 700;
        color: #EB5F51;
        margin-bottom: 4px;
        border: none;
    }

    /* 横スクロール行 */
    .side-menu-years {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .side-menu-years::-webkit-scrollbar {
        display: none;
    }

    .side-menu-years li {
        border: none;
        height: auto;
        flex: 0 0 auto;
    }

    .side-menu-years a {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        padding: 4px 14px;
        font-size: 12px;
        line-height: 1;

        border-radius: 20px;
        border: 1px solid #aaa;
        background: #f7f7f7;
        color: #222;
        white-space: nowrap;
        text-decoration: none;

        transition: 0.15s;
    }

    .side-menu-years a:hover {
        background: #222;
        color: #fff;
        border-color: #222;
    }

    .side-menu-years a.is-current {
        background: #EB5F51;
        border-color: #EB5F51;
        color: #fff;
    }

    .year-filter {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;

        padding: 8px 16px;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
}

/*  Issue Grid */
.issue-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 28px;
}

.issue-card__body {
    min-width: 0;
}

.issue-card__desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.issue-card__thumb {
    padding: 16px; 
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.issue-card__thumb img {
    width: 160px;
    max-width: 160px;
    height: auto;
    object-fit: contain;
    border: 1px solid #e6e6e6;
}

/*  Responsive */
@media (max-width: 768px) {
    .magazine-page {
        padding: 40px 0;
    }
    .magazine-page h1 {
        font-size: 28px;
        padding-left: 24px;
        margin: 40px 0 24px;
    }
    .magazine-page h1::before {
        width: 10px;
        height: 36px;
    }

    .magazine-layout {
        flex-direction: column;
        padding: 0 16px; /* ← H1上の余白を完全に消す */
    }

    .magazine-main {
        order: 1;
    }

    .magazine-header {
        margin-top: 0;
        padding-top: 0;
    }

    .magazine-title {
        margin-top: 0;
        font-size: 28px;
        padding-left: 24px;
    }

    .magazine-title::before {
        width: 10px;
        height: 36px;
    }

    .latest-issue {
        grid-template-columns: 1fr;
    }

    .issue-grid {
        grid-template-columns: 1fr;
    }

    .side-menu {
        position: static;
        width: 100%;
        min-width: auto;
        order: 3;
        margin-top: 40px;
        border-top: 1px solid #ddd;
    }

    .side-menu ul {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
    }

    .side-menu li {
        height: 48px;
        border-bottom: 1px solid #ddd;
    }

    .side-menu li:first-of-type {
        border-top: none;
    }
	
	.side-menu-img-div {
		display: block;
		position: absolute;
		top: 0;
		right: 0;
		height: 100%;
	}
	
	.side-menu-img-div p {
		font-size: 2em;
	}
	
	.side-menu-img {
		height: 100%;
	}
	
	.side-menu-gra {
        position: absolute;
        top: 0;
        left: -0.1em;
        width: 100%;
        height: 100%;
        background:
            linear-gradient(to right,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.9) 15%, rgba(255, 255, 255, 0.5) 40%,
            rgba(255, 255, 255, 0) 65%);
    }
}
    
.issue-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.issue-card__meta {
    font-size: 12px;
    color: #666;
}

.issue-card__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 6px;
}

.issue-card__desc.is-small {
    font-size: 12px;
    color: #666;
}

.issue-card__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
}

.issue-card__thumb img {
    width: 100%;
    max-width: 160px;
    height: auto;
    object-fit: contain;
    border: 1px solid #e6e6e6;
}

/*  Mobile & Tablet（〜1024px） */
@media (max-width: 1024px) {
    /* ===== Layout ===== */
    .magazine-layout {
        flex-direction: column;
        padding: 0 16px;
        gap: 40px;
    }

    /* ===== Side Menu ===== */
    .side-menu {
        position: static;
        min-width: auto;
        margin-left: 0;
        margin-right: 0;
        margin-top: 40px;
    }

    .side-menu-ul .current-page {
        padding: 16px;
    }

    .side-menu-ul {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 0 16px;
    }

    .side-menu-ul li {
        border: none;
        flex: 0 0 50%;
        height: 48px;
    }

    .side-menu-ul a {
        position: relative;
        display: flex;
        align-items: center;

        min-height: 56px;
        padding: 16px;

        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;

        background: #fff;
        border-radius: 12px;
        overflow: hidden;
    }

    .side-menu-ul a::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 30%;
        height: 100%;

        background:
            linear-gradient(to right,
                rgba(255, 255, 255, 1) 0%,
                rgba(255, 255, 255, 0.9) 15%,
                rgba(255, 255, 255, 0.5) 40%,
                rgba(255, 255, 255, 0) 65%),
            var(--menu-bg-image);

        background-size: cover;
        background-position: left center;
        pointer-events: none;
    }

    .side-menu-ul a:active::after {
        background-size: 110%;
    }

    /* 現在ページ強調 */
    .side-menu-ul li.current-page a {
        font-weight: 700;
    }

    .side-menu-ul li.current-page a::after {
        opacity: 1;
    }
}

/* Bottom Side Menu (Mobile & Tablet) */
@media (max-width: 1024px) {
    .side-menu {
        position: static;
        width: 100%;
        margin-top: 40px;
        background: #fafafa;
        border-top: 1px solid #ddd;
        padding: 24px 0 8px;
    }

    .side-menu-group {
        margin-bottom: 24px;
    }

    /* Company Info Group（縦積みカード） */
    .side-menu-group:not(.side-menu-years) {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 0 16px;
    }

    .side-menu-group:not(.side-menu-years) li {
        /* border: none; */
        height: auto;
    }

    .side-menu-group:not(.side-menu-years) a {
        position: relative;
        display: flex;
        align-items: center;

        min-height: 56px;
        padding: 16px;

        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;

        background: #fff;
        border-radius: 12px;
        overflow: hidden;
    }

    .side-menu-group:not(.side-menu-years) a::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 30%;
        height: 100%;

        background:
            linear-gradient(
            to right,
            rgba(255,255,255,1) 0%,
            rgba(255,255,255,0.9) 15%, 
            rgba(255,255,255,0.5) 40%,
            rgba(255,255,255,0) 65%
            ),
            var(--menu-bg-image);

        background-size: cover;
        background-position: left center;
        pointer-events: none;
    }

    /*.side-menu-group li:nth-child(1) {
        --menu-bg-image: url();
    }

    .side-menu-group li:nth-child(2) {
        --menu-bg-image: url(http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/aiueok.jpg);
    }

    .side-menu-group li:nth-child(3) {
        --menu-bg-image: url(http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/05_02_役員紹介.jpeg);
    }

    .side-menu-group li:nth-child(4) {
        --menu-bg-image: url(http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/vol.36_キッズかごやまスクール_シャボン玉組2.jpg);
    }

    .side-menu-group li:nth-child(5) {
        --menu-bg-image: url(http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/vol.37_キッズかごやまスクール_シールアート.jpeg);
    }

    .side-menu-group li:nth-child(6) {
        --menu-bg-image: url(http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/vol.34_キッズうえだイベント_生物教室.jpg);
    }*/

    .side-menu-group:not(.side-menu-years) a:active::after {
        background-size: 110%;
    }

    /* 現在ページ強調 */
    .side-menu-group:not(.side-menu-years) li.is-current a {
        font-weight: 700;
    }

    .side-menu-group:not(.side-menu-years) li.is-current a::after {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .side-menu-years {
        display: none!important ;
    }
}

@media screen and (max-width: 765px) {
    /* レイアウトを縦並びにする（前提） */
    .main-and-side {
        flex-direction: column;
    }

    /* サイドメニュー本体 */
    .side-menu {
        position: static;
        width: 100%;
        min-width: auto;
        order: 3;
        margin-top: 40px;
    }

    /* メニューリスト全体（← side-menu-ul → side-menu-group に変更） */
    .side-menu-group {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
        margin: 0;
        list-style: none;

        /* 2カラム時の“カード間の隙間”を作るなら */
        gap: 12px 12px;
    }

    /* 各メニュー項目（2カラム） */
    .side-menu-group li {
        /* gapを使うので calc で2列を成立させる */
        border-bottom: none;   /* liの線はカードに任せる */
        height: auto;          /* aが56pxを持つので固定不要 */
    }

    .side-menu-group li:first-of-type {
        border-top: none;
    }

    /* リンク本体（カード） */
    .side-menu-group a {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 56px;
        padding: 16px;
        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;
        background: #fff;
        border-radius: 12px;
        overflow: hidden;

        /* クリック領域＆見た目の安定 */
        width: 100%;
    }

    /* 背景画像＋フェード（右側） */
    .side-menu-group a::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 30%;
        height: 100%;
        background:
        linear-gradient(
            to right,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.9) 15%,
            rgba(255, 255, 255, 0.5) 40%,
            rgba(255, 255, 255, 0) 65%
        ),
        var(--menu-bg-image);
        background-size: cover;
        background-position: left center;
        pointer-events: none;
    }

    /* タップ時演出 */
    .side-menu-group a:active::after {
        background-size: 110%;
    }

    /* 各項目ごとの背景画像指定（← side-menu-ul → side-menu-group に変更） */
    /*.side-menu-group li:nth-child(1) {
        --menu-bg-image: url();
    }

    .side-menu-group li:nth-child(2) {
        --menu-bg-image: url("http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/05_01_会社概要.jpg");
    }

    .side-menu-group li:nth-child(3) {
        --menu-bg-image: url("http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/05_02_役員紹介.jpeg");
    }

    .side-menu-group li:nth-child(4) {
        --menu-bg-image: url("http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/05_03_沿革.jpg");
    }

    .side-menu-group li:nth-child(5) {
        --menu-bg-image: url("http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/05_04_CSR.jpg");
    }

    .side-menu-group li:nth-child(6) {
        --menu-bg-image: url("http://tomoni-p.com.testrs.jp/20251202/wp-content/uploads/2025/12/05_05_福祉を見る.png");
    }*/

    .side-menu-group {
        gap: 0!important;
    }

    .side-menu-group a {
        border-radius: 0 !important;
    }
}

@media screen and (max-width: 768px) {
    .side-menu-group {
        margin-left: -16px !important;
        margin-right: -16px !important;
    }
}

/* Side Menu (Tablet & SP) 統一：カード2カラム */
@media screen and (max-width: 1024px) {
    /* サイドメニュー本体を下へ */
    .side-menu{
        position: static;
        width: 100%;
        min-width: auto;
        margin-top: 40px;
        padding: 30px 0 0;
        order: 2;
    }

    /* ul(=side-menu-group) を2カラムカードに */
    .side-menu-group{
        display: flex;
        flex-wrap: wrap;
        list-style: none;
        margin: 0;
        padding: 0;

        /* ←これが“カード感”の要 */
        gap: 12px;
    }

    .side-menu-group li{
        flex: 0 0 calc(50% - 6px); /* gap 12px の半分 */
        border: none;
        height: auto;
    }

    .side-menu-group a{
        position: relative;
        display: flex;
        align-items: center;
        min-height: 56px;
        padding: 16px;

        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;

        background: #fff;
        border-radius: 12px;   /* ←角丸を維持 */
        overflow: hidden;
        width: 100%;
    }

    /* 背景画像＋フェード（右側） */
    .side-menu-group a::after{
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 30%;
        height: 100%;
        background:
        linear-gradient(
            to right,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 0.9) 15%,
            rgba(255, 255, 255, 0.5) 40%,
            rgba(255, 255, 255, 0) 65%
        ),
        var(--menu-bg-image);
        background-size: cover;
        background-position: left center;
        pointer-events: none;
    }

    /* タップ時演出 */
    .side-menu-group a:active::after{
        background-size: 110%;
    }
}

/*  SPだけ：画面端まで伸ばす（余白の相殺） */
@media screen and (max-width: 768px){
    .side-menu-group{
        margin-left: -16px;
        margin-right: -16px;
    }
}

@media (max-width: 1024px){
    .side-menu-group{
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .side-menu-group li{
        flex: none;
        width: 100%;
    }
}

/*  Side Menuスクロール */
@media (min-width: 1025px){
    .side-menu{
        position: sticky;
        top: 90px;
    max-height: calc(100vh - 90px - 24px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .side-menu::after{
        content: "";
        display: block;
        height: 120px;
    }
}