/* ============================================================
   PRODUCTIVITY HUB — styles.css
   Warm, minimalist, light-first design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Neutral Base */
  --color-bg:        #FAF9F7;
  --color-surface:   #FFFFFF;
  --color-border:    #EBEBEB;
  --color-shadow:    rgba(0, 0, 0, 0.07);

  /* Typography */
  --color-heading:   #1A1A2E;
  --color-body:      #3D3D4E;
  --color-muted:     #8A8A9A;

  /* Accent — warm coral/indigo */
  --color-accent:    #5B5BD6;   /* indigo */
  --color-accent-h:  #4747B8;
  --color-tag:       #F0EFFF;
  --color-tag-txt:   #5B5BD6;

  /* Highlight */
  --color-badge:     #FF6B6B;   /* coral for "new" badge */

  /* Code block */
  --color-code-bg:   #F3F4F6;
  --color-code-txt:  #1A1A2E;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Layout */
  --container:  1140px;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  /* Font */
  --font-body:  'Inter', system-ui, sans-serif;
  --font-mono:  'Fira Code', monospace;

  /* Transition */
  --ease: all 0.22s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--ease);
}
a:hover { color: var(--color-accent-h); }

h1, h2, h3, h4 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.tag {
  display: inline-block;
  background: var(--color-tag);
  color: var(--color-tag-txt);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-new {
  display: inline-block;
  background: var(--color-badge);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   HEADER
   ============================================================ */
.main-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-heading);
  letter-spacing: -0.03em;
}
.logo:hover { color: var(--color-accent); text-decoration: none; }
.logo span { color: var(--color-accent); }

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: var(--color-tag); }

.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-heading);
  border-radius: 2px;
  position: relative;
}
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--color-heading);
  border-radius: 2px;
  left: 0;
  transition: var(--ease);
}
.hamburger::before { top: -6px; }
.hamburger::after  { top: 6px; }

/* Nav */
.main-nav {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md);
  box-shadow: 0 8px 24px var(--color-shadow);
}
.main-nav.active { display: block; }

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.nav-list a {
  font-weight: 500;
  color: var(--color-body);
  padding: var(--space-sm) 0;
  display: block;
}
.nav-list a:hover { color: var(--color-accent); text-decoration: none; }

/* ============================================================
   HERO (INDEX)
   ============================================================ */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-md);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}

.hero p {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 540px;
  margin: 0 auto var(--space-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-accent);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--ease);
  box-shadow: 0 4px 14px rgba(91,91,214,0.35);
}
.btn:hover {
  background: var(--color-accent-h);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(91,91,214,0.4);
}

/* ============================================================
   ARTICLES GRID
   ============================================================ */
.latest-articles {
  padding: 0 0 var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px var(--color-shadow);
  border-color: transparent;
}

.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.card-content {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--space-sm);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-muted);
}

.card-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: -0.02em;
}

.card-content p {
  color: var(--color-muted);
  font-size: 0.92rem;
  flex-grow: 1;
}

.read-more {
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-accent);
  margin-top: var(--space-sm);
}
.read-more::after { content: '→'; }
.read-more:hover { text-decoration: none; gap: 8px; }

/* ============================================================
   ARTICLE PAGE LAYOUT
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-md);
  align-items: start;
}

.main-article { max-width: 760px; }

.article-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.main-article h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-sm);
}

.article-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.article-hero-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  border: 1px solid var(--color-border);
}

.main-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--space-xl) 0 var(--space-sm);
  letter-spacing: -0.02em;
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-tag);
}

.main-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--color-heading);
}

.main-article p { margin-bottom: var(--space-md); }

.main-article ul, .main-article ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}
.main-article li { margin-bottom: var(--space-xs); }

/* Code Blocks */
.main-article pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  margin-bottom: var(--space-md);
  font-size: 0.88rem;
  line-height: 1.65;
}
.main-article code {
  font-family: var(--font-mono);
  color: var(--color-code-txt);
}

/* Inline code */
.main-article p code, .main-article li code {
  background: var(--color-code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--color-accent);
}

/* Code label badges */
.code-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* FAQ Section */
.faq-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.faq-block h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: var(--space-sm);
}
.faq-block p { margin-bottom: 0; color: var(--color-body); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.ad-slot {
  width: 300px;
  height: 600px;
  background: var(--color-code-bg);
  border: 2px dashed var(--color-border);
  color: var(--color-muted);
  display: none;          /* hidden on mobile — shown only on desktop */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: 0 auto;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.sidebar-widget h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.sidebar-widget ul { list-style: none; }
.sidebar-widget li {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget a {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-body);
}
.sidebar-widget a:hover { color: var(--color-accent); text-decoration: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.main-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-heading);
}

.footer-tagline {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--color-muted);
  font-size: 0.85rem;
}
.footer-links a:hover { color: var(--color-accent); text-decoration: none; }

.footer-copy {
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* ============================================================
   RESPONSIVE — DESKTOP (≥768px)
   ============================================================ */
@media (min-width: 768px) {
  .nav-toggle { display: none; }

  .main-nav {
    display: block;
    position: static;
    width: auto;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .nav-list {
    flex-direction: row;
    gap: var(--space-lg);
  }

  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .article-layout {
    grid-template-columns: 1fr 320px;
  }

  .ad-slot {
    display: flex;
    position: sticky;
    top: 84px;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-heading);
  color: var(--color-surface);
  padding: var(--space-md);
  box-shadow: 0 -4px 20px var(--color-shadow);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #E8E8F0;
}

.cookie-banner a {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner a:hover {
  text-decoration: none;
  color: var(--color-accent);
}

.cookie-banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.btn-cookie-accept,
.btn-cookie-decline {
  border: none;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--ease);
  font-size: 0.9rem;
}

.btn-cookie-accept {
  background: var(--color-accent);
  color: #fff;
}
.btn-cookie-accept:hover {
  background: var(--color-accent-h);
  transform: translateY(-2px);
}

.btn-cookie-decline {
  background: transparent;
  color: #E8E8F0;
  border: 1px solid #E8E8F0;
}
.btn-cookie-decline:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
  }
  .cookie-banner p {
    text-align: left;
    max-width: 75%;
  }
}
