/* ============================================
   Sylvinfo — Les Applications Pur Beurre Salé
   ============================================ */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-text: #1a1a2e;
  --color-text-light: #4a4a6a;
  --color-primary: #1b2a4a;
  --color-accent: #2d5f8a;
  --color-border: #e0e4ea;
  --color-card-bg: #ffffff;
  --color-card-shadow: rgba(27, 42, 74, 0.08);
  --color-badge-ios: #007aff;
  --color-badge-macos: #34c759;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f1523;
    --color-bg-alt: #161d2f;
    --color-text: #e8eaf0;
    --color-text-light: #a0a8c0;
    --color-primary: #4d8cc7;
    --color-accent: #6ba3d6;
    --color-border: #2a3450;
    --color-card-bg: #1a2235;
    --color-card-shadow: rgba(0, 0, 0, 0.3);
  }
}

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

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

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ---- Header ---- */
.site-header {
  background: var(--color-primary);
  color: #ffffff;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.site-tagline {
  font-size: 0.8rem;
  opacity: 0.75;
  font-weight: 400;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
}

.header-nav a:hover {
  color: #ffffff;
  text-decoration: none;
}

.lang-switch {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

/* ---- Main ---- */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* ---- Hero (page de garde) ---- */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ---- App Grid ---- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.app-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--color-text);
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--color-card-shadow);
  text-decoration: none;
}

.app-card-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin-bottom: 1rem;
  background: var(--color-bg-alt);
  object-fit: cover;
}

.app-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.app-card .tagline {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.platform-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-ios {
  background: rgba(0, 122, 255, 0.12);
  color: var(--color-badge-ios);
}

.badge-macos {
  background: rgba(52, 199, 89, 0.12);
  color: var(--color-badge-macos);
}

/* ---- App Detail Page ---- */
.app-detail {
  max-width: 760px;
  margin: 0 auto;
}

.app-detail-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.app-detail-icon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  background: var(--color-bg-alt);
  object-fit: cover;
  flex-shrink: 0;
}

.app-detail-info h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.app-detail-info .tagline {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.app-detail-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--color-primary);
}

.app-detail-body p,
.app-detail-body li {
  color: var(--color-text-light);
  line-height: 1.7;
}

.app-detail-body ul {
  list-style: none;
  padding: 0;
}

.app-detail-body ul li {
  padding: 0.3rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.app-detail-body ul li::before {
  content: "\2022";
  color: var(--color-accent);
  font-weight: 700;
  position: absolute;
  left: 0;
}

.app-store-badge {
  display: inline-block;
  margin-top: 1.5rem;
}

.app-store-badge img {
  height: 44px;
}

.app-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.app-links a {
  font-size: 0.9rem;
}

/* ---- Screenshots placeholder ---- */
.screenshot-count {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--color-text-light);
}

.screenshots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  -webkit-overflow-scrolling: touch;
}

.screenshot-img {
  min-width: 180px;
  max-height: 400px;
  border-radius: var(--radius);
  object-fit: contain;
  flex-shrink: 0;
}

.screenshot-placeholder {
  min-width: 180px;
  height: 320px;
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ---- Legal Pages (Privacy, Terms, Support) ---- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.legal-page .last-updated {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: var(--color-primary);
}

.legal-page p,
.legal-page li {
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.legal-page ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

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

/* ---- Support Page ---- */
.support-contact {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

.support-contact .email {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-text-light);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--color-accent);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-detail-header {
    flex-direction: column;
    text-align: center;
  }

  .app-detail-icon {
    width: 96px;
    height: 96px;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-tagline {
    display: none;
  }
}

@media (max-width: 400px) {
  main {
    padding: 1.5rem 1rem;
  }
}
