/*
 * Style definitions for the PATUNIQ modular storytelling website.
 * The palette uses calming purples and clean whites to ensure
 * accessibility for neurodivergent audiences. Layouts are mobile‑first
 * and responsive, with clear navigation and generous touch targets.
 */

/* Root variables define the core colour scheme and spacing values. */
:root {
  --primary: #6c63ff;
  --secondary: #a583ff;
  --accent: #ff8c42;
  --background: #f5f5ff;
  --background-alt: #ffffff;
  --text-primary: #1f1f2e;
  --text-secondary: #44445e;
  --card-bg: #ffffff;
  --card-shadow: rgba(0, 0, 0, 0.08);
  --tag-bg: #f0f0ff;
  --tag-text: #4c43c9;
}

/* Global resets to provide a consistent baseline across browsers */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

/* A simple container that centres content and limits width */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Header and navigation styling */
header {
  background-color: var(--background-alt);
  box-shadow: 0 1px 4px var(--card-shadow);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  padding-bottom: 0.3rem;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

/* The 'active' class is applied manually in the HTML for the current page */
.nav-links a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* Language switch and contact button in the header */
.lang-switch {
  margin-right: 1rem;
}

.lang-switch a {
  color: var(--text-primary);
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid #ddd;
  padding: 0.4rem 0.7rem;
  border-radius: 0.3rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.lang-switch a:hover {
  background-color: var(--primary);
  color: #fff;
}

.contact-btn {
  display: inline-block;
  background-color: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.contact-btn:hover {
  background-color: #564de4;
}

/* Hamburger icon only visible on narrow screens */
.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* Navigation layout for small screens */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--background-alt);
    padding: 1rem;
    gap: 1rem;
    display: none;
    box-shadow: 0 2px 6px var(--card-shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .hamburger {
    display: block;
  }
  /* Hide language switch on very small screens for simplicity */
  .lang-switch {
    display: none;
  }
}

/* Hero section styling */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  padding: 3rem 0;
}

.hero-text {
  flex: 1 1 50%;
}

.hero-image {
  flex: 1 1 40%;
  min-height: 300px;
  background-size: cover;
  background-position: center;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px var(--card-shadow);
}

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

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.hero .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  padding: 0.75rem 1.4rem;
  border-radius: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.btn-primary:hover {
  background-color: #564de4;
}

.btn-secondary {
  background-color: var(--background-alt);
  color: var(--primary);
  padding: 0.75rem 1.4rem;
  border: 2px solid var(--primary);
  border-radius: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease, color 0.3s ease;
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: #fff;
}

/* Section component: default spacing */
.section {
  padding: 3rem 0;
}

.section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section p.subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Card grid for characters and other items */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.card {
  background-color: var(--card-bg);
  border-radius: 0.6rem;
  box-shadow: 0 2px 6px var(--card-shadow);
  overflow: hidden;
  flex: 1 1 280px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
}

.card-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 1rem 1.2rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-label {
  align-self: flex-end;
  background-color: var(--secondary);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card p.description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex-grow: 1;
  margin-bottom: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background-color: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.card a.details-link {
  align-self: flex-start;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.3s ease;
}

.card a.details-link:hover {
  color: #564de4;
}

.card a.details-link i {
  font-size: 0.8rem;
}

/* CTA link below sections */
.section .cta-link {
  margin-top: 1.5rem;
  display: block;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  text-align: center;
}

.section .cta-link:hover {
  text-decoration: underline;
}

/* News list */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-item {
  background-color: var(--card-bg);
  border-radius: 0.6rem;
  box-shadow: 0 2px 6px var(--card-shadow);
  padding: 1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.news-item .news-text {
  flex: 1 1 auto;
}

.news-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.news-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.news-item .news-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 1rem;
  white-space: nowrap;
}

/* Contact form */
.contact-section form {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-section input,
.contact-section textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 0.4rem;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s ease;
}

.contact-section input:focus,
.contact-section textarea:focus {
  border-color: var(--primary);
}

.contact-section button {
  align-self: flex-start;
  padding: 0.75rem 1.4rem;
  background-color: var(--primary);
  border: none;
  border-radius: 0.4rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.contact-section button:hover {
  background-color: #564de4;
}

/* Footer */
footer {
  background-color: var(--background-alt);
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid #e1e1e8;
}

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

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

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

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

@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
  }
  .hero-text,
  .hero-image {
    flex: 1 1 100%;
  }
  .hero-image {
    height: 300px;
  }
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}