/*
Theme Name: MARUMI
Description: A minimal and elegant WordPress theme for MARUMI Inc.
Version: 1.0
Author: MARUMI Inc.
Requires PHP: 7.4
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", serif;
    color: #231F20;
    font-size: 16px;
    line-height: 1.7;
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: Arial, sans-serif;
    font-weight: normal;
    margin-bottom: 20px;
}

p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
}

a {
    color: #231F20;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Mobile container adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* Header */
.site-header {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 60px;
    position: relative;
}

.site-header .container {
    max-width: none;
    padding: 0 40px;
}

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

.site-logo {
    flex: 0 0 auto;
    margin-left: 0;
}

/* Custom logo styles */
.site-logo .custom-logo-link {
    display: inline-block;
}

.site-logo .custom-logo {
    max-height: 60px;
    width: auto;
    height: auto;
}

.site-title {
    font-family: Arial, sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    margin: 0;
}

.site-title a {
    color: #231F20;
}

/* Navigation */
.main-navigation {
    flex: 0 0 auto;
    margin-right: 0;
}

.main-navigation ul,
.primary-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-navigation li,
.primary-menu li {
    margin-left: 40px;
}

.main-navigation li:last-child,
.primary-menu li:last-child {
    margin-right: 0;
}

.main-navigation a,
.primary-menu a {
    font-family: Arial, sans-serif;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #231F20;
    transition: opacity 0.3s ease;
}

.main-navigation a:hover,
.primary-menu a:hover {
    opacity: 0.7;
    text-decoration: none;
}

.japanese {
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", serif;
    font-size: 14px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #231F20;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hamburger animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

/* Content Sections */
.content-section {
    margin-bottom: 100px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile content section adjustments */
@media (max-width: 768px) {
    .content-section {
        margin-bottom: 60px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .content-section {
        margin-bottom: 40px;
        text-align: center;
    }
}

.section-title {
    font-family: Arial, sans-serif;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 40px;
    text-align: center;
}

/* Mobile section title adjustments */
@media (max-width: 768px) {
    .section-title {
        font-size: 20px;
        margin-bottom: 30px;
        letter-spacing: 0.8px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 18px;
        margin-bottom: 20px;
        letter-spacing: 0.5px;
    }
}

.section-title .japanese {
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", serif;
    font-size: 14px;
}

.section-layout {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    justify-content: center;
}

/* Ensure consistent centering on all screen sizes */
@media (max-width: 768px) {
    .section-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
        margin-bottom: 30px;
    }

    .section-layout .section-image,
    .section-layout .section-content {
        width: 100%;
        max-width: 500px;
        text-align: center;
    }

    .section-content {
        padding-left: 0;
        text-align: center;
    }
}

.section-layout .section-image,
.section-layout .section-content {
    width: calc((100% - 60px) / 2);
}

/* Brand Section Title */
.brand-section .section-title {
    text-align: center;
}

/* Contact Section Title */
.contact-section .section-title {
    text-align: center;
}

/* Image Styles */
.section-image img {
    width: 100%;
    height: auto;
    display: block;
}

.section-content {
    padding-left: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    width: 500px;
    height: 500px;
    margin: 20px auto;
    box-sizing: border-box;
    background-color: #ffffff !important;
}

/* Gallery Grid Mobile Responsive Improvements */
@media (max-width: 768px) {
    .gallery-grid {
        width: 100%;
        max-width: 400px;
        height: auto;
        margin: 15px auto;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        justify-items: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin: 10px auto;
        grid-template-columns: 1fr;
        gap: 6px;
        justify-items: center;
    }
}

.section-image .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Responsive gallery for different image counts */
.gallery-grid:has(.gallery-item:nth-child(4)):not(.gallery-layout-hero-top) {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-grid:has(.gallery-item:nth-child(7)):not(.gallery-layout-hero-top) {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Force white background for all gallery elements and WordPress generated classes */
.gallery-grid *,
.gallery-item *,
.section-image *,
.attachment-medium,
.size-medium,
img[class*="attachment"],
img[class*="size-"],
img[loading="lazy"] {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Target the specific image you showed */
img[src*="アセット"] {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Apply to ALL images to be completely sure */
img {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Fix large line breaks in content - make them minimal */
br {
    line-height: 0.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 4px !important;
}

.company-overview br,
.section-content br,
.content-section br {
    line-height: 0.1 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 2px !important;
    display: block !important;
}

/* Specifically target brand section images */
.brand-section img,
.brand-item img,
#brand img {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Nuclear option - force ALL elements to have white background */
* {
    background-color: transparent !important;
}

/* Then specifically set white for images */
img,
.gallery-item,
.gallery-grid {
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Gallery Link Styles */
.gallery-link {
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.gallery-link:hover {
    opacity: 0.8;
    transform: scale(1.02);
    text-decoration: none;
}

.gallery-link img {
    transition: all 0.3s ease;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: #ffffff !important;
}

/* Add a subtle overlay on hover for linked images */
.gallery-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(35, 31, 32, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.gallery-link:hover::after {
    background: rgba(35, 31, 32, 0.1);
}

/* Gallery Layout Patterns */

/* 3x3 Grid (Default) */
.gallery-layout-grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
}

/* Hero Single Layout - Just one large image */
.gallery-layout-hero-single {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 0 !important;
    width: 500px !important;
    height: 500px !important;
    margin: 20px auto !important;
    box-sizing: border-box !important;
}

.gallery-layout-hero-single .gallery-item {
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.gallery-layout-hero-single .gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    background-color: #f8f8f8 !important;
}

/* Hide additional images beyond the 1st for this layout */
.gallery-layout-hero-single .gallery-item:nth-child(n+2) {
    display: none !important;
}

/* 2x2 Grid (Larger images) */
.gallery-layout-grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
}

/* 4x2 Grid (Horizontal) */
.gallery-layout-grid-4x2 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
}

/* Masonry Layout */
.gallery-layout-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
}

.gallery-layout-masonry .gallery-item {
    overflow: hidden;
}

.gallery-layout-masonry .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mosaic Layout (Mixed sizes) */
.gallery-layout-mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
}

.gallery-layout-mosaic .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-layout-mosaic .gallery-item:nth-child(4) {
    grid-column: span 2;
}

.gallery-layout-mosaic .gallery-item:nth-child(6) {
    grid-row: span 2;
}

.gallery-layout-mosaic .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Carousel Layout */
.gallery-layout-carousel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
    gap: 15px;
    overflow: hidden;
}

.gallery-layout-carousel .gallery-item {
    overflow: hidden;
}

.gallery-layout-carousel .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-layout-carousel::-webkit-scrollbar {
    height: 8px;
}

.gallery-layout-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-layout-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.gallery-layout-carousel::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Single Row Layout */
.gallery-layout-single-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 1fr;
    gap: 10px;
}

.gallery-layout-single-row .gallery-item {
    overflow: hidden;
}

.gallery-layout-single-row .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Layouts - Main image prominent */
.gallery-layout-hero-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 2fr 1fr;
    gap: 10px;
}

.gallery-layout-hero-main .gallery-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1;
}

.gallery-layout-hero-main .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Left Layout - Main image on left */
.gallery-layout-hero-left {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
}

.gallery-layout-hero-left .gallery-item:first-child {
    grid-column: 1;
    grid-row: 1 / 4;
}

.gallery-layout-hero-left .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Right Layout - Main image on right */
.gallery-layout-hero-right {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
}

.gallery-layout-hero-right .gallery-item:first-child {
    grid-column: 2;
    grid-row: 1 / 4;
}

.gallery-layout-hero-right .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Vertical Layout - Left hero + right 2 vertical images */
.gallery-layout-hero-vertical {
    display: grid;
    grid-template-columns: 320px 168px;
    grid-template-rows: 244px 244px;
    gap: 12px;
    width: 500px;
    height: 500px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Main hero image (first) - left side, full height */
.gallery-layout-hero-vertical .gallery-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 320px;
    height: 500px;
    overflow: hidden;
    box-sizing: border-box;
}

.gallery-layout-hero-vertical .gallery-item:nth-child(1) img {
    width: 320px !important;
    height: 500px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Second image - top right */
.gallery-layout-hero-vertical .gallery-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    width: 168px;
    height: 244px;
    overflow: hidden;
    box-sizing: border-box;
}

.gallery-layout-hero-vertical .gallery-item:nth-child(2) img {
    width: 168px !important;
    height: 244px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Third image - bottom right */
.gallery-layout-hero-vertical .gallery-item:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    width: 168px;
    height: 244px;
    overflow: hidden;
    box-sizing: border-box;
}

.gallery-layout-hero-vertical .gallery-item:nth-child(3) img {
    width: 168px !important;
    height: 244px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Hide additional images beyond the 3rd for this layout */
.gallery-layout-hero-vertical .gallery-item:nth-child(n+4) {
    display: none;
}

/* Hero Top Layout - Horizontal hero at top + 6 square images below in 2 rows */
.gallery-layout-hero-top {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: 1.5fr 1fr 1fr !important;
    gap: 8px !important;
    width: 500px !important;
    height: 500px !important;
    margin: 20px auto !important;
    box-sizing: border-box !important;
}

/* Main hero image (first) - top row, full width */
.gallery-layout-hero-top .gallery-item:nth-child(1) {
    grid-column: 1 / 4;
    grid-row: 1;
    overflow: hidden;
}

.gallery-layout-hero-top .gallery-item:nth-child(1) img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f8f8f8;
}

/* Second row images (2-4) - first 3 images */
.gallery-layout-hero-top .gallery-item:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    overflow: hidden;
}

.gallery-layout-hero-top .gallery-item:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    overflow: hidden;
}

.gallery-layout-hero-top .gallery-item:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
    overflow: hidden;
}

/* Third row images (5-7) - second 3 images */
.gallery-layout-hero-top .gallery-item:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
    overflow: hidden;
}

.gallery-layout-hero-top .gallery-item:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
    overflow: hidden;
}

.gallery-layout-hero-top .gallery-item:nth-child(7) {
    grid-column: 3;
    grid-row: 3;
    overflow: hidden;
}

/* All small images should be square */
.gallery-layout-hero-top .gallery-item:nth-child(n+2) {
    display: block !important;
    overflow: hidden !important;
}

.gallery-layout-hero-top .gallery-item:nth-child(n+2) img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
}

/* Force show all 7 images in hero-top layout */
.gallery-layout-hero-top .gallery-item:nth-child(-n+7) {
    display: block !important;
}

/* Hide additional images beyond the 7th for this layout */
.gallery-layout-hero-top .gallery-item:nth-child(n+8) {
    display: none;
}

/* Hero Surrounded Layout - Main image surrounded by 5 smaller images */
.gallery-layout-hero-surrounded {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
}

/* Main image (first) - left top, 2x2 size */
.gallery-layout-hero-surrounded .gallery-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

/* Top right image (second) */
.gallery-layout-hero-surrounded .gallery-item:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

/* Middle right image (third) */
.gallery-layout-hero-surrounded .gallery-item:nth-child(3) {
    grid-column: 3;
    grid-row: 2;
}

/* Bottom right image (fourth) */
.gallery-layout-hero-surrounded .gallery-item:nth-child(4) {
    grid-column: 3;
    grid-row: 3;
}

/* Bottom center image (fifth) */
.gallery-layout-hero-surrounded .gallery-item:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
}

/* Bottom left image (sixth) */
.gallery-layout-hero-surrounded .gallery-item:nth-child(6) {
    grid-column: 1;
    grid-row: 3;
}

/* All images in surrounded layout should be square and cover */
.gallery-layout-hero-surrounded .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* Admin sortable gallery styling */
.sortable-gallery .gallery-image-item {
    transition: all 0.3s ease;
}

.sortable-gallery .gallery-image-item:hover {
    border-color: #0073aa !important;
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

.sortable-gallery .gallery-image-item.ui-sortable-helper {
    border-color: #0073aa !important;
    box-shadow: 0 4px 12px rgba(0,115,170,0.5);
    transform: rotate(3deg);
}

/* Brand Gallery Section Spacing */
.brand-gallery-section {
    margin: 40px 0 60px 0;
}

/* Early breakpoint to prevent text overlay on images */
@media (max-width: 900px) {
    .section-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .section-layout .section-image,
    .section-layout .section-content {
        width: 100%;
        max-width: 500px;
        text-align: center;
    }

    .section-content {
        text-align: center;
    }

    .section-content p,
    .section-content div {
        text-align: center;
    }
}

/* Responsive Adjustments for Gallery Layouts */
@media (max-width: 1024px) {
    .gallery-layout-grid-4x2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-layout-masonry {
        column-count: 2;
    }

    .gallery-layout-mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 100px;
    }

    .gallery-layout-carousel .gallery-item {
        flex: 0 0 250px;
    }

    .gallery-layout-single-row .gallery-item {
        width: 120px;
    }

    /* Hero layouts responsive */
    .gallery-layout-hero-main {
        grid-template-columns: 1fr;
    }

    .gallery-layout-hero-main .gallery-item:first-child {
        grid-column: 1;
    }

    .gallery-layout-hero-left,
    .gallery-layout-hero-right {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        height: auto;
    }

    .gallery-layout-hero-left .gallery-item:first-child,
    .gallery-layout-hero-right .gallery-item:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .gallery-layout-hero-left .gallery-item:first-child img,
    .gallery-layout-hero-right .gallery-item:first-child img {
        height: 250px;
    }

    /* Hero vertical responsive */
    .gallery-layout-hero-vertical {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        gap: 15px;
    }

    .gallery-layout-hero-vertical .gallery-item:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .gallery-layout-hero-vertical .gallery-item:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .gallery-layout-hero-vertical .gallery-item:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }

    .gallery-layout-hero-vertical .gallery-item img {
        height: 300px;
        aspect-ratio: 4 / 3; /* More landscape for mobile */
    }

    /* Hero surrounded responsive */
    .gallery-layout-hero-surrounded {
        width: 300px;
        height: 300px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr 1fr;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(1) {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(4) {
        grid-column: 1;
        grid-row: 3;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(5) {
        grid-column: 2;
        grid-row: 3;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(6) {
        display: none; /* Hide 6th image on smaller screens */
    }
}

@media (max-width: 480px) {
    .gallery-layout-grid-3x3,
    .gallery-layout-grid-4x2 {
        grid-template-columns: 1fr;
    }

    .gallery-layout-masonry {
        column-count: 1;
    }

    .gallery-layout-mosaic {
        grid-template-columns: 1fr;
        grid-auto-rows: 150px;
    }

    .gallery-layout-mosaic .gallery-item:nth-child(1),
    .gallery-layout-mosaic .gallery-item:nth-child(4),
    .gallery-layout-mosaic .gallery-item:nth-child(6) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-layout-carousel .gallery-item {
        flex: 0 0 200px;
    }

    .gallery-layout-single-row {
        flex-direction: column;
        align-items: center;
    }

    .gallery-layout-single-row .gallery-item {
        width: 100%;
        max-width: 300px;
    }

    /* Hero surrounded mobile */
    .gallery-layout-hero-surrounded {
        width: 250px;
        height: 250px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(1) {
        grid-column: 1 / 3;
        grid-row: 1;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
    }

    .gallery-layout-hero-surrounded .gallery-item:nth-child(4),
    .gallery-layout-hero-surrounded .gallery-item:nth-child(5),
    .gallery-layout-hero-surrounded .gallery-item:nth-child(6) {
        display: none; /* Hide remaining images on mobile */
    }

    /* Hero vertical mobile - show only main image */
    .gallery-layout-hero-vertical .gallery-item:nth-child(2),
    .gallery-layout-hero-vertical .gallery-item:nth-child(3) {
        display: none; /* Hide side images on very small screens */
    }

    .gallery-layout-hero-vertical .gallery-item:nth-child(1) img {
        height: 400px;
        aspect-ratio: 3 / 4; /* Back to portrait for main image */
    }
}

/* Works List */
.works-list {
    margin-top: 20px;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    text-align: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-description {
    color: white;
    font-size: 16px;
    margin-top: 20px;
    padding: 0 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-align: left;
}


.lightbox-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.lightbox-caption {
    color: #e0e0e0;
    font-size: 14px;
    margin-bottom: 8px;
    font-style: italic;
}

.lightbox-desc-text {
    color: #d0d0d0;
    font-size: 14px;
    line-height: 1.5;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 20px 15px;
    border-radius: 5px;
    transition: background 0.3s ease;
    user-select: none;
}

.lightbox-navigation:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-counter {
    position: absolute;
    top: -50px;
    left: 0;
    color: white;
    font-size: 14px;
    opacity: 0.8;
}

/* Gallery item hover effect for better UX - only for brand galleries */
.gallery-grid:not(.works-gallery) .gallery-item {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-grid:not(.works-gallery) .gallery-item:hover {
    transform: scale(1.02);
}

.gallery-grid:not(.works-gallery) .gallery-item img {
    transition: opacity 0.3s ease;
}

.gallery-grid:not(.works-gallery) .gallery-item:hover img {
    opacity: 0.9;
}

/* WORKS gallery specific styles - restore normal link behavior */
.works-gallery .gallery-item {
    cursor: default;
}

.works-gallery .gallery-link {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.works-gallery .gallery-link:hover {
    opacity: 0.8;
}

/* Mobile responsive lightbox */
@media (max-width: 1024px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-image {
        max-height: 70vh;
    }

    .lightbox-description {
        font-size: 14px;
        margin-top: 15px;
    }

    .lightbox-close {
        top: -40px;
        font-size: 25px;
    }

    .lightbox-navigation {
        font-size: 30px;
        padding: 15px 10px;
    }

    .lightbox-prev {
        left: -60px;
    }

    .lightbox-next {
        right: -60px;
    }
}

.work-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.work-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.work-item h4 {
    font-family: Arial, sans-serif;
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.work-item p {
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
}

/* Brand Section */
.brand-section {
    margin-bottom: 100px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Brand content block spacing - TARGET ACTUAL HTML STRUCTURE */
body .brand-description p {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-block: 0 !important;
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    padding: 0 !important;
}

body .brand-description .wp-block-buttons {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-block: 0 !important;
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    padding: 0 !important;
}

/* Force all direct children to have minimal spacing */
body .brand-description > * {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body .brand-description > * + * {
    margin-top: 0px !important;
}

/* Target the specific button container classes */
body .brand-description .wp-container-core-buttons-is-layout-6447b855,
body .brand-description .wp-block-buttons-is-layout-flex,
body .brand-description .is-content-justification-left {
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Override all WordPress block elements */
body .brand-description [class*="wp-block"],
body .brand-description .is-layout-flow > *,
body .brand-description .is-layout-flex > * {
    margin: 0 !important;
    margin-block: 0 !important;
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-inline: 0 !important;
}

/* Override WordPress CSS variables with maximum specificity */
body .brand-description {
    --wp--style--block-gap: 0px !important;
    --wp--preset--spacing--10: 0px !important;
    --wp--preset--spacing--20: 0px !important;
    --wp--preset--spacing--30: 0px !important;
    --wp--preset--spacing--40: 0px !important;
    --wp--preset--spacing--50: 0px !important;
    --wp--preset--spacing--60: 0px !important;
}

/* No spacing - elements touch each other */
.brand-description p {
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.brand-description .wp-block-buttons {
    margin: 0 !important;
    margin-bottom: 0 !important;
}

.brand-description .wp-block-button {
    margin: 0 !important;
}

/* Add minimal 2px spacing only between direct children */
.brand-description > * + * {
    margin-top: 2px !important;
}

/* Force all WordPress layout classes to zero spacing */
.brand-description .is-layout-flow > *,
.brand-description .is-layout-flex > *,
.brand-description .wp-block-group > *,
.brand-description .wp-container-core-group-is-layout-1 > * {
    margin: 0 !important;
    margin-block: 0 !important;
    padding: 0 !important;
}

/* Override ALL WordPress spacing CSS variables */
.brand-description,
.brand-description * {
    --wp--style--block-gap: 0px !important;
    --wp--preset--spacing--20: 0px !important;
    --wp--preset--spacing--30: 0px !important;
    --wp--preset--spacing--40: 0px !important;
    --wp--preset--spacing--50: 0px !important;
    --wp--preset--spacing--60: 0px !important;
    --wp--preset--spacing--70: 0px !important;
    --wp--preset--spacing--80: 0px !important;
}

/* Target ALL dynamic WordPress container classes */
.brand-description [class*="wp-container"],
.brand-description [class*="is-layout"],
.brand-description [class*="wp-block"] {
    margin: 0 !important;
    margin-block: 0 !important;
    padding: 0 !important;
}

/* WordPress Button Styles - Fix fill visibility */
.wp-block-button__link,
.wp-element-button,
body .wp-block-button__link,
body .wp-element-button {
    display: inline-block !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    border: 2px solid #231F20 !important;
    background-color: #231F20 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-sizing: border-box !important;
    min-height: 48px !important;
}

/* Button hover states */
.wp-block-button__link:hover,
.wp-element-button:hover,
body .wp-block-button__link:hover,
body .wp-element-button:hover {
    background-color: #444 !important;
    border-color: #444 !important;
    color: #ffffff !important;
}

/* Outline button style */
.wp-block-button.is-style-outline .wp-block-button__link,
.is-style-outline .wp-element-button {
    background-color: transparent !important;
    color: #231F20 !important;
    border: 2px solid #231F20 !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.is-style-outline .wp-element-button:hover {
    background-color: #231F20 !important;
    color: #ffffff !important;
}

/* Fill button style (default) */
.wp-block-button.is-style-fill .wp-block-button__link,
.is-style-fill .wp-element-button,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background-color: #231F20 !important;
    color: #ffffff !important;
    border: 2px solid #231F20 !important;
}

/* Brand description specific button fixes */
.brand-description .wp-block-button__link,
.brand-description .wp-element-button {
    margin: 0 !important;
}

/* Remove gap between header and content */
.site-main {
    margin-top: 0;
    padding-top: 0;
}

/* Add spacing after slideshow */
.hero-slideshow + .container {
    margin-top: 40px;
}

/* Hero Slideshow Styles */
.hero-slideshow {
    width: 100%;
    margin: 0;
    background: #000;
}

.slideshow-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    height: 400px;
    overflow: hidden;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #000;
}

.slideshow-navigation {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    height: 12px;
    width: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active,
.dot:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Hero Slideshow Responsive */
@media (max-width: 1024px) {
    .slideshow-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .slideshow-container {
        height: 250px;
        margin-bottom: 30px;
    }

    .hero-slideshow {
        margin-bottom: 30px;
    }

    .slide img {
        object-fit: cover;
        object-position: center;
    }

    .slideshow-navigation {
        bottom: 15px;
    }

    .dot {
        height: 10px;
        width: 10px;
    }
}

@media (max-width: 480px) {
    .slideshow-container {
        height: 200px;
        margin-bottom: 20px;
    }

    .hero-slideshow {
        margin-bottom: 20px;
    }

    .slideshow-navigation {
        bottom: 10px;
        gap: 8px;
    }

    .dot {
        height: 8px;
        width: 8px;
    }
}



.brand-description-intro {
    text-align: center;
    margin-bottom: 40px;
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-line;
}

.brand-item {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid #f0f0f0;
}

.brand-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.brand-name {
    font-family: Arial, sans-serif;
    font-size: 22px;
    margin-bottom: 24px;
    font-weight: normal;
}

.brand-description {
    font-size: 16px;
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 20px;
    white-space: pre-line;
}

.brand-description p {
    margin-bottom: 16px;
    white-space: pre-line;
}

.awards-list {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 24px;
    white-space: pre-line;
}

.awards-list p {
    margin-bottom: 8px;
    white-space: pre-line;
}

.brand-link {
    font-size: 16px;
    display: block;
    margin-bottom: 12px;
    color: #231F20;
    text-decoration: none;
}

.brand-link:hover {
    text-decoration: underline;
}

.no-image {
    width: 100%;
    height: 200px;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #999;
}

/* Contact Section */
.contact-section {
    text-align: center;
    margin-bottom: 100px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.contact-email {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Forms and Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="password"],
textarea,
select {
    font-size: 16px;
    line-height: 1.5;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", serif;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 5px rgba(35, 31, 32, 0.1);
}

textarea {
    min-height: 200px;
    resize: vertical;
    white-space: pre-line;
}

/* Contact Form 7 Specific Styles */
.wpcf7-form {
    font-size: 16px;
}

.wpcf7-form p {
    margin-bottom: 20px;
}

.wpcf7-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: normal;
}

.wpcf7-form input[type="submit"],
input[type="submit"],
button,
.button {
    font-size: 16px;
    padding: 12px 30px;
    background-color: #231F20;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wpcf7-form input[type="submit"]:hover,
input[type="submit"]:hover,
button:hover,
.button:hover {
    background-color: #444;
}

.wpcf7-not-valid-tip {
    color: #dc3232;
    font-size: 14px;
    margin-top: 5px;
}

.wpcf7-response-output {
    margin: 20px 0;
    padding: 15px;
    font-size: 15px;
    border-radius: 4px;
}

/* Preserve Line Breaks in Content */
.section-content p,
.content-section p,
.brand-item p,
.work-item p,
.entry-content p,
.company-info p {
    white-space: pre-line;
}

/* Company Overview and Description Areas */
.company-overview,
.company-description,
.brand-awards,
.work-description,
.section-content > div {
    white-space: pre-wrap !important;
    font-size: 16px !important;
    line-height: 1.7 !important;
    margin-bottom: 20px;
}

/* Force Text Size Updates - Override WordPress defaults */
body,
body * {
    font-size: inherit;
}

body {
    font-size: 16px !important;
}

.content-section p,
.section-content p,
.section-content div,
#about p,
#about div {
    font-size: 16px !important;
    line-height: 1.7 !important;
    white-space: pre-wrap !important;
}

/* Customizer Text Areas - Make sure line breaks work */
[id*="customize-control"] textarea {
    font-size: 16px !important;
    line-height: 1.6 !important;
    min-height: 200px !important;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #eee;
    margin-top: 80px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .site-header .container {
        padding: 0 20px;
    }

    .header-content {
        align-items: center;
        justify-content: space-between;
    }

    /* Show hamburger menu */
    .menu-toggle {
        display: flex;
        margin-left: auto;
        margin-right: 0;
    }

    /* Hide desktop menu */
    .main-navigation {
        position: static;
    }

    .main-navigation ul,
    .primary-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border-top: 1px solid #f0f0f0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 20px 0;
        z-index: 1000;
        margin: 0;
    }

    /* Show mobile menu when active */
    .main-navigation.active ul,
    .main-navigation.active .primary-menu {
        display: flex;
    }

    .main-navigation li,
    .primary-menu li {
        margin: 0;
        margin-bottom: 15px;
        text-align: center;
    }

    .main-navigation li:last-child,
    .primary-menu li:last-child {
        margin-bottom: 0;
    }

    .main-navigation a,
    .primary-menu a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
        width: 100%;
    }

    .section-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 25px;
        margin-bottom: 25px;
    }

    .section-layout .section-image,
    .section-layout .section-content {
        width: 100%;
        max-width: 400px;
        text-align: center;
    }

    .section-content {
        padding-top: 0;
        text-align: center;
        padding-left: 0;
        padding-right: 0;
    }

    .section-content p,
    .section-content div,
    .section-content h3 {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    /* Ensure brand names are centered */
    .brand-name {
        text-align: center;
    }

    /* Ensure all text content is centered on mobile */
    .brand-description,
    .company-overview {
        text-align: center;
    }

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

    .section-image .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .section-image .gallery-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    /* Mobile-specific section adjustments */
    .content-section {
        text-align: center;
        margin-bottom: 40px;
    }

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

    /* Hero slideshow mobile adjustments */
    .slideshow-container {
        height: 200px;
        margin-bottom: 30px;
    }

    /* Mobile contact section */
    .contact-section {
        text-align: center;
        margin-bottom: 40px;
    }

    /* Mobile brand section */
    .brand-section {
        text-align: center;
        margin-bottom: 40px;
    }

    .brand-item {
        text-align: center;
        margin-bottom: 40px;
        padding-bottom: 30px;
    }

    /* Mobile gallery improvements */
    .gallery-grid {
        justify-items: center;
        gap: 6px;
        width: 100% !important;
        max-width: 280px !important;
        height: auto !important;
        margin: 10px auto !important;
    }

    .gallery-item {
        width: 100%;
        max-width: 280px;
        height: auto;
    }

    .gallery-item img {
        width: 100%;
        height: auto;
        border-radius: 4px;
    }

    /* Specific gallery layout mobile overrides */
    .gallery-layout-grid-3x3,
    .gallery-layout-grid-4x2,
    .gallery-layout-mosaic,
    .gallery-layout-masonry {
        width: 100% !important;
        max-width: 280px !important;
        height: auto !important;
        margin: 10px auto !important;
    }

    .gallery-layout-carousel {
        overflow-x: auto;
        padding: 10px 0;
    }

    .gallery-layout-single-row {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* Brand section mobile improvements */
    .brand-description-intro {
        margin-bottom: 30px;
        font-size: 15px;
        padding: 0 10px;
    }

    .brand-name {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .brand-description {
        font-size: 15px;
        margin-bottom: 15px;
        padding: 0 10px;
    }

    /* Contact section mobile improvements */
    .contact-email {
        font-size: 15px;
        margin-bottom: 15px;
    }

    .contact-section p {
        font-size: 15px;
        padding: 0 10px;
    }

    .main-navigation li {
        display: block;
        margin: 10px 0;
    }
}