/* ==========================================================================
   ExtractThumb — shared stylesheet
   Utility Top, Content Bottom layout. Vanilla, fast-loading, system fonts.
   ========================================================================== */

:root {
  --red: #e8412a;
  --red-dark: #c8341f;
  --ink: #1d1b19;
  --body: #3a3733;
  --muted: #6f6a63;
  --line: #e9e3da;
  --line-soft: #f0ebe2;
  --cream: #faf5ef;
  --cream-deep: #f5eee4;
  --paper: #ffffff;
  --kofi: #ef6c4d;
  --kofi-dark: #d9532f;
  --accent-soft: #fdeee9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 27, 25, .04), 0 8px 24px rgba(29, 27, 25, .05);
  --shadow-hover: 0 2px 4px rgba(29, 27, 25, .06), 0 14px 34px rgba(29, 27, 25, .09);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Top navigation ---------- */
.site-nav {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px 22px; max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  display: grid; place-items: center; background: var(--red);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; color: var(--ink); font-size: 1.04rem; letter-spacing: -0.02em; }
.brand-tag { font-size: .72rem; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--body); font-size: .92rem; font-weight: 500;
  padding: 7px 11px; border-radius: 7px;
}
.nav-links a:hover { background: var(--cream-deep); color: var(--ink); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--red); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; cursor: pointer; color: var(--ink);
}

/* ---------- Hero / tool zone ---------- */
.hero {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 54px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.6vw, 2.7rem);
  font-weight: 800; margin: 0 0 26px; letter-spacing: -0.025em;
}
.hero h1 .accent { color: var(--red); }

.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 620px; margin: 0 auto;
  padding: 22px;
}
.tool-form { display: flex; gap: 10px; }
.tool-form input[type="url"], .tool-form input[type="text"] {
  flex: 1 1 auto; min-width: 0;
  font: inherit; font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff; color: var(--ink);
}
.tool-form input::placeholder { color: #a39d94; }
.tool-form input:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: none; border-radius: 10px;
  padding: 14px 22px; white-space: nowrap;
  transition: background-color .15s ease, transform .04s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost {
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--cream); }

.try-row {
  margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; justify-content: center;
  font-size: .86rem; color: var(--muted);
}
.try-row .try-label { margin-right: 2px; }
.chip {
  font: inherit; font-size: .84rem; cursor: pointer;
  background: var(--cream-deep); color: var(--body);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px;
}
.chip:hover { background: #fff; border-color: var(--red); color: var(--red); }

.tool-msg { margin-top: 14px; font-size: .92rem; min-height: 1.2em; }
.tool-msg.error { color: var(--red-dark); }

/* Results */
.results { margin-top: 22px; display: none; }
.results.visible { display: block; }
.results h2 { font-size: 1.05rem; margin: 0 0 14px; }
.res-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.res-item {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; text-align: left;
}
.res-thumb { background: #f3efe8; aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.res-meta { padding: 11px 13px; }
.res-q { font-weight: 700; color: var(--ink); font-size: .92rem; }
.res-dim { color: var(--muted); font-size: .8rem; margin: 2px 0 10px; }
.res-actions { display: flex; gap: 8px; }
.res-actions .btn { padding: 8px 13px; font-size: .85rem; border-radius: 8px; }

/* Ko-fi */
.kofi { margin-top: 30px; text-align: center; }
.kofi-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--kofi); color: #fff; font-weight: 700;
  padding: 11px 20px; border-radius: 999px; font-size: .96rem;
  box-shadow: 0 6px 16px rgba(217, 83, 47, .25);
}
.kofi-btn:hover { background: var(--kofi-dark); text-decoration: none; }
.kofi-note { margin-top: 9px; font-size: .85rem; color: var(--muted); }

/* ---------- Content zone (below fold) ---------- */
.content-zone { background: var(--paper); padding: 70px 0 20px; }
.section-eyebrow {
  text-transform: uppercase; letter-spacing: .14em;
  font-size: .74rem; font-weight: 700; color: var(--red);
  display: block; margin-bottom: 10px;
}
.hub-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.hub-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); margin: 0 0 12px; }
.hub-head p { color: var(--muted); margin: 0; font-size: 1.04rem; }

/* Resource directory cards */
.card-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.res-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.res-card:hover {
  box-shadow: var(--shadow-hover); transform: translateY(-3px);
  border-color: #ddd4c8; text-decoration: none;
}
.res-card .card-icon {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 16px;
}
.res-card .card-icon svg { width: 24px; height: 24px; }
.res-card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.res-card p { color: var(--muted); font-size: .95rem; margin: 0 0 18px; flex: 1; }
.res-card .card-link { color: var(--red); font-weight: 700; font-size: .9rem; }

.hub-cluster { margin-top: 56px; }
.hub-cluster h3.cluster-title {
  font-size: 1.15rem; margin: 0 0 18px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.link-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.link-list a {
  display: block; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font-weight: 600; background: #fff;
}
.link-list a:hover { border-color: var(--red); background: var(--accent-soft); text-decoration: none; }
.link-list a span { display: block; font-weight: 400; color: var(--muted); font-size: .86rem; margin-top: 3px; }

/* FAQ accordion */
.faq-zone { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 64px 0; margin-top: 70px; }
.faq-list { max-width: 760px; margin: 30px auto 0; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--ink); font-size: 1.05rem;
  padding: 20px 44px 20px 4px; position: relative;
}
.faq-q::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--red); transition: transform .2s ease;
}
.faq-q[aria-expanded="true"]::after { content: "\2013"; }
.faq-a { display: none; padding: 0 4px 22px; color: var(--body); }
.faq-a p { margin: 0 0 12px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-item.open .faq-a { display: block; }

/* Strategy / prose blurb on home */
.strategy-zone { padding: 64px 0; }
.strategy-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.strategy-grid .prose-col h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 16px; }
.strategy-grid .prose-col p { color: var(--body); margin: 0 0 14px; }
.strategy-art { width: 100%; }

/* ---------- Article pages ---------- */
.article { padding: 50px 0 30px; }
.article-head { max-width: 760px; margin: 0 auto 34px; }
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }
.crumbs span { margin: 0 6px; opacity: .6; }
.article-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 14px; }
.article-lede { font-size: 1.18rem; color: var(--muted); margin: 0; }
.article-meta { margin-top: 18px; font-size: .85rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.article-meta .tag { background: var(--accent-soft); color: var(--red-dark); padding: 3px 10px; border-radius: 999px; font-weight: 600; }

.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.prose h3 { font-size: 1.18rem; margin: 28px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin-bottom: 9px; }
.prose img, .prose .figure { margin: 26px 0; }
.prose .figure { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.prose .figure figcaption { font-size: .85rem; color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--line-soft); background: var(--cream); }
.callout {
  background: var(--cream); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: 10px; padding: 18px 20px; margin: 26px 0;
}
.callout strong { color: var(--ink); }
.spec-table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: .95rem; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 14px; border: 1px solid var(--line); }
.spec-table th { background: var(--cream); color: var(--ink); font-weight: 700; }
.spec-table tr:nth-child(even) td { background: #fcfaf6; }

.key-takeaways { background: var(--accent-soft); border-radius: 12px; padding: 22px 24px; margin: 34px 0; }
.key-takeaways h2 { margin: 0 0 12px; font-size: 1.2rem; }
.key-takeaways ul { margin: 0; padding-left: 20px; }

.cta-band {
  margin: 44px auto 0; max-width: 760px;
  background: var(--ink); color: #fff; border-radius: 16px;
  padding: 32px; text-align: center;
}
.cta-band h2 { color: #fff; margin: 0 0 8px; font-size: 1.4rem; }
.cta-band p { color: #d9d4cc; margin: 0 0 20px; }
.cta-band .btn-primary { background: var(--red); }
.cta-band .btn-primary:hover { background: var(--red-dark); }

.related { max-width: 760px; margin: 46px auto 0; }
.related h2 { font-size: 1.2rem; margin: 0 0 16px; }

/* Simple page (about, legal, contact) */
.simple { padding: 50px 0 20px; }
.simple .prose h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 8px; }
.simple .updated { color: var(--muted); font-size: .85rem; margin: 0 0 26px; }

/* contact form */
.contact-form { display: grid; gap: 16px; max-width: 540px; margin-top: 8px; }
.contact-form label { font-weight: 600; color: var(--ink); font-size: .92rem; display: block; margin-bottom: 6px; }
.contact-form input, .contact-form textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--accent-soft); }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* ---------- Footer ---------- */
.site-footer { background: var(--cream); border-top: 1px solid var(--line); margin-top: 70px; padding: 48px 0 30px; }
.footer-top { text-align: center; font-weight: 800; color: var(--ink); margin-bottom: 30px; letter-spacing: -.01em; }
.footer-cols {
  display: grid; gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  max-width: 920px; margin: 0 auto;
}
.footer-col h4 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 0 0 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--body); font-size: .92rem; }
.footer-col a:hover { color: var(--red); }
.footer-base {
  text-align: center; margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 63px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 8px 14px 14px; z-index: 50;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; border-radius: 8px; }
  .nav-toggle { display: inline-flex; }
  .site-nav { position: relative; }
  .hero { padding: 40px 0 46px; }
  .tool-form { flex-direction: column; }
  .tool-form .btn-primary { width: 100%; }
  .strategy-grid { grid-template-columns: 1fr; gap: 30px; }
  .strategy-art { max-width: 380px; margin: 0 auto; }
  .content-zone { padding: 50px 0 10px; }
  .faq-zone { padding: 48px 0; margin-top: 50px; }
}

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

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }

/* ── Ad zone (homepage, below the knowledge-hub cards) ────────────── */
.ad-zone {
  background: var(--cream);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 26px 20px;
}
/* Two stacked ad slots (Adsterra above AdSense), clearly separated */
.ad-stack {
  max-width: 728px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.ad-slot {
  text-align: center;
}
.ad-label {
  display: block;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
/* Adsterra is a fixed 300x250 iframe — center it and reserve its space */
.ad-fixed {
  width: 300px;
  min-height: 250px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-fixed iframe { border: 0; display: block; }
/* AdSense is responsive — reserve a minimum height to avoid layout shift */
.ad-slot ins.adsbygoogle {
  display: block;
  min-height: 100px;
}
@media (max-width: 760px) {
  .ad-zone { padding: 20px 14px; }
  .ad-stack { gap: 22px; }
}

/* ── On-page SEO answers section (homepage) ──────────────────────── */
.answers-zone {
  background: var(--paper);
  padding: 66px 0 58px;
  border-bottom: 1px solid var(--line-soft);
}
.answers-zone .section-eyebrow { text-align: center; }
.answers-zone .prose h2:first-of-type { margin-top: 6px; }
.answers-zone .prose ol { margin: 0 0 18px; padding-left: 22px; }
.answers-zone .prose ol li { margin-bottom: 10px; }

/* Reuse .hub-cluster / .link-list styling; just space the related-tools block */
.related-tools { margin-top: 46px; }

/* ── Vimeo / TikTok extractors in the hero ───────────────────────── */
.alt-tools {
  max-width: 560px;
  margin: 18px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alt-tool {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}
.alt-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
}
.alt-toggle:hover { background: var(--cream); }
.alt-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  flex-shrink: 0;
}
.alt-badge--vimeo { background: #1ab7ea; }
.alt-badge--tiktok { background: #111; }
.alt-toggle-text { flex: 1; }
.alt-chevron {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  transition: transform .2s ease;
}
.alt-toggle[aria-expanded="true"] .alt-chevron { transform: rotate(45deg); }
.alt-warn {
  margin: 0;
  padding: 9px 16px;
  background: #fff7ed;
  color: #9a3412;
  font-size: .8rem;
  line-height: 1.4;
}
.alt-panel {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line-soft);
}
.alt-row { display: flex; gap: 8px; }
.alt-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.alt-row input:focus { outline: none; border-color: var(--red); }
.alt-row .btn { white-space: nowrap; }
.alt-msg { margin: 9px 0 0; font-size: .85rem; color: var(--muted); min-height: 1.1em; }
.alt-msg.error { color: var(--red-dark); }
.alt-result:not(:empty) { margin-top: 13px; }
.alt-card { display: flex; gap: 14px; align-items: flex-start; }
.alt-thumb {
  width: 150px;
  max-width: 45%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--cream);
}
.alt-card-meta { flex: 1; min-width: 0; }
.alt-card-title { font-weight: 600; font-size: .92rem; margin: 0 0 4px; color: var(--ink); word-break: break-word; }
.alt-card-dim { font-size: .82rem; color: var(--muted); margin: 0 0 10px; }
.alt-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .alt-row { flex-direction: column; }
  .alt-row .btn { width: 100%; }
}
