/*
 * 강한설비 (strongsulbi.com) — Custom Theme CSS
 * Kadence theme override to apply new design system.
 *
 * Deploy: Code Snippets plugin (wp-admin) → add as "Site-wide CSS"
 * OR: append to Kadence "Additional CSS" in Customizer
 *
 * Design system: PART F of melodic-weaving-hennessy.md plan
 */

/* ============================================================= */
/* 1. Pretendard Variable font (self-hosted) */
/* ============================================================= */
@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url('/wp-content/uploads/fonts/PretendardVariable.woff2?v=2') format('woff2');
}

/* ============================================================= */
/* 2. Design tokens (CSS custom properties) */
/* ============================================================= */
:root {
  /* Color palette — Horizon Services benchmark (2026-04-18) */
  --navy-trust: #003D7A;          /* Horizon Blue */
  --navy-trust-darker: #002A56;
  --cream-bg: #F5F5F5;            /* Horizon Off-white */
  --copper-accent: #FF6B35;       /* Horizon Orange (CTA) */
  --copper-accent-darker: #E85A28;
  --safe-gray: #2C2C2C;           /* Dark Charcoal */
  --alert-red: #C84B31;

  /* Supporting */
  --border-soft: #E2E8F0;
  --text-primary: #2C2C2C;
  --text-inverse: #FFFFFF;
  --white-card: #FFFFFF;

  /* Typography */
  --font-family-sans: 'Pretendard Variable', Pretendard, -apple-system,
    BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic',
    '맑은 고딕', sans-serif;

  /* Type scale */
  --fs-h1: 48px;
  --fs-h1-mobile: 32px;
  --fs-h2: 36px;
  --fs-h3: 28px;
  --fs-h4: 20px;
  --fs-body-lg: 18px;
  --fs-body: 16px;
  --fs-body-sm: 14px;
  --fs-caption: 12px;

  /* Spacing (8px grid) */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 48px;
  --s-xxl: 96px;

  /* Border radius */
  --radius: 4px;

  /* Shadow */
  --shadow-soft: 0 2px 8px rgba(10, 44, 66, 0.04);
}

/* ============================================================= */
/* 3. Global typography */
/* ============================================================= */
html,
body {
  font-family: var(--font-family-sans);
  color: var(--text-primary);
  font-feature-settings: 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--cream-bg);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--navy-trust);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 0;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.2;
}
@media (max-width: 768px) {
  h1 { font-size: var(--fs-h1-mobile); }
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.3;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.4;
  font-weight: 600;
}

h4 {
  font-size: var(--fs-h4);
  line-height: 1.4;
  font-weight: 600;
}

p, li {
  color: var(--safe-gray);
  line-height: 1.6;
}

a {
  color: var(--navy-trust);
  text-decoration: underline;
  text-decoration-color: rgba(10, 44, 66, 0.2);
  text-underline-offset: 3px;
  transition: text-decoration-color 200ms ease;
}
a:hover {
  text-decoration-color: var(--copper-accent);
}

/* ============================================================= */
/* 4. Button overrides (Horizon style — Orange primary CTA) */
/* ============================================================= */
.wp-block-button__link {
  font-family: var(--font-family-sans) !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 16px 28px !important;
  font-size: 16px !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  transition: background 200ms ease, border-color 200ms ease !important;
  box-shadow: none !important;
}

/* Primary CTA — Horizon Orange */
.wp-block-button__link.has-copper-accent-background-color,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="has-"]) {
  background: var(--copper-accent) !important;
  color: #FFFFFF !important;
  border: none !important;
}
.wp-block-button__link.has-copper-accent-background-color:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:not([class*="has-"]):hover {
  background: var(--copper-accent-darker) !important;
}

/* Secondary CTA — Navy Blue solid */
.wp-block-button__link.has-navy-trust-background-color {
  background: var(--navy-trust) !important;
  color: #FFFFFF !important;
  border: none !important;
}
.wp-block-button__link.has-navy-trust-background-color:hover {
  background: var(--navy-trust-darker) !important;
}

/* Tertiary — White border on dark hero */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent !important;
  color: #FFFFFF !important;
  border: 2px solid #FFFFFF !important;
  padding: 14px 26px !important;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Alert/Emergency button */
.wp-block-button__link.has-alert-red-background-color {
  background: var(--alert-red) !important;
  color: #FFFFFF !important;
}

/* ============================================================= */
/* 5. Cards and borders */
/* ============================================================= */
.wp-block-column[style*="border"] {
  transition: border-color 200ms ease;
}
.wp-block-column[style*="border"]:hover {
  border-color: var(--navy-trust) !important;
}

/* ============================================================= */
/* 6. Kadence header customization */
/* ============================================================= */
.site-header {
  background: var(--cream-bg) !important;
  box-shadow: none;
  transition: box-shadow 200ms ease;
}
.site-header.item-is-fixed,
.site-header.is-sticky {
  box-shadow: var(--shadow-soft);
}
.site-header-wrap {
  min-height: 72px;
}

.site-branding a {
  text-decoration: none;
}

.primary-navigation a,
.header-navigation a {
  font-family: var(--font-family-sans);
  font-weight: 500 !important;
  font-size: 15px !important;
  color: var(--navy-trust) !important;
  text-decoration: none !important;
  letter-spacing: 0 !important;
}
.primary-navigation a:hover,
.header-navigation a:hover {
  color: var(--copper-accent) !important;
}

/* Phone number always visible in header */
.header-contact .header-button-inner-wrap {
  color: var(--copper-accent) !important;
  font-weight: 700 !important;
}

/* ============================================================= */
/* 7. Footer */
/* ============================================================= */
.site-footer,
.site-footer * {
  font-family: var(--font-family-sans);
}
.site-footer {
  background: var(--navy-trust) !important;
  color: #C7D2D9 !important;
}
.site-footer a {
  color: #C7D2D9 !important;
  text-decoration: none !important;
}
.site-footer a:hover {
  color: var(--copper-accent) !important;
}
.site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5 {
  color: #F8F7F4 !important;
}

/* ============================================================= */
/* 8. Remove AI-aesthetic elements */
/* ============================================================= */
/* Block counter animations (too AI-like) */
.kadence-blocks-countup,
.kb-count-up {
  animation: none !important;
}

/* Disable parallax */
[data-kb-parallax="true"] {
  background-attachment: scroll !important;
}

/* Tame overly rounded shapes */
.wp-block-image img[style*="border-radius"],
.kadence-blocks-info-card {
  border-radius: var(--radius) !important;
}

/* ============================================================= */
/* 9. Mobile sticky CTA bar (home only) */
/* ============================================================= */
@media (max-width: 768px) {
  .sticky-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    z-index: 9999;
    box-shadow: 0 -2px 12px rgba(10, 44, 66, 0.12);
  }
  .sticky-mobile-cta a {
    flex: 1;
    padding: 16px;
    text-align: center;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
  }
  .sticky-mobile-cta .btn-call {
    background: var(--navy-trust);
  }
  .sticky-mobile-cta .btn-sms {
    background: var(--copper-accent);
  }
  body { padding-bottom: 56px; }
}

/* ============================================================= */
/* 10. Check-list style (S4 section) */
/* ============================================================= */
ul.is-style-check-list {
  list-style: none;
  padding-left: 0;
}
ul.is-style-check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 16px;
  color: var(--navy-trust);
}
ul.is-style-check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C46D40' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ============================================================= */
/* 11. Table style */
/* ============================================================= */
.wp-block-table {
  font-family: var(--font-family-sans);
}
.wp-block-table table {
  border-collapse: collapse;
  width: 100%;
}
.wp-block-table th {
  background: var(--navy-trust);
  color: var(--text-inverse);
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
}
.wp-block-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.wp-block-table.is-style-stripes tbody tr:nth-child(even) td {
  background: rgba(248, 247, 244, 0.6);
}

/* ============================================================= */
/* 12. Accordion (FAQ) */
/* ============================================================= */
details {
  border-bottom: 1px solid var(--border-soft);
  padding: 20px 0;
}
details summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  color: var(--navy-trust);
  padding-right: 32px;
  position: relative;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: var(--copper-accent);
  font-weight: 400;
  transition: transform 200ms ease;
}
details[open] summary::after {
  content: '−';
  transform: translateY(-50%) rotate(0deg);
}
details p {
  margin-top: 16px;
  color: var(--safe-gray);
  line-height: 1.7;
  padding-right: 32px;
}

/* ============================================================= */
/* 13. Remove Kadence default emoji on reusable blocks */
/* ============================================================= */
/* Disable auto-emoji WP feature (kill request to s.w.org) */
img.emoji, img.wp-smiley { display: none !important; }

/* ============================================================= */
/* 14a. Hero CTA — prevent mobile wrap */
/* ============================================================= */
.hero-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 640px) {
  .hero-cta-buttons {
    flex-direction: column;
  }
  .hero-cta-buttons .wp-block-button {
    width: 100% !important;
    flex: none !important;
  }
  .hero-cta-buttons .wp-block-button__link {
    padding: 14px 16px !important;
    font-size: 15px !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    width: 100% !important;
  }
}

/* ============================================================= */
/* 14b. Service card — entire card clickable via overlay <a> */
/* ============================================================= */
.kh-service-card {
  position: relative;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.kh-service-card:hover {
  border-color: #003D7A !important;
  box-shadow: 0 4px 12px rgba(0, 61, 122, 0.12);
}
.kh-service-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-indent: -9999px;
  overflow: hidden;
  border-radius: 4px;
}
.kh-service-card__link:focus-visible {
  outline: 2px solid #FF6B35;
  outline-offset: -2px;
}

/* ============================================================= */
/* 15. Case/Service card image uniform height (override Kadence) */
/* ============================================================= */
.wp-block-image[style*="aspect-ratio"] {
  aspect-ratio: 4 / 3 !important;
  height: 260px !important;
  max-height: 260px !important;
  min-height: 260px !important;
  overflow: hidden !important;
  margin: 0 !important;
  display: block !important;
  position: relative !important;
}
.wp-block-image[style*="aspect-ratio"] img {
  width: 100% !important;
  height: 260px !important;
  max-height: 260px !important;
  min-height: 260px !important;
  object-fit: cover !important;
  display: block !important;
  max-width: none !important;
  margin: 0 !important;
}
@media (max-width: 768px) {
  .wp-block-image[style*="aspect-ratio"],
  .wp-block-image[style*="aspect-ratio"] img {
    height: 220px !important;
    max-height: 220px !important;
    min-height: 220px !important;
  }
}

/* ============================================================= */
/* 16. Global sticky header */
/* ============================================================= */
#masthead.site-header {
  position: sticky !important;
  top: 0;
  z-index: 500;
  background: var(--cream-bg);
  box-shadow: 0 1px 0 var(--border-soft);
  transition: box-shadow 200ms ease;
}
#masthead.site-header:has(+ *:not(:first-child)),
body:not(.admin-bar) #masthead.site-header {
  box-shadow: var(--shadow-soft);
}
/* WP admin bar offset when logged-in */
body.admin-bar #masthead.site-header {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar #masthead.site-header {
    top: 46px;
  }
}
/* Ensure no ancestor overflow clips sticky */
html, body, #page, .site {
  overflow: visible !important;
}

/* ============================================================
   서비스 하위페이지 6종 — 본문 좌우 간격 (정보성글과 톤 맞춤)
   page-id-11 ~ 16: plumbing-repair / leak-detection / boiler /
   air-conditioning / water-heater / drainage
   원본은 content-width-fullwidth content-style-unboxed 라서
   본문 텍스트가 뷰포트 가장자리에 붙어 가독성 저하.
   ============================================================ */
body.page-id-11 .entry-content,
body.page-id-12 .entry-content,
body.page-id-13 .entry-content,
body.page-id-14 .entry-content,
body.page-id-15 .entry-content,
body.page-id-16 .entry-content,
body.page-id-11 .entry-content .alignfull > .wp-block-group__inner-container,
body.page-id-12 .entry-content .alignfull > .wp-block-group__inner-container,
body.page-id-13 .entry-content .alignfull > .wp-block-group__inner-container,
body.page-id-14 .entry-content .alignfull > .wp-block-group__inner-container,
body.page-id-15 .entry-content .alignfull > .wp-block-group__inner-container,
body.page-id-16 .entry-content .alignfull > .wp-block-group__inner-container,
body.page-id-11 .entry-content .alignfull > .wp-block-cover__inner-container,
body.page-id-12 .entry-content .alignfull > .wp-block-cover__inner-container,
body.page-id-13 .entry-content .alignfull > .wp-block-cover__inner-container,
body.page-id-14 .entry-content .alignfull > .wp-block-cover__inner-container,
body.page-id-15 .entry-content .alignfull > .wp-block-cover__inner-container,
body.page-id-16 .entry-content .alignfull > .wp-block-cover__inner-container {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 5vw, 3rem);
  padding-right: clamp(1rem, 5vw, 3rem);
  box-sizing: border-box;
}

/* ============================================================
   헤더 서브메뉴 (서비스 드롭다운) — 검정 배경 → 흰색 배경
   기존: rgb(26,32,44) 배경 + rgb(0,61,122) 텍스트 = 대비 거의 0
   ============================================================ */
.site-header .sub-menu,
header.site-header .sub-menu {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
  padding: 4px 0 !important;
}
.site-header .sub-menu a,
header.site-header .sub-menu a {
  color: #003D7A !important;
  background: transparent !important;
  transition: background 150ms ease, color 150ms ease;
}
.site-header .sub-menu li:hover > a,
.site-header .sub-menu a:hover,
.site-header .sub-menu a:focus,
.site-header .sub-menu li:focus-within > a {
  background: #F1F5F9 !important;
  color: #FF6B35 !important;
}
.site-header .sub-menu .current-menu-item > a,
.site-header .sub-menu .current_page_item > a,
.site-header .sub-menu .current-menu-ancestor > a {
  color: #FF6B35 !important;
  background: #FFF7ED !important;
}
