/* Kudozen/久渡春生 Website Styles
   A clean, poetic, high-end design for an elegant brand */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@300;400;500;700&family=Noto+Sans:wght@300;400;500&family=Noto+Serif+JP:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500&display=swap');

/* Language System Loading States - Prevent flash of empty content */
[data-i18n] {
  transition: opacity 0.2s ease-in-out;
}

:root {
  /* Main color palette */
  --primary-color: #8E354A; /* Deep plum red - Japanese traditional color "Kurenai" */
  --secondary-color: #F8F1E0; /* Soft cream */
  --accent-color: #D9B166; /* Gold accent */
  --text-color: #333333;
  --light-text: #FFFFFF;
  --dark-bg: #1A1A1A;
  --light-bg: #FFFFFF;
  
  /* For transitions */
  --transition-speed: 0.3s;
  
  /* Header heights for different screen sizes */
  --header-height-desktop: 90px;
  --header-height-tablet: 120px;
  --header-height-mobile: 140px;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: 'Noto Serif', 'Noto Serif JP', serif;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

p {
  margin-bottom: 1.5rem;
  font-weight: 300;
}

/* Container */
.container {
  width: 85%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header */
header {
  background-color: rgba(255, 255, 255, 0.95);
  position: fixed;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-image {
  height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  transition: opacity var(--transition-speed);
}

.logo-image:hover {
  opacity: 0.8;
}

/* Make logo clickable */
.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Navigation */
nav ul {
  display: flex;
  list-style: none;
}

nav li {
  margin-left: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 400;
  font-size: 1rem;
  transition: color var(--transition-speed);
  position: relative;
  padding-bottom: 5px;
}

nav a:hover {
  color: var(--primary-color);
}

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

nav a:hover::after {
  width: 100%;
}

/* Language Switch */
.language-switch {
  display: flex;
  gap: 10px;
  margin-left: 2rem;
}

.language-switch button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  transition: opacity var(--transition-speed);
}

.language-switch button:hover,
.language-switch button.active {
  opacity: 1;
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  height: calc(50vh + var(--header-height-desktop));
  min-height: calc(350px + var(--header-height-desktop));
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-attachment: scroll; /* Better for mobile */
  position: relative;
  padding-top: var(--header-height-desktop);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  width: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--light-text);
  max-width: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: 300;
}

/* Hero Video Styles */
.hero-video {
  position: relative;
  overflow: hidden;
}

.hero-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-video-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #8E354A 0%, #D9B166 100%);
}

.hero-video .container {
  position: relative;
  z-index: 2;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

/* Hero buttons positioning for index page */
.hero-video .hero-buttons {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 3;
  margin: 0; /* Remove any inherited margins */
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--primary-color);
  color: var(--light-text);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all var(--transition-speed);
  border: 1px solid var(--primary-color);
}

.btn:hover {
  background-color: transparent;
  color: var(--light-text);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--light-text);
}

.btn-outline:hover {
  background-color: var(--light-text);
  color: var(--primary-color);
  border-color: var(--light-text);
}

/* Sections */
section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 20px auto 0;
}

/* About Section */
.about-content {
  display: flex;
  gap: 60px;
  align-items: center;
}

.about-text {
  flex: 1;
}

.about-image {
  flex: 1;
}

.about-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* About image container */
.about-image {
  min-height: clamp(200px, 40vw, 400px);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  aspect-ratio: 4/3;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Philosophy Grid */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 60px;
}

.philosophy-item {
  text-align: center;
  padding: 30px;
  border-radius: 8px;
  background-color: var(--light-bg);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-speed);
}

.philosophy-item:hover {
  transform: translateY(-10px);
}

.philosophy-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

/* Products */
.product-series {
  margin-bottom: 80px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.product-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.product-image {
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.product-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s;
  max-height: 300px;
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

/* Product image placeholders */
.product-image {
  background-color: var(--secondary-color);
  position: relative;
}

.product-image::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(142, 53, 74, 0.2);
  bottom: -20px;
  right: -20px;
}

.product-image img {
  opacity: 1;  /* Show actual product images */
}

.product-info {
  padding: 25px;
}

.product-name {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.product-description {
  font-size: 0.9rem;
  margin-bottom: 15px;
  color: #666;
}

/* Contact */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.contact-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.contact-text h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.contact-form input, 
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

/* Footer */
footer {
  background-color: var(--dark-bg);
  color: var(--light-text);
  padding: 60px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  display: flex;
  flex-direction: column;
}

.footer-logo .logo-image {
  height: 60px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 20px;
}

.footer-links h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
}

.footer-links h3::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
  margin-top: 10px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #999;
  text-decoration: none;
  transition: color var(--transition-speed);
}

.footer-links a:hover {
  color: var(--light-text);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* Responsive Video Container System */
.video-container {
  position: relative;
  width: 100%;
  margin: clamp(20px, 5vw, 40px) 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  /* Pure aspect ratio approach - no conflicting heights */
  aspect-ratio: 16/9;
  height: clamp(200px, 50vw, 600px);
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
}

/* Story section video container specific styles */
.story-section .video-container {
  margin: clamp(15px, 4vw, 30px) 0;
  aspect-ratio: 16/9;
  height: clamp(180px, 45vw, 500px);
}

.story-section .video-container::before {
  display: none; /* Hide placeholder text for story section videos */
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16/9) {
  .video-container {
    height: 0;
    padding-bottom: clamp(28%, 50vw, 56.25%); /* Responsive 16:9 aspect ratio */
    position: relative;
  }
  
  .video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  
  .story-section .video-container {
    padding-bottom: clamp(25%, 45vw, 56.25%);
  }
}

/* Responsive Design - Mobile First Approach */

/* Tablet styles */
@media (max-width: 992px) {
  .container {
    width: 95%;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  .hero {
    height: calc(50vh + var(--header-height-tablet));
    min-height: calc(350px + var(--header-height-tablet));
    padding-top: var(--header-height-tablet);
  }
  
  .hero .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
  }
  
  .hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .about-content {
    flex-direction: column;
  }
  
  .philosophy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Video adjustments for tablet */
  .video-container {
    min-height: 250px;
    max-height: 450px;
  }
  
  .story-section .video-container {
    min-height: 200px;
    max-height: 400px;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  /* Header mobile optimization */
  .header-container {
    flex-direction: column;
    padding: 10px 0;
    gap: 10px;
  }
  
  .logo {
    margin-bottom: 10px;
  }
  
  .logo-image {
    height: 40px;
    max-width: 150px;
  }
  
  .footer-logo .logo-image {
    height: 50px;
    max-width: 150px;
  }
  
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }
  
  nav li {
    margin: 2px 8px;
  }
  
  nav a {
    font-size: 0.9rem;
    padding: 5px 0;
  }
  
  .language-switch {
    margin-left: 0;
    gap: 8px;
  }
  
  .language-switch button {
    font-size: 0.8rem;
    padding: 2px 4px;
  }
  
  /* Hero mobile optimization */
  .hero {
    height: calc(40vh + var(--header-height-mobile));
    min-height: calc(300px + var(--header-height-mobile));
    padding-top: var(--header-height-mobile);
  }
  
  .hero .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
  }
  
  .hero-content {
    max-width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .hero-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  /* Hero buttons mobile positioning */
  .hero-video .hero-buttons {
    bottom: 20px;
    right: 20px;
    flex-direction: column;
    gap: 10px;
  }
  
  /* Video mobile optimization */
  .video-container {
    margin: clamp(15px, 4vw, 20px) 0;
    height: clamp(150px, 40vw, 250px);
    border-radius: 4px;
  }
  
  .video-container video {
    object-fit: cover; /* Maintain aspect ratio */
  }
  
  .story-section .video-container {
    height: clamp(120px, 35vw, 200px);
  }
  
  /* General mobile improvements */
  .philosophy-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  section {
    padding: 60px 0;
  }
  
  .section-title {
    margin-bottom: 40px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 0 10px;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .video-container {
    height: clamp(120px, 30vw, 180px);
  }
  
  .story-section .video-container {
    height: clamp(100px, 25vw, 150px);
  }
  
  .video-container video {
    object-fit: cover;
  }
  
  nav li {
    margin: 2px 5px;
  }
  
  nav a {
    font-size: 0.8rem;
  }
  
  .language-switch button {
    font-size: 0.7rem;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    height: 50vh;
    padding-top: 80px; /* Reduced for landscape */
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .video-container {
    height: clamp(150px, 35vw, 250px);
  }
  
  .story-section .video-container {
    height: clamp(130px, 30vw, 200px);
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 1s ease forwards;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* Process timeline container */
.process-timeline {
  display: flex;
  flex-direction: column;
  gap: 60px;
  max-width: 800px;
  margin: 0 auto;
}

/* Individual process step */
.process-step {
  text-align: center;
}

/* Process content wrapper */
.process-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Enhanced process image centering */
.process-image {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: clamp(15px, 3vw, 20px) auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  aspect-ratio: 16/10;
  height: clamp(200px, 35vw, 400px);
}

.process-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.process-step:hover .process-image img {
  transform: scale(1.05);
}

/* Process step header - number and title on same line */
.process-step-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.process-step-header .process-number {
  margin-bottom: 0;
  position: relative;
  font-size: 1.75rem;
  font-family: 'Noto Serif', 'Noto Serif JP', serif;
  font-weight: 500;
}

.process-step-header .process-number::before {
  content: "--";
}

.process-step-header .process-number::after {
  content: "--";
}

.process-step-header h3 {
  margin-bottom: 0;
  font-size: 1.75rem;
}

/* Process step text content */
.process-content p {
  max-width: 700px;
  text-align: center;
  line-height: 1.7;
  margin: 0 auto;
}

/* Story page specific styles */
.story-section {
  padding: 80px 0 40px 0; /* Reduced bottom padding */
}

.mission-section {
  padding: 40px 0 100px 0; /* Reduced top padding */
}

/* Blog page specific styles */
.blog-filter {
  padding: 50px 0;
}

.blog-categories {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.blog-categories .btn {
  background-color: transparent;
  color: var(--text-color);
  border: 2px solid #ddd;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.blog-categories .btn:hover {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

.blog-categories .btn.active {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 50px; /* Increased spacing between article cards */
  margin-top: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.article-card {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.article-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.article-category {
  background-color: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.article-excerpt {
  line-height: 1.6;
  color: #555;
  margin-bottom: 20px;
}

.article-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* Contact page social and shopping links styling */
.contact-info .social-links .btn,
.contact-info .shopping-links .btn {
  background-color: var(--primary-color);
  color: var(--light-text);
  border: 1px solid var(--primary-color);
  margin-right: 10px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-info .social-links .btn:hover,
.contact-info .shopping-links .btn:hover {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 50px;
  padding: 20px 0;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: all var(--transition-speed);
}

.pagination a:hover {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

.pagination a.active {
  background-color: var(--primary-color);
  color: var(--light-text);
  border-color: var(--primary-color);
}

.pagination span {
  color: #999;
  font-weight: 500;
}

/* Blog articles responsive adjustments */
@media (max-width: 768px) {
  .pagination {
    gap: 5px;
  }
  
  .pagination a {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

/* Terms Page Specific Styles */
.terms-list {
  list-style-type: disc;
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

.terms-list li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
  color: var(--text-color);
}

.terms-list li:last-child {
  margin-bottom: 0;
}
