/* WATTS Renewal — Design Tokens & Components
   Shared foundation for all new pages (P8 homeppage redesign)
   No Tailwind — vanilla CSS with careful spacing & typography
*/

:root {
  --brown: #553722;
  --green: #4e6700;
  --bg-dark: #faf9f8;
  --text-dark: #1a1c1b;
  --text-light: #ffffff;
  --border-light: #e2e3e1;
  --border-muted: #d1cec7;
  --success: #2d6a4f;
  --error: #ba1a1a;
  --warning: #f7a800;

  /* Spacing scale */
  --unit: 4px;
  --xs: calc(var(--unit) * 2);    /* 8px */
  --sm: calc(var(--unit) * 4);    /* 16px */
  --md: calc(var(--unit) * 6);    /* 24px */
  --lg: calc(var(--unit) * 8);    /* 32px */
  --xl: calc(var(--unit) * 10);   /* 40px */
  --2xl: calc(var(--unit) * 16);  /* 64px */

  /* Typography */
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --line-height-tight: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--line-height-normal);
  color: var(--text-dark);
  background-color: var(--bg-dark);
}

/* Headings */
h1 { font-size: 48px; font-weight: 700; line-height: var(--line-height-tight); letter-spacing: -0.02em; }
h2 { font-size: 32px; font-weight: 700; line-height: var(--line-height-tight); }
h3 { font-size: 24px; font-weight: 600; line-height: var(--line-height-normal); }
h4 { font-size: 20px; font-weight: 600; line-height: var(--line-height-normal); }
h5 { font-size: 18px; font-weight: 600; line-height: var(--line-height-normal); }
h6 { font-size: 16px; font-weight: 600; line-height: var(--line-height-normal); }

p { margin-bottom: var(--sm); }

/* Links */
a {
  color: var(--brown);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--green); }

/* Common Components */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--text-light);
  border-bottom: 1px solid var(--border-light);
  padding: var(--md) 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.site-header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--brown);
  text-decoration: none;
}

.site-nav-container {
  display: flex;
  align-items: center;
  gap: var(--lg);
}

nav[data-nav="watts"] {
  display: flex;
  gap: var(--lg);
  align-items: center;
}

nav[data-nav="watts"] a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  padding: var(--xs) var(--sm);
  border-radius: 4px;
  transition: all 0.2s ease;
}

nav[data-nav="watts"] a:hover {
  background-color: rgba(85, 55, 34, 0.08);
  color: var(--brown);
}

.site-footer {
  background-color: var(--brown);
  color: var(--text-light);
  padding: var(--2xl) var(--lg);
  margin-top: var(--2xl);
}

.site-footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--lg);
  padding-bottom: var(--lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: var(--lg);
}

.site-footer-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: var(--sm);
}

.site-footer-section p,
.site-footer-section a {
  font-size: 14px;
  line-height: var(--line-height-relaxed);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--xs);
}

.site-footer-section a:hover {
  color: var(--text-light);
  text-decoration: underline;
}

.site-footer-bottom {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Button Components */

.btn {
  display: inline-block;
  padding: var(--sm) var(--lg);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
  vertical-align: middle;
  user-select: none;
}

.btn-primary {
  background-color: var(--brown);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: #44291a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(85, 55, 34, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-cta {
  background-color: var(--green);
  color: var(--text-light);
  font-weight: 600;
  padding: var(--md) var(--xl);
  font-size: 16px;
}

.btn-cta:hover {
  background-color: #3d5200;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(78, 103, 0, 0.3);
}

.btn-cta:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: transparent;
  color: var(--brown);
  border: 2px solid var(--brown);
}

.btn-secondary:hover {
  background-color: rgba(85, 55, 34, 0.08);
  border-color: #44291a;
}

/* Card Component */

.card {
  background-color: var(--text-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: var(--lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--md);
  color: var(--text-dark);
}

.card-text {
  font-size: 14px;
  line-height: var(--line-height-relaxed);
  color: var(--text-dark);
  opacity: 0.85;
}

/* Section Component */

.section {
  padding: var(--2xl) var(--lg);
}

.section-container {
  max-width: 1440px;
  margin: 0 auto;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: var(--lg);
  color: var(--text-dark);
}

.section-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
  opacity: 0.8;
  margin-bottom: var(--lg);
  line-height: var(--line-height-relaxed);
}

/* Grid Utilities */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lg);
}

/* Hero Component */

.hero {
  background:
    linear-gradient(135deg, rgba(250, 249, 248, 0.94) 0%, rgba(250, 249, 248, 0.88) 48%, rgba(250, 249, 248, 0.76) 100%),
    url("franchise-hero-bg.webp");
  background-size: auto, cover;
  background-position: center, center 38%;
  background-repeat: no-repeat;
  padding: calc(var(--2xl) * 1.5) var(--lg);
  text-align: center;
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: var(--md);
  line-height: var(--line-height-tight);
  color: var(--brown);
}

.hero-subtitle {
  font-size: 18px;
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--lg);
  color: var(--text-dark);
  opacity: 0.8;
}

.hero-actions {
  display: flex;
  gap: var(--md);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-actions .btn {
  min-width: 170px;
  padding: var(--md) var(--xl);
  font-size: 16px;
  font-weight: 600;
}

/* Badge Component — "예시 · 확정 전" marker */

.badge-tbd {
  display: inline-block;
  background-color: #fde047;
  color: #713f12;
  border: 2px solid #d4af37;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Breakpoints */

@media (max-width: 1100px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }

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

  /* Compressed mobile header — 2-row grid layout */
  .site-header {
    padding: 2px 0; /* Minimal padding */
  }

  .site-header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0; /* Remove gap entirely */
    padding: 0 var(--md);
    align-items: center;
  }

  .site-logo {
    font-size: 18px;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1;
    line-height: 1;
    padding: 0;
  }

  /* Nav container spans full width on second row */
  .site-nav-container {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  nav[data-nav="watts"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0; /* Remove gap between nav items */
    width: 100%;
  }

  nav[data-nav="watts"] a {
    text-align: center;
    padding: 1px 2px; /* Ultra-minimal padding */
    font-size: 14px;
    white-space: nowrap;
    min-height: 44px; /* Accessible touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    line-height: 1;
  }

  .btn-cta {
    grid-column: 3;
    grid-row: 1;
    white-space: nowrap;
    padding: 4px 6px; /* Minimal padding */
    font-size: 14px;
    height: 44px;
    line-height: 1;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .section {
    padding: var(--xl) var(--md);
  }
}

@media (max-width: 760px) {
  html {
    font-size: 15px;
  }

  .hero {
    background-size: auto, auto 100%;
    background-position: center, center top;
  }

  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: var(--sm) 0;
  }

  .site-header-container {
    flex-direction: column;
    gap: var(--sm);
    padding: 0 var(--md);
  }

  .section {
    padding: var(--lg) var(--md);
  }

  .section-title {
    font-size: 24px;
    margin-bottom: var(--md);
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-actions {
    flex-direction: column;
    gap: var(--sm);
  }

  .btn,
  .btn-primary,
  .btn-cta,
  .btn-secondary {
    width: 100%;
  }

  .card {
    padding: var(--md);
  }
}

@media (max-width: 400px) {
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }

  .site-logo {
    font-size: 18px;
  }

  .badge-tbd {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }

  .section {
    padding: var(--md) var(--sm);
  }

  .site-footer-container {
    grid-template-columns: 1fr;
  }
}

/* Flex children fix — prevent shrinking in flex containers (HANDOFF §3) */

.flex-col-scroll > * {
  flex: none;
  min-height: 0;
}

/* Utility classes */

.container-max {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--lg);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--sm); }
.mb-md { margin-bottom: var(--md); }
.mb-lg { margin-bottom: var(--lg); }
.mb-xl { margin-bottom: var(--xl); }

.mt-sm { margin-top: var(--sm); }
.mt-md { margin-top: var(--md); }
.mt-lg { margin-top: var(--lg); }
.mt-xl { margin-top: var(--xl); }

.gap-sm { gap: var(--sm); }
.gap-md { gap: var(--md); }
.gap-lg { gap: var(--lg); }

.hidden { display: none; }
.visible { display: block; }
