/* Layout & components — loaded after style.css design tokens */

/* ---------- Header ---------- */
.lf-header {
  border-bottom: 1px solid var(--lf-line);
  background: rgba(250,250,248,0.92);
  backdrop-filter: saturate(180%) blur(6px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.lf-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}
.lf-header__brand { font-weight: 700; font-family: var(--lf-font-display); font-size: 1.15rem; }
.lf-logo { text-decoration: none; }
.lf-header__nav { flex: 1; display: flex; align-items: center; }
.lf-nav { list-style: none; display: flex; gap: 22px; margin: 0 24px 0 0; padding: 0; flex-wrap: wrap; }
.lf-nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--lf-ink); }
.lf-nav a:hover { color: var(--lf-accent-dark); }
.lf-nav__cta { display: none; }
.lf-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px; height: 36px;
  border: 1px solid var(--lf-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.lf-nav-toggle span { width: 16px; height: 2px; background: var(--lf-ink); margin: 0 auto; border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.lf-nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.lf-nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.lf-nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Primary nav: dropdown submenus (desktop) ---------- */
.lf-nav > li { position: relative; }
.lf-nav > li > a { display: inline-flex; align-items: center; gap: 6px; }
.lf-nav .menu-item-has-children > a::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  flex-shrink: 0;
}
.lf-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 200px;
  background: var(--lf-card);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  box-shadow: 0 16px 32px rgba(26, 26, 46, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 200;
}
.lf-nav .sub-menu .sub-menu { top: -8px; left: calc(100% + 8px); }
.lf-nav > li:hover > .sub-menu,
.lf-nav > li.is-open > .sub-menu,
.lf-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lf-nav .sub-menu li { width: 100%; }
.lf-nav .sub-menu a { display: block; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.lf-nav .sub-menu a:hover,
.lf-nav .sub-menu a:focus { background: var(--lf-bg); color: var(--lf-accent-dark); }

/* Touch-friendly submenu toggle button, injected by JS — hidden on desktop, shown on mobile */
.lf-submenu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  position: absolute;
  right: 0; top: 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--lf-ink);
}
.lf-submenu-toggle span {
  display: block;
  width: 8px; height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.lf-nav > li.is-open > .lf-submenu-toggle span { transform: rotate(225deg); }

/* ---------- Hero ---------- */
.lf-hero {
  padding: 72px 0 48px;
  text-align: center;
  background: radial-gradient(ellipse at top, #FFF3E0 0%, var(--lf-bg) 65%);
}
.lf-hero h1 { font-size: clamp(1.9rem, 4vw, 3.1rem); max-width: 780px; margin: 0.35em auto; }
.lf-hero p { max-width: 600px; margin: 0 auto 26px; color: var(--lf-ink-soft); font-size: 1.05rem; }

.lf-section { padding: 52px 0; }
.lf-section h2 { font-size: 1.55rem; margin-bottom: 8px; }
.lf-section > .lft-note:first-of-type,
.lf-section .lft-note { margin-bottom: 20px; }

/* ---------- Toolbar: filter pills + search ---------- */
.lf-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 4px 0 28px;
}
.lf-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.lf-filter-bar::-webkit-scrollbar { display: none; }
.lf-filter-pill {
  flex: 0 0 auto;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--lf-line);
  background: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--lf-ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lf-filter-pill:hover { border-color: var(--lf-ink-soft); }
.lf-filter-pill.is-active { background: var(--lf-ink); color: #fff; border-color: var(--lf-ink); }
.lf-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--lf-line);
  border-radius: 999px;
  background: #fff;
  min-width: 220px;
  color: var(--lf-ink-soft);
  flex: 0 0 auto;
}
.lf-search input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  background: transparent;
  color: var(--lf-ink);
}

/* ---------- Tool cards (icon-box style) ---------- */
.lf-tool-card {
  position: relative;
  background: var(--lf-card);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(26,26,46,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.lf-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26,26,46,0.09);
  border-color: rgba(26,26,46,0.12);
}
.lf-tool-card__icon {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  border-radius: 10px;
}
.lf-tool-card__icon svg {
  width: 22px !important;
  height: 22px !important;
  display: block;
}
.lf-tool-card__open {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--lf-ink-soft);
  opacity: 0.7;
}
.lf-tool-card__open:hover { opacity: 1; background: var(--lf-bg); }
.lf-tool-card h3 { font-size: 1.08rem; margin: 16px 0 6px; line-height: 1.3; }
.lf-tool-card h3 a { text-decoration: none !important; color: var(--lf-ink); }
.lf-tool-card h3 a:hover { color: var(--lf-accent-dark); }
.lf-tool-card p { color: var(--lf-ink-soft); font-size: 0.9rem; margin: 0 0 16px; line-height: 1.5; }
.lf-tool-card__cat { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; }
.lf-tool-card.is-hidden { display: none; }

/* ---------- Category / archive pages ---------- */
.lf-badge { display: inline-block; }

/* ---------- Why Us ---------- */
.lf-why { background: #fff; border-radius: 20px; margin-top: 12px; margin-bottom: 12px; }
.lf-why__card { padding: 8px 4px; }
.lf-why__icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(244,163,64,0.14);
  color: var(--lf-accent-dark);
  margin-bottom: 14px;
}
.lf-why__icon svg { width: 22px; height: 22px; }
.lf-why__card h3 { font-size: 1.02rem; margin: 0 0 6px; }
.lf-why__card p { color: var(--lf-ink-soft); font-size: 0.9rem; margin: 0; line-height: 1.5; }

/* ---------- FAQ ---------- */
.lf-faq__list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.lf-faq__item { border: 1px solid var(--lf-line); border-radius: 12px; background: #fff; overflow: hidden; }
.lf-faq__question {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--lf-ink);
  cursor: pointer;
}
.lf-faq__chevron { flex-shrink: 0; transition: transform 0.2s ease; }
.lf-faq__question[aria-expanded="true"] .lf-faq__chevron { transform: rotate(180deg); }
.lf-faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding: 0 20px;
}
.lf-faq__answer p { margin: 0 0 18px; color: var(--lf-ink-soft); font-size: 0.94rem; line-height: 1.6; }
.lf-faq__item.is-open .lf-faq__answer { max-height: 400px; }

/* ---------- How it works (single tool page) ---------- */
.lf-how { background: #fff; border-radius: 20px; margin-top: 40px; }
.lf-how h2 { text-align: center; }
.lf-how__step { text-align: center; padding: 0 12px; }
.lf-how__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--lf-ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.lf-how__step h3 { font-size: 1rem; margin: 0 0 6px; }
.lf-how__step p { color: var(--lf-ink-soft); font-size: 0.9rem; line-height: 1.55; margin: 0; }

/* ---------- Tool app shell ---------- */
.lf-tool__header { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.lf-tool__app { max-width: 900px; margin: 0 auto 40px; }
.lf-tool__placeholder { padding: 48px; text-align: center; border: 1px dashed var(--lf-line); border-radius: var(--lf-radius); color: var(--lf-ink-soft); }
.lf-badge--privacy { background: rgba(46,158,107,0.12); color: var(--lf-success); }

.lf-post__meta, .lf-post__tags { color: var(--lf-ink-soft); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.lf-footer { border-top: 1px solid var(--lf-line); padding: 48px 0 20px; margin-top: 40px; }
.lf-footer__grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr 1fr; }
.lf-footer__col ul { list-style: none; margin: 0; padding: 0; }
.lf-footer__col li { margin-bottom: 8px; }
.lf-footer__col a, .lf-footer nav a { text-decoration: none; color: var(--lf-ink-soft); }
.lf-footer__col a:hover, .lf-footer nav a:hover { color: var(--lf-ink); }
.lf-footer__bottom { border-top: 1px solid var(--lf-line); margin-top: 32px; padding-top: 16px; font-size: 0.85rem; color: var(--lf-ink-soft); }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .lf-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  body.lf-nav-open { overflow: hidden; }

  .lf-header__nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    background: #fff;
    border-bottom: 1px solid var(--lf-line);
    padding: 16px 24px 20px;
    flex-direction: column;
    align-items: flex-start;
    z-index: 90;
  }
  .lf-header__nav.is-open { display: flex; }
  .lf-nav { flex-direction: column; gap: 0; width: 100%; margin: 0 0 16px; }
  .lf-nav > li { position: relative; width: 100%; border-bottom: 1px solid var(--lf-line); }
  .lf-nav > li > a { width: 100%; padding: 12px 28px 12px 0; }
  .lf-nav .menu-item-has-children > a::after { display: none; }

  .lf-submenu-toggle { display: flex; }

  .lf-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    margin: 0;
    padding: 0 0 0 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .lf-nav > li.is-open > .sub-menu { max-height: 800px; padding-bottom: 6px; }
  .lf-nav .sub-menu a { padding: 10px 0; }

  .lf-nav__cta { display: inline-flex; }
  .lf-header__cta-desktop { display: none; }
  .lf-nav-toggle { display: flex; }

  .lf-hero { padding: 48px 0 36px; }
  .lf-section { padding: 40px 0; }

  .lf-toolbar { flex-direction: column; align-items: stretch; }
  .lf-search { width: 100%; }

  .lf-grid--3, .lf-grid--4 { grid-template-columns: 1fr; }

  .lf-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .lf-wrap { padding: 0 16px; }
  .lf-footer__grid { grid-template-columns: 1fr; }
  .lf-tool-card { padding: 18px; }
  .lf-faq__question { padding: 14px 16px; font-size: 0.94rem; }
  .lf-faq__answer { padding: 0 16px; }
}