/* ==========================================================
   ETOLIFY — style.css
   Primary: #1a4a8a  Accent: #f0a500  
   ========================================================== */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-primary:   #1a4a8a;
  --c-primary-d: #133870;
  --c-primary-l: #e8f0fb;
  --c-accent:    #f0a500;
  --c-accent-d:  #c98a00;
  --c-text:      #1a1a2e;
  --c-muted:     #5a6478;
  --c-border:    #dde3ef;
  --c-bg:        #ffffff;
  --c-bg-alt:    #f5f7fb;
  --c-white:     #ffffff;

  --radius:      8px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);

  --header-h:    64px;
  --max-w:       1200px;
  --font:        system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--c-primary);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary, .btn-outline, .btn-ghost {
  display: inline-block;
  padding: .7rem 1.6rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--c-accent);
  color: var(--c-text);
  border-color: var(--c-accent);
}
.btn-primary:hover { background: var(--c-accent-d); border-color: var(--c-accent-d); text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border-color: var(--c-primary);
  margin-top: 1.5rem;
}
.btn-outline:hover { background: var(--c-primary); color: #fff; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--c-white);
  border-color: rgba(255,255,255,.5);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; text-decoration: none; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--c-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -.3px;
}
.logo-text:hover { text-decoration: none; }

/* Header search */
.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.header-search .search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: #fff;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: .55rem 1rem .55rem 2.4rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .9rem;
  outline: none;
  transition: background .2s, border-color .2s;
}
.search-input::placeholder { color: rgba(255,255,255,.6); }
.search-input:focus { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 320px;
  overflow-y: auto;
  z-index: 800;
  display: none;
}
.search-dropdown.open { display: block; }
.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem 1rem;
  font-size: .9rem;
  color: var(--c-text);
  cursor: pointer;
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.active { background: var(--c-primary-l); }
.search-result-item .result-cat {
  font-size: .75rem;
  color: var(--c-muted);
  background: var(--c-bg-alt);
  padding: .15rem .5rem;
  border-radius: 4px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: .4rem;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.site-nav { margin-left: auto; }
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .15rem;
}
.nav-link {
  display: block;
  padding: .45rem .75rem;
  font-size: .88rem;
  font-weight: 500;
  color: rgba(255,255,255,.88);
  border-radius: var(--radius);
  transition: background .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }

/* Dropdown */
.has-drop { position: relative; }
.drop-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: .4rem 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s;
  z-index: 700;
}
.has-drop:hover .drop-menu,
.has-drop:focus-within .drop-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.drop-menu li a {
  display: block;
  padding: .45rem 1rem;
  font-size: .875rem;
  color: var(--c-text);
  transition: background .15s;
  text-decoration: none;
}
.drop-menu li a:hover { background: var(--c-primary-l); color: var(--c-primary); }
.drop-menu .view-all {
  color: var(--c-primary);
  font-weight: 600;
  border-top: 1px solid var(--c-border);
  margin-top: .4rem;
  padding-top: .6rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-d) 100%);
  color: #fff;
  padding: 4rem 1.25rem 3.5rem;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.12);
  color: var(--c-accent);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .85rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(240,165,0,.3);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.5px;
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255,255,255,.82);
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Hero search */
.hero-search-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto 1.5rem;
}
.hs-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: var(--c-muted);
  pointer-events: none;
}
.hero-search-input {
  width: 100%;
  padding: .85rem 1.25rem .85rem 3rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-lg);
  color: var(--c-text);
  background: #fff;
}
.hero-search-input:focus { box-shadow: 0 0 0 3px var(--c-accent), var(--shadow-lg); }
.hero-search-wrap .search-dropdown { left: 0; right: 0; top: calc(100% + 6px); }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.tag {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.2);
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .82rem;
  text-decoration: none;
  transition: background .15s;
}
.tag:hover { background: rgba(255,255,255,.22); color: #fff; text-decoration: none; }

/* ── Stats Bar ────────────────────────────────────────────── */
.stats-bar {
  background: var(--c-accent);
  padding: 1rem 1.25rem;
}
.stats-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
}
.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1;
}
.stat-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: rgba(0,0,0,.6);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: .15rem;
}

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--c-bg-alt); }
.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: .5rem;
}
.section-sub {
  color: var(--c-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ── Category Grid ────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.2rem;
  text-decoration: none;
  color: var(--c-text);
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.cat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-primary);
  transform: translateY(-2px);
  text-decoration: none;
}
.cat-icon {
  width: 44px;
  height: 44px;
  background: var(--c-primary-l);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.cat-icon svg { width: 24px; height: 24px; stroke: var(--c-primary); }
.cat-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: .35rem;
}
.cat-desc {
  font-size: .85rem;
  color: var(--c-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: .75rem;
}
.cat-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-l);
  padding: .2rem .6rem;
  border-radius: 12px;
  align-self: flex-start;
}

/* ── Tool Grid ────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  transition: box-shadow .18s, border-color .18s;
}
.section-alt .tool-card { background: var(--c-bg); }
.tool-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--c-primary);
  text-decoration: none;
}
.tool-name {
  font-size: .92rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: .3rem;
}
.tool-cat {
  font-size: .75rem;
  color: var(--c-muted);
  font-weight: 500;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-container { max-width: 760px; }
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.faq-q {
  width: 100%;
  background: var(--c-bg);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: .97rem;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background .15s;
}
.faq-q::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--c-primary);
  flex-shrink: 0;
  transition: transform .2s;
  line-height: 1;
}
.faq-q[aria-expanded="true"] { background: var(--c-primary-l); }
.faq-q[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-a {
  padding: 0 1.25rem 1rem;
  font-size: .93rem;
  color: var(--c-muted);
  line-height: 1.65;
  border-top: 1px solid var(--c-border);
}
.faq-a p { margin: .75rem 0 0; }
.faq-a a { color: var(--c-primary); }

/* ── CTA Banner ───────────────────────────────────────────── */
.cta-banner {
  background: var(--c-primary);
  color: #fff;
  padding: 3rem 1.25rem;
  text-align: center;
}
.cta-banner h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  margin-bottom: .6rem;
}
.cta-banner p {
  color: rgba(255,255,255,.8);
  margin-bottom: 1.75rem;
  font-size: 1rem;
}
.cta-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: #0e2f5c;
  color: rgba(255,255,255,.75);
  padding: 3rem 1.25rem 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .75rem;
  text-decoration: none;
}
.footer-tagline { font-size: .85rem; line-height: 1.6; color: rgba(255,255,255,.6); }
.footer-heading {
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.footer-links a { font-size: .875rem; color: rgba(255,255,255,.7); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 0 1.5rem;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.footer-bottom a { color: rgba(255,255,255,.6); }

/* ── Back to Top ──────────────────────────────────────────── */
.back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  transition: background .18s, transform .18s;
}
.back-top svg { width: 20px; height: 20px; stroke: #fff; }
.back-top:hover { background: var(--c-primary-d); transform: translateY(-2px); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: .75rem 1rem; gap: .5rem; }
  .site-logo { order: 1; }
  .hamburger { display: flex; order: 2; margin-left: auto; }
  .header-search { order: 3; width: 100%; max-width: 100%; flex: none; }

  .site-nav {
    display: none;
    order: 4;
    width: 100%;
    margin-left: 0;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: .5rem;
  }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: flex-start; gap: 0; }
  .nav-link { font-size: .95rem; padding: .6rem .75rem; width: 100%; }
  .has-drop .drop-menu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(255,255,255,.15);
    border-radius: 0;
    background: transparent;
    display: none;
    padding: 0 0 0 .75rem;
  }
  .has-drop.open .drop-menu { display: block; }
  .drop-menu li a { color: rgba(255,255,255,.8); font-size: .875rem; padding: .4rem .5rem; }
  .drop-menu li a:hover { background: transparent; color: #fff; }
  .drop-menu .view-all { border-top-color: rgba(255,255,255,.1); color: var(--c-accent); }

  .hero { padding: 2.5rem 1.25rem 2rem; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .stats-inner { gap: 1rem; justify-content: center; }
  .stat-item { min-width: 100px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.75rem; }
  .cta-actions { flex-direction: column; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .hero-search-wrap, .back-top, .cta-banner, footer { display: none; }
}
