/*
  Table of Contents
  -----------------
  1. Reset & Global Styles
  2. Header & Navigation
  3. Hero Section
  4. Content Sections (Common Styles)
  5. Specific Sections (Message, Gallery, etc.)
  6. Footer
  7. Animations & Keyframes
  8. Responsive Design
*/

/* 1. Reset & Global Styles
------------------------------------------------------------*/
:root {
  --bg-color: #ffffff;
  --surface-color: #f8f9fa;
  --primary-color: #2c3e50; /* Dark Slate Blue */
  --secondary-color: #3498db; /* Bright Blue for accents */
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  --header-height: 70px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 140px; /* Adjust scroll padding for new header height */
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.8;
  font-weight: 300;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

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

/* 2. Header & Navigation
------------------------------------------------------------*/
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-link.desktop-logo {
  grid-column: 2;
  justify-self: center;
}

.logo-link.mobile-logo {
  display: none;
}

.header-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
}

.logo-img {
  max-height: 50px;
}

.main-nav ul {
  list-style: none;
  display: flex;
}

.main-nav li {
  margin-left: 30px;
}

.main-nav a {
  color: var(--text-primary);
  font-weight: 400;
  position: relative;
  padding: 5px 0;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

#mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

/* 3. Hero Section
------------------------------------------------------------*/
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to top, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 50%), url('./images/mainImg.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  z-index: -1;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

.hero-text p {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #f0f0f0;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* 4. Content Sections (Common Styles)
------------------------------------------------------------*/
.content-section {
  padding: 80px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.content-section header {
  text-align: center;
  margin-bottom: 60px;
}

.content-section header h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary-color);
  margin-bottom: 10px;
}

.content-section header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.inner-content {
  max-width: 900px;
  margin: 0 auto;
}

/* 5. Specific Sections
------------------------------------------------------------*/
/* Message */
#message .inner-content {
  text-align: center;
  font-size: 1.1rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  display: block; /* Ensures the link takes up the full space */
  overflow: hidden;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

/* Brand */
.brand-list {
  display: flex;
  justify-content: space-around;
  gap: 40px;
  text-align: center;
}
.brand-item img {
  margin: 0 auto 20px;
  filter: grayscale(1);
  opacity: 0.6;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.brand-item:hover img {
  filter: grayscale(0);
  opacity: 1;
}

.brand-links {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
}

.brand-link {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 500;
  position: relative;
  padding-bottom: 5px; /* Space for the underline */
  text-decoration: none;
}

.brand-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--primary-color);
  transition: width 0.4s ease;
}

.brand-link:hover::after {
  width: 100%;
}

.brand-link-icon.instagram {
  width: 28px;
  height: 28px;
}

.brand-link-icon.instagram svg {
  width: 100%;
  height: 100%;
  fill: var(--text-primary);
  transition: opacity 0.3s ease;
}

.brand-link-icon.instagram:hover svg {
  opacity: 0.7;
}

/* Company */
.ceo-greeting {
  display: flex;
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
  background-color: var(--surface-color);
  padding: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.ceo-photo {
  flex-shrink: 0;
}
.ceo-photo img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}
.ceo-message h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}
.ceo-name {
  text-align: right;
  margin-top: 15px;
  font-style: italic;
}

.company-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.company-map {
  height: 350px;
  border-radius: 8px;
  overflow: hidden;
}
.company-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.social-links {
  margin-top: 20px;
  display: none; /* This line hides the social links */
}
.social-links a {
  margin-right: 15px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.social-links a:hover {
  opacity: 1;
}
.social-links img {
  width: 24px;
  height: 24px;
  display: inline-block;
}

/* 6. Footer
------------------------------------------------------------*/
#footer {
  text-align: center;
  padding: 40px 5%;
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo img {
  max-height: 40px;
  margin: 0 auto;
}


/* 7. Animations & Keyframes
------------------------------------------------------------*/
.animated {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.animated.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 8. Responsive Design
------------------------------------------------------------*/
/* PC Navigation Layout */
@media (min-width: 769px) {
  #header {
    height: auto;
    padding: 10px 0;
  }

  .header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
  }
  
  .header-right {
    grid-column: auto;
    justify-self: auto;
    margin-top: 10px;
  }
  
  .header-left {
    display: none;
  }
  
  .logo-link.desktop-logo {
    grid-column: auto;
    justify-self: auto;
  }
}

@media (max-width: 992px) {
  .ceo-greeting {
    flex-direction: column;
    text-align: center;
  }
  .company-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: var(--header-height);
  }
  .header-inner {
    display: flex;
    justify-content: space-between;
  }
  .logo-link.desktop-logo {
    display: none;
  }
  .logo-link.mobile-logo {
    display: block;
  }
  .header-left {
      flex-grow: 1;
  }

  .hero-image {
    /* For smartphones, switch to a vertically-oriented image (e.g., mainImg_sp.jpg) */
    /* スマートフォン向けには、縦長の画像（例：mainImg_sp.jpg）に切り替えます */
    background-image: linear-gradient(to top, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 50%), url('./images/mainImg_sp.jpg');
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--bg-color);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
    padding-top: 100px;
  }
  .main-nav.is-open {
    transform: translateX(0);
  }
  .main-nav ul {
    flex-direction: column;
    align-items: center;
  }
  .main-nav li {
    margin: 0;
    width: 100%;
    text-align: center;
  }
  .main-nav a {
    display: block;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
  }
  
  #mobile-menu-btn {
    display: block;
    width: 30px;
    height: 22px;
    position: relative;
  }
  #mobile-menu-btn span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
  }
  #mobile-menu-btn span:nth-child(1) { top: 0px; }
  #mobile-menu-btn span:nth-child(2) { top: 9px; }
  #mobile-menu-btn span:nth-child(3) { top: 18px; }
  
  #mobile-menu-btn.is-open span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
  }
  #mobile-menu-btn.is-open span:nth-child(2) {
    opacity: 0;
    left: -30px;
  }
  #mobile-menu-btn.is-open span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
  }
  .brand-list {
    flex-direction: column;
  }
  .sp-only { display: block; }
}

