/* --- 🎥 갤러리 및 정보 레이아웃 --- */

/* 레이아웃의 부모 컨테이너 */
.machine-detail-layout {
  display: grid;
  grid-template-columns: 1fr; /* 📱 모바일: 기본적으로 1단 컬럼 */
  gap: 24px; /* 컬럼 사이의 간격 */
}

/* 💻 768px 이상인 화면(태블릿, 데스크탑)에서는 2단으로 변경 */
@media (min-width: 768px) {
  .machine-detail-layout {
    /* 전체를 12칸으로 나누고, 갤러리 7칸, 정보 5칸을 차지하도록 설정 */
    grid-template-columns: repeat(12, 1fr);
  }

  .machine-detail__gallery {
    grid-column: 1 / 7; /* 1번 칸에서 시작해서 8번 칸 앞에서 끝남 (총 7칸) */
  }

  .machine-detail__info {
    grid-column: 7 / 13; /* 8번 칸에서 시작해서 13번 칸 앞에서 끝남 (총 5칸) */
  }

  .machine-detail__info {
    /* 스티키 포지션 적용 */
    position: -webkit-sticky;
    position: sticky;

    /* 화면 상단에서 20px 떨어진 곳에 고정 */
    top: 20px;

    /* Grid/Flex 레이아웃에서 아이템이 늘어나는 것을 방지 */
    align-self: start;
  }

}

/* --- 🖼️ 반응형 이미지 처리 --- */

/* 갤러리 컨테이너와 그 안의 이미지 스타일 */
.machine-detail__gallery {
  width: 100%; /* 항상 부모 요소의 너비를 100% 차지 */
}

.machine-detail__gallery img {
  width: 100%; /* 이미지 너비를 컨테이너에 100% 맞춤 */
  height: auto; /* 이미지의 세로 비율을 자동으로 유지 */
  display: block; /* 이미지 아래의 불필요한 여백 제거 */
  border-radius: 18px; /* 이미지 모서리를 부드럽게 */
  padding: 0.5rem;
}

.page-title-wrap{
    padding: 30px 0;
}

.container {
  /* 최대 너비를 1200px로 설정 (일반적인 웹사이트 본문 너비) */
  max-width: 1200px;
  
  /* 최신 방식으로 가운데 정렬 (margin-left/right: auto 와 동일) */
  margin-inline: auto;
  
  /* 모바일에서 화면 양쪽 끝에 내용이 달라붙지 않도록 좌우에 여백 추가 */
  padding-inline: 1rem; /* 1rem은 약 16px 입니다 */
}

#block-views-block-agricultural-machinery-block-1--2 > div > div > div > div > ul > li > span.views-field.views-field-field-images > span > a > img {
    max-width: 80px;
    float: left;
    margin-right: 0.5rem;
    border-radius: 0.3rem;
}
#block-views-block-agricultural-machinery-block-1--2  ul{
    padding-left:1rem;
    padding-right: 1rem;
}
#block-views-block-agricultural-machinery-block-1--2  ul > li {
        list-style: none;
}

/* --- News Item Layout --- */
.news-item {
  /* 이 한 줄이 핵심입니다. 
    자식 요소인 .news-item__image 와 .news-item__content 를 
    가로(같은 줄) 방향으로 나란히 배치합니다. 
  */
  display: flex;

  /* 이미지와 텍스트의 높이가 다를 경우,
    세로 방향에서 보기 좋게 중앙으로 정렬합니다. 
  */
  align-items: center;

  /* 이미지와 텍스트 사이에 16px 정도의 간격을 줍니다. */
  gap: 16px;
}

.news-item__image {
  /* 화면이 좁아져도 이미지 컬럼의 너비가 줄어들어
    찌그러지는 것을 방지합니다. 
  */
  flex-shrink: 0;
  
  /* 이미지 컬럼의 너비를 고정합니다. (원하는 크기로 조절) */
  width: 120px; 
}

.news-item__image img {
        padding: 10px;
    border-radius: 1rem;
}

.news-item__content {
  /* 이미지 너비를 제외한 나머지 공간을
    콘텐츠 영역이 모두 차지하도록 합니다. 
  */
  flex-grow: 1;
}

@media (max-width: 500px) {
 div.news-item__content .news-item__meta{
    display: none;
 }
}

.field_year_of_manufacture > div {
        display: contents;
}




/* --- 상세 정보 테이블 스타일 (추천) --- */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid #333;
  font-size: 0.95rem;
}

.detail-table th,
.detail-table td {
  padding: 16px 10px;
  border-bottom: 1px solid #e9e9e9;
  vertical-align: middle;
}

.detail-table th {
  width: 120px;
  background-color: #f9f9f9;
  font-weight: 500;
  text-align: center;
  color: #333;
}

.detail-table td {
  color: #555;
}

/* 링크 스타일 */
.detail-table td a {
  text-decoration: none;
  color: #007bff;
}
.detail-table td a:hover {
  text-decoration: underline;
}

/* 가격 wrapper */
.price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.price-amount {
  font-weight: bold;
  font-size: 1.3rem;
  color: #d9534f;
}

.price-negotiable {
  font-size: 0.9rem;
  color: #666;
}




/* --- 사양표 전체 래퍼 --- */
.spec-table-wrapper {
  margin: 2em 0;
  font-family: 'Pretendard', sans-serif; /* 예시 폰트 */
}

/* --- 표 기본 스타일 (데스크탑) --- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid #333;
}

/* 표의 캡션(제목)은 시각적으로 숨기지만, 스크린 리더를 위해 남겨둡니다. */
.spec-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.spec-table th,
.spec-table td {
  padding: 16px;
  border-bottom: 1px solid #e9e9e9;
  text-align: left;
  vertical-align: top;
}

/* --- 표의 라벨(th) 스타일 --- */
.spec-table th {
  width: 180px; /* 라벨 너비 고정 */
  background-color: #f7f7f7;
  font-weight: 600;
  color: #333;
}

/* --- 표의 값(td) 스타일 --- */
.spec-table td {
  color: #555;
}

/* --- 추가 설명 스타일 --- */
.spec-description {
  margin-top: 24px;
  padding-top: 24px;
}
.spec-description h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.spec-description p {
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
}

/* --- 📱 반응형 스타일 (모바일 화면) --- */
@media (max-width: 768px) {
  /* 테이블의 기본 형식을 해제하고 블록 요소처럼 만듭니다. */
  .spec-table,
  .spec-table tbody,
  .spec-table tr,
  .spec-table th,
  .spec-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* 각 행(tr)을 카드처럼 보이게 만듭니다. */
  .spec-table tr {
    margin-bottom: 1rem;
    border-bottom: 2px solid #ddd;
    padding-bottom: 1rem;
  }
  .spec-table tr:last-child {
    border-bottom: 0;
  }

  /* 라벨(th) 스타일 조정 */
  .spec-table th {
    width: auto;
    background-color: transparent;
    border-bottom: none;
    font-size: 0.9rem;
    color: #666;
    padding: 8px 0;
  }

  /* 값(td) 스타일 조정 */
  .spec-table td {
    border: none;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 500;
  }
}