/* ============================================================
   Klimatmarsch Göteborg 2026 - Redesign
   Clean, professional Scandinavian NGO aesthetic
   ============================================================ */

/* ============================================================
   CSS Variables - Color Palette & Design Tokens
   ============================================================ */

:root {
  /* Primary colors derived from climate stripes */
  --color-primary-dark: #0A3D62;
  --color-primary-accent: #2BAF8A;
  --color-background-light: #F5F7FA;
  --color-text-primary: #111111;
  --color-text-secondary: #444444;
  --color-white: #ffffff;
  --color-overlay: rgba(10, 61, 98, 0.85);

  /* Spacing scale - fluid with clamp */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: clamp(1rem, 4vw, 2rem);
  --space-lg: clamp(2rem, 6vw, 3rem);
  --space-xl: clamp(3rem, 8vw, 4rem);

  /* Responsive padding */
  --pad-inline: clamp(16px, 4vw, 28px);
  --pad-block: clamp(16px, 3vw, 24px);

  /* Layout */
  --max-content-width: 900px;
  --border-radius: 8px;
  --border-radius-sm: 4px;

  /* Typography - fluid scaling */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-h1: clamp(2rem, 7vw, 3.5rem);
  --font-size-h2: clamp(1.75rem, 5vw, 2.5rem);
  --font-size-subtitle: clamp(1.125rem, 3.5vw, 1.5rem);
  --font-size-date: clamp(1rem, 2.5vw, 1.125rem);
  --font-size-body: clamp(16px, 2vw, 18px);
  --font-size-button: clamp(1rem, 2.5vw, 1.125rem);
}

/* ============================================================
   Reset & Base Styles
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--color-text-secondary);
  background-color: var(--color-white);
}

/* ============================================================
   Skip Link (Accessibility)
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: 2000;
  font-weight: 600;
  border-radius: 0 0 var(--border-radius-sm) 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-primary-accent);
  outline-offset: 2px;
}

/* ============================================================
   Hero Header with Climate Stripes - MOBILE FIRST
   ============================================================ */

.hero-header {
  position: relative;
  width: 100%;
  /* Mobile: constrained height to keep CTAs visible */
  min-height: clamp(520px, 85vh, 600px);
  max-height: 100vh;
  background-image: url('/img/sweden_stripes.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  /* iOS safe-area support */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Stronger gradient for better text contrast */
  background: linear-gradient(
    to bottom,
    rgba(10, 61, 98, 0.50) 0%,
    rgba(10, 61, 98, 0.65) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad-block) var(--pad-inline);
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: var(--color-white);
  /* Content card for improved readability */
  max-width: min(36rem, 100%);
  padding: var(--pad-block) var(--pad-inline);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: clamp(12px, 4vw, 24px);
  /* Additional safe-area padding inside content */
  padding-top: calc(var(--pad-block) + env(safe-area-inset-top, 0px));
}

.hero-title {
  font-size: var(--font-size-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  /* Prevent text clipping */
  padding-top: 0.1em;
}

.hero-subtitle {
  font-size: var(--font-size-subtitle);
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-date {
  font-size: var(--font-size-date);
  font-weight: 500;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  opacity: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Hero Action Buttons - Mobile First */
.hero-actions {
  display: grid;
  gap: clamp(12px, 2vw, 16px);
  /* Mobile: stack vertically, Desktop: horizontal */
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 540px) {
  .hero-actions {
    grid-template-columns: 1fr 1fr;
    max-width: 28rem;
    margin: 0 auto;
  }
}

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

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: clamp(0.875rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
  min-height: 48px;
  font-size: var(--font-size-button);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  border-radius: var(--border-radius-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  /* Flex to center text vertically */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-primary {
  background-color: var(--color-primary-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #239b78;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 175, 138, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn-secondary:hover {
  background-color: var(--color-white);
  color: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-primary:focus,
.btn-secondary:focus {
  outline: 3px solid var(--color-primary-accent);
  outline-offset: 3px;
}

/* ============================================================
   Layout Container
   ============================================================ */

.container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Org-mode generated content wrapper */
.content {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ============================================================
   Sections
   ============================================================ */

.section {
  padding: var(--space-lg) 0;
}

.section:first-of-type {
  padding-top: var(--space-xl);
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4 {
  color: var(--color-text-primary);
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-h2);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
  padding-top: 1em;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

h4 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: 1.5em;
  max-width: 70ch;
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
}

strong {
  font-weight: 700;
  color: var(--color-text-primary);
}

/* ============================================================
   Notice Box
   ============================================================ */

.notice-box {
  background-color: var(--color-background-light);
  border-left: 5px solid var(--color-primary-accent);
  border-radius: var(--border-radius-sm);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
  display: flex;
  gap: clamp(0.75rem, 2vw, 1rem);
  align-items: flex-start;
  flex-wrap: nowrap;
}

.notice-box::before {
  display: none;
}

.notice-box p:first-of-type {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.notice-box p:not(:first-of-type) {
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 0;
}

/* When using the actual notice structure with icon/content divs */
.notice-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  flex-grow: 0;
  width: 1.5rem;
  margin-top: 0.05em;
  line-height: 1;
}

.notice-content {
  flex: 1;
  min-width: 0;
}

.notice-content h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--color-primary-dark);
  margin-top: 0;
  font-weight: 700;
}

.notice-content p {
  font-size: 1rem;
  margin-bottom: 0;
}

.notice-content p:first-child {
  margin-top: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.3;
}

.notice-content p:not(:first-child) {
  font-style: italic;
  margin-top: var(--space-xs);
}

/* ============================================================
   Schedule Grid
   ============================================================ */

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
  list-style: none;
  padding-left: 0;
}

/* Style schedule section list items as cards */
/* Target schedule section by ID - works with org-mode CUSTOM_ID */
#schedule ~ .outline-text-2 .marsch-list,
#text-schedule .marsch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

#schedule ~ .outline-text-2 .marsch-list .marsch-item,
#text-schedule .marsch-list .marsch-item {
  background-color: var(--color-background-light);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  padding-left: calc(var(--space-md) + 2.5rem);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.6;
}

#schedule ~ .outline-text-2 .marsch-list .marsch-item:hover,
#text-schedule .marsch-list .marsch-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Add icons via ::before for different schedule items */
#schedule ~ .outline-text-2 .marsch-list .marsch-item:nth-child(1)::before,
#text-schedule .marsch-list .marsch-item:nth-child(1)::before {
  content: "";
  position: absolute;
  left: var(--space-md);
  top: var(--space-md);
  width: 24px;
  height: 24px;
  background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232BAF8A" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
}

#schedule ~ .outline-text-2 .marsch-list .marsch-item:nth-child(2)::before,
#text-schedule .marsch-list .marsch-item:nth-child(2)::before {
  content: "";
  position: absolute;
  left: var(--space-md);
  top: var(--space-md);
  width: 24px;
  height: 24px;
  background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232BAF8A" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
}

#schedule ~ .outline-text-2 .marsch-list .marsch-item:nth-child(3)::before,
#text-schedule .marsch-list .marsch-item:nth-child(3)::before {
  content: "";
  position: absolute;
  left: var(--space-md);
  top: var(--space-md);
  width: 24px;
  height: 24px;
  background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232BAF8A" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
}

#schedule ~ .outline-text-2 .marsch-list .marsch-item:nth-child(4)::before,
#text-schedule .marsch-list .marsch-item:nth-child(4)::before {
  content: "";
  position: absolute;
  left: var(--space-md);
  top: var(--space-md);
  width: 24px;
  height: 24px;
  background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232BAF8A" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
}

.schedule-item {
  background-color: var(--color-background-light);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.schedule-item-wide {
  grid-column: 1 / -1;
}

.schedule-icon {
  color: var(--color-primary-accent);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.schedule-details h3 {
  font-size: 1.125rem;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-xs);
}

.schedule-details p {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Route styling */
.route {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: var(--space-xs);
}

.route-step {
  font-weight: 600;
  color: var(--color-text-primary);
}

.route-arrow {
  color: var(--color-primary-accent);
  font-weight: 700;
}

/* ============================================================
   Contact Section
   ============================================================ */

.contact-links {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.contact-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  transition: all 0.3s ease;
}

.contact-link:hover {
  background-color: var(--color-primary-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 175, 138, 0.3);
}

.contact-link:focus {
  outline: 3px solid var(--color-primary-accent);
  outline-offset: 3px;
}

/* Action buttons list styling */
.action-buttons {
  list-style: none;
  padding: 0;
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.action-buttons li {
  margin: 0;
}

.action-buttons a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  transition: all 0.3s ease;
}

.action-buttons a:hover {
  background-color: var(--color-primary-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 175, 138, 0.3);
  color: var(--color-white);
}

.action-buttons a:focus {
  outline: 3px solid var(--color-primary-accent);
  outline-offset: 3px;
}

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

.footer-stripe {
  width: 100%;
  height: 8px;
  background-image: url('/img/sweden_stripes.png');
  background-size: cover;
  background-position: center;
  margin-top: var(--space-xl);
}

.site-footer {
  background-color: var(--color-primary-dark);
  color: var(--color-white);
  padding: var(--space-lg) 0 var(--space-md);
}

.site-footer .container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.footer-content {
  text-align: center;
}

.footer-org {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.footer-attribution {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: var(--space-sm);
}

.footer-attribution a {
  color: var(--color-white);
  text-decoration: underline;
  opacity: 0.9;
}

.footer-attribution a:hover {
  opacity: 1;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.footer-separator {
  opacity: 0.5;
}

.footer-nav a {
  color: var(--color-white);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.footer-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-nav a:focus {
  outline: 2px solid var(--color-primary-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.attribution {
  font-size: 0.875rem;
  opacity: 0.8;
}

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

.attribution a:hover {
  text-decoration: underline;
}

/* ============================================================
   Links
   ============================================================ */

a {
  color: var(--color-primary-accent);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus {
  outline: 3px solid var(--color-primary-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Responsive Design - Progressive Enhancement
   ============================================================ */

/* Most responsive behavior handled by fluid typography and clamp() */
/* Only breakpoint-specific layout changes needed here */

/* Tablet and up - desktop hero sizing */
@media (min-width: 768px) {
  .hero-header {
    min-height: clamp(500px, 70vh, 650px);
  }

  .hero-content {
    /* Slightly larger padding on desktop */
    padding: clamp(2rem, 4vw, 3rem);
  }
}

/* Desktop - larger screens */
@media (min-width: 1024px) {
  .hero-header {
    min-height: 600px;
  }
}

/* Tablet and below - layout adjustments */
@media (max-width: 768px) {
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .schedule-item-wide {
    grid-column: 1;
  }

  .route {
    flex-direction: column;
    align-items: flex-start;
  }

  .route-arrow {
    transform: rotate(90deg);
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .notice-box {
    flex-direction: column;
    padding: var(--space-sm);
  }

  .schedule-item {
    padding: var(--space-sm);
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Print Styles
   ============================================================ */

@media print {
  .hero-overlay {
    background: rgba(10, 61, 98, 0.6);
  }

  .btn-primary,
  .btn-secondary,
  .contact-links,
  .footer-nav {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  h2 {
    page-break-after: avoid;
  }
}

/* ============================================================
   Accessibility - Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   High Contrast Mode
   ============================================================ */

@media (prefers-contrast: high) {
  .hero-overlay {
    background: rgba(0, 0, 0, 0.9);
  }

  .notice-box {
    border: 2px solid var(--color-text-primary);
  }

  a {
    text-decoration: underline;
  }
}
