/**
 * Factory Page Styles - 工場案内ページ
 */

/* ヒーローセクション */
.factory-hero {
    position: relative;
    height: 289px;
    background-image: url('../../images/factory-hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(35, 35, 35, 0.3);
    z-index: 1;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hero-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 39.317px;
    height: 31.899px;
}

.logo-text {
    width: 172.075px;
    height: 20.345px;
}

.hero-nav .nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-nav .nav-menu a {
    color: white;
    text-decoration: none;
    font-family: 'Toppan Bunkyu Mincho', 'Yu Kyokasho', serif;
    font-size: 15px;
    padding: 15px 25px;
    display: block;
    text-align: center;
    width: 154px;
    transition: background-color 0.3s;
}

.hero-nav .nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hero-nav .nav-menu .contact-btn {
    border: 0.5px solid white;
    width: 137px;
}



/* 工場所在地マップセクション */
.factory-map-section {
    padding: 80px 0;
}

.kanto-map {
    position: relative;
    width: 100%;
    height: auto;
    background: #e6edf3;
    border-radius: 8px;
    padding: 20px;
}

.kanto-map img {
    width: 100%;
    height: auto;
    display: block;
}

/* 工場プロット */
.factory-plots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 工場プロットの線SVG */
.factory-plot-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* 工場プロット地点 */
.factory-plot {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: all;
    z-index: 10;
}

/* 各工場プロットの位置 */
.factory-plot.shiki-plot {
    top: 62%;
    left: 66%;
}

.factory-plot.asaka-plot {
    top: 62.5%;
    left: 66.5%;
}

.factory-plot.tochigi-plot {
    top: 51%;
    left: 67%;
}

.plot-dot {
    display: block;
    width: 10px;
    height: 10px;
    background: #21759b;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: absolute;
    top: -5px;
    left: -5px;
}

.plot-label {
    position: absolute;
    background: #fff;
    color: #21759b;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-15px);
    white-space: nowrap;
    pointer-events: auto;
    z-index: 100;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.plot-label:hover,
.plot-label:focus {
    background: #21759b;
    color: #fff;
}

.plot-label.shiki-label {
    top: 51%;
    left: 84%;
}

.plot-label.asaka-label {
    top: 62.5%;
    left: 84%;
}

.plot-label.tochigi-label {
    top: 40%;
    right: 60%;
}

/* 工場セクション共通 */
.factory-section {
    padding: 60px 0;
}

/* 工場コンテンツ共通レイアウト */
.factory-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 100px;
    row-gap: 50px;
}

.factory-content.reverse {
    grid-template-areas: reverse;
    grid-template-columns: 1fr 2fr;
}

.factory-item {
    position: relative;
    flex-shrink: 0;
}

.factory-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 5/3;
    object-fit: cover;
    display: block;
}

.factory-item iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 5/3;
}

.factory-title {
    position: relative;
    display: inline-block;
    font-family: 'Toppan Bunkyu Midashi Mincho', 'Yu Kyokasho', serif;
    font-size: 24px;
    font-weight: 800;
    color: black;
    text-shadow: 2px 2px 2px white;
    padding: 0 10px;
    margin: 0 0 24px 0;
    line-height: 1.2;
}

.factory-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: #21A0DB;
    z-index: -1;
}

.factory-title span {
    font-size: 16px;
}

.factory-address {
    padding-left: 15px;
}

.factory-address p {
    font-family: 'Toppan Bunkyu Mincho', 'Yu Kyokasho', serif;
    font-size: 18px;
    line-height: 1.5;
    color: black;
    margin: 0;
}

.factory-products {
    padding-left: 15px;
    margin-bottom: 40px;
}

.factory-products h3 {
    font-family: 'Toppan Bunkyu Midashi Mincho', 'Yu Kyokasho', serif;
    font-size: 24px;
    font-weight: 800;
    color: black;
    margin: 0 0 20px 0;
}

.factory-products p {
    font-family: 'Toppan Bunkyu Mincho', 'Yu Kyokasho', serif;
    font-size: 18px;
    line-height: 1.5;
    color: black;
    margin: 0;
}

.factory-details {
    margin-top: 60px;
}

.details-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Toppan Bunkyu Mincho', 'Yu Kyokasho', serif;
    font-size: 18px;
    color: #232323;
    text-decoration: none;
    transition: opacity 0.3s;
}

/* 設備詳細ボタンの目立つスタイル */
.btn-equipment {
    background: linear-gradient(135deg, #21A0DB 0%, #1e90da 100%);
    color: white !important;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(33, 160, 219, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-equipment:hover {
    background: linear-gradient(135deg, #1e90da 0%, #1976d2 100%);
    box-shadow: 0 6px 20px rgba(33, 160, 219, 0.4);
    transform: translateY(-2px);
    color: white !important;
}

.btn-equipment:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(33, 160, 219, 0.3);
}

.btn-equipment .btn-text {
    position: relative;
    z-index: 2;
}

.btn-equipment .arrow-icon {
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
    width: 20px;
    height: 20px;
}

/* .btn-equipment:hover .arrow-icon {
    transform: rotate(0deg) scale(1.1);
} */

img.arrow-icon {
    width: 26px;
    height: 26px;
    transition: transform 0.3s ease;
    transform: rotate(180deg);
    /* 初期状態で下向き */
}

img.arrow-icon.rotated {
    transform: rotate(0deg);
    /* 展開時は上向き */
}

/* 設備セクション - 全工場共通 */
.secondary-equipment {
    padding: 60px 0 0;
    margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    opacity: 1;
    max-height: none;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
}

.secondary-equipment.collapsed {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0 40px;
    transform: translateY(-20px);
}

.secondary-equipment.expanded {
    opacity: 1;
    max-height: 2000px;
    margin-top: 60px;
    padding: 0 20px;
    transform: translateY(0);
}

.equipment-table {
    background: white;
    overflow: hidden;
}

.equipment-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

.equipment-data {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Toppan Bunkyu Mincho', 'Yu Kyokasho', serif;
    font-size: 15px;
    margin-top: 10px;
}

.equipment-data,
.equipment-data th,
.equipment-data td {
    border: 1px solid #999;
    min-width: 50px;
}

.equipment-data thead th {
    background-color: #232323;
    color: white;
    font-weight: 600;
}

.equipment-data th {
    padding: 8px;
    text-align: left;
    font-weight: normal;
    color: black;
}

.equipment-data td {
    padding: 5px;
    color: black;
}

.equipment-data tr:last-child td {
    border-bottom: none;
}

.equipment-data p {
    margin-bottom: 0;
}

hr {
    border: none;
    height: 1px;
    background-color: #232323;
    margin: 20px 0;
}

hr.factory-separator {
    max-width: 1125px;
    margin: 0px auto;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {

    .container {
        max-width: 100%;
        padding: 0 40px;
    }

    .secondary-equipment {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .secondary-equipment.expanded {
        max-height: 1500px;
        /* モバイル用に調整 */
    }
}

@media (max-width: 968px) {
    .hero-nav .nav-menu {
        flex-wrap: wrap;
        gap: 10px;
    }

    .hero-nav .nav-menu a {
        width: auto;
        padding: 10px 15px;
        font-size: 14px;
    }

    .factory-title {
        font-size: 20px;
        margin-bottom: 30px;
    }

    .factory-address p,
    .factory-products p {
        font-size: 16px;
    }

    .factory-products h3 {
        font-size: 20px;
    }

    .secondary-equipment {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .secondary-equipment.expanded {
        max-height: 2500px;
        /* シングルカラム用に調整 */
    }

    .factory-section {
        padding: 40px 0;
    }
}

@media (max-width: 768px) {
    .factory-hero {
        height: 200px;
    }

    .hero-header {
        flex-direction: column;
        gap: 20px;
    }

    .hero-nav .nav-menu {
        justify-content: center;
    }

    .kanto-map {
        padding: 10px;
    }

    /* 工場プロット地点 */
    .factory-plot {
        width: 6px;
        height: 6px;
    }

    /* 工場プロット地点 */
    .factory-plot {
        width: 6px;
        height: 6px;
    }

    /* 各工場プロットの位置 */
    .factory-plot.shiki-plot {
        top: 64%;
        left: 46.5%;
    }

    .factory-plot.asaka-plot {
        top: 64.5%;
        left: 47.5%;
    }

    .factory-plot.tochigi-plot {
        top: 48%;
        left: 49%;
    }

    .plot-dot {
        width: 6px;
        height: 6px;
        border: 1px solid #fff;
        top: -3px;
        left: -3px;
    }

    .plot-label {
        font-size: 12px;
        padding: 3px 8px;
        transform: translateY(-15px);
    }

    .plot-label.shiki-label {
        top: 48%;
        left: 70%;
    }

    .plot-label.asaka-label {
        top: 64.5%;
        left: 70%;
    }

    .plot-label.tochigi-label {
        top: 40%;
        right: 70%;
    }

    .factory-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .factory-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .factory-address p,
    .factory-products p {
        font-size: 14px;
    }

    .factory-products h3 {
        font-size: 18px;
    }

    .details-link {
        font-size: 16px;
    }

    .btn-equipment {
        padding: 12px 20px;
        font-size: 16px;
    }

    .btn-equipment .arrow-icon {
        width: 18px;
        height: 18px;
    }

    .equipment-data {
        font-size: 13px;
    }

    .factory-section {
        padding: 30px 0;
    }
}

@media (max-width: 480px) {
    .factory-hero {
        height: 150px;
    }

    .logo-icon {
        width: 30px;
        height: 24px;
    }

    .logo-text {
        width: 130px;
        height: 15px;
    }

    .hero-nav .nav-menu a {
        padding: 8px 12px;
        font-size: 12px;
    }

    .factory-title {
        font-size: 16px;
    }

    .factory-address p,
    .factory-products p {
        font-size: 13px;
    }

    .factory-products h3 {
        font-size: 16px;
    }

    .details-link {
        font-size: 14px;
    }

    .btn-equipment {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 40px;
    }

    .btn-equipment .arrow-icon {
        width: 16px;
        height: 16px;
    }

    .secondary-equipment.collapsed {
        padding: 0 0;
    }

    .secondary-equipment.expanded {
        padding: 0;
    }

    .equipment-data {
        font-size: 12px;
    }

    .equipment-data th,
    .equipment-data td {
        padding: 4px;
    }
}