/* =========================================================
   The Writer Zone — style.css
   Mobile-first, conserve l'identité : blanc arrondi, bleu #4040FF
   ========================================================= */

:root {
  --color-bg: #e8eaf2;
  --color-surface: #ffffff;
  --color-text: #101090;
  --color-muted: #666;
  --color-accent: #4040FF;
  --color-accent-dark: #2a2ad6;
  --color-accent-hover: #5b5bff;
  --color-border: #d0d4e0;
  --color-footer-bg: #e4e4e4;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(16, 16, 144, 0.08);
  --shadow-hover: 0 4px 16px rgba(16, 16, 144, 0.15);
  --maxw: 900px;
  --font-sans: Verdana, Geneva, "DejaVu Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* masqué jusqu'au chargement i18n pour éviter le flash */
body.i18n-loading {
  visibility: hidden;
}

/* ===== Layout container ===== */

.site-shell {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 640px) {
  .site-shell {
    margin: 1.5rem auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
}

@media (max-width: 639px) {
  body { background: var(--color-surface); }
}

/* ===== Header ===== */

.site-header {
  padding: 0.75rem 1rem;
  background: var(--color-surface);
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__logo img {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.lang-switcher button {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text);
  transition: all 0.15s ease;
}

.lang-switcher button:hover,
.lang-switcher button:focus-visible {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  outline: none;
}

.lang-switcher button.is-active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  font-weight: 600;
}

/* Bannière langue */
.site-header__banner img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
}

/* ===== Navigation ===== */

.site-nav {
  background: var(--color-accent);
  position: relative;
}

.site-nav__toggle {
  display: block;
  width: 100%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.site-nav__toggle::before {
  content: "☰ ";
  margin-right: 0.5rem;
}

.site-nav__toggle[aria-expanded="true"]::before {
  content: "✕ ";
}

.site-nav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

.site-nav__menu.is-open {
  display: block;
}

.site-nav__menu li { position: relative; }

.site-nav__menu a,
.site-nav__menu .menu-label {
  display: block;
  padding: 0.85rem 1.2rem;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-nav__menu a:hover,
.site-nav__menu a:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.site-nav__menu .submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-accent-dark);
}

.site-nav__menu .submenu a {
  padding-left: 2.5rem;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .site-nav__toggle { display: none; }

  .site-nav__menu {
    display: flex !important;
    flex-wrap: wrap;
  }

  .site-nav__menu > li { position: relative; }

  .site-nav__menu a,
  .site-nav__menu .menu-label {
    border-top: none;
    padding: 0.75rem 1.5rem;
  }

  .site-nav__menu .menu-label { cursor: default; }

  .site-nav__menu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    display: none;
    box-shadow: var(--shadow);
    z-index: 10;
  }

  .site-nav__menu > li:hover > .submenu,
  .site-nav__menu > li:focus-within > .submenu {
    display: block;
  }

  .site-nav__menu .submenu a { padding-left: 1.2rem; }
}

/* ===== Main content ===== */

.site-main {
  padding: 1.25rem 1rem 2rem;
}

@media (min-width: 640px) {
  .site-main { padding: 1.5rem 2rem 2.5rem; }
}

.page-title {
  font-size: 1.6rem;
  font-weight: normal;
  margin: 0 0 1.25rem;
  color: var(--color-text);
}

@media (min-width: 768px) {
  .page-title { font-size: 2rem; }
}

.intro {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ===== Product grid (home page) ===== */

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}

@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.product-card img {
  max-width: 160px;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

.product-card__title {
  font-size: 1rem;
  font-weight: bold;
}

.product-card__tagline {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ===== Product detail page ===== */

.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .product-detail {
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    align-items: start;
  }
}

.product-detail__img img {
  max-width: 180px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.product-detail__text p {
  margin: 0 0 1rem;
}

.features-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 1.5rem 0 0.75rem;
  letter-spacing: 0.02em;
}

.features-list {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

.features-list li {
  margin-bottom: 0.4rem;
}

.promo {
  color: #c43030;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-left: 3px solid #c43030;
  background: #fdf4f4;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

/* Masque le cadre quand la promo est vide (ex: pas de promo dans la langue courante) */
.promo:empty {
  display: none;
}

/* ===== Store badges ===== */

.store-badges {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  margin: 2rem 0;
  padding: 1.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fafbff;
}

.store-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.store-badge__label {
  font-weight: bold;
  font-size: 1rem;
}

.store-badge a {
  display: inline-block;
  border-radius: 13px;
  overflow: hidden;
}

.store-badge img {
  display: block;
  max-width: 250px;
  width: 100%;
  height: auto;
  border-radius: 13px;
}

.store-badge--windows img {
  max-width: 284px;
  border-radius: 0;
}

@media (min-width: 600px) {
  .store-badges {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ===== Screenshots grid ===== */

.screenshots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}

@media (min-width: 600px) {
  .screenshots { grid-template-columns: repeat(4, 1fr); }
}

.screenshots a {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.15s ease;
}

.screenshots a:hover,
.screenshots a:focus-visible {
  transform: scale(1.03);
  outline: 2px solid var(--color-accent);
}

.screenshots img {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== Buttons ===== */

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn:hover,
.btn:focus-visible {
  background: var(--color-accent-hover);
  outline: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--block { display: block; text-align: center; width: 100%; }

/* ===== Downloads list ===== */

.download-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0 2rem;
}

.download-list h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--color-text);
}

.download-list a {
  display: block;
  padding: 0.85rem 1rem;
  background: #fafbff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s ease;
}

.download-list a:hover,
.download-list a:focus-visible {
  background: var(--color-accent);
  color: #fff;
  outline: none;
}

.download-list a::before {
  content: "⬇ ";
  margin-right: 0.5rem;
}

/* ===== Links list (help) ===== */

.link-list {
  margin: 1rem 0 2rem;
  padding-left: 1.2rem;
}

.link-list li {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.link-list a {
  color: var(--color-accent);
}

/* ===== Footer ===== */

.site-footer {
  margin-top: auto;
  background: var(--color-footer-bg);
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.site-footer a {
  color: var(--color-text);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.site-footer__links {
  margin-bottom: 0.5rem;
}

.site-footer__copy {
  margin-top: 0.5rem;
}

/* ===== Legal / long text pages ===== */

.prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.7;
}

.prose h1, .prose h2, .prose h3 {
  color: var(--color-text);
  margin-top: 1.5rem;
}

.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.1rem; }

.prose p { margin: 0 0 1rem; }

.prose a { color: var(--color-accent); }

/* ===== Utility ===== */

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* ===== Lightbox ===== */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  cursor: zoom-out;
  animation: lightbox-fade 0.15s ease-out;
}

.lightbox.is-open { display: flex; }

@keyframes lightbox-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: #fff;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* indique que les miniatures sont cliquables */
.screenshots a { cursor: zoom-in; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  z-index: 9999;
  border-radius: var(--radius-sm);
}
