/*

このcssは長いです。セクションごとにcssが集まっているので
ctrl+F で検索しジャンプするのが便利です。

================================================================================
カスタムプロパティ宣言
================================================================================
*/
:root {
    /* カラーパレット */
    --color-primary: #F1404B;
    --color-secondary: #252C41;
    --color-white: #fff;
    --color-black: #000;
    --color-background-light: #fff9e6;
    --color-background-gray: #F4F5F9;
    --color-grid: #dddfe6;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-overlay: rgba(0, 0, 0, 0.3);
    
    /* スペーシング */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
    --spacing-xxl: 50px;
    
    /* 角 */
    --radius-sm: 10px;
    --radius-md: 20px;
    --radius-lg: 40px;
    --radius-xl: 80px;
    --radius-round: 50%;
    --radius-pill: 100px;
    
    /* 影 */
    --shadow-light: 0 -5px 20px var(--color-shadow);
    --shadow-medium: 4px 4px 0px 0px var(--color-primary);
    --shadow-dark: 4px 4px 0px 0px var(--color-overlay);
    --shadow-box: 5px 5px 5px rgba(0, 0, 0, 0.2);
    
    /* 文字サイズ */
    --font-size-xs: clamp(0.5rem, 0.833rem + 0.5vw, 1.5rem);
    --font-size-sm: clamp(1rem, 0.506rem + 0.6vw, 1.5rem);
    --font-size-md: clamp(1rem, 2vw, 1.8rem);
    --font-size-lg: clamp(2.5rem, 5vw, 5rem);
    --font-size-xl: clamp(24px, calc(10px + 5vw), 80px);
    
    /* レイアウト */
    --hero-step: 300px;
}

/*
================================================================================
共通スタイル
================================================================================
*/

body {
    font-family: 'Noto Sans JP', sans-serif;
}

main > section {
    display: flow-root;
}

.plaid-background {
    background-color: var(--color-background-light);
    background-image: 
        linear-gradient(var(--color-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
    background-size: 1rem 1rem;
    background-position: center;
    box-shadow: var(--shadow-light);
}

.title {
    margin: var(--spacing-xl) var(--spacing-xl) var(--spacing-sm);
    font-size: var(--font-size-lg);
    color: var(--color-secondary);
}

.caption {
    background-color: var(--color-primary);
    font-size: var(--font-size-md);
    color: var(--color-white);
    margin: var(--spacing-lg) var(--spacing-lg) 0 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    display: inline-block;
    width: fit-content;
    position: relative;
    transform: translateX(70px);
}

.caption::before {
    content: '';
    position: absolute;
    left: -50px;
    top: 50%;
    width: var(--spacing-xl);
    height: 1.9px;
    background-color: var(--color-black);
}

.caption::after {
    content: attr(data-text);
    display: block;
    transform: translateX(var(--spacing-xs));
}

/* アニメーションの初期状態 */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 画面に入ったら付与されるクラス */
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

body.is-modal-open {
    overflow: hidden;
}

/*
================================================================================
ヒーローセクション
================================================================================
*/
#hero {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
}

.hero-progress-container {
    position: relative;
    width: 100%;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.progress-separator {
    position: absolute;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--color-white);
    z-index: 1;
    transform: translateX(-50%);
}

.hero-progress-bar {
    width: 0%;
    height: 3px;
    background-color: var(--color-primary);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--hero-step);
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: -1;
}

.hero-background.active {
    opacity: 1;
}

.hero-background,
.hero-content {
    height: var(--hero-step);
}

/* 高さの計算 */
@media (min-height: 440px) { #hero { --hero-step: 400px; } }
@media (min-height: 540px) { #hero { --hero-step: 500px; } }
@media (min-height: 640px) { #hero { --hero-step: 600px; } }
@media (min-height: 740px) { #hero { --hero-step: 700px; } }
@media (min-height: 840px) { #hero { --hero-step: 800px; } }
@media (min-height: 940px) { #hero { --hero-step: 900px; } }

/* PC向けスタイル */
@media (min-width: 768px) {
    .hero-content { 
        height: calc(var(--hero-step) + var(--spacing-xl)); 
    }
    
    .hero-background {
        top: var(--spacing-xl);
        right: 60px;
        bottom: var(--spacing-xl);
        left: 200px;
        width: auto;
        border-radius: var(--radius-xl);
        box-shadow:
            0 1.9px 2.5px rgba(0, 0, 0, 0.057),
            0 5px 6.1px rgba(0, 0, 0, 0.076),
            0 10.1px 11.4px rgba(0, 0, 0, 0.086),
            0 19.2px 19.8px rgba(0, 0, 0, 0.092),
            0 38.4px 34.8px rgba(0, 0, 0, 0.1),
            0 101px 74px rgba(0, 0, 0, 0.13);
    }

    .hero-background::before {
        border-radius: var(--radius-xl);
    }
}

/* スマホ用白色オーバーレイ */
@media (width < 768px) {
    .hero-white {
        position: absolute;
        height: var(--hero-step);
        width: 50%;
        background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
        z-index: -1;
    }
}

/*　ヘッダー　左上のタイトル */
.heading-title {
    position: absolute;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    z-index: 1;
    gap: 0;
    margin: var(--spacing-md);
}

.heading-title img {
    height: auto;
    max-height: var(--hero-step);
    max-width: 200px;
}

.heading-title img:first-child {
    top: var(--spacing-md);
    left: var(--spacing-sm);
}

.heading-title img:last-child {
    transform: scale(0.4) translateX(-50%);
    transform-origin: top left;
}

@media (width < 768px) {
    .heading-title {
        transform: scale(0.85);
        transform-origin: top left;
        margin: var(--spacing-xs);
    }
}

/* hero-content(文字ラベル、スマホ表示) */
.hero-content {
    flex-grow: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 1;
    padding: var(--spacing-md);
    box-sizing: border-box;
}

.heading-text {
    text-align: right;
}

.tag {
    display: inline-block;
    font-size: 1rem;
    font-weight: 300;
    color: var(--color-white);
    background-color: var(--color-primary);
    padding: 2px var(--spacing-xs);
    margin-bottom: 8px;
}

.heading-text h1 {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 3.5rem;
    font-weight: 470;
    margin: 0;
    color: var(--color-primary);
}

.heading-text h1 span {
    background-color: var(--color-white);
    padding: 6px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.heading-text h1 span:first-child {
    margin-bottom: 8px;
}

.below-container {
    display: grid;
    grid-template-columns: auto;
    justify-items: end;
    margin: var(--spacing-xs);
    margin-bottom: 35px;
}

.below-tag {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: 35px var(--spacing-sm) 0;
    font-size: 1.3em;
    justify-self: end;
}

.below-text {
    color: var(--color-primary);
    font-size: 16px;
    font-weight: bold;
    justify-self: end;
    text-align: right;
    margin-right: var(--spacing-md);
}

.below-text:last-child {
    font-weight: 500;
}

.pc-text {
    display: none;
}

@media (min-width: 768px) {
    .hero-content {
        padding-top: var(--spacing-xl);
        padding-bottom: 4px;
    }
    
    .tag {
        font-size: 1.3rem;
    }
    
    .heading-text h1 {
        flex-direction: row;
        gap: var(--spacing-sm);
        background-color: var(--color-white);
        font-size: clamp(2rem, 5vw, 7rem);
        width: fit-content;
        margin-left: auto;
    }
    
    .heading-text h1 span:first-child {
        margin-bottom: 0;
    }
    
    .below-tag,
    .below-text {
        display: none;
    }

    .pc-text {
        display: block;
        font-size: clamp(14px, 2vw, 26px);
        color: var(--color-primary);
        font-weight: bold;
        background-color: var(--color-white);
        padding: 4px 8px;
        width: fit-content;
        margin-left: auto;
        margin-top: var(--spacing-xs);
    }
    
    .hero-until h2 {
        font-size: 2rem;
    }
    
    .hero-until h2 span {
        font-size: 2.5rem;
    }
}

/* カウントダウン */
.hero-until {
    text-align: center;
    position: relative;
    padding: 1em var(--spacing-md);
    margin: 0 var(--spacing-md);
}

.hero-until::before,
.hero-until::after {
    content: '';
    width: var(--spacing-xl);
    height: var(--spacing-xl);
    position: absolute;
    display: inline-block;
}

.hero-until::before {
    border-left: solid 1px var(--color-secondary);
    border-top: solid 1px var(--color-secondary);
    top: 0;
    left: 0;
}

.hero-until::after {
    border-right: solid 1px var(--color-secondary);
    border-bottom: solid 1px var(--color-secondary);
    bottom: 0;
    right: 0;
}

.hero-until p {
    font-size: clamp(14px, 2vw, 26px);
    color: var(--color-secondary);
    margin: 0 0 var(--spacing-sm);
    font-weight: bold;
}

.hero-until p span {
    color: var(--color-primary);
}

.hero-until h2 {
    font-size: var(--font-size-xl);
    color: var(--color-secondary);
    margin: 0;
}

.hero-until h2 span {
    color: var(--color-primary);
    font-weight: bold;
    font-size: clamp(24px, calc(10px + 5vw), 100px);
    background: linear-gradient(transparent 60%, yellow 30%);
    display: inline-block;
}

#hero .hero-line {
    width: 1px;
    height: var(--spacing-lg);
    background-color: var(--color-secondary);
    margin: 0 auto var(--spacing-xl) auto;
}


/*
================================================================================
メニューセクション
================================================================================
*/
#menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr;
    box-sizing: border-box;
    height: 100%;
}

#menu > .title {
    grid-column: 1 / 2;
    grid-row: 1;
    align-self: start;
}

#menu > .caption {
    grid-column: 1 / 2;
    grid-row: 2;
    margin: var(--spacing-sm) 0;
    align-self: start;
}

#menu > .left {
    grid-column: 1 / 2;
    grid-row: 3;
    padding: var(--spacing-md) var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    box-sizing: border-box;
    align-self: stretch;
    overflow-y: auto;
    max-height: 100%;
    justify-self: end;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.top-wrapper {
    display: grid;
    /* grid-template-rows: auto auto 1fr; */
    grid-template-rows: auto auto auto 1fr;
    height: 100%;
}

.top-wrapper .check-stickers:nth-child(1) {
    grid-row: 1;
}

.top-wrapper .check-stickers:nth-child(2) {
    grid-row: 2;
}

.top-wrapper .check-stickers:nth-child(3) {
    grid-row: 3;
    align-self: start;
    display: flex;
    flex-direction: column;
}

.top-wrapper .check-stickers:nth-child(4) {
    grid-row: 4;
    align-self: start;
    display: flex;
    flex-direction: column;
}

#menu > .right {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) var(--spacing-sm);
    box-sizing: border-box;
    align-self: stretch;
    width: 100%;
    margin-top: var(--spacing-sm);
    justify-self: start;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    #menu > .left,
    #menu > .right {
        width: 80%;
    }
}

@media (min-width: 768px) and (max-width: 1250px) {
    #menu > .left,
    #menu > .right {
        width: 90%;
    }
}

/* スマホ幅（865px以下）は縦並び */
@media (max-width: 865px) {
    #menu {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }
    
    #menu > .title {
        grid-column: 1;
        grid-row: 1;
    }
    
    #menu > .caption {
        grid-column: 1;
        grid-row: 2;
    }
    
    #menu > .left {
        grid-column: 1;
        grid-row: 3;
        padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
        justify-self: center;
    }
    
    #menu > .right {
        grid-column: 1;
        grid-row: 4;
        padding: var(--spacing-sm) var(--spacing-md) var(--spacing-xxl);
        margin-bottom: 0;
        justify-self: center;
    }
}

.right > nav,
.check-stickers {
    background-color: var(--color-white);
    border: solid 2px var(--color-secondary);
    box-shadow: var(--shadow-medium);
}

.right > nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.right,
.left {
    margin-bottom: var(--spacing-lg);
}

.check-stickers {
    margin: var(--spacing-md) 0;
}

.left button {
    padding: 0;
    width: 100%;
    text-align: left;
}

.check-stickers {
    position: relative;
    display: block;
    text-decoration: none;
    color: var(--color-black);
    transition: transform 0.2s ease;
}

.check-stickers:first-child {
    margin-top: 0;
}

.check-stickers:last-child {
    margin-bottom: 0;
}

.check-stickers:hover {
    transform: scale(1.02);
}

.check-stickers::after {
    content: "CHECK !!";
    position: absolute;
    top: -15px;
    left: var(--spacing-sm);
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 4px 15px;
}

.check-stickers > h2 {
    line-height: 1;
    display: inline-block;
    font-size: var(--font-size-md);
    margin: var(--spacing-md) 0;
}

.check-stickers > h2 img {
    display: inline-block;
    width: var(--spacing-lg);
    height: var(--spacing-lg);
    margin: 0 var(--spacing-md);
    vertical-align: middle;
}

.check-stickers p {
    margin: var(--spacing-sm);
    text-decoration: solid underline var(--color-primary) 4px;
    text-align: right;
}

@media (min-width: 1250px), (min-width: 510px) and (max-width: 865px) {
    .check-stickers:nth-child(1), .check-stickers:nth-child(2) {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .check-stickers p {
        margin: 0 var(--spacing-md) 0 0;
    }

    .check-stickers > h2 {
        margin: var(--spacing-md) 0;
    }
}

.check-stickers > img {
    justify-self: center;
}

/* 右側のセクション */
.right > nav > ul {
    list-style-type: none;
    padding: 0;
    margin: var(--spacing-md);
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr 1fr;
    flex: 1;
    align-content: start;
    justify-content: center;
    vertical-align: middle;
}

@media (min-width: 1400px) {
    .right > nav {
        place-items: center;
    }

    .right > nav > ul {
        width: 80%;
        gap: var(--spacing-lg);
        margin: var(--spacing-lg) var(--spacing-md);
    }
}

.right > nav ul li > a {
    display: block;
    text-decoration: none;
    color: var(--color-white);
    border-radius: var(--radius-md) 0 var(--radius-md) 0;
    border: solid 1px var(--color-black);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-dark);
    min-height: 150px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: clamp(150px, 15vw, 300px);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

/* 統一されたオーバーレイを疑似要素で作成 */
.right > nav ul li > a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
}

.right > nav ul li > a:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-medium);
    filter: brightness(1.1);
}

/* ホバー時はオーバーレイを薄く */
.right > nav ul li > a:hover::before {
    background-color: rgba(0, 0, 0, 0.2);
}

/* タイムテーブル */
.right > nav li:first-child {
    grid-column: 1 / 3;
}

.right > nav .box-time-table {
    background-image: url("../img/top/time_table.jpg");
}

.right > nav .box-time-table .icon {
    background-color: var(--color-primary);
    background-image: url('../img/top/icon_svg/icon_time_w.svg');
}

.right > nav > ul li:nth-child(2),
.right > nav > ul li:nth-child(3) {
    display: contents;
}

/* 企画検索 */
.right > nav li:nth-child(2) a:first-of-type {
    background-image: url("../img/top/kikaku_search.png");
}

.right > nav li:nth-child(2) a:first-of-type .icon {
    background-color: var(--color-primary);
    background-image: url('../img/top/icon_svg/icon_search_w.svg');
}

/* キャンパスマップ */
.right > nav li:nth-child(2) a:last-of-type {
    background-image: url("../img/top/campus_map.png");
}

.right > nav li:nth-child(2) a:last-of-type .icon {
    background-color: var(--color-primary);
    background-image: url('../img/top/icon_svg/icon_map_w.svg');
}

/* 高専祭について */
.right > nav li:nth-child(3) a:first-of-type {
    background-image: url("../img/top/hero.png");
}

.right > nav li:nth-child(3) a:first-of-type .icon {
    background-color: var(--color-primary);
    background-image: url('../img/top/icon_svg/icon_info_w.svg');
}

/* よくある質問 */
.right > nav li:nth-child(3) a:last-of-type {
    background-image: url("../img/top/question.png");
}

.right > nav li:nth-child(3) a:last-of-type .icon {
    background-color: var(--color-primary);
    background-image: url('../img/top/icon_svg/icon_help_w.svg');
}

.right > nav a .icon {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--spacing-xxl);
    height: var(--spacing-xxl);
    border-radius: 0 0 var(--radius-md) 0;
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
}

.right > nav a > .board-title,
.right > nav a > .subtitle {
    position: absolute;
    width: 100%;
    left: 0;
    color: var(--color-white);
    z-index: 2;
}

.right > nav a > .board-title {
    font-size: clamp(16px, 2.5vw, 30px);
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70%;
    line-height: 1.3;
}

.right > nav a > .subtitle {
    font-size: clamp(12px, 2vw, 20px);
    font-weight: 500;
    text-align: center;
    bottom: 15px;
}

.right > nav a > .subtitle span {
    color: var(--color-primary);
}

/* 最新情報はこちら */
.right > nav li.box-info {
    grid-column: 1 / 3;
    height: 130px;
    width: 95%;
    place-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px var(--spacing-md);
    min-height: 120px;
    border: 2px solid var(--color-black);
    border-radius: var(--radius-md) 0 var(--radius-md) 0;
    box-shadow: var(--shadow-dark);
    gap: var(--spacing-md);
    position: relative;
}

.right > nav li.box-info .text {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-primary);
    text-align: center;
    flex-shrink: 0;
}

.right > nav li.box-info .divider {
    width: 3px;
    background-color: var(--color-grid);
    height: 80px;
    flex-shrink: 0;
}

.right > nav li.box-info .social-icons {
    display: flex;
    align-self: center;
    flex-grow: 1;
    flex-shrink: 0;
    justify-content: space-around;
}

.right > nav li.box-info .social-icon {
    width: var(--spacing-xxl);
    height: var(--spacing-xxl);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

@media (max-width: 500px) {
    .right > nav li.box-info .social-icon {
        width: var(--spacing-lg);
        height: var(--spacing-lg);
    }
}

.right > nav li.box-info .social-icon:hover {
    transform: scale(1.1);
}

.right > nav li.box-info .social-icon.x {
    background-image: url('../img/top/icon_svg/icon_twitter_b.svg');
}

.right > nav li.box-info .social-icon.instagram {
    background-image: url('../img/top/icon_svg/icon_instagram_b.svg');
}


/*
================================================================================
アバウトセクション
================================================================================
*/
#about {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), 
        url("../img/top/about_classRoom.png");
    background-size: cover;
    background-position: center;
    position: relative;
}

.about-img-62nd {
    width: 50%;
    display: block;
    object-fit: scale-down;
    position: absolute;
}

.about-img-tani-1 {
    width: 100%;
    max-width: 1000px;
    display: none;
    margin: 0 auto;
    position: relative;
}

.about-img-tani-2 {
    width: 90%;
    margin: 0 auto;
    margin-top: var(--spacing-xl);
}

.fes-description {
    width: 85%;
    margin: 0 auto;
    top: 0;
    line-height: 1.6;
    font-size: var(--font-size-sm);
}

@media (min-width: 768px) {
    .about-img-62nd {
        width: clamp(280px, 40vw, 400px);
        position: absolute;
        left: 50%;
        top: 80px;
        transform: translateX(-50%);
        margin: 0;
        translate: 0 50%;
    }

    .about-img-tani-1 {
        display: block;
    }

    .about-img-tani-2 {
        display: none;
    }

    .fes-description {
        width: 80%;
        line-height: 2.5;
    }
}

@media (min-width: 1200px) {
    .fes-description {
        width: 60%;
    }
}

#about .buttons {
    display: flex;
    justify-content: center;
    gap: clamp(0.2rem, 0.4rem + 1vw, 1.875rem);
    margin-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

#about .buttons a {
    display: inline-block;
    padding: var(--spacing-sm) 24px;
    border-radius: var(--radius-pill);
    background-color: var(--color-white);
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: bold;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s;
}

#about .buttons a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    transform: translateX(-101%);
    transition: transform 0.3s ease-in-out;
    z-index: -1;
}

#about .buttons a:hover {
    color: var(--color-white);
}

#about .buttons a:hover::before {
    transform: translateX(0);
}

#about .buttons a:hover .arrow,
#about .buttons a:hover .arrow::before {
    background-color: var(--color-white);
}

#about .buttons a .arrow {
    position: relative;
    display: inline-block;
    width: var(--spacing-lg);
    height: 2.4px;
    margin-left: 8px;
    border-radius: 9px;
    background-color: var(--color-primary);
    transition: background-color 0.3s;
    vertical-align: middle;
}

#about .buttons a .arrow::before {
    content: "";
    position: absolute;
    top: calc(50% - 2px);
    right: 0;
    width: 15px;
    height: 3px;
    border-radius: 9px;
    background-color: var(--color-primary);
    transform: rotate(45deg);
    transform-origin: calc(100% - 2px) 50%;
    transition: background-color 0.3s;
}

/* iPhone SE Galaxy Z Fold 用画面 */
@media (max-width: 376px) {
    #about .buttons .arrow,
    #about .buttons::before {
        visibility: hidden;
    }

    #about .buttons a {
        height: 45px;
        width: 175px;
    }

    #about .buttons a:last-child {
        width: 146px;
    }
}

/*
================================================================================
ニュースセクション
================================================================================
*/
#news {
    position: relative;
    height: 1000px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr;
    box-sizing: border-box;
    height: 100%;
}

.news-headings div {
    grid-column: 1 / 2;
    grid-row: 3;
    margin: var(--spacing-sm) auto;
    width: 80%;
    height: 330px;
}

.news-headings p {
    text-align: center;
}

@media (max-width: 768px) {
    .news-headings div {
        display: none;
    }
}

.news-area {
    width: 90%;
    margin: var(--spacing-xxl) auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-secondary);
    min-height: 500px;
    box-shadow: var(--shadow-box);
    display: grid;
    grid-template-columns: 23% auto 1fr;
    grid-template-rows: auto 1fr;
    padding: 1em;
    gap: 1em 0;
    position: relative;
}

.news-area > h3 {
    text-align: center;
    color: var(--color-secondary);
    font-weight: 400;
    font-size: clamp(1.3rem, 0.377rem + 1.299vw, 2rem);
    margin: var(--spacing-sm);
}

.news-area > h3:nth-of-type(1) { 
    grid-area: 1 / 1 / 2 / 2; 
}

.news-area > h3:nth-of-type(2) { 
    grid-area: 1 / 2 / 2 / 4; 
}

.news-list-wrapper {
    grid-area: 2 / 1 / 3 / 4;
    max-height: 400px;
    overflow-y: auto;
}

.news-list-wrapper::-webkit-scrollbar {
    width: var(--spacing-sm);
}

.news-list-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--color-overlay);
    border-radius: 99px;
}

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

.news-list-combined > li {
    display: grid;
    grid-template-columns: minmax(100px, 20%) auto 1fr;
    gap: 1em;
    padding: 0 0.5em;
    align-items: center;
}

.news-list-combined > li:last-child {
    border-bottom: none;
}

.category-item {
    display: inline-grid;
    outline: 1.5px solid var(--color-black);
    background-color: transparent;
    color: var(--color-white);
    padding: 0.5em;
    border-radius: var(--radius-md);
    text-align: center;
    justify-self: center;
    font-weight: 400;
    width: 80%;
    min-width: 108px;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 -2px 0 var(--color-black);
}

.category-item::after {
    content: "";
    background-color: #f99799;
    outline: 1.5px solid #f99799;
    width: 100%;
    z-index: -1;
    position: absolute;
    height: 100%;
    top: var(--spacing-xs);
    left: var(--spacing-xs);
    border-radius: var(--radius-md);
    transition: 0.2s all;
}

.category-item::before {
    content: "";
    background-color: var(--color-white);
    width: 100%;
    z-index: -2;
    position: absolute;
    height: 100%;
    border-radius: var(--radius-md);
}

.category-item > span {
    background-color: var(--color-black);
    width: 15px;
    height: 0.5px;
    position: absolute;
    bottom: var(--spacing-xs);
    right: -5px;
    transform: rotate(45deg);
}

#news .bar {
    grid-column: 2 / 3;
    background-color: var(--color-black);
    width: 2px;
    height: 100%;
}

.content-item {
    grid-column: 3 / 4;
    text-align: left;
    border-bottom: double 6px var(--color-secondary);
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    gap: 0.2em;
    min-width: 0;
    align-items: center;
}

.category-item:hover,
.content-item .text:hover,
.content-item img:hover {
    cursor: pointer;
}

.content-item .date {
    grid-area: 1 / 1 / 2 / 3;
    margin: 0;
    color: var(--color-secondary);
    font-size: 0.8em;
    margin-bottom: 0;
    align-self: end;
    margin-top: 16px;
}

.content-item .text {
    color: var(--color-secondary);
    grid-area: 2 / 2 / 3 / 3;
    font-size: 1.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    min-width: 0;
}

.content-item > img {
    width: var(--spacing-xl);
    grid-area: 2 / 1 / 3 / 2;
    justify-content: center;
}

.content-item .text {
    transition: color 0.2s, text-shadow 0.2s;
}

.category-item:hover::after {
    top: 3px;
    left: 3px;
}

.content-item .text:hover {
    color: var(--color-primary);
    text-shadow: 0 0 10px var(--color-white);
}

.content-item img {
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-item img:hover {
    transform: scale(1.12) rotate(-6deg);
}

@media (max-width: 768px) {
    #news {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    .news-area {
        margin-top: var(--spacing-xl);
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        width: 95%;
    }

    .news-area > h3 {
        display: none;
    }

    .news-list-wrapper {
        max-height: 450px;
        translate: 0 -10px;
    }

    .news-list-combined > li {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        margin: 25px 0 var(--spacing-sm);
        align-items: center;
    }

    #news .content-item {
        display: contents;
    }

    #news .category-item {
        grid-area: 1 / 1 / 2 / 2;
    }

    #news .bar {
        display: none;
    }

    #news .date {
        grid-area: 1 / 2 / 2 / 3;
        align-self: center;
        margin-top: 0;
    }

    .content-item > img {
        translate: 0 -8px;
    }

    .content-item .text {
        grid-area: 2 / 1 / 3 / 3;
        padding-left: var(--spacing-xxl);
        border-bottom: double 6px var(--color-secondary);
        padding-bottom: 15px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--color-white);
    padding: 2em 2.5em 2em 2em;
    border-radius: 5px;
    width: 90%;
    max-width: 1000px;
    box-shadow: var(--shadow-box);
    position: relative;
    overflow-y: auto;
    max-height: 80vh;
}

.modal-content::-webkit-scrollbar {
    width: var(--spacing-sm);
    height: 80%;
    vertical-align: middle;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-overlay);
    border-radius: var(--radius-pill);
    height: 80%;
    vertical-align: middle;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-secondary);
    transition: 0.1s all;
}

.close-btn:hover {
    transform: scale(1.1);
    color: var(--color-primary)
}

#modal-title {
    margin-top: 0;
    color: var(--color-black);
    font-size: 1.4rem;
    font-weight: bold;
}

#modal-category {
    font-size: 1rem;
    color: var(--color-secondary);
    margin: 0.5em 0;
}

#modal-date {
    font-size: 0.9rem;
    color: var(--color-secondary);
    text-align: right;
    margin-bottom: 1em;
}

#modal-body {
    font-size: 1rem;
    color: var(--color-black);
    line-height: 1.5;
}

#modal-body pre {
    background-color: #aaa;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--color-black);
    padding: 5px;
}

/*
================================================================================
SNSセクション
================================================================================
*/
#sns {
    position: relative;
    background-color: var(--color-background-gray);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr;
}

.sns-headings {
    grid-area: 1 / 1 / 2 / 3;
}

#sns .left {
    grid-area: 2 / 1 / 3 / 2;
    margin: 0;
    align-self: center;
}

#sns .left .dialogue-container {
    position: relative;
}

#sns .left .dialogue-container img {
    width: 80%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: var(--spacing-lg) auto 0;
}

#sns .left .dialogue-container p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.3rem);
}

#sns .left .sns-icons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 70%;
    margin: var(--spacing-xxl) auto var(--spacing-lg) auto;
    gap: var(--spacing-md);
}

#sns .left .sns-icons a:hover {
    transform: translateY(-5px) scale(1.1);
}

#sns .left .sns-icons a {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 80px;
    height: 80px;
    background-color: var(--color-white);
    border-radius: var(--radius-round);
    border: 2px solid var(--color-black);
    transition: 0.2s ease;
}

#sns .left .sns-icons img {
    width: 40%;
}

#sns .x-embedded {
    grid-area: 2 / 2 / 3 / 3;
    justify-self: center;
    align-self: center;
    width: 95%;
    max-width: 420px;
    margin: var(--spacing-lg) 0;
    border-radius: 12px;
    padding: 2px;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 768px) {
    #sns {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        border-radius: 0 120px 0 0;
    }

    .sns-headings {
        grid-area: 1 / 1 / 2 / 2;
    }

    #sns .left {
        grid-area: 2 / 1 / 3 / 2;
    }

    #sns .x-embedded {
        grid-area: 3 / 1 / 4 / 2;  /* スマホでの配置 */
        justify-self: center;
        width: 90%; /* スマホでは画面幅の90%に */
        margin: var(--spacing-lg) auto;
    }
}

/*
================================================================================
スポンサーシップセクション
================================================================================
*/
#sponsorship {
    box-shadow: none;
    padding-bottom: var(--spacing-lg);
}

#sponsorship .sponsorship-description {
    margin: var(--spacing-md);
    font-size: var(--font-size-sm);
}

#sponsorship .plaid-background {
    height: 100%;
}

.sponsorship-content {
    justify-content: center;
    align-items: flex-start;
    gap: var(--spacing-xl);
    margin: var(--spacing-xl) auto 0;
    width: 70%;
}

@media (max-width: 768px) {
    .sponsorship-content {
        width: 90%;
        gap: var(--spacing-lg);
    }
}
.column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.card {
    padding: var(--spacing-sm);
    text-align: center;
    margin: 0 auto;
    margin-bottom: var(--spacing-xl);
    text-decoration: none;
    color: var(--color-black);
}

/* グループ見出し */
.sponsor-rank {
    margin: 1rem 0;
    color: var(--color-secondary);
    text-align: center;
}

/* グループ内カードを横並び（折り返しあり） */
.sponsor-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

/* カード幅：列内で横並びする */
.sponsor-cards a.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: calc(50% - 0.5rem);
    box-sizing: border-box;
    margin: auto;
}

.card img {
    background: var(--color-white);
    border: 1px solid var(--color-secondary);
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
    margin: 0 auto;
}


.card p {
    margin: 0 auto;
    font-size: var(--font-size-sm);
}

/* グループごとの調整 */
.sponsor-group.sponsor-pr {
    margin: auto;
}
.sponsor-group.sponsor-pr .sponsor-cards {
    display: inline-block;
}
.sponsor-group.sponsor-pr .sponsor-cards a.card {
    width: 100%;
}
.sponsor-group.sponsor-pr img {
    max-width: 500px;
    width: 100%;
}
.sponsor-group.sponsor-sl img {
    max-height: 70px;
    max-width: 90%;
}

/*
================================================================================
フッターセクション
================================================================================
*/
#footer {
    background-size: cover;
    background-position: center;
    max-height: 70%;
    width: 100%;
    background-image:
        linear-gradient(var(--color-overlay), var(--color-overlay)),
        url("../img/top/sns.png");
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl) var(--spacing-md);
    box-sizing: border-box;
    overflow: hidden;
}

#footer img[alt*="KCCT Fes"],
#footer img[alt*="単位より"] {
    margin-bottom: var(--spacing-md);
    width: 30%;
}

#footer img[alt*="単位より"] {
    width: 60%;
}

.footer-icons {
    display: flex;
    gap: var(--spacing-xxl);
    align-items: center;
}

.footer-icons img {
    height: var(--spacing-lg);
    width: auto;
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
    transition: transform 0.2s ease;
}

.footer-icons img:hover {
    transform: scale(1.1);
}

@media (max-width: 376px) {
    .footer-icons img {
        height: var(--spacing-xl);
    }

    #footer img[alt*="KCCT Fes"] {
        width: 60%;
    }

    #footer img[alt*="単位より"] {
        width: 90%;
    }
}

@media (min-width: 1250px) {
    .footer-icons img {
        height: 45px;
    }

    #footer img[alt*="KCCT Fes"] {
        width: 20%;
    }

    #footer img[alt*="単位より"] {
        width: 40%;
    }
}