/*
 * Stylesheet for article-journaliste.fr
 * A clean news portal design with a focus on readability and responsive layout.
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --primary-color: #0a1f44;        /* dark blue for headers and footer */
  --secondary-color: #e63946;      /* red accent for highlights */
  --accent-color: #457b9d;         /* blue accent */
  --background-color: #f8f9fa;     /* light background */
  --text-color: #1d3557;           /* primary text colour */
  --light-gray: #f1f1f1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Top bar for live ticker */
.top-bar {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.25rem 1rem;
  font-size: 0.9rem;
  overflow: hidden;
}
.ticker {
  white-space: nowrap;
  animation: ticker 30s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
header .logo {
  display: flex;
  align-items: center;
}
header .logo img {
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
}
header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}
nav a:hover, nav a.active {
  color: var(--secondary-color);
}

/* Hero section */
.hero {
  position: relative;
  height: 60vh;
  background: url('../images/salle-redaction-moderne.png') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
}
.hero .hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 800px;
}
.hero .hero-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.hero .hero-content p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.hero .hero-content a {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s;
}
.hero .hero-content a:hover {
  background-color: var(--accent-color);
}

/* Sections and containers */
.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding: 2rem 0;
}
.section {
  margin-bottom: 3rem;
}
.section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-left: 4px solid var(--secondary-color);
  padding-left: 0.5rem;
}
.section p {
  margin-bottom: 1rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
}
.card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.card .card-content {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.card .card-content h4 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-family: 'Playfair Display', serif;
}
.card .card-content p {
  flex-grow: 1;
  margin-bottom: 1rem;
}
.card .card-content a {
  align-self: flex-start;
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.3s;
}
.card .card-content a:hover {
  background-color: var(--accent-color);
}

/* Extra images row at bottom of pages */
.extra-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.extra-images img {
  width: calc(20% - 0.8rem);
  min-width: 150px;
  border-radius: 6px;
  object-fit: cover;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: #fff;
  padding: 2rem 0;
}
footer .footer-content {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}
footer h4 {
  margin-bottom: 0.5rem;
  font-family: 'Playfair Display', serif;
}
footer ul {
  list-style: none;
  padding: 0;
}
footer ul li {
  margin-bottom: 0.4rem;
}
footer ul li a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}
footer ul li a:hover {
  color: var(--secondary-color);
}
.footer-bottom {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 1rem;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  border-top: 1px solid #ddd;
  padding: 1rem;
  display: none;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}
.cookie-banner p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
}
.cookie-banner .cookie-buttons {
  display: flex;
  gap: 1rem;
}
.cookie-banner button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}
.cookie-banner .accept {
  background-color: var(--secondary-color);
  color: #fff;
}
.cookie-banner .decline {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

/* Forms */
form input, form textarea {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
form button {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}
form button:hover {
  background-color: var(--accent-color);
}

/* Admin styles */
.admin {
  padding: 2rem;
}
.admin textarea {
  width: 100%;
  height: 400px;
  margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero {
    height: 40vh;
  }
  .hero .hero-content h2 {
    font-size: 2rem;
  }
  .card img {
    height: 180px;
  }
  .extra-images img {
    width: calc(33.333% - 0.66rem);
  }
}