/* ==========================================================================
   Modern CSS Variables (Custom Properties)
   ========================================================================== */

:root {
  --primary: #1f8f8b;
  --bg: #f7f9f9;
  --text: #222;
  --muted: #888;
  --border: #ddd;
  --white: #fff;

  /* Modern additions for consistency */
  --font-family-base: "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 1200px;
  --sidebar-width: 220px;
  --border-radius: 8px;
  --transition-duration: 0.2s;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Reset and Base Styles
   ========================================================================== */

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

body {
  margin: 0;
  font-family: var(--font-family-base);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: bold;
  font-size: 18px;
}

.header-inner img {
  height: 40px;
  width: auto;
  display: block;
}

.logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition-duration) ease;
}

.logo a:hover {
  opacity: 0.7;
}

.logo a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */

.layout {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 80px);
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

nav {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 32px 16px;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  margin-bottom: 16px;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all var(--transition-duration) ease;
}

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

nav a.active {
  color: var(--primary);
  font-weight: bold;
  background-color: #f8f9fa;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

main {
  flex: 1;
  padding: 48px 32px;
}

h1 {
  font-size: 28px;
  margin-bottom: 24px;
  color: var(--text);
}

h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text);
}

p {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* ==========================================================================
   Common Components
   ========================================================================== */

.section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 32px;
  box-shadow: var(--box-shadow);
}

.preparing {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 48px 16px;
}

/* ==========================================================================
   Company Table
   ========================================================================== */

.company-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.company-table th,
.company-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  text-align: left;
}

.company-table th {
  width: 180px;
  background: #fafafa;
  font-weight: normal;
  color: #555;
}

.company-table tr:last-child th,
.company-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Product/Service Sections
   ========================================================================== */

.product {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 32px;
  margin-bottom: 48px;
  box-shadow: var(--box-shadow);
}

.product-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.product-media {
  width: 45%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.media-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-content {
  width: 55%;
}

.product-content h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--text);
}

.product-content p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0;
}

/* ==========================================================================
   Hero Video Section (Top Page)
   ========================================================================== */

.hero-video {
  margin-bottom: 24px;
}

.hero-video-frame {
  width: 50%;
  margin: 0 auto;
  background: #000;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.hero-video-frame video {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Hero Catchcopy (Top Page)
   ========================================================================== */

.hero-catchcopy {
  text-align: center;
  margin-bottom: 32px;
  padding: 24px 16px;
}

.catchcopy-main {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 8px;
}

.catchcopy-sub {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 0;
}

/* ==========================================================================
   News Section (Top Page)
   ========================================================================== */

.news-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 32px;
  box-shadow: var(--box-shadow);
}

.news-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.news-list {
  min-height: 80px;
}

.news-placeholder {
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ==========================================================================
   Contact Form
   ========================================================================== */

.section iframe {
  border: none;
  border-radius: 4px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  nav ul {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
  }

  nav li {
    margin-bottom: 0;
  }

  main {
    padding: 32px 16px;
  }

  .product-layout {
    flex-direction: column;
  }

  .product-media,
  .product-content {
    width: 100%;
  }

  .header-inner {
    padding: 16px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .company-table th {
    width: 120px;
  }

  .company-table th,
  .company-table td {
    padding: 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    font-size: 16px;
  }

  .header-inner img {
    height: 32px;
  }

  main {
    padding: 24px 12px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .product {
    padding: 20px;
  }

  .company-table th,
  .company-table td {
    padding: 8px;
    font-size: 12px;
  }

  .company-table th {
    width: 80px;
  }

  .catchcopy-main,
  .catchcopy-sub {
    font-size: 18px;
  }

  .news-section {
    padding: 20px;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  nav {
    display: none;
  }

  .layout {
    flex-direction: column;
  }

  main {
    padding: 0;
  }

  .section,
  .product,
  .company-table {
    box-shadow: none;
    border: 1px solid #000;
  }

  .product {
    break-inside: avoid;
  }
}

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
    --text: #000;
    --muted: #333;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
a:focus,
iframe:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Improve readability on smaller screens */
@media (max-width: 600px) {
  body {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
