/*
Theme Name:   The WhAIstledown
Theme URI:    https://thewhaistledown.com
Author:       Lady WhAIstledown
Author URI:   https://thewhaistledown.com
Description:  Thème WordPress pour The WhAIstledown — une chronique mondaine où le monde de l'IA est conté comme la haute société anglaise du XIXe siècle.
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  the-whaistledown
Tags:         blog, one-column, custom-logo, editor-style, translation-ready
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ══════════════════════════════════════
   The WhAIstledown — Feuille de style
   ══════════════════════════════════════ */

:root {
  --ink: #1b1b1f;
  --paper: #fbf4e6;
  --paper-2: #f7ecd7;
  --wax: #7a1b22;
  --gold: #b58a2a;
  --gold-light: rgba(181, 138, 42, .15);
  --shadow: 0 18px 55px rgba(0, 0, 0, .18);
  --radius: 22px;
  --max: 860px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }

body {
  color: var(--ink);
  background:
    radial-gradient(1100px 650px at 15% 20%, rgba(181, 138, 42, .18), transparent 60%),
    radial-gradient(900px 520px at 85% 18%, rgba(122, 27, 34, .14), transparent 65%),
    radial-gradient(1200px 780px at 50% 100%, rgba(0, 0, 0, .08), transparent 60%),
    linear-gradient(180deg, #fffaf0, var(--paper));
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1.55;
  padding: 0;
}

/* ---------- GRAIN TEXTURE ---------- */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, .035) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(0, 0, 0, .03) 0 1px, transparent 2px),
    radial-gradient(circle at 50% 10%, rgba(0, 0, 0, .025) 0 1px, transparent 2px);
  background-size: 120px 120px, 160px 160px, 220px 220px;
  mix-blend-mode: multiply;
  opacity: .55;
  z-index: 0;
}

/* ---------- NAV ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  padding: 12px 18px;
  background: rgba(255, 250, 240, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.nav-brand {
  font-family: "Great Vibes", cursive;
  font-size: 1.5rem;
  color: var(--wax);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-links a,
.nav-links .menu-item a {
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .04em;
  font-variant: small-caps;
  transition: background .15s;
}
.nav-links a:hover,
.nav-links .menu-item a:hover { background: var(--gold-light); }

/* WP nav menu reset */
.nav-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-links li { margin: 0; }

/* ---------- HEADER / HERO ---------- */
.site-header {
  position: relative;
  text-align: center;
  padding: 72px 18px 48px;
  max-width: var(--max);
  margin: 0 auto;
}

.crest {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, .08);
  font-variant: small-caps;
  letter-spacing: .08em;
  font-size: .95rem;
}
.crest .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--wax);
  box-shadow: 0 0 0 3px rgba(122, 27, 34, .15);
}

.site-title {
  margin: 28px 0 6px;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: .01em;
}
.site-title a { text-decoration: none; color: inherit; }
.site-title .wax { color: var(--wax); }

.tagline {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--gold);
  margin: 6px 0 28px;
  opacity: .9;
}

.hero-text {
  font-size: 1.35rem;
  max-width: 54ch;
  margin: 0 auto 16px;
  line-height: 1.6;
}

.hero-mystery {
  font-size: 1.18rem;
  font-style: italic;
  opacity: .75;
  margin: 0 auto 34px;
  max-width: 40ch;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------- MAIN ---------- */
.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 18px 60px;
}

/* ---------- CARDS ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .55));
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 32px;
}
.card::before {
  content: "";
  position: absolute; inset: -2px;
  background:
    linear-gradient(135deg, rgba(181, 138, 42, .22), transparent 55%),
    linear-gradient(225deg, rgba(122, 27, 34, .18), transparent 60%);
  pointer-events: none;
  opacity: .9;
}
.inner {
  position: relative;
  padding: 34px 30px 30px;
}

/* ---------- SECTION TITLES ---------- */
.section-kicker {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 600;
  font-size: .85rem;
  opacity: .65;
  margin: 0 0 6px;
}
h2, .entry-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 14px;
  line-height: 1.15;
}
h3 {
  font-size: 1.25rem;
  margin: 0 0 6px;
}

/* ---------- POSTS / ENTRIES ---------- */
.entry-title a {
  text-decoration: none;
  color: var(--ink);
  transition: color .12s;
}
.entry-title a:hover { color: var(--wax); }

.entry-meta {
  font-size: .92rem;
  opacity: .6;
  margin: 0 0 14px;
  font-variant: small-caps;
  letter-spacing: .06em;
}

.entry-content {
  font-size: 1.12rem;
  line-height: 1.65;
}
.entry-content p { margin: 0 0 1.1em; }
.entry-content a { color: var(--wax); }
.entry-content a:hover { text-decoration: none; }
.entry-content blockquote {
  position: relative;
  padding: 20px 22px 20px 24px;
  border-left: 4px solid rgba(122, 27, 34, .55);
  background: rgba(255, 255, 255, .5);
  border-radius: 14px;
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 20px 0;
  font-style: italic;
}

.entry-footer {
  margin-top: 18px;
  font-size: .95rem;
  opacity: .7;
}
.entry-footer a { color: var(--wax); }

.read-more {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  color: var(--wax);
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: .06em;
  transition: opacity .12s;
}
.read-more:hover { opacity: .7; }
.read-more::after { content: " →"; }

/* Post signature */
.post-signature {
  margin: 20px 0 0;
  font-style: italic;
}
.post-signature strong { color: var(--wax); }

/* Pagination */
.pagination {
  text-align: center;
  padding: 20px 0;
}
.pagination .nav-links { justify-content: center; }
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 38px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .12);
  background: rgba(255, 255, 255, .6);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  transition: background .12s;
}
.pagination a:hover { background: var(--gold-light); }
.pagination .current {
  background: var(--wax);
  color: #fff;
  border-color: var(--wax);
}

/* ---------- QUOTE ---------- */
.quote {
  position: relative;
  padding: 20px 22px 20px 24px;
  border-left: 4px solid rgba(122, 27, 34, .55);
  background: rgba(255, 255, 255, .5);
  border-radius: 14px;
  font-size: 1.18rem;
  line-height: 1.6;
  margin: 20px 0;
}
.quote em { font-style: italic; }
.quote.centered {
  text-align: center;
  border-left: none;
  max-width: 52ch;
  margin: 22px auto;
}

/* ---------- RULE ---------- */
.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .22), transparent);
  margin: 28px 0;
}

/* ---------- FLOURISH ---------- */
.flourish {
  font-family: "Great Vibes", cursive;
  font-size: 2.2rem;
  color: rgba(181, 138, 42, .9);
  text-align: center;
  padding: 0;
}

/* ---------- GRID ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.grid-main {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px;
  align-items: start;
  min-width: 0;
}
.grid-main > * {
  min-width: 0;
}
@media (max-width: 760px) {
  .grid-2, .grid-main { grid-template-columns: 1fr; }
}

/* ---------- BOX ---------- */
.box {
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 18px;
  background: rgba(251, 244, 230, .72);
  padding: 22px 20px;
}
.box h3 { color: var(--wax); }

/* ---------- TEASER LIST ---------- */
.teaser-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.teaser-list li {
  position: relative;
  padding: 9px 0 9px 26px;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.teaser-list li:last-child { border-bottom: none; }
.teaser-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: .85rem;
  top: 11px;
}

/* ---------- WAX SEAL ---------- */
.seal {
  position: absolute;
  right: 22px; top: 22px;
  width: 76px; height: 76px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 30px rgba(0, 0, 0, .18);
  border: none;
  pointer-events: none;
}
@media (max-width: 500px) {
  .seal { width: 56px; height: 56px; right: 14px; top: 14px; }
}

/* -- Single post seal: large, centered above title -- */
.single-seal-wrap {
  text-align: center;
  margin-bottom: 18px;
}
.seal.seal-single {
  position: static;
  width: 190px; height: 190px;
  display: inline-block;
  border-radius: 50%;
  box-shadow: 0 22px 40px rgba(0, 0, 0, .22);
}
@media (max-width: 500px) {
  .seal.seal-single { width: 140px; height: 140px; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .16);
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .08s;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: 0 8px 18px rgba(0, 0, 0, .11); }
.btn.primary {
  background: linear-gradient(180deg, rgba(122, 27, 34, .92), rgba(122, 27, 34, .80));
  color: #fff;
  border-color: rgba(122, 27, 34, .65);
}
.btn.primary:hover {
  background: linear-gradient(180deg, rgba(122, 27, 34, .96), rgba(122, 27, 34, .86));
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .14);
  background: rgba(255, 255, 255, .55);
  font-size: .98rem;
}
.pill b { color: var(--wax); }

/* ---------- FORM ---------- */
.form { display: grid; gap: 10px; margin-top: 12px; }
label { font-weight: 700; font-size: 1rem; }
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .16);
  background: rgba(255, 255, 255, .78);
  font-family: inherit;
  font-size: 1.05rem;
}
input:focus,
textarea:focus { outline: 2px solid rgba(181, 138, 42, .35); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.fineprint {
  margin-top: 10px;
  font-size: .95rem;
  opacity: .75;
}

/* ---------- COMMENTS ---------- */
.comments-area {
  margin-top: 32px;
}
.comments-area .card { margin-bottom: 0; }
.comment-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.comment-list li {
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.comment-list li:last-child { border-bottom: none; }
.comment-author {
  font-weight: 700;
  color: var(--wax);
}
.comment-metadata {
  font-size: .85rem;
  opacity: .6;
  margin-bottom: 6px;
}
.comment-respond { margin-top: 22px; }
#respond .comment-reply-title {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.comment-form label { display: block; margin-bottom: 4px; }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .form-submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(122, 27, 34, .65);
  background: linear-gradient(180deg, rgba(122, 27, 34, .92), rgba(122, 27, 34, .80));
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}
.comment-form .form-submit input[type="submit"]:hover {
  transform: translateY(-1px);
}

/* ---------- SIDEBAR / WIDGETS ---------- */
.widget {
  margin-bottom: 24px;
}
.widget-title {
  font-size: 1.15rem;
  color: var(--wax);
  margin-bottom: 8px;
  font-variant: small-caps;
  letter-spacing: .06em;
}
.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.widget li:last-child { border-bottom: none; }
.widget a {
  color: var(--ink);
  text-decoration: none;
  transition: color .12s;
}
.widget a:hover { color: var(--wax); }

/* ---------- FOOTER ---------- */
.site-footer {
  text-align: center;
  padding: 28px 18px 52px;
  opacity: .8;
}
.site-footer p { margin: 0 0 4px; }

/* ---------- UTILITIES ---------- */
ul { margin: 8px 0 0 1.2rem; padding: 0; font-size: 1.06rem; }
li { margin: 5px 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 404 ---------- */
.error-404 {
  text-align: center;
  padding: 60px 0;
}
.error-404 h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--wax);
  margin-bottom: 16px;
}
.error-404 p {
  font-size: 1.2rem;
  max-width: 48ch;
  margin: 0 auto 24px;
}

/* ---------- SEARCH ---------- */
.search-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
}
.search-form .search-field {
  flex: 1;
}
.search-form .search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .16);
  background: rgba(255, 255, 255, .78);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .12s;
}
.search-form .search-submit:hover {
  background: var(--gold-light);
}

/* ---------- SUBSTACK EMBED ---------- */
.substack-embed {
  position: relative;
  width: 100%;
  margin-top: 12px;
  overflow: hidden;
}
.substack-embed iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 320px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .1) !important;
}
.substack-box {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 760px) {
  .substack-embed iframe {
    height: 300px;
  }
}
@media (max-width: 480px) {
  .substack-embed iframe {
    height: 280px;
  }
}

/* ---------- HIDE CATEGORIES ON FRONT PAGE ---------- */
.is-front-page .widget_categories,
.is-front-page .wp-block-categories {
  display: none;
}

/* ---------- INSCRIPTION SECTION MOBILE FIX ---------- */
@media (max-width: 760px) {
  .grid-main {
    gap: 16px;
  }
  .substack-box {
    padding: 18px 14px;
  }
  #inscription .inner {
    padding: 24px 16px 22px;
  }
}

/* ---------- ALIGNMENTS (WP) ---------- */
.alignleft { float: left; margin-right: 1.5em; margin-bottom: 0.5em; }
.alignright { float: right; margin-left: 1.5em; margin-bottom: 0.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .9rem; opacity: .7; text-align: center; margin-top: 6px; }

img { max-width: 100%; height: auto; }
