/* ============================================================
   CookingCalcs — Global Stylesheet
   assets/css/style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

:root {
  --tomato:       #e8412a;
  --tomato-dark:  #c0321c;
  --tomato-light: #fde8e5;
  --sand:         #faf7f2;
  --sand-dark:    #f0ebe1;
  --charcoal:     #1e1e1e;
  --ink:          #3a3a3a;
  --mid:          #6b6b6b;
  --muted:        #9a9a9a;
  --border:       #e8e2d9;
  --white:        #ffffff;
  --radius:       12px;
  --radius-lg:    20px;
  --shadow:       0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:    0 12px 48px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(250,247,242,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--charcoal);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── NAV ────────────────────────────────────────────────────── */
.main-nav { display: flex; align-items: center; }

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 68px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mid);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.nav-arrow {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--mid);
  padding: 0.25rem;
  transition: transform 0.2s, color 0.2s;
  line-height: 1;
}
.nav-arrow:hover { color: var(--tomato); }
.nav-has-dropdown.open .nav-arrow { transform: rotate(180deg); color: var(--tomato); }

.nav-link:hover,
.nav-link.active,
.nav-btn.active {
  color: var(--tomato);
  background: var(--tomato-light);
}

/* ── DROPDOWN ───────────────────────────────────────────────── */
.nav-has-dropdown { position: relative; height: 68px; display: flex; align-items: center; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
  z-index: 600;
}

.nav-dropdown--right { left: auto; right: 0; }

.nav-has-dropdown.open .nav-dropdown { display: block; }

.nav-dropdown li a {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown li a:hover,
.nav-dropdown li a.active {
  background: var(--tomato-light);
  color: var(--tomato-dark);
}

.nav-dropdown-all {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tomato) !important;
  border-radius: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  transition: background 0.15s;
}
.nav-dropdown-all:hover { background: var(--tomato-light); }

.nav-empty {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* ── HAMBURGER ──────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
}

.footer-brand .logo { color: var(--white); font-size: 1.1rem; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; max-width: 220px; }

.footer-links { display: contents; }

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.footer-col ul li a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── CONTAINER ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
  padding: 5rem 2rem 4rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: var(--tomato-light);
  color: var(--tomato-dark);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 1.1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--charcoal);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--tomato);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--mid);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
  line-height: 1.7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--tomato);
  color: var(--white);
  padding: 0.9rem 2.25rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--tomato-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--tomato);
  padding: 0.9rem 2.25rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--tomato);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--tomato-light);
}

/* ── TOOL CARDS ─────────────────────────────────────────────── */
.section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--mid);
  margin-bottom: 2.5rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.tool-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--tomato-light);
}

.tool-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.tool-card p {
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.6;
}

.tool-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tomato);
}

/* ── BLOG CARDS ─────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
}

.blog-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.blog-card-tag {
  display: inline-block;
  background: var(--sand-dark);
  color: var(--mid);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 0.875rem;
}

.blog-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.blog-card p {
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.6;
}

.blog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-desc {
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.6;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.blog-card-footer time {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── TOOL PAGE ──────────────────────────────────────────────── */
.tool-page {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.tool-page h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
}

.tool-page .tool-desc {
  font-size: 1rem;
  color: var(--mid);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.tool-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--tomato);
}

.result-box {
  background: var(--tomato-light);
  border: 1.5px solid var(--tomato);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.result-box .result-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--tomato-dark);
}

.result-box .result-label {
  font-size: 0.875rem;
  color: var(--mid);
  margin-top: 0.25rem;
}

/* ── BLOG PAGE ──────────────────────────────────────────────── */
.blog-page {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.blog-page h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.blog-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--charcoal);
  margin: 2rem 0 0.75rem;
}

.blog-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--charcoal);
  margin: 1.5rem 0 0.5rem;
}

.blog-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.blog-content ul,
.blog-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.blog-content li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.blog-content th {
  background: var(--sand-dark);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
}

.blog-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
}

/* ── DIVIDER ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0 2rem;
}

/* ── MISC ────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ── MOBILE NAV (헤더 밖, fixed) ────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 600;
  flex-direction: column;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .mobile-nav.nav-open { display: flex; }
}
.mobile-nav .nav-list {
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  gap: 0;
  width: 100%;
}
.mobile-nav .nav-has-dropdown { height: auto; width: 100%; flex-direction: column; align-items: flex-start; }
.mobile-nav .nav-has-dropdown > .nav-link,
.mobile-nav .nav-has-dropdown > .nav-arrow {
  display: inline-flex;
}
.mobile-nav .nav-has-dropdown > a.nav-link + .nav-arrow {
  position: absolute;
  right: 1rem;
  top: 0.875rem;
}
.mobile-nav .nav-has-dropdown { position: relative; }
.mobile-nav .nav-link {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius);
  justify-content: space-between;
}
.mobile-nav .nav-dropdown {
  position: static;
  box-shadow: none;
  border: none;
  background: var(--sand);
  border-radius: var(--radius);
  margin: 0.25rem 0 0.5rem;
  max-height: none;
  width: 100%;
  padding: 0.5rem;
}
.mobile-nav .nav-dropdown li a {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

/* ── NAV OVERLAY (모바일) ───────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 599;
}
.nav-overlay.active { display: block; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .main-nav {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 600;
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav.nav-open { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    gap: 0;
    width: 100%;
  }

  .nav-has-dropdown { height: auto; width: 100%; flex-direction: column; align-items: flex-start; }

  .nav-link {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius);
    justify-content: space-between;
  }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--sand);
    border-radius: var(--radius);
    margin: 0.25rem 0 0.5rem;
    max-height: none;
    width: 100%;
    padding: 0.5rem;
  }

  .nav-dropdown li a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand { grid-column: 1 / -1; }

  .hero { padding: 3rem 1.5rem 2.5rem; }

  .section { padding: 2.5rem 1.5rem; }

  .tools-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  .tool-page,
  .blog-page { margin: 2rem auto; padding: 0 1.25rem; }

  .tool-box { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .header-inner { padding: 0 1.25rem; }
}
