* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'ptbd', 'Pretendard', 'Noto Sans KR', sans-serif; background-color: #f2f4f7; color: #222; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* 텍스트 드래그 선택 방지 */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 이미지 드래그 방지 */
img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* Font Setting */
@font-face { font-family: 'ptbd'; src: url('평택반도체 Regular.ttf') format('truetype'); font-weight: normal; font-style: normal; }

/* Header & GNB */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid #e5e5e5; height: 60px; }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; justify-content: space-between; align-items: center; }
.header-left { display: flex; align-items: center; gap: 15px; }
.btn-menu { background: none; border: none; font-size: 22px; cursor: pointer; padding: 5px; display: flex; align-items: center; line-height: 1; transform: translateY(-2px); }
.logo { font-size: 22px; font-weight: 900; color: #000; letter-spacing: -1px; white-space: nowrap; }

.header-right { display: flex; align-items: center; gap: 15px; font-size: 14px; font-weight: 600; }
.btn-login-sm { background: #111; color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 13px; }
.btn-remote-sm { background: #0300b6; color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #eb2525; transition: transform 0.2s ease; animation: tripleGlowBorder 1.8s infinite ease-in-out; }
.btn-remote-sm:hover { transform: scale(1.05); }
.site-toggle-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  user-select: none;
}

.toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 150px;
  height: 32px;
  padding: 3px;
  border-radius: 20px;
  background-color: #cbd5e1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
  transition: background-color 0.35s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.site-toggle-btn:hover .toggle-track {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-label {
  position: relative;
  z-index: 2;
  width: 50%;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.3px;
  transition: color 0.3s ease;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  width: 70px;
  height: 26px;
  background-color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* [상태 A: 좌측 활성화] A 색상 지정 (로열 블루 계열) */
.site-toggle-btn.active-left .toggle-track {
  background-color: #eb2525; /* ★ A 색상 */
}
.site-toggle-btn.active-left .toggle-knob {
  transform: translateX(0);
}
.site-toggle-btn.active-left .toggle-label.left {
  color: #1e293b;
}
.site-toggle-btn.active-left .toggle-label.right {
  color: rgba(255, 255, 255, 0.9);
}

/* [상태 B: 우측 활성화] B 색상 지정 (에메랄드 그린 계열) */
.site-toggle-btn.active-right .toggle-track {
  background-color: #810ca5; /* ★ B 색상 */
}
.site-toggle-btn.active-right .toggle-knob {
  transform: translateX(74px);
}
.site-toggle-btn.active-right .toggle-label.left {
  color: rgba(255, 255, 255, 0.9);
}
.site-toggle-btn.active-right .toggle-label.right {
  color: #0f172a;
}

/* Slide-out Drawer */
.drawer-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); z-index: 999; opacity: 0; visibility: hidden; transition: 0.3s; }
.drawer-overlay.active { opacity: 1; visibility: visible; }

.drawer-menu { position: fixed; top: 0; left: -380px; width: 380px; height: 100vh; background: #fff; z-index: 1000; transition: left 0.3s ease; display: flex; flex-direction: column; box-shadow: 2px 0 12px rgba(0,0,0,0.15); }
.drawer-menu.active { left: 0; }
.drawer-header { color:#200000; padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; }

.drawer-content { flex: 1; overflow-y: auto; padding: 20px; }
.menu-group { margin-bottom: 25px; }
.menu-group-title { font-size: 15px; color: #ff6b6b; font-weight: 700; margin-bottom: 10px; }
.menu-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 15px; }
.menu-list a { font-size: 14px; color: #555; font-weight: 500; }
.menu-list a:hover { color: #ffc5c5; font-weight: 700; }

.drawer-footer { background: #200000; color: #aaa; padding: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; font-size: 13px; }
.drawer-footer a { color: #ccc; display: flex; align-items: center; gap: 6px; }
.drawer-footer a:hover { color: #ccc; }

/* Main Layout */
.main-wrapper { max-width: 1280px; margin: 0 auto; padding: 25px 20px; }

/* 1. 상단 프로모션 배너 (넥토리얼 스타일) */
.top-promo-banner {
  background: url('img/ban.jpg') no-repeat center / cover;
  color: #fff;
  border-radius: 12px;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.promo-text .promo-badge {
  background: #ffc5c5;
  color: #2a0f0f;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}
.promo-text h2 {
  font-size: 24px;
  margin: 12px 0 8px;
  line-height: 1.3;
}
.promo-text p {
  font-size: 15px;
  opacity: 0.8;
  margin-bottom: 16px;
}
.btn-promo {
  display: inline-block;
  background: #fff;
  color: #2a0f0f;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 15px;
  transition: background-color 0.2s;
}
.btn-promo:hover { background: #ffc5c5; }
.promo-media {
  width: 400px;
  height: 225px;
  background: #2a0f0f;
  border-radius: 12px; 
  border: 2px solid #ffc5c5;
  box-shadow: 0 0 15px #ff6b6b, 0 0 30px #ff6b6b85; /* 네온 글로우 효과 */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.promo-media iframe {
  border: none;
  display: block;
  width: 100%;
  height: 100%;
}

.video-placeholder { text-align: center; }

/* 2. 섹션 헤더 & 필터 */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-title { font-size: 20px; font-weight: 800; }
.sub-tag { font-size: 13px; color: #eb2525; font-weight: 700; margin-top: 2px; display: block; }

.filter-tabs { display: flex; gap: 8px; }
.tab-btn { background: #f0e2e2; border: none; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; color: #475569; }
.tab-btn.active { background: #2a0f0f; color: #fff; }

/* 3. 추천 서비스 세션 & 우측 이벤트 배너 */
.recommended-section { margin-bottom: 45px; }
.recommended-grid { display: grid; grid-template-columns: repeat(4, 1fr) 200px; gap: 15px; margin-top: 15px; }

.side-event-banner {
  background: linear-gradient(135deg, #ff7c7c 0%, #ffdcdc 100%);
  color: #fff;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.banner-sub { font-size: 11px; opacity: 0.8; letter-spacing: 0.5px; }
.side-event-banner h4 { font-size: 20px; font-weight: 800; margin: 10px 0; line-height: 1.25; }
.banner-date { font-size: 11px; opacity: 0.7; }

/* 4. 전체 서비스 세션 (5열 그리드) 및 공통 카드 디자인 */
.all-services-section { margin-bottom: 40px; }
.card-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-top: 15px; }

.card-item { background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid #ffdcdc; transition: transform 0.2s, box-shadow 0.2s; }
.card-item:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.06); }
.card-thumb { width: 100%; height: 130px; background-color: #e1cbcb; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #8b6464; position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 3px; }
.card-content { padding: 14px; }
.card-title { font-size: 15px; font-weight: 700; color: #3b1e1e; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { font-size: 12px; color: #8b6464; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 5. RSS 섹션 & news-card 스타일 */
.rss-section {
  margin-bottom: 45px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: none !important;
  box-shadow: 0 0 0 1px #ffc5c5 !important;
  border-radius: 10px;
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.news-card .date {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #eb2525;
  background: #ffdcdc;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.news-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #3b1e1e;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card p {
  font-size: 12px;
  color: #8b6464;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}
/* 지도 버튼 그룹 스타일 */
.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}

.btn-group .map-btn {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 네이버 지도 버튼 스타일 */
.map-btn.naver {
    background: #03cf5d;
    color: #ffffff;
}
.map-btn.naver:hover {
    background: #02b350;
}

/* 카카오 맵 버튼 스타일 */
.map-btn.kakao {
    background: #fee500;
    color: #3c1e1e;
}
.map-btn.kakao:hover {
    background: #e6ce00;
}

.loader {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: #ffc5c5;
  font-size: 14px;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed #e1cbcb;
}

/* Footer */
.site-footer { background: #fff; color: #000; padding: 40px 0 20px; font-size: 12px; margin-top: 60px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.footer-links { display: flex; gap: 20px; border-bottom: 1px solid #000; padding-bottom: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a.highlight { color: #000; font-weight: 700; }
.footer-info { line-height: 1.8; margin-bottom: 15px; }

/* Layer Popup Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: #fff;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px;
  background: #ff6b6b;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

@keyframes tripleGlowBorder {
  0%, 100% {
    border-color: #10b981; /* 색상 1: 에메랄드 그린 */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  }
  33% {

    border-color: #eb2525; /* 색상 2: 레드 */
    box-shadow: 0 0 8px rgba(235, 37, 37, 0.7);
  }
  66% {
    border-color: #f6ea3b; /* 색상 3: 노랑 (엘로우) */
    box-shadow: 0 0 8px rgba(246, 234, 59, 0.7);
  }
}

@media (max-width: 1100px) {
  .recommended-grid { grid-template-columns: repeat(4, 1fr); }
  .side-event-banner { display: none; }
  .card-grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  /* 1. 헤더 레이아웃 최적화 */
  .site-header {
    height: auto;
    min-height: 60px;
    padding: 6px 0;
  }
  .header-inner {
    padding: 0 10px;
    gap: 6px;
  }
  .header-left {
    gap: 6px;
    flex-shrink: 0;
  }
  .logo {
    font-size: 16px;
  }

  .header-right {
    gap: 4px;
  }

  /* 헤더 우측 토글 버튼 크기 축소 */
  .site-toggle-btn .toggle-track {
    width: 115px;
    height: 28px;
  }
  .site-toggle-btn .toggle-knob {
    width: 54px;
    height: 22px;
  }
  .site-toggle-btn.active-right .toggle-knob {
    transform: translateX(55px);
  }
  .toggle-label {
    font-size: 10px;
  }

  /* 우측 버튼 패딩 및 폰트 축소 */
  .btn-remote-sm, 
  .btn-login-sm {
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* 2. 상단 프로모션 배너 최적화 */
  .top-promo-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px 15px;
    gap: 15px;
    margin-bottom: 25px;
  }
  .promo-text .promo-badge {
    font-size: 11px;
  }
  .promo-text h2 {
    font-size: 18px;
    line-height: 1.4;
    word-break: keep-all; /* 단어 단위로 깔끔하게 줄바꿈 */
  }
  /* 모바일 화면에서는 강제 줄바꿈(<br>) 무시 */
  .promo-text h2 br {
    display: none;
  }
  .promo-text p {
    font-size: 13px;
    margin-bottom: 12px;
  }
  .btn-promo {
    padding: 6px 14px;
    font-size: 13px;
  }

  /* 유튜브 영상 16:9 비율 가변 유지 */
  .promo-media {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  /* 3. 그리드 레이아웃 최적화 */
  .recommended-grid { 
    grid-template-columns: repeat(2, 1fr); 
  }
  .card-grid-5 { 
    grid-template-columns: repeat(2, 1fr); 
  }
  .card-grid-5 > *:nth-child(n+5) {
    display: none !important;
  }


  .btn-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media print {
  body {
    display: none !important;
  }
}

/* 1. 위젯 및 위젯 내부 모든 글꼴을 'ptbd'로 강제 통일 */
.feedcontrol-widget,
.feedcontrol-widget * {
  font-family: 'ptbd', 'Pretendard', sans-serif !important;
}

.feedcontrol-widget {
  border: none !important;
  box-shadow: 0 0 0 1px #ffc5c5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  overflow: hidden !important; /* 내부 요소 테두리 삐져나옴 방지 */
}

/* 개별 뉴스 항목 테두리 지정 */
.feedcontrol-widget [class*="item"],
.feedcontrol-widget article {
  padding: 10px 15px !important;
  border-bottom: 1px solid #ffc5c5 !important;
  margin: 0 1px !important;
}

/* PC/모바일 공통: 마지막 항목의 하단 선 및 여백 제거 (이중 선 방지) */
.feedcontrol-widget [class*="item"]:last-child,
.feedcontrol-widget article:last-child,
.feedcontrol-widget > div > div:last-child {
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

.feedcontrol-widget a { color: #3b1e1e !important; }
.feedcontrol-widget p { color: #8b6464 !important; }

/* ★ [핵심 추가] PC: 이미지를 감싸는 부모 감싸개(Wrapper) 크기 확대 */
.feedcontrol-widget [class*="image"],
.feedcontrol-widget figure,
.feedcontrol-widget picture,
.feedcontrol-widget a > div:first-child {
  width: 220px !important;
  min-width: 220px !important;
  max-width: none !important;
  flex: 0 0 220px !important; /* Flex 레이아웃에서 고정 너비 강제 지정 */
}

/* PC: 이미지 자체 크기 설정 */
.feedcontrol-widget img {
  width: 100% !important;
  height: 150px !important;
  object-fit: cover !important; /* 비율 유지하며 깔끔하게 자르기 */
  border-radius: 8px !important;
}

.feedcontrol-widget [class*="title"],
.feedcontrol-widget a {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #3b1e1e !important;
  line-height: 1.4 !important;
}

.feedcontrol-widget [class*="description"],
.feedcontrol-widget [class*="desc"],
.feedcontrol-widget p {
  font-size: 13px !important;
  color: #8b6464 !important;
  line-height: 1.5 !important;
  margin-top: 6px !important;
}

/* 2. 모바일 전용 위젯 레이아웃 보정 (768px 이하) */
@media (max-width: 768px) {
  .feedcontrol-widget {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ★ [핵심 추가] 모바일: 이미지를 감싸는 부모 영역 크기 제어 */
  .feedcontrol-widget [class*="image"],
  .feedcontrol-widget figure,
  .feedcontrol-widget picture,
  .feedcontrol-widget a > div:first-child {
    width: 150px !important;
    min-width: 150px !important;
    flex: 0 0 150px !important;
  }

  /* 모바일: 이미지 자체 크기 설정 */
  .feedcontrol-widget img {
    width: 100% !important;
    height: 110px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
  }

  /* 뉴스 제목 (2줄 제한) */
  .feedcontrol-widget [class*="title"],
  .feedcontrol-widget a {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #3b1e1e !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: keep-all !important;
  }

  /* 뉴스 요약문 (2줄 제한) */
  .feedcontrol-widget [class*="description"],
  .feedcontrol-widget [class*="desc"],
  .feedcontrol-widget p {
    font-size: 12px !important;
    color: #8b6464 !important;
    line-height: 1.4 !important;
    margin-top: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}