/* ============================================
   Porsche 911 – Annonce de vente
   Modern, clean static site
   ============================================ */

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

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #6b6b6b;
  --color-accent: #c0002b;
  --color-border: #e8e8e8;
  --color-dark: #111111;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --transition: .25s ease;
  --font: "Helvetica Neue", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 600;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section h2 {
  font-size: 1.75rem;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin-top: -28px;
  margin-bottom: 40px;
}

/* --- Hero --- */
.hero {
  position: relative;
  height: 85vh;
  min-height: 500px;
  max-height: 900px;
  overflow: hidden;
  background: var(--color-dark);
}

.hero-image {
  position: absolute;
  inset: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .85;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 50%, rgba(0,0,0,.2) 100%);
  display: flex;
  align-items: flex-end;
}

.hero-content {
  padding: 48px 32px 56px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  color: #fff;
}

.hero-tag {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  opacity: .8;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-price {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  color: var(--color-accent);
}

/* --- Specs Bar --- */
.specs {
  background: var(--color-dark);
  color: #fff;
  padding: 40px 0;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  text-align: center;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.spec-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .6;
}

/* --- Description --- */
.description {
  background: var(--color-surface);
}

.description-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.description-main .lead {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.description-main p {
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.info-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.info-card h3 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.info-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
}

.info-card dt {
  font-weight: 600;
  font-size: .9rem;
}

.info-card dd {
  font-size: .9rem;
  color: var(--color-text-secondary);
  text-align: right;
}

/* --- Gallery --- */
.gallery-section {
  background: var(--color-bg);
}

.gallery-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.gallery-tab {
  padding: 8px 20px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: var(--color-surface);
  font-size: .88rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text-secondary);
}

.gallery-tab:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.gallery-tab.active {
  background: var(--color-dark);
  color: #fff;
  border-color: var(--color-dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, opacity .35s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
  opacity: .9;
}

.gallery-item.hidden {
  display: none;
}

/* --- Videos --- */
.videos-section {
  background: var(--color-surface);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.video-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.video-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-card h3 {
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 500;
}

/* --- Equipment --- */
.equipment-section {
  background: var(--color-bg);
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.equipment-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.equipment-card h3 {
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 20px;
  color: var(--color-text);
}

.equipment-card ul {
  list-style: none;
}

.equipment-card li {
  padding: 7px 0;
  font-size: .9rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}

.equipment-card li:last-child {
  border-bottom: none;
}

/* --- Maintenance Timeline --- */
.maintenance-section {
  background: var(--color-surface);
}

.timeline {
  position: relative;
  padding-left: 32px;
  margin-bottom: 48px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding: 14px 0;
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-accent);
  transform: translateX(-1px);
}

.timeline-km {
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  min-width: 100px;
}

.timeline-desc {
  color: var(--color-text-secondary);
  font-size: .95rem;
}

.original-parts {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: inline-block;
}

.original-parts h3 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.original-parts ul {
  list-style: none;
}

.original-parts li {
  padding: 4px 0;
  font-size: .9rem;
  color: var(--color-text-secondary);
}

.original-parts li::before {
  content: "–";
  margin-right: 8px;
  color: var(--color-accent);
}

/* --- Price Section --- */
.price-section {
  background: var(--color-dark);
  padding: 60px 0;
}

.price-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.price-details h2 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.price-details p {
  color: rgba(255,255,255,.6);
  font-size: .95rem;
}

.price-amount {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transform: scale(.97);
  transition: opacity .3s ease, transform .3s ease;
}

.lightbox.active .lightbox-content img {
  opacity: 1;
  transform: scale(1);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition);
  z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: .7;
}

.lightbox-close {
  top: 24px;
  right: 28px;
  font-size: 2.5rem;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
  line-height: 1;
  padding: 16px;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  letter-spacing: .1em;
}

/* --- Footer --- */
footer {
  padding: 32px 0;
  text-align: center;
  font-size: .8rem;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

/* --- Responsive --- */
@media (max-width: 960px) {
  .specs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 16px;
  }

  .description-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section {
    padding: 56px 0;
  }
}

@media (max-width: 640px) {
  .hero {
    height: 65vh;
    min-height: 400px;
  }

  .hero-content {
    padding: 32px 20px 40px;
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .gallery-tabs {
    gap: 6px;
  }

  .gallery-tab {
    padding: 6px 14px;
    font-size: .82rem;
  }

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

  .price-card {
    flex-direction: column;
    text-align: center;
  }

  .section h2 {
    font-size: 1.4rem;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2.5rem;
    padding: 8px;
  }

  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}
