/* ============================================================
   FUNK-IT TOOLKIT — Main Layout & Global Styles
   ============================================================ */

/* ── Base ── */
body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-text-dark);
  font-size: 1rem;
}

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


/* ============================================================
   TOP PLUG BAR — Small promo above the header
   ============================================================ */
.top-plug {
  background: var(--c-orange);
  color: var(--c-text-light);
  text-align: center;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.55rem 1rem;
  line-height: 1.4;
}

.top-plug a {
  color: var(--c-text-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}

.top-plug a:hover {
  color: var(--c-gold);
}


/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--c-card);
  padding: 1rem 1.5rem 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Brand logotype */
.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
  padding-bottom: 0.75rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--c-text-light);
  letter-spacing: 0.02em;
}

.brand-name .highlight {
  color: var(--c-orange);
}

.brand-tagline {
  font-size: 0.68rem;
  color: var(--c-teal);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
}

.nav-link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text-light);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.8rem;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link:hover,
.nav-link.active {
  background: var(--c-orange);
  border-color: var(--c-orange);
  color: #fff;
}

.nav-link.nav-external {
  background: var(--c-rose);
  border-color: var(--c-rose);
  color: #fff;
}

.nav-link.nav-external:hover {
  background: #c9405a;
  border-color: #c9405a;
}

/* Toggle button in nav — coming-soon show/hide */
/* Inherits .nav-link base styles; button-specific resets handled here */
.nav-toggle {
  -webkit-appearance: none;
  appearance: none;
  /* Subtle visual distinction from plain nav links */
  border-style: dashed;
  opacity: 0.75;
}

.nav-toggle:hover {
  opacity: 1;
  background: var(--c-orange);
  border-color: var(--c-orange);
  border-style: solid;
  color: #fff;
}

/* Greyed-out nav links in viewer mode */
.nav-link-inactive {
  opacity: 0.28;
  pointer-events: none;
  cursor: default;
  user-select: none;
}

/* Back-to-toolkit link in viewer mode (teal-tinted) */
.nav-back {
  background: rgba(100,153,172,0.22);
  border-color: var(--c-teal);
  color: var(--c-teal);
}

.nav-back:hover {
  background: var(--c-teal);
  border-color: var(--c-teal);
  color: #fff;
}


/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: var(--c-card);
  padding: var(--sp-xl) 1.5rem var(--sp-lg);
  text-align: center;
  border-bottom: 3px solid var(--c-orange);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  color: var(--c-text-light);
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.hero-title .highlight {
  color: var(--c-orange);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--c-teal);
  max-width: 560px;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
}

/* Note: the coming-soon toggle button now lives in the nav (see header.php)
   and is styled via .nav-toggle below. The old .btn-toggle-coming is removed. */


/* ============================================================
   TOOLS SECTIONS
   ============================================================ */
.tools-section {
  padding: var(--sp-xl) 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.tools-section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: var(--c-text-dark);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--section-accent, var(--c-orange));
  margin-top: 0.35rem;
}

/* Per-section accent color via custom property */
#finance .section-title::after  { --section-accent: var(--c-cat-finance); }
#design  .section-title::after  { --section-accent: var(--c-cat-design);  }
#tech    .section-title::after  { --section-accent: var(--c-cat-tech);    }

.section-desc {
  display: block;
  font-size: 0.92rem;
  color: var(--c-text-muted);
  margin-top: 0.6rem;
  max-width: 600px;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-card);
  color: var(--c-text-light);
  text-align: center;
  padding: var(--sp-md) 1.5rem;
  border-top: 2px solid var(--c-rose);
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(242,246,250,0.55);
  margin-top: 0.5rem;
}

.footer-copy a {
  color: var(--c-teal);
}

.footer-copy a:hover {
  color: var(--c-gold);
}


/* ============================================================
   VIEWER PAGE — Tool iframe layout
   viewer.php uses this to fill the viewport below the header.
   Height is fine-tuned by inline JS in viewer.php.
   ============================================================ */
.tool-iframe-wrapper {
  /* JS overrides this with exact calculated height */
  height: calc(100vh - 120px);
  min-height: 400px;
}

.tool-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}


/* ============================================================
   RESPONSIVE — Tablet (max 768px)
   ============================================================ */
@media (max-width: 768px) {

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .site-nav {
    gap: 0.3rem;
  }

  .nav-link {
    font-size: 0.74rem;
    padding: 0.3rem 0.65rem;
  }

  .hero {
    padding: var(--sp-lg) 1rem var(--sp-md);
  }

  .tools-section {
    padding: var(--sp-lg) 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

}


/* ============================================================
   RESPONSIVE — Mobile (max 480px)
   ============================================================ */
@media (max-width: 480px) {

  .brand-name {
    font-size: 1.3rem;
  }

  .site-nav {
    width: 100%;
  }

  .nav-link {
    font-size: 0.7rem;
    padding: 0.28rem 0.55rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .top-plug {
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
  }

}
