/* company.css - Company page (pages/company.html) styles */

/* ========== Sub Banner Override ========== */
.sub .sub-banner {
  padding: 0;
}

/* ========== Flex Content Reverse ========== */
.flex-content.reversed {
  flex-direction: row-reverse;
}

/* ========== Company Overview ========== */
.company-overview .pic-sec {
  gap: 12px;
}

.company-overview .pic-sec figure:first-child {
  grid-column: 1 / -1;
}

.company-overview .pic-sec figure:first-child img {
  aspect-ratio: 16 / 9;
}

/* ========== History Timeline ========== */
.company-history {
  background: var(--color-bg-light);
}

.timeline {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 0 0;
}

/* Vertical center line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

/* Bottom end cap */
.timeline::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 10px;
  height: 10px;
  background: var(--color-text-dark);
  border-radius: 50%;
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding-bottom: 50px;
}

.timeline-item:last-child {
  padding-bottom: 10px;
}

/* Odd items: left side */
.timeline-item:nth-child(odd) {
  padding-right: 50px;
  text-align: right;
}

/* Even items: right side */
.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-left: 50px;
}

/* Dot on the line */
.timeline-item::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--color-bg);
  border: 3px solid var(--color-text-dark);
  border-radius: 50%;
  top: 14px;
  z-index: 2;
  transition: var(--transition);
}

.timeline-item:nth-child(odd)::before {
  right: -9px;
}

.timeline-item:nth-child(even)::before {
  left: -9px;
}

.timeline-item:hover::before {
  background: var(--color-text-dark);
  transform: scale(1.3);
}

/* Content card */
.timeline-content {
  background: var(--color-bg);
  padding: 24px 28px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  position: relative;
}

.timeline-content:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* Arrow connector: odd → points right */
.timeline-item:nth-child(odd) .timeline-content::after {
  content: '';
  position: absolute;
  top: 14px;
  right: -8px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid var(--color-bg);
}

/* Arrow connector: even → points left */
.timeline-item:nth-child(even) .timeline-content::after {
  content: '';
  position: absolute;
  top: 14px;
  left: -8px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--color-bg);
}

.timeline-year {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-dark);
  display: block;
  margin-bottom: 6px;
  line-height: 1;
}

.timeline-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-dark);
}

.timeline-content p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 0;
}

/* ========== Core Values ========== */
.company-values .values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.company-values .value-card {
  text-align: center;
  padding: 40px 28px 36px;
  background: var(--color-bg-light);
  border-radius: 8px;
  border-top: 3px solid var(--color-text-dark);
  transition: var(--transition);
}

.company-values .value-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
}

.company-values .value-card .value-num {
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-accent);
  display: block;
  margin-bottom: 16px;
  line-height: 1;
}

.company-values .value-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 14px;
}

.company-values .value-card p {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ========== Stats Bar ========== */
.company-stats {
  background: var(--color-text-dark);
}

.sub .company-stats {
  padding: 70px 0;
}

.company-stats .stats-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  text-align: center;
}

.company-stats .stat-item strong {
  font-family: var(--font-en);
  font-size: 44px;
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
  color: var(--color-accent);
}

.company-stats .stat-item span {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
}

/* ========== Facilities ========== */
.company-facilities .metrics-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding: 0;
}

.company-facilities .metrics-list li {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 18px 10px;
  background: var(--color-bg-light);
  border-radius: 8px;
}

.company-facilities .metrics-list li strong {
  font-family: var(--font-en);
  font-size: 30px;
  font-weight: 700;
  color: var(--color-text-dark);
  display: block;
  margin-bottom: 6px;
}

.company-facilities .metrics-list li span {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ========== Team Intro ========== */
.company-team {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(180, 204, 255, 0.45), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 211, 182, 0.5), transparent 24%),
    linear-gradient(180deg, #fbfbfc 0%, #f3f5f8 100%);
}

.company-team::before,
.company-team::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.75;
}

.company-team::before {
  top: 90px;
  right: -120px;
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.5);
}

.company-team::after {
  bottom: 60px;
  left: -80px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.35);
}

.company-team .inner {
  position: relative;
  z-index: 1;
}

.team-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 44px;
}

.team-copy h2 {
  font-size: 42px;
  margin-bottom: 18px;
  line-height: 1.25;
}

.team-copy > p:last-of-type {
  max-width: 720px;
  font-size: 17px;
  color: var(--color-text);
  line-height: 1.9;
}

.team-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.team-keywords span,
.team-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.team-keywords span {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--color-text-dark);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
}

.team-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 30px;
  background: rgba(17, 24, 39, 0.94);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  box-shadow: 0 28px 50px rgba(17, 24, 39, 0.18);
}

.team-note-label {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #d5def2;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.team-note p {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.8);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.team-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto auto auto;
  column-gap: 20px;
  padding: 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}

.team-card::after { display: none; }

.team-avatar {
  grid-row: 1 / 3;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--team-avatar);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-role {
  display: inline-flex;
  width: fit-content;
  align-self: end;
  margin-bottom: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--team-badge);
  color: var(--color-text-dark);
  font-size: 11px;
  font-weight: 700;
}

.team-card h3 {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.02em;
  align-self: start;
}

.team-quote {
  grid-column: 1 / -1;
  margin: 6px 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border-left: 3px solid var(--team-badge);
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-text-dark);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.team-desc {
  grid-column: 1 / -1;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.team-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.team-tags span {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-muted);
  font-size: 11px;
}

.team-card.tone-coral {
  --team-avatar: linear-gradient(135deg, #ffd8c7 0%, #ffeeda 100%);
  --team-badge: #ffe1d6;
}

.team-card.tone-amber {
  --team-avatar: linear-gradient(135deg, #fff0c1 0%, #ffe1a5 100%);
  --team-badge: #fff0c6;
}

.team-card.tone-mint {
  --team-avatar: linear-gradient(135deg, #d6f6ea 0%, #c2efdf 100%);
  --team-badge: #daf7eb;
}

.team-card.tone-sky {
  --team-avatar: linear-gradient(135deg, #d6e8ff 0%, #c2ddff 100%);
  --team-badge: #deebff;
}

.team-card.tone-lilac {
  --team-avatar: linear-gradient(135deg, #ece1ff 0%, #dcd2ff 100%);
  --team-badge: #efe8ff;
}

.team-card.tone-sand {
  --team-avatar: linear-gradient(135deg, #f7e7d5 0%, #f3dcc1 100%);
  --team-badge: #f8ecdd;
}

/* ========== Responsive: Tablet ========== */
@media (max-width: 1024px) {
  .company-stats .stats-wrap {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 20px;
  }

  .company-stats .stat-item strong {
    font-size: 36px;
  }

  .timeline-content {
    padding: 20px 24px;
  }

  .team-intro {
    grid-template-columns: 1fr;
  }

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

/* ========== Responsive: Mobile ========== */
@media (max-width: 780px) {
  /* Timeline: single column, line on left */
  .timeline::before {
    left: 20px;
  }

  .timeline::after {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 55px;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item:nth-child(odd) {
    padding-right: 0;
    text-align: left;
  }

  .timeline-item:nth-child(even) {
    margin-left: 0;
    padding-left: 55px;
  }

  .timeline-item::before {
    left: 12px !important;
    right: auto !important;
  }

  /* All arrows point left on mobile */
  .timeline-item .timeline-content::after {
    left: -8px !important;
    right: auto !important;
    border-left: none !important;
    border-right: 8px solid var(--color-bg) !important;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
  }

  .company-values .values-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .company-stats .stats-wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 16px;
  }

  .sub .company-stats {
    padding: 50px 0;
  }

  .flex-content.reversed {
    flex-direction: column;
  }

  /* Org chart: stack vertically on mobile */
  .org-divisions {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .org-divisions::before,
  .org-division::before {
    display: none;
  }

  .org-chain .org-box {
    padding: 12px 40px;
    min-width: 160px;
    font-size: 15px;
    letter-spacing: 3px;
  }

  .team-copy h2 {
    font-size: 32px;
  }

  .team-copy > p:last-of-type {
    font-size: 15px;
  }

  .team-note {
    padding: 24px;
    border-radius: 24px;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .team-card {
    padding: 20px;
    border-radius: 16px;
  }

  .team-card h3 {
    font-size: 15px;
  }
}

@media (min-width: 781px) and (max-width: 1024px) {
  .org-divisions {
    grid-template-columns: repeat(2, 1fr);
    gap: 50px 30px;
  }

  /* 2-col layout: connector from col1 center to col2 center
     Formula: (100% - 30px) / 4 for 2 cols × 30px gap */
  .org-divisions::before {
    left: calc((100% - 30px) / 4);
    right: calc((100% - 30px) / 4);
  }

  /* Items 3 and 4 in 2nd row: no top connector */
  .org-division:nth-child(n+3)::before {
    display: none;
  }
}

/* ========== Organization Chart (matches reference image) ========== */
.company-org {
  background: var(--color-bg-light);
}

.org-chart {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 10px 10px;
}

/* Top vertical chain: 대표이사 */
.org-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
  position: relative;
}

.org-chain .org-box {
  background: #e8e8e8;
  border: 1px solid var(--color-text-dark);
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  text-align: center;
  border-radius: 4px;
  width: 240px;
  box-sizing: border-box;
  position: relative;
  box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.18);
}

.org-chain .org-box:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 22px;
  background: var(--color-text-dark);
}

/* Vertical line from 대표이사 to horizontal divider */
.org-chain::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 22px;
  background: var(--color-text-dark);
}

/* 4 divisions row */
.org-divisions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  position: relative;
}

/* Horizontal connector — exactly from col1 center to col4 center
   Formula: (100% - total_gaps) / (cols * 2) for 4 cols × 30px gap */
.org-divisions::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc((100% - 90px) / 8);
  right: calc((100% - 90px) / 8);
  height: 1px;
  background: var(--color-text-dark);
}

.org-division {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 22px;
}

/* Vertical line from horizontal connector to division head */
.org-division::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 22px;
  background: var(--color-text-dark);
}

.org-head {
  width: 100%;
  background: #e8e8e8;
  border: 1px solid var(--color-text-dark);
  padding: 14px 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--color-text-dark);
  border-radius: 4px;
  margin-bottom: 18px;
  position: relative;
  box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.18);
}

/* Vertical line from division head down to first team */
.org-head::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 18px;
  background: var(--color-text-dark);
}

.org-teams {
  list-style: none;
  width: 100%;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.org-teams li {
  background: var(--color-bg);
  border: 1px solid var(--color-text-dark);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--color-text-dark);
  border-radius: 4px;
  position: relative;
  box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.18);
}

/* Vertical line connecting consecutive team boxes */
.org-teams li:not(:first-child)::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 16px;
  background: var(--color-text-dark);
}

/* Responsive: Small Mobile ========== */
@media (max-width: 480px) {
  .timeline::before {
    left: 15px;
  }

  .timeline::after {
    left: 15px;
  }

  .timeline-item {
    padding-left: 45px;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    padding-left: 45px;
  }

  .timeline-item::before {
    left: 7px !important;
  }

  .timeline-year {
    font-size: 22px;
  }

  .timeline-content {
    padding: 18px 20px;
  }

  .timeline-content h3 {
    font-size: 15px;
  }

  .company-stats .stat-item strong {
    font-size: 28px;
  }

  .company-facilities .metrics-list li strong {
    font-size: 24px;
  }
}
