/* ==========================================================================
   바이오플랜 (BIOPLAN) — 재배력(작물별 방제·시비 캘린더) 전용 스타일
   --------------------------------------------------------------------------
   ▷ kr/farming_calendar.html, kr/farming_calendar_detail.html 에서만 로드.
   ▷ common_n.css 를 건드리지 않고 이 파일에서만 재배력 UI를 관리한다.
   ▷ 브랜드 컬러는 common_n.css가 이미 로드해 둔 --color-accent 계열(tokens.css
     기반)을 재사용하고, 제품 구분용 색상 4개만 아래에 로컬 변수로 정의한다.
     (실제 카탈로그 이미지에서 픽셀 샘플링한 색을 접근성 위해 살짝 보정)
   ========================================================================== */

:root {
  --fc-c-iodei: #8fbb2e; /* 이오데이 — 연두색 */
  --fc-c-bunul: #00793f; /* 분얼박사 — 진초록 */
  --fc-c-ecto: #f2a118; /* 엑토신 — 주황 */
  --fc-c-turgeo: #e8481f; /* 터거 — 빨강/오렌지레드 */
}

/* ==========================================================================
   공통: SUB NAVIGATION + HERO + CRUMB + TITLE (products.html과 동일 패턴)
   ========================================================================== */
.sub-nav {
  margin-top: var(--header-h);
  background: var(--color-accent);
  height: 56px;
  position: relative;
  z-index: 50;
}
.sub-nav-inner {
  max-width: var(--container-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
}
.sub-nav .home {
  display: grid;
  place-items: center;
  width: 56px;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  flex-shrink: 0;
}
.sub-nav .home svg {
  width: 16px;
  height: 16px;
}
.sub-nav-item {
  position: relative;
  height: 100%;
}
.sub-nav-item > button {
  height: 100%;
  min-width: 240px;
  padding: 0 24px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  letter-spacing: -0.01em;
}
.sub-nav-item > button .caret {
  width: 10px;
  height: 10px;
  transition: transform 0.25s var(--ease);
}
.sub-nav-item.open > button .caret {
  transform: rotate(180deg);
}
.sub-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid var(--color-line);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    visibility 0s linear 0.2s;
  z-index: 10;
}
.sub-nav-item.open .sub-nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    visibility 0s linear 0s;
}
.sub-nav-dropdown a {
  display: block;
  padding: 12px 24px;
  font-size: 13px;
  color: var(--color-text-soft);
  border-bottom: 1px solid var(--color-line-soft);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.sub-nav-dropdown a:last-child {
  border-bottom: none;
}
.sub-nav-dropdown a:hover,
.sub-nav-dropdown a.is-current {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

.page-hero {
  height: 280px;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.05)),
    url("/images/bg14.jpg");
  background-size: cover;
  background-position: center;
}

.fc-wrap {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 64px 48px 100px;
  word-break: keep-all;
}

.fc-crumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-mute, #9aa3ad);
  font-size: 15px;
  margin-top: 30px;
  margin-bottom: 30px;
}
.fc-crumb svg {
  width: 14px;
  height: 14px;
}
.fc-crumb .sep {
  opacity: 0.5;
}

.fc-title {
  text-align: center;
  font-size: 50px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: 16px;
}
.fc-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--color-text-soft);
  margin-bottom: 56px;
}

/* ==========================================================================
   목록 페이지: 작물별/제품별 탭
   ========================================================================== */
.fc-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--color-line);
  margin-bottom: 48px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.fc-tab {
  padding: 18px 12px;
  background: #fff;
  border: none;
  border-right: 1px solid var(--color-line);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.fc-tab:last-child {
  border-right: none;
}
.fc-tab:hover:not(.is-active) {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.fc-tab.is-active {
  background: var(--color-text);
  color: #fff;
}

.fc-panel {
  display: none;
}
.fc-panel.is-active {
  display: block;
}

.fc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
}
.fc-card {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.fc-card:hover {
  transform: translateY(-4px);
}
.fc-card__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-line-soft);
  border: 1px solid var(--color-line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  position: relative;
}
.fc-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 22px;
  transition: transform 0.5s var(--ease);
}
.fc-card:hover .fc-card__img img {
  transform: scale(1.06);
}
.fc-card__emoji {
  font-size: 56px;
}
.fc-card.is-soon .fc-card__img {
  opacity: 0.55;
}
.fc-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(26, 26, 26, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 100px;
  letter-spacing: -0.01em;
}
.fc-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  text-align: center;
}
.fc-card.is-soon .fc-card__title {
  color: var(--color-text-mute, #9aa3ad);
}
.fc-card__meta {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--color-text-mute, #9aa3ad);
  margin-top: 4px;
}

/* ==========================================================================
   상세 페이지 공통
   ========================================================================== */
.fc-detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.fc-detail-header__img {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  background: var(--color-line-soft);
  border: 1px solid var(--color-line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.fc-detail-header__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}
.fc-detail-header__body h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.fc-detail-header__body p {
  font-size: 14.5px;
  color: var(--color-text-soft);
}

/* ==========================================================================
   상세 페이지: 재배 트랙(조생종 등) 선택 탭 — 큼직한 터치 버튼
   ========================================================================== */
.fc-variety-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.fc-vtab {
  padding: 16px 12px;
  background: #fff;
  border: 2px solid var(--color-line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.fc-vtab:hover:not(.is-active) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.fc-vtab.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* ==========================================================================
   상세 페이지: 카탈로그 원본 스타일 가로 간트 표
   --------------------------------------------------------------------------
   .fc-gantt-panel(grid) = 1행: 좌측 세로 타이틀바 + 간트표(가로스크롤) /
   2행: 제품 범례를 전체 폭 가로로. 간트표가 폭을 다 쓰도록 범례를 표
   옆이 아니라 아래에 배치한다. .fc-gantt는 하나의 CSS Grid에 헤더(월/순)·
   생육단계·제품 적용·병해충·기상재해를 전부 grid-column/row로 배치한다 —
   작물마다 컬럼 수(월 수)·레인 수(겹치는 기상재해 등)가 JS에서 계산되어
   인라인 style로 주입되므로 이 CSS는 특정 작물에 종속되지 않는다.
   ========================================================================== */
.fc-gantt-panel {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-areas:
    "title main"
    "legend legend";
  gap: 16px;
}
.fc-gantt-titlebar {
  grid-area: title;
  border-radius: 12px;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 16px 0;
}
.fc-gantt-main {
  grid-area: main;
  min-width: 0;
}
.fc-gantt-today-note {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 10px;
}
.fc-gantt-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: 12px;
}
.fc-gantt {
  display: grid;
  position: relative;
  min-width: 640px;
}
.fc-gantt-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.3;
  border-right: 1px solid var(--color-line-soft);
  border-bottom: 1px solid var(--color-line-soft);
  word-break: keep-all;
}
.fc-gantt-corner,
.fc-gantt-rowlabel {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-accent-soft);
  font-weight: 800;
  color: var(--color-text);
  font-size: 13px;
  border-right: 2px solid var(--color-accent);
}
.fc-gantt-month {
  background: var(--color-accent);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  border-right: 2px solid rgba(255, 255, 255, 0.3);
}
.fc-gantt-dekad {
  background: var(--color-accent-soft);
  color: var(--color-text-soft);
  font-weight: 700;
}
.fc-gantt-dekad.is-today {
  background: var(--color-accent);
  color: #fff;
}
.fc-gantt-stage {
  background: #fff;
  color: var(--color-text);
  font-weight: 700;
  margin: 3px 2px;
  border: 1px solid var(--color-line);
  border-radius: 6px;
}
.fc-gantt-stage.is-now {
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
}
.fc-gantt-app {
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  margin: 4px 1px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.35);
  transition: filter 0.15s var(--ease);
}
.fc-gantt-app:hover,
.fc-gantt-app:focus-visible {
  filter: brightness(1.08);
}
.fc-gantt-app.is-now {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
.fc-gantt-pest {
  background: #f6dcdd;
  color: #7a2020;
  font-weight: 700;
  margin: 3px 2px;
  border-radius: 6px;
}
.fc-gantt-risk {
  background: #fbe8c8;
  color: #7a4a06;
  font-weight: 700;
  margin: 3px 2px;
  border-radius: 6px;
}
.fc-gantt-today {
  background: rgba(0, 90, 54, 0.08);
  pointer-events: none;
}

/* ==========================================================================
   상세 페이지: 하단 가로 제품 범례
   ========================================================================== */
.fc-gantt-legend {
  grid-area: legend;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.fc-gantt-legend__item {
  display: block;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  transition: box-shadow 0.15s var(--ease);
}
.fc-gantt-legend__item:hover {
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.2);
}
.fc-gantt-legend__tag {
  display: inline-block;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}
.fc-gantt-legend__img {
  display: block;
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
}
.fc-gantt-legend__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fc-gantt-legend__list li {
  font-size: 12.5px;
  color: var(--color-text-soft);
  line-height: 1.5;
  padding-left: 12px;
  position: relative;
}
.fc-gantt-legend__list li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--color-accent);
  font-weight: 800;
}
.fc-gantt-legend__note {
  font-size: 11.5px;
  color: #a05a00;
  background: #fff7e8;
  border: 1px solid #f0cf98;
  border-radius: 8px;
  padding: 10px;
  line-height: 1.5;
}

.fc-cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-accent);
}

.fc-tl-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-text);
  margin: 40px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
}
.fc-tl-section-title:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 32px;
}

/* ==========================================================================
   제품별 보기: 사용 목록 카드 (type=product 상세)
   ========================================================================== */
.fc-usage-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fc-usage-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: #fff;
}
.fc-usage-card__dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.fc-usage-card__body {
  flex: 1;
}
.fc-usage-card__crop {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}
.fc-usage-card__variety {
  font-size: 15px;
  color: var(--color-text-soft);
}
.fc-usage-card__timing {
  font-size: 15px;
  color: var(--color-text-mute, #9aa3ad);
  font-weight: 700;
  white-space: nowrap;
}
.fc-usage-card__link {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .sub-nav-inner {
    padding: 0 24px;
  }
  .sub-nav-item > button {
    min-width: 180px;
  }
  .fc-wrap {
    padding: 48px 24px 80px;
  }
  .fc-title {
    font-size: 30px;
  }
  .fc-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 18px;
  }
}

@media (max-width: 860px) {
  .page-hero {
    margin-top: var(--header-h) !important;
    height: 180px;
  }
  .sub-nav {
    height: auto;
    min-height: 48px;
    display: none !important;
  }

  .fc-wrap {
    padding: 40px 16px 64px;
  }
  .fc-title {
    font-size: 24px;
    margin-bottom: 12px;
  }
  .fc-subtitle {
    margin-bottom: 32px;
    font-size: 14px;
  }
  .fc-tabs {
    margin-bottom: 32px;
  }
  .fc-tab {
    padding: 14px 8px;
    font-size: 14px;
  }

  .fc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 14px;
  }
  .fc-card__title {
    font-size: 14.5px;
  }
  .fc-card__emoji {
    font-size: 40px;
  }

  .fc-detail-header {
    gap: 14px;
    margin-bottom: 28px;
  }
  .fc-detail-header__img {
    width: 64px;
    height: 64px;
  }
  .fc-detail-header__body h1 {
    font-size: 22px;
  }

  .fc-usage-card {
    padding: 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .fc-vtab {
    font-size: 15px;
    padding: 14px 8px;
  }

  /* 좁은 화면: 세로 타이틀바 대신 상단 가로 바 + 표/범례를 세로로 쌓는다.
     표 자체는 계속 가로 스크롤(.fc-gantt-scroll)로 본다 — 열 수가
     많아 강제로 줄이면 글자가 안 보이게 되므로 폭 축소 대신 스크롤 유지. */
  .fc-gantt-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "main"
      "legend";
  }
  .fc-gantt-titlebar {
    writing-mode: horizontal-tb;
    padding: 10px;
    font-size: 15px;
  }
  .fc-gantt-legend {
    grid-template-columns: repeat(2, 1fr);
  }
  .fc-gantt-cell {
    font-size: 11px;
  }
}
