/*
Theme Name: 240gk Theme
Author: Motoki
Description: WordPress Theme for 240gk Project
Version: 1.0.0
Text Domain: 240gk-theme
*/

:root {
    --primary-color: #fcbf49;
    --secondary-color: #00a1e4;
    --dark-color: #111;
    --text-color: #111;
    --bg-color: #fff;
    --max-width: 1140px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Noto Sans JP", sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.top-color-line {
    height: 10px;
    background: linear-gradient(
        to right,
        #00a8e8 0%,
        #00a8e8 24%,
        #84cc16 24%,
        #84cc16 48%,
        #f97316 48%,
        #f97316 72%,
        #7e22ce 72%,
        #7e22ce 100%
    );
}

.site-header {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 16px;
    min-height: 66px;
}

.site-branding a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1.45rem;
}

.site-branding img {
    max-height: 50px;
    width: auto;
}

.menu-toggle {
    display: none;
    border: 2px solid var(--dark-color);
    background: #fff;
    color: var(--dark-color);
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.main-navigation .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}

.main-navigation .menu-item > a,
.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    padding: 20px 12px;
    display: block;
    font-size: 0.9rem;
    line-height: 1.1;
    white-space: nowrap;
}

.main-navigation .home-link > a,
.main-navigation .menu > .current-menu-item:first-child > a {
    background-color: var(--primary-color);
    padding: 20px 16px;
}

.site-main {
    max-width: 100%;
    overflow-x: hidden;
}

.entry-header,
.entry-content > * {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.entry-title {
    margin: 2rem auto 1.2rem;
    padding: 0 16px;
    text-align: center;
}

.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.hero-image {
    margin-top: 0;
    margin-bottom: 0;
}

.buttons-section-wrapper,
.news-events-wrapper {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.buttons-section-wrapper {
    padding: 56px 16px;
    text-align: center;
}

.buttons-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.buttons-container img {
    border-radius: 12px;
    transition: transform 0.3s;
}

.buttons-container img:hover {
    transform: translateY(-5px);
}

.ec-feed-wrapper {
    padding: 60px 16px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.ec-feed-wrapper.alignfull {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.entry-content .ec-feed-wrapper > .wp-block-group__inner-container {
    width: min(100%, var(--max-width)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.entry-content .wp-block-group.alignfull.ec-feed-wrapper,
.entry-content .wp-block-cover.alignfull.news-events-wrapper,
.entry-content .wp-block-group.alignfull.news-events-wrapper {
    width: 100% !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.entry-content .ec-feed-wrapper .section-title,
.entry-content .ec-feed-wrapper .ec-grid,
.entry-content .news-events-wrapper .news-events-container,
.entry-content .news-events-wrapper .news-list {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Compatibility for actual imported markup:
   EC section is currently wrapped by .buttons-section-wrapper */
.entry-content .buttons-section-wrapper .wp-block-group.alignwide > .wp-block-group__inner-container,
.entry-content .buttons-section-wrapper .wp-block-group.alignwide .section-title,
.entry-content .buttons-section-wrapper .wp-block-group.alignwide .ec-grid {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.entry-content .ec-feed-wrapper.is-layout-constrained > .section-title,
.entry-content .ec-feed-wrapper.is-layout-constrained > .ec-grid,
.entry-content .ec-feed-wrapper .is-layout-constrained > .section-title,
.entry-content .ec-feed-wrapper .is-layout-constrained > .ec-grid,
.entry-content .news-events-container.is-layout-constrained > .section-title,
.entry-content .news-events-container.is-layout-constrained > .news-list {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.section-title {
    text-align: center;
    margin-bottom: 28px;
}

.section-title span {
    display: block;
    font-size: 0.84rem;
    font-weight: bold;
    line-height: 1.1;
}

.section-title h2 {
    font-size: 2rem;
    margin: 5px 0 0;
    line-height: 1.2;
}

.ec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.entry-content .ec-feed-wrapper .wp-block-columns.ec-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
    margin: 0 0 18px !important;
    max-width: 100% !important;
}

.entry-content .ec-feed-wrapper .wp-block-columns.ec-grid > .wp-block-column {
    flex-basis: auto !important;
    flex-grow: 0 !important;
    margin: 0 !important;
}

.ec-item {
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.ec-item-image {
    padding: 12px;
    background: #fff;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ec-item-info {
    padding: 10px 12px;
    border-top: 2px solid #222;
    font-weight: bold;
    font-size: 0.88rem;
    line-height: 1.3;
}

.ec-item-price {
    font-size: 1rem;
    margin-top: 4px;
}

.ec-item-button {
    margin: 0 12px 12px;
}

.ec-item-button .wp-element-button {
    background: #0f172a;
    color: #fff;
    text-align: center;
    padding: 7px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    display: block;
    width: 100%;
}

.news-events-wrapper {
    padding: 56px 16px 34px;
    position: relative;
}

.news-events-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.news-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.news-list > .wp-block-media-text,
.news-list > .alignwide {
    width: 100%;
    max-width: none;
    margin: 0;
}

.entry-content .news-events-wrapper .news-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* news-list has an inner-container wrapper in current HTML */
.entry-content .news-events-wrapper .news-list > .wp-block-group__inner-container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px 20px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.entry-content .news-events-wrapper .news-list > .wp-block-media-text,
.entry-content .news-events-wrapper .news-list > .alignwide {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.entry-content .news-events-wrapper .wp-block-cover__inner-container,
.entry-content .news-events-wrapper .news-events-container {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.entry-content .news-events-wrapper .news-events-container > .wp-block-group__inner-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Final hard override for Gutenberg constrained layout in News section */
.entry-content .news-events-wrapper .wp-block-group__inner-container {
    max-width: none !important;
}

.entry-content .news-events-wrapper .news-events-container,
.entry-content .news-events-wrapper .news-events-container > .wp-block-group__inner-container,
.entry-content .news-events-wrapper .news-list,
.entry-content .news-events-wrapper .news-list > .wp-block-group__inner-container {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.entry-content .news-events-wrapper .news-list > * {
    min-width: 0 !important;
}

.entry-content .news-events-wrapper .news-list .news-item {
    width: 100% !important;
    margin: 0 !important;
}

.entry-content .news-events-wrapper .news-list > .wp-block-group__inner-container > .news-item,
.entry-content .news-events-wrapper .news-list > .wp-block-group__inner-container > .wp-block-media-text {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    min-width: 0 !important;
}

.entry-content .news-events-wrapper .news-list .wp-block-media-text.alignwide {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.entry-content .news-events-wrapper .news-list .wp-block-media-text,
.entry-content .news-events-wrapper .news-list .wp-block-media-text.alignwide {
    display: grid !important;
    grid-template-columns: 120px minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
}

.entry-content .news-events-wrapper .news-list .wp-block-media-text__content {
    padding: 0 !important;
}

.news-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px;
    border-radius: 8px;
}

.news-item img {
    width: 136px;
    border-radius: 6px;
    object-fit: cover;
}

.news-item.wp-block-media-text {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: start;
}

.news-item .wp-block-media-text__content {
    padding: 0;
}

.news-item-content {
    flex: 1;
}

.news-item h3 {
    margin: 0 0 6px;
    font-size: 0.92rem;
    line-height: 1.4;
}

.news-item p {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #555;
}

.news-item-more {
    text-align: right;
    display: block;
    margin-top: 7px;
    font-weight: bold;
    font-size: 0.75rem;
    text-decoration: none;
    color: #111;
}

.site-footer {
    background: #111;
    color: #fff;
    padding: 34px 16px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 26px;
    align-items: start;
}

.footer-links .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-info p {
    margin: 0 0 8px;
    font-size: 0.84rem;
    color: #d4d4d4;
    line-height: 1.45;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-social a {
    color: #111;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    background: #fff;
}

@media (max-width: 1024px) {
    .main-navigation .menu-item > a,
    .main-navigation a {
        padding: 20px 8px;
        font-size: 0.82rem;
    }

    .ec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-content .ec-feed-wrapper .wp-block-columns.ec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-content .news-events-wrapper .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .entry-content .news-events-wrapper .news-list > .wp-block-group__inner-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-inner {
        min-height: 58px;
    }

    .menu-toggle {
        display: inline-block;
    }

    .main-navigation {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
        display: none;
    }

    .main-navigation.is-open {
        display: block;
    }

    .main-navigation .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .main-navigation .menu-item > a,
    .main-navigation a,
    .main-navigation .home-link > a {
        padding: 14px 16px;
        border-bottom: 1px solid #eee;
        background: transparent;
    }

    .main-navigation .home-link > a {
        background: #fff8e8;
    }

    .buttons-container {
        flex-direction: column;
    }

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

    .entry-content .ec-feed-wrapper .wp-block-columns.ec-grid {
        grid-template-columns: 1fr !important;
    }

    .entry-content .news-events-wrapper .wp-block-cover__inner-container,
    .entry-content .news-events-wrapper .news-events-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    .entry-content .news-events-wrapper .news-list > .wp-block-group__inner-container {
        grid-template-columns: 1fr !important;
    }

    .news-item {
        flex-direction: column;
    }

    .news-item img {
        width: 100%;
    }
}
