/*
Theme Name: Piratage Info
Theme URI: https://piratage-informatique.com
Description: Cybersécurité pour indépendants digitaux
Version: 1.2.0
Author: Piratage Info
Text Domain: piratage-info
*/

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg-deep:    oklch(0.10 0.007 35);
  --bg-surface: oklch(0.14 0.006 35);
  --bg-subtle:  oklch(0.18 0.005 35);
  --text-main:  oklch(0.93 0.006 50);
  --text-muted: oklch(0.53 0.007 50);
  --accent:     oklch(0.78 0.16 82);
  --border:     oklch(0.22 0.005 35);

  --font-display: 'Epilogue', system-ui, sans-serif;
  --font-body:    'Figtree', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Échelle perfect fourth 1.333 */
  --step-0: 1rem;
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: 3.157rem;
  --step-5: 4.209rem;

  --ease-fast:   cubic-bezier(0.23, 1, 0.32, 1);
  --ease-smooth: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-micro: 100ms;
  --dur-short: 150ms;
  --dur-mid:   200ms;
  --space-xs: 0.5rem;
  --space-sm: 1.25rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 5rem;
  --max-prose:   66ch;
  --max-content: 1200px;
  --nav-h:       64px;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; transition: opacity var(--dur-mid) var(--ease-fast); }
@media (hover: hover) and (pointer: fine) { a:hover { opacity: 0.7; } }

/* ─── Navigation ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-h);
  background: oklch(0.10 0.007 35 / 0.92);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: var(--nav-h);
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.site-logo span { color: var(--accent); }
.site-logo:hover { opacity: 0.8; }

.nav-menu {
  display: none;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--dur-mid) var(--ease-fast);
}

.nav-menu a:hover { color: var(--text-main); opacity: 1; }

@media (min-width: 768px) {
  .nav-menu { display: flex; }
}

/* ─── Nav toggle (hamburger) ─────────────────────────────── */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: -0.5rem;
}
@media (min-width: 768px) { .nav-toggle { display: none; } }

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform var(--dur-short) var(--ease-fast),
              opacity var(--dur-short) var(--ease-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile nav panel ───────────────────────────────────── */
.nav-mobile {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 98;
  flex-direction: column;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--dur-mid) var(--ease-fast),
              padding var(--dur-mid) var(--ease-fast);
  padding: 0 1.5rem;
  display: block;
  visibility: hidden;
}
.nav-mobile.is-open {
  max-height: 240px;
  padding: 1rem 1.5rem;
  visibility: visible;
}
.nav-mobile a {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--text-main);
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  opacity: 1;
}
.nav-mobile a:last-child { border-bottom: none; }
@media (hover: hover) and (pointer: fine) {
  .nav-mobile a:hover { color: var(--accent); }
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
}

/* Atmosphère : dégradés radiaux + grille de points */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 55% 40%, oklch(0.18 0.018 60 / 0.45), transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 75%, oklch(0.14 0.012 35 / 0.25), transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, oklch(0.40 0.010 70 / 0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: clamp(4rem, 12vmin, 6.5rem) 1.5rem clamp(3rem, 8vmin, 4.5rem);
  width: 100%;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(var(--step-4), 8vw, var(--step-5));
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  color: var(--text-main);
  max-width: 14ch;
  margin-bottom: 1.5rem;
  opacity: 0;
}

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

.hero-sub {
  font-size: clamp(var(--step-0), 2vw, var(--step-1));
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  opacity: 0;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bg-deep);
  background: var(--accent);
  padding: 0.75rem 1.75rem;
  border-radius: 3px;
  transition: opacity var(--dur-mid) var(--ease-fast), transform var(--dur-mid) var(--ease-fast);
  opacity: 0;
}

.hero-cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  color: var(--bg-deep);
}

.hero-cta:active {
  transform: scale(0.97) translateY(0);
  transition-duration: var(--dur-micro);
}

.hero-cta-arrow {
  font-size: 1.1em;
  line-height: 1;
}

/* ─── Section layout ─────────────────────────────────────── */
.section {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-lg) 1.5rem;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 3rem;
}

/* ─── Valeurs ────────────────────────────────────────────── */
.values-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.value-item {
  display: grid;
  grid-template-columns: 3ch 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.value-item:first-child { border-top: 1px solid var(--border); }

.value-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 0.3rem;
}

.value-text {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-main);
}

.value-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.6;
}

/* ─── Articles liste ─────────────────────────────────────── */
.articles-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.article-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: none;
}

.article-item:first-child { border-top: 1px solid var(--border); }

.article-item:hover .article-title { color: var(--accent); }

.article-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
  color: var(--text-main);
  transition: color var(--dur-mid) var(--ease-fast);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.articles-footer {
  margin-top: 2rem;
}

.link-all {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ─── Newsletter ─────────────────────────────────────────── */
.newsletter-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.newsletter-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .newsletter-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.newsletter-text h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.newsletter-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.newsletter-form input[type="email"] {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: 3px;
  outline: none;
  width: 220px;
  transition: border-color var(--dur-mid) var(--ease-fast);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--accent);
}

.newsletter-form input::placeholder { color: var(--text-muted); }

.newsletter-form button {
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity var(--dur-mid) var(--ease-fast);
  white-space: nowrap;
}

.newsletter-form button:hover { opacity: 0.88; }

.newsletter-form button:active {
  transform: scale(0.97);
  transition-duration: var(--dur-micro);
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color var(--dur-mid) var(--ease-fast);
}

.footer-links a:hover { color: var(--text-main); opacity: 1; }

/* ─── Page article (single) ──────────────────────────────── */
.article-header {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.article-header-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1.5rem;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(var(--step-3), 5vw, var(--step-4));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  color: var(--text-main);
  max-width: 22ch;
}

/* Corps article */
.article-body {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 3rem 0 1rem;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--text-main);
  margin: 2rem 0 0.75rem;
}

.article-body p { margin-bottom: 1.25rem; color: var(--text-main); }

.article-body ul, .article-body ol {
  padding-left: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.article-body li { margin-bottom: 0.4rem; line-height: 1.65; }

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

.article-body pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-main);
}

/* Bloc "À retenir" : border-top accent, pas de border-left */
.article-body .retenir {
  background: var(--bg-surface);
  border-top: 2px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 0 4px 4px;
  margin: 2rem 0;
}

.article-body .retenir strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* CTA affiliation en bas d'article */
.article-cta {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 1.75rem;
  border-radius: 4px;
  margin: 3rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .article-cta { flex-direction: row; align-items: center; justify-content: space-between; }
}

.article-cta-text p:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.article-cta-text p:last-child {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 3px;
  white-space: nowrap;
  transition: opacity var(--dur-mid) var(--ease-fast);
  flex-shrink: 0;
}

.article-cta-btn:hover { opacity: 0.85; color: var(--bg-deep); }

/* ─── Index articles ─────────────────────────────────────── */
.archive-header {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.archive-header h1 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.archive-list {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  list-style: none;
}

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.pagination a {
  color: var(--text-muted);
  transition: color var(--dur-mid) var(--ease-fast);
}

.pagination a:hover { color: var(--accent); opacity: 1; }

/* ─── Section intro ──────────────────────────────────────── */
.section-intro {
  max-width: var(--max-prose);
  font-size: 1.0625rem;
  color: var(--text-main);
  line-height: 1.75;
  margin-bottom: 2rem;
}

/* ─── Audience grid ──────────────────────────────────────── */
.audience-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: var(--max-prose);
}
@media (min-width: 640px) { .audience-grid { grid-template-columns: 1fr 1fr; } }
.audience-grid li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.audience-grid li::before {
  content: "--";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: -0.05em;
}

/* ─── FAQ accordion ──────────────────────────────────────── */
.faq-list { max-width: var(--max-prose); display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q {
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  padding: var(--space-sm) 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: -0.01em;
  transition: color var(--dur-short) var(--ease-fast);
}
.faq-q::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) {
  .faq-q:hover { color: var(--accent); }
}
.faq-q::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform var(--dur-short) var(--ease-fast);
}
details[open] > .faq-q::after { transform: rotate(45deg); }
.faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-mid) var(--ease-fast),
              padding-bottom var(--dur-mid) var(--ease-fast);
  overflow: hidden;
  padding-bottom: 0;
}
details[open] > .faq-body {
  grid-template-rows: 1fr;
  padding-bottom: var(--space-sm);
}
.faq-body > div { overflow: hidden; min-height: 0; }
.faq-a { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.7; padding-left: 1rem; }

/* ─── Guides coming ──────────────────────────────────────── */
.guides-coming { max-width: var(--max-prose); font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; }

/* ─── Focus rings ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ─── Newsletter feedback ────────────────────────────────── */
.nl-feedback { font-size: 0.875rem; line-height: 1.5; margin: 0; }
.nl-success { color: var(--accent); }
.nl-error   { color: oklch(0.62 0.22 15); margin-top: 0.5rem; }

/* ─── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-label, .hero-headline, .hero-sub, .hero-cta {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (min-width: 480px) {
  .article-item { gap: 2rem; }
}

@media (min-width: 1024px) {
  .hero-inner { padding: 7rem 1.5rem; }
  .section { padding: 5rem 1.5rem; }
}
