/*
Theme Name: Points et Miles
Theme URI: https://pointsetmiles.be
Author: Points et Miles
Description: Thème éditorial sur mesure pour Points et Miles — le blog belge francophone des miles, points et cartes. Palette navy / bleu ciel / or, typographie éditoriale, motif trajectoire de vol.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pointsetmiles
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --navy: #10293f;
  --navy-deep: #0b1e30;
  --ink: #22303c;
  --ink-soft: #55636f;
  --sky: #eaf4fb;
  --sky-line: #cfe3f2;
  --gold: #c7a345;
  --gold-soft: #e9d9a8;
  --paper: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(16, 41, 63, 0.06), 0 10px 30px -18px rgba(16, 41, 63, 0.25);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --w-content: 720px;
  --w-wide: 1120px;
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); text-decoration-color: var(--sky-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.35rem; }

.wrap { max-width: var(--w-wide); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.wrap--narrow { max-width: var(--w-content); }

/* Eyebrow — petit label doré au-dessus des titres */
.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sky-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--navy);
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  flex: none;
}
.brand__mark svg { width: 20px; height: 20px; }

.brand em { font-style: normal; color: var(--gold); }

.site-nav ul {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.8rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.4rem 0.1rem;
}
.site-nav .current-menu-item > a,
.site-nav a:hover { color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--sky-line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font: inherit;
  color: var(--navy);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--sky-line);
    padding: 0.8rem 1.2rem 1.2rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.2rem; }
  .site-nav a { display: block; padding: 0.55rem 0.2rem; font-size: 1.05rem; }
}

/* ==========================================================================
   Héro (page d'accueil) — signature : trajectoire de vol
   ========================================================================== */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--sky) 0%, rgba(234, 244, 251, 0.35) 78%, var(--paper) 100%);
  overflow: hidden;
}

.hero__inner {
  position: relative;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem);
  max-width: 640px;
}

.hero__badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--sky-line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.4rem;
}

.hero h1 { margin-bottom: 0.6em; }
.hero h1 .line-gold { color: var(--gold); }

.hero p.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 1.8rem;
}

/* Trajectoire de vol : trait pointillé + avion, traverse le héro */
.flightpath {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--navy);
  opacity: 0.35;
}
.flightpath svg { position: absolute; right: -4%; top: 8%; width: 58%; height: auto; }
.flightpath .dash {
  stroke-dasharray: 6 10;
  animation: pm-dash 22s linear infinite;
}
@keyframes pm-dash { to { stroke-dashoffset: -320; } }
@media (max-width: 900px) { .flightpath svg { width: 90%; opacity: 0.5; top: 2%; } }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.72rem 1.4rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { box-shadow: 0 8px 20px -10px rgba(16, 41, 63, 0.55); }
.btn--ghost { background: var(--paper); color: var(--navy); border-color: var(--sky-line); }
.btn--gold { background: var(--gold); color: var(--navy-deep); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(2.6rem, 6vw, 4.2rem) 0; }
.section--sky { background: var(--sky); }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.section-head .more { font-weight: 600; font-size: 0.95rem; white-space: nowrap; }

/* ==========================================================================
   Cartes d'articles
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.4rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--sky-line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16,41,63,.06), 0 18px 40px -18px rgba(16,41,63,.32); }

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 0.8rem;
}

.cat-chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--sky);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  text-decoration: none;
}
.cat-chip:hover { background: var(--sky-line); }

.post-card h3 { font-size: 1.28rem; margin-bottom: 0.5rem; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { color: var(--gold); }

.post-card__excerpt { color: var(--ink-soft); font-size: 0.97rem; flex: 1; }

.post-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.1rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.post-card__foot .read { font-weight: 600; text-decoration: none; }

/* Filtres de catégories (page Articles) */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 2rem;
}
.cat-filter a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--sky-line);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}
.cat-filter a.is-active,
.cat-filter a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ==========================================================================
   Article (single)
   ========================================================================== */
.entry-header { padding: clamp(2.2rem, 6vw, 3.6rem) 0 1.2rem; }
.entry-header .post-card__meta { margin-bottom: 1rem; }

.entry-content { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.entry-content > * { max-width: var(--w-content); margin-left: auto; margin-right: auto; }
.entry-content p { margin: 0 0 1.25em; }
.entry-content h2 { margin-top: 2.2em; }
.entry-content h3 { margin-top: 1.8em; }

.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin: 0 0 1.25em; }
.entry-content li { margin-bottom: 0.4em; }

.entry-content blockquote {
  border-left: 3px solid var(--gold);
  background: var(--sky);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.6em auto;
  padding: 1rem 1.3rem;
  font-style: italic;
  color: var(--navy);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em auto;
  font-size: 0.95rem;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--sky-line);
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.entry-content th { background: var(--sky); color: var(--navy); }

.entry-content .alignwide { max-width: var(--w-wide); }
.entry-content .alignfull { max-width: none; }

.entry-content code {
  background: var(--sky);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  font-size: 0.92em;
}

/* Encadré "engagement" réutilisable via classe .pm-note dans l'éditeur */
.pm-note {
  background: var(--sky);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.1rem 1.3rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0 3rem;
  border-top: 1px solid var(--sky-line);
  font-size: 0.95rem;
}
.post-nav a { text-decoration: none; font-weight: 600; }

/* ==========================================================================
   Newsletter
   ========================================================================== */
.newsletter {
  background: var(--navy);
  color: #e8eef4;
  border-radius: var(--radius);
  padding: clamp(1.8rem, 5vw, 2.8rem);
  position: relative;
  overflow: hidden;
}
.newsletter .eyebrow { color: var(--gold-soft); }
.newsletter h2 { color: #fff; }
.newsletter p { color: #c3d2df; max-width: 52ch; }

.newsletter__form { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.newsletter__form input[type="email"] {
  flex: 1 1 240px;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font: inherit;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--sky);
  border-top: 1px solid var(--sky-line);
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(2.2rem, 5vw, 3.4rem) 0 1.6rem;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.3fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-grid h4 { font-size: 1.05rem; margin-bottom: 0.7rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.45rem; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--gold); }

.footer-social { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.footer-social a {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--sky-line);
  background: var(--paper);
  color: var(--navy);
}
.footer-social svg { width: 17px; height: 17px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--sky-line);
  padding-top: 1.2rem;
  font-size: 0.88rem;
}

/* ==========================================================================
   Pagination, divers
   ========================================================================== */
.pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 2rem 0; }
.pagination .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--sky-line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

.page-header { padding: clamp(2.2rem, 6vw, 3.4rem) 0 0.4rem; }
.page-header p.desc { color: var(--ink-soft); max-width: 60ch; margin-top: 0.4rem; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
}

.no-results { padding: 2rem 0 4rem; color: var(--ink-soft); }
