/*
Theme Name: AdFree
Theme URI: https://adfree.pro
Author: AdFree
Author URI: https://adfree.pro
Description: Landing theme for the AdFree ad blocker and pop-up blocker browser extension. Cache-safe multilingual layer (?lang=), hreflang, JSON-LD and a built-in blog.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: adfree
*/

/* ---------------- Tokens ---------------- */
:root {
  --brand: #d92b2b;
  --brand-dark: #a80f13;
  --brand-light: #ff7a78;
  --brand-tint: #fff1f1;
  --brand-tint-2: #ffe3e3;

  --ink: #17181c;
  --ink-2: #3d434e;
  --ink-soft: #656d7b;
  --line: #e7e9ef;
  --line-soft: #f1f3f7;

  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --dark: #14161c;
  --dark-2: #1e212a;
  --on-dark: #eef0f5;
  --on-dark-soft: #a8b0c0;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 14px 40px rgba(20, 22, 28, .10);
  --shadow-sm: 0 4px 16px rgba(20, 22, 28, .07);
  --maxw: 1140px;
  --maxw-narrow: 760px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Noto Sans", "Noto Sans Arabic", "Noto Sans JP", "Noto Sans SC", sans-serif;
}

/* ---------------- Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 750; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.14rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 1em; padding-inline-start: 1.25em; }
svg { width: 1.25em; height: 1.25em; flex: none; }
code { background: var(--line-soft); padding: .12em .4em; border-radius: 6px; font-size: .92em; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: .7em 1.1em; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Layout ---------------- */
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, var(--maxw-narrow)); }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-soft { background: var(--bg-soft); }
.center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .82rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 .7em;
}
.eyebrow svg { width: 1.05em; height: 1.05em; }
.section-title { max-width: 22ch; }
.section-sub { color: var(--ink-soft); max-width: 62ch; font-size: 1.06rem; margin-bottom: 2.4em; }
.section-title + .section-sub { margin-top: -.2em; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .78em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 650; font-size: .97rem; line-height: 1; cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 1.15em; height: 1.15em; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 22px rgba(217, 43, 43, .28); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); background: #fff; }
.btn-invert { color: var(--on-dark); border-color: rgba(255, 255, 255, .28); }
.btn-invert:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }
.btn-lg { padding: .95em 1.7em; font-size: 1.04rem; }
.btn-sm { padding: .62em 1.05em; font-size: .9rem; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-name { font-size: 1.24rem; font-weight: 700; letter-spacing: -.005em; }
.logo-mark { display: block; flex: none; max-width: none; }

.site-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 1.5rem; }
.site-nav > a { color: var(--ink-2); font-weight: 550; font-size: .97rem; }
.site-nav > a:hover { color: var(--brand); text-decoration: none; }
.site-nav .nav-cta { color: #fff; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; margin-inline-start: auto; width: 42px; height: 42px; padding: 11px 9px; cursor: pointer; }
.nav-burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; margin-bottom: 5px; }
.nav-burger span:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  .nav-burger { display: block; }
  .site-nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 20px 1.1rem;
    box-shadow: var(--shadow);
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav > a { padding: .7em 0; border-bottom: 1px solid var(--line-soft); }
  .site-nav .nav-cta { margin-top: .9rem; }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 7vw, 86px) 0 0;
  background:
    radial-gradient(760px 380px at 82% -8%, var(--brand-tint-2), transparent 62%),
    radial-gradient(620px 340px at 8% 6%, #fff6f2, transparent 60%),
    var(--bg);
}
.hero-inner { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-copy h1 { margin-bottom: .35em; }
.pill {
  display: inline-block; background: #fff; border: 1px solid var(--brand-tint-2);
  color: var(--brand-dark); font-size: .85rem; font-weight: 600;
  padding: .45em 1em; border-radius: 999px; margin-bottom: 1.3em; box-shadow: var(--shadow-sm);
}
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.9rem 0 1.1rem; }
.hero-note { font-size: .9rem; color: var(--ink-soft); margin-bottom: .4em; }
.hero-rating { display: flex; align-items: center; gap: .45em; font-size: .9rem; color: var(--ink-soft); }
.hero-rating .i-star { fill: #f7b731; stroke: #e8a317; width: 1.1em; height: 1.1em; }
.hero-rating a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }

/* Popup mock: decorative, so it carries no text that would need translating.
   The mark sits top-left and the card bottom-right, clear of each other — an
   earlier version centred the mark and dropped the card on top of it, which
   sliced the logo in half. */
.hero-art { position: relative; min-height: 340px; }
.hero-shield {
  position: absolute; top: 4%; inset-inline-start: 4%;
  filter: drop-shadow(0 22px 42px rgba(168, 15, 19, .30));
  animation: adf-float 7s ease-in-out infinite;
}
@keyframes adf-float { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }
.hero-card {
  position: absolute; inset-inline-end: 0; bottom: 4%;
  width: 208px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
}
.hc-top { display: flex; align-items: center; gap: .5em; margin-bottom: .8em; }
.hc-name { font-weight: 750; color: var(--ink); font-size: .95rem; }
.hc-switch { margin-inline-start: auto; width: 34px; height: 19px; border-radius: 999px; background: var(--brand); position: relative; }
.hc-switch::after { content: ""; position: absolute; inset-block: 3px; inset-inline-end: 3px; width: 13px; border-radius: 50%; background: #fff; }
.hc-count strong { font-size: 1.85rem; color: var(--brand); letter-spacing: -.03em; }
.hc-rows { display: grid; gap: .55em; margin-top: .9em; }
.hc-row { display: flex; align-items: center; gap: .6em; color: var(--ink-soft); }
.hc-row svg { width: 1.05em; height: 1.05em; }
.hc-row i { display: block; flex: 1; height: 7px; border-radius: 999px; background: var(--line-soft); }
.hc-row:nth-child(1) i { background: linear-gradient(90deg, var(--brand-tint-2) 72%, var(--line-soft) 72%); }
.hc-row:nth-child(2) i { background: linear-gradient(90deg, var(--brand-tint-2) 48%, var(--line-soft) 48%); }
.hc-row:nth-child(3) i { background: linear-gradient(90deg, var(--brand-tint-2) 30%, var(--line-soft) 30%); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.stat { background: #fff; padding: 1.35rem 1rem; text-align: center; }
.stat strong { display: block; font-size: 1.65rem; color: var(--ink); letter-spacing: -.03em; font-weight: 800; }
.stat span { font-size: .87rem; color: var(--ink-soft); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art {
    order: -1; min-height: 0; display: flex; flex-direction: column; align-items: center;
  }
  .hero-shield, .hero-card { position: static; }
  .hero-card { margin-top: 1.2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- Cards & grids ---------------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-tint-2); }
.card h3, .card h2 { font-size: 1.1rem; margin-bottom: .4em; }
.card p { margin: 0; font-size: .97rem; color: var(--ink-soft); }
.card-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 1rem;
  border-radius: 12px; background: var(--brand-tint); color: var(--brand);
}
.card-icon svg { width: 22px; height: 22px; }
.card-accent { background: linear-gradient(180deg, var(--brand-tint), #fff 65%); border-color: var(--brand-tint-2); }
.mail-link { font-weight: 650; word-break: break-word; }

/* ---------------- Steps ---------------- */
.steps { list-style: none; padding: 0; margin: 0 0 2.4rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.4rem; }
.step-num {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: .9rem;
  border-radius: 50%; background: var(--brand); color: #fff; font-weight: 750; font-size: .95rem;
}
.step h3 { margin-bottom: .35em; }
.step p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------------- Privacy (dark) ---------------- */
.section-dark { background: var(--dark); color: var(--on-dark-soft); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .lead { color: var(--on-dark-soft); }
.section-dark .eyebrow { color: var(--brand-light); }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: start; }
.privacy-lists { display: grid; gap: 1.4rem; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.ticks li { display: flex; gap: .7em; align-items: flex-start; line-height: 1.5; }
.ticks svg { width: 1.2em; height: 1.2em; margin-top: .18em; }
.i-yes { color: #37d67a; }
.i-no  { color: #ff7a78; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: 1fr; } }

/* ---------------- FAQ ---------------- */
.faq { display: grid; gap: 12px; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 1.2rem; box-shadow: var(--shadow-sm);
}
.faq summary {
  display: flex; align-items: center; gap: 1rem; cursor: pointer; list-style: none;
  padding: 1.05rem 0; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; flex: 1; font-size: 1.05rem; }
.faq .i-chev { color: var(--ink-soft); transition: transform .2s; }
.faq details[open] .i-chev { transform: rotate(180deg); }
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq details p { padding: 1rem 0 1.15rem; margin: 0; color: var(--ink-soft); }

/* ---------------- CTA ---------------- */
.cta {
  padding: clamp(56px, 8vw, 92px) 0;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; text-align: center;
}
.cta h2 { color: #fff; margin: .6em auto .3em; max-width: 20ch; }
.cta .lead { color: rgba(255, 255, 255, .88); margin-inline: auto; }
.cta .logo-mark { margin-inline: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .25)); }
.cta .btn-primary { background: #fff; color: var(--brand-dark); box-shadow: 0 10px 26px rgba(0, 0, 0, .22); margin-top: 1.2rem; }
.cta .btn-primary:hover { background: #fff; color: #000; }
.cta-note { margin-top: 1rem; font-size: .9rem; color: rgba(255, 255, 255, .8); }

/* ---------------- Pages, blog, prose ---------------- */
.page-head {
  padding: clamp(42px, 6vw, 76px) 0 0;
  background: radial-gradient(640px 320px at 20% -20%, var(--brand-tint), transparent 65%), var(--bg);
}
.page-head h1 { margin-bottom: .35em; }
.crumbs { font-size: .9rem; color: var(--ink-soft); display: flex; gap: .5em; flex-wrap: wrap; margin-bottom: .9em; }
.post-meta { font-size: .88rem; color: var(--ink-soft); }

.guide { list-style: none; margin: 0 0 2.6rem; padding: 0; display: grid; gap: 1.2rem; }
.guide-step { display: flex; gap: 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.4rem; box-shadow: var(--shadow-sm); }
.guide-step h2 { font-size: 1.18rem; margin-bottom: .35em; }
.guide-step p { margin: 0; color: var(--ink-soft); }

.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card-link { display: block; color: inherit; padding: 1.3rem; }
.post-card-link:hover { text-decoration: none; }
.post-thumb { display: block; margin: -1.3rem -1.3rem 1.1rem; }
.post-thumb img { width: 100%; }
.post-card-title { font-size: 1.12rem; margin: .45em 0 .4em; color: var(--ink); }
.post-card p { color: var(--ink-soft); font-size: .96rem; margin-bottom: .8em; }
.post-more { color: var(--brand-dark); font-weight: 650; font-size: .92rem; display: inline-flex; align-items: center; gap: .4em; }
.post-more svg { width: 1em; height: 1em; }
.empty { color: var(--ink-soft); text-align: center; padding: 2rem 0; }

.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2.5rem; }
.pagination .page-numbers {
  display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 .6em;
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-2); background: #fff;
}
.pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.article-hero { margin: 2rem 0 0; }
.article-hero img { border-radius: var(--radius); width: 100%; }

.prose { padding-top: 1.6rem; }
.prose h2 { margin-top: 1.9em; font-size: 1.55rem; }
.prose h3 { margin-top: 1.6em; font-size: 1.2rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose li { margin-bottom: .45em; }
.prose img { border-radius: var(--radius-sm); margin: 1.6em 0; }
.prose blockquote {
  margin: 1.6em 0; padding: .3em 0 .3em 1.2em;
  border-inline-start: 3px solid var(--brand); color: var(--ink-soft); font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .96rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .7em .9em; text-align: start; }
.prose th { background: var(--bg-soft); color: var(--ink); font-weight: 700; }

.article-cta {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  background: linear-gradient(140deg, var(--brand-tint), #fff 70%);
  border: 1px solid var(--brand-tint-2); border-radius: var(--radius);
  padding: 1.5rem; margin: 3rem 0 1.6rem;
}
.article-cta h2 { font-size: 1.2rem; margin: 0 0 .25em; }
.article-cta p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.article-cta > div { flex: 1 1 260px; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--dark); color: var(--on-dark-soft); padding: clamp(46px, 6vw, 70px) 0 28px; font-size: .95rem; }
.site-footer a { color: var(--on-dark-soft); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand .brand, .footer-brand .brand-name { color: #fff; }
.footer-tag { max-width: 34ch; margin: .9em 0 1.3em; }
.footer-col h2 { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: #fff; margin-bottom: 1em; }
.footer-col { display: flex; flex-direction: column; gap: .6em; align-items: flex-start; }

.lang-bar { border-top: 1px solid var(--dark-2); margin-top: 2.6rem; padding-top: 1.6rem; }
.lang-title { display: flex; align-items: center; gap: .5em; font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: #fff; margin-bottom: .9em; }
.lang-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5em 1.3em; }
.lang-list .is-current { color: #fff; font-weight: 700; }

.footer-bottom { border-top: 1px solid var(--dark-2); margin-top: 1.8rem; padding-top: 1.5rem; font-size: .86rem; }
.footer-bottom p { margin: 0 0 .6em; }
.footer-fineprint { color: #6f7789; max-width: 90ch; }

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------- RTL ---------------- */
[dir="rtl"] .btn svg,
[dir="rtl"] .post-more svg { transform: scaleX(-1); }
[dir="rtl"] .hero-card { inset-inline-end: 2%; }
