/* =====================================================================
   TalentedHub — frontend styles
   Modern 2026 look: bento grid, soft shadows, dark/light theming.
   All colors are CSS variables so re-skinning is a one-place change.
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --accent:        #6d4aff;   /* primary brand purple */
  --accent-2:      #00c2a8;   /* teal secondary */
  --accent-grad:   linear-gradient(120deg, #6d4aff 0%, #9a5cff 45%, #00c2a8 110%);

  --bg:            #f6f7fb;
  --surface:       #ffffff;
  --surface-2:     #f0f1f7;
  --text:          #14151a;
  --text-soft:     #5b5f6e;
  --text-faint:    #8a8f9e;
  --border:        #e7e8f0;
  --shadow-sm:     0 1px 2px rgba(20,21,26,.06), 0 2px 8px rgba(20,21,26,.04);
  --shadow-md:     0 6px 24px rgba(20,21,26,.08);
  --shadow-lg:     0 18px 50px rgba(40,30,90,.16);

  --radius:        18px;
  --radius-sm:     12px;
  --radius-pill:   999px;
  --maxw:          1200px;
  --gap:           22px;
  --font-head:     'Sora', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg:            #0c0d12;
  --surface:       #15171f;
  --surface-2:     #1c1f29;
  --text:          #f3f4f8;
  --text-soft:     #aab0c0;
  --text-faint:    #767d90;
  --border:        #272a35;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
  --shadow-md:     0 8px 28px rgba(0,0,0,.45);
  --shadow-lg:     0 20px 55px rgba(0,0,0,.6);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; letter-spacing: -.02em; }
ul, ol { list-style: none; padding: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: .95rem; padding: 12px 22px;
  border-radius: var(--radius-pill); transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(109,74,255,.35); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(109,74,255,.45); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-light { background: #fff; color: #14151a; }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; gap: 26px; height: 70px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px rgba(109,74,255,.4);
}
.brand-text span { color: var(--accent); }
[data-theme="dark"] .brand-text span { color: var(--accent-2); }

.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  font-weight: 500; font-size: .95rem; color: var(--text-soft);
  padding: 8px 14px; border-radius: var(--radius-pill); transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
[data-theme="dark"] .nav-link.active { color: #fff; background: color-mix(in srgb, var(--accent) 30%, transparent); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-soft); transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-btn { display: none; }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding-top: 54px; padding-bottom: 30px; }
.hero-head { max-width: 760px; margin-bottom: 38px; }
.eyebrow {
  display: inline-block; font-weight: 600; font-size: .82rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 18px;
}
.hero-title { font-size: clamp(2.1rem, 5vw, 3.7rem); font-weight: 800; }
.hero-title .grad {
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-soft); margin-top: 18px; max-width: 620px; }

/* ---------- Bento featured grid ---------- */
.bento { display: grid; grid-template-columns: 2fr 1fr; grid-auto-rows: 1fr; gap: var(--gap); }
.bento-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.bento-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.bento-feature { grid-row: span 2; }
.bento-feature .card-img { aspect-ratio: 16/9; }
.bento-mini { flex-direction: row; }
.bento-mini .card-img { width: 42%; min-height: 100%; }
.bento-mini .card-body { padding: 16px 18px; }

.card-img {
  position: relative; display: block; background-image: var(--img);
  background-size: cover; background-position: center; background-color: var(--surface-2);
}
.card-img.ratio { aspect-ratio: 3/2; }
.badge {
  position: absolute; top: 14px; left: 14px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 6px 12px; border-radius: var(--radius-pill);
}
.badge-accent { background: var(--accent); color: #fff; }

.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pill {
  align-self: flex-start; font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  padding: 5px 11px; border-radius: var(--radius-pill);
}
[data-theme="dark"] .pill { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.card-title { font-size: 1.5rem; font-weight: 700; }
.card-title.sm { font-size: 1.06rem; }
.card-title a { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 2px;
  background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s; }
.card-title a:hover { background-size: 100% 2px; color: var(--accent); }
.card-excerpt { color: var(--text-soft); font-size: .96rem; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px;
  color: var(--text-faint); font-size: .85rem; }
.card-meta .dot { opacity: .5; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ---------- Category strip ---------- */
.cat-strip { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 38px; padding-bottom: 8px; }
.chip {
  font-weight: 600; font-size: .9rem; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border); padding: 9px 18px;
  border-radius: var(--radius-pill); transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Layout: feed + sidebar ---------- */
.layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; padding-top: 34px; padding-bottom: 60px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-title { font-size: 1.6rem; font-weight: 700; }
.link-more { color: var(--accent); font-weight: 600; font-size: .92rem; }
.link-more:hover { text-decoration: underline; }

.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card .card-title { font-size: 1.18rem; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 34px; }

/* ---------- Ad slots ---------- */
.ad-slot {
  display: grid; place-items: center; color: var(--text-faint);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, transparent 10px, transparent 20px);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; font-weight: 600;
}
.ad-infeed { grid-column: 1 / -1; min-height: 110px; }
.ad-rail { min-height: 250px; }
.ad-rail.sticky { position: sticky; top: 90px; min-height: 600px; }

/* ---------- Sidebar widgets ---------- */
.sidebar { display: flex; flex-direction: column; gap: 26px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.widget-cta { background: var(--accent-grad); color: #fff; border: none; }
.widget-cta h3 { font-size: 1.25rem; margin-bottom: 8px; }
.widget-cta p { font-size: .92rem; opacity: .92; margin-bottom: 16px; }
.mini-form { display: flex; flex-direction: column; gap: 10px; }
.mini-form input, .newsletter-form input {
  padding: 12px 16px; border-radius: var(--radius-pill); border: none; font-size: .92rem;
  background: rgba(255,255,255,.92); color: #14151a; outline: none;
}
.mini-form input:focus, .newsletter-form input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.4); }

.rank-list li + li { margin-top: 4px; }
.rank-list a { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: var(--radius-sm); transition: background .2s; }
.rank-list a:hover { background: var(--surface-2); }
.rank-list .rank { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 26px; }
.rank-list span:last-child { font-size: .94rem; font-weight: 500; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { font-size: .85rem; color: var(--text-soft); background: var(--surface-2);
  padding: 7px 13px; border-radius: var(--radius-pill); transition: all .2s; }
.tag-cloud a:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- Newsletter band ---------- */
.newsletter { padding: 26px 0 70px; }
.newsletter-inner {
  background: var(--accent-grad); border-radius: 28px; padding: 48px 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.newsletter-inner::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  background: rgba(255,255,255,.14); border-radius: 50%;
}
.newsletter-copy h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.newsletter-copy p { opacity: .92; margin-top: 8px; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.newsletter-form input { min-width: 240px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1.4fr; gap: 34px; padding-bottom: 40px; }
.footer-tag { color: var(--text-soft); margin-top: 14px; max-width: 280px; }
.footer-brand .socials { margin-top: 20px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-soft); font-size: .92rem; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-news p { color: var(--text-soft); font-size: .9rem; margin-bottom: 14px; }
.footer-form { display: flex; gap: 8px; }
.footer-form input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit;
  font-size: .9rem; outline: none; transition: border-color .2s; }
.footer-form input:focus { border-color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding: 22px 22px; color: var(--text-faint); font-size: .88rem; }
.footer-legal-links { display: flex; gap: 22px; }
.footer-legal-links a { color: var(--text-faint); transition: color .2s; }
.footer-legal-links a:hover { color: var(--accent); }
.socials { display: flex; gap: 8px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-soft); transition: all .2s; }
.socials a:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

/* ---------- Mobile nav drawer ---------- */
/* On mobile, main.js moves the drawer (.main-nav, z-index:70) out to <body>,
   so it sits above this backdrop. Backdrop dims everything incl. the header. */
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; visibility: hidden;
  transition: opacity .25s; z-index: 60; }
.nav-backdrop.open { opacity: 1; visibility: visible; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .ad-rail.sticky { position: static; min-height: 250px; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .sidebar > * { flex: 1 1 260px; }
  /* The 6-column footer doesn't fit below ~1000px and overflows horizontally.
     Collapse it to 3 columns with the brand + newsletter spanning full width. */
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-news { grid-column: 1 / -1; }
  .footer-form { max-width: 380px; }
}
@media (max-width: 900px) {   /* keep in sync with the matchMedia() breakpoint in assets/js/main.js */
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto; height: auto; width: min(82vw, 320px);
    background: var(--surface); flex-direction: column; gap: 6px; padding: 88px 20px 24px;
    transform: translateX(102%); transition: transform .3s ease, visibility .3s ease; z-index: 70;
    box-shadow: -10px 0 44px rgba(0,0,0,.18); overflow-y: auto;
    visibility: hidden;            /* closed drawer is fully hidden so it can't be swiped/scrolled to on mobile */
  }
  .main-nav.open { transform: translateX(0); visibility: visible; }
  .nav-link { width: 100%; font-size: 1.05rem; padding: 12px 16px; }
  .menu-btn { display: grid; }
  .bento { grid-template-columns: 1fr; }
  .bento-feature { grid-row: auto; }
  .bento-mini { flex-direction: column; }
  .bento-mini .card-img { width: 100%; aspect-ratio: 16/9; }
  /* footer collapse handled in the max-width:1000px block above */
}
@media (max-width: 620px) {
  .post-grid { grid-template-columns: 1fr; }
  .sidebar { flex-direction: column; }
  .header-actions .btn-primary { display: none; }
  .newsletter-inner { padding: 32px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ---- Header search ---- */
.header-search { display: flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 6px 12px; color: var(--text-faint); transition: border-color .2s, box-shadow .2s; }
.header-search:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.header-search input { border: none; background: none; outline: none; color: var(--text); font-size: .9rem; width: 140px; }
.header-search input::placeholder { color: var(--text-faint); }
.search-icon-link { display: none; }
/* Below ~1024px the inline search box no longer fits next to the full nav and
   pushes .header-actions off-screen (horizontal scroll). Swap it for the
   compact search icon until the desktop layout has room again. */
@media (max-width: 1024px) {
  .header-search { display: none; }
  .search-icon-link { display: inline-flex; }
}

/* ---- Search results page ---- */
.search-page { padding-bottom: 50px; }
.search-big { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 8px 8px 8px 18px;
  color: var(--text-faint); box-shadow: var(--shadow-sm); }
.search-big input { flex: 1; border: none; background: none; outline: none; font-size: 1rem; color: var(--text); }
.search-hint, .search-count { text-align: center; color: var(--text-soft); margin: 18px 0; }
.search-empty { text-align: center; padding: 30px 0; }
.search-empty h2 { font-size: 1.3rem; margin-bottom: 8px; }
.search-group { max-width: 760px; margin: 0 auto 26px; }
.search-group > h2 { font-family: var(--font-head); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-faint); margin: 0 0 12px; }
.search-result { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; transition: transform .15s, border-color .15s; }
.search-result:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.sr-tag { flex-shrink: 0; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 9px; border-radius: var(--radius-pill); color: #fff; }
.tag-course { background: #7c3aed; } .tag-lesson { background: #2965f1; }
.tag-guide { background: var(--accent); } .tag-tool { background: #0a7ea4; }
.sr-text { display: flex; flex-direction: column; min-width: 0; }
.sr-text strong { font-weight: 700; color: var(--text); }
.sr-text em { font-style: normal; font-size: .9rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---- Contact form states + honeypot ---- */
.form-success { background: color-mix(in srgb, #059669 12%, var(--surface)); border: 1px solid #059669; color: var(--text);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; font-weight: 600; }
.form-error { background: color-mix(in srgb, #dc2626 10%, var(--surface)); border: 1px solid #dc2626; color: var(--text);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
/* Honeypot hidden field — clip-based hiding (does NOT shift off-screen, so it can't create horizontal scroll) */
.hp-field { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; pointer-events: none; }

/* Newsletter inline success/error message */
.subscribe-msg { font-weight: 700; margin: 0; padding: 10px 2px; line-height: 1.4; }
.subscribe-msg.err { opacity: .95; }
.footer-news .subscribe-msg, .newsletter .subscribe-msg { color: inherit; }

/* Safety net: prevent any accidental horizontal scroll on mobile.
   'clip' (not 'hidden') keeps the sticky header working. */
html { overflow-x: clip; }
