/* KOAS Agency - Story Page Styles */

:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --dark-bg: #1a1a1a;
  --darker-bg: #0f0f0f;
  --light-bg: #f8f9fa;
  --text-color: #ffffff;
  --text-muted: #b0b0b0;
  --border-color: #333;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.header {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-content {
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo-container img {
  height: 40px;
  width: auto;
}

.header-nav {
  display: flex;
  gap: 15px;
}

.header-nav a {
  color: var(--text-color);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.upload-link-header {
  background: var(--secondary-color);
  color: white;
}

.back-link {
  background: var(--primary-color);
  color: white;
}

.agency-subtitle {
  text-align: center;
  margin-top: 15px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Main Content */
.main-content {
  margin-top: 120px;
  padding: 60px 0;
}

.page-title-section {
  text-align: center;
  margin-bottom: 60px;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Playfair Display', serif;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 120px; /* Space for year markers on the left */
}

.timeline::before {
  content: '';
  position: absolute;
  left: 100px; /* Position timeline line at 100px from left (after year markers) */
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  z-index: 1;
}

.timeline-year {
  position: relative;
  margin-bottom: 80px;
}

.year-marker {
  position: absolute;
  left: 0; /* Position year markers on the far left */
  top: 0;
  background: var(--dark-bg);
  color: var(--primary-color);
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1.4rem;
  border: 3px solid var(--primary-color);
  z-index: 2;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  transform: rotate(-2deg); /* Slight rotation for visual interest */
}

.year-marker:hover {
  transform: rotate(0deg) scale(1.05);
  transition: all 0.3s ease;
}

.year-content {
  margin-top: 20px;
  margin-left: 50px; /* Offset content from timeline line */
}

.timeline-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 50px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: relative;
  transition: all 0.3s ease;
  width: calc(100% - 120px); /* Use container width minus timeline area */
  max-width: 700px; /* Reasonable max width within container */
  min-width: 350px; /* Ensure minimum readable width */
  margin-left: 30px; /* Align with timeline line */
}

.timeline-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.timeline-item:nth-child(odd) {
  margin-left: 30px;
  margin-right: auto;
}

.timeline-item:nth-child(even) {
  margin-left: auto;
  margin-right: 30px;
}

/* Timeline item connector lines */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px; /* Connect to timeline line */
  top: 30px;
  width: 30px;
  height: 2px;
  background: var(--primary-color);
  z-index: 2;
}

.timeline-date {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 15px;
  font-size: 1.1rem;
  text-align: center;
}

.timeline-card {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.timeline-image {
  flex: 0 0 280px;
  min-width: 250px;
  max-width: 320px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.timeline-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.timeline-image:hover img {
  transform: scale(1.05);
}

.timeline-content {
  flex: 1;
  padding: 10px 0;
}

.timeline-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--secondary-color);
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.timeline-content p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 15px;
  font-size: 1.05rem;
  text-align: justify;
}

.timeline-content p:last-child {
  margin-bottom: 0;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 25px;
}

.photo-grid-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-grid-item:hover img {
  transform: scale(1.1);
}

/* Footer */
.footer {
  margin-top: 80px;
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .timeline-item {
    width: calc(100% - 100px);
    max-width: 650px;
  }

  .timeline-image {
    flex: 0 0 260px;
    min-width: 220px;
    height: 180px;
  }
}

@media (max-width: 1024px) {
  .timeline {
    padding-left: 80px; /* Reduce space for smaller screens */
  }

  .timeline::before {
    left: 60px; /* Adjust timeline line position */
  }

  .timeline-item {
    width: calc(100% - 80px); /* Account for reduced padding */
    max-width: 600px;
    min-width: 300px;
    margin-left: 20px;
    padding: 30px;
  }

  .timeline-item:nth-child(odd) {
    margin-left: 20px;
  }

  .timeline-item:nth-child(even) {
    margin-right: 20px;
  }

  .timeline-item::before {
    left: -20px;
    width: 20px;
  }

  .year-marker {
    padding: 10px 16px;
    font-size: 1.2rem;
    left: -10px;
  }

  .year-content {
    margin-left: 30px;
  }

  .timeline-image {
    flex: 0 0 240px;
    min-width: 200px;
    height: 160px;
  }

  .timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  .timeline-content p {
    font-size: 1rem;
    line-height: 1.7;
  }
}

@media (max-width: 900px) {
  .timeline-item {
    width: calc(100% - 60px);
    max-width: 650px;
    min-width: 280px;
  }

  .timeline-card {
    flex-direction: column;
    gap: 20px;
  }

  .timeline-image {
    flex: none;
    width: 100%;
    max-width: 400px;
    height: 250px;
    align-self: center;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .main-content {
    margin-top: 140px;
    padding: 40px 0;
  }

  .page-title {
    font-size: 2.2rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .timeline {
    padding-left: 0; /* Remove left padding on mobile */
  }

  .timeline::before {
    display: none; /* Hide timeline line on mobile */
  }

  .timeline-year {
    margin-bottom: 60px;
  }

  .year-marker {
    position: static; /* Change to static positioning */
    display: block;
    margin-bottom: 20px;
    text-align: center;
    transform: none;
    width: fit-content;
    margin: 0 auto 20px;
  }

  .year-marker:hover {
    transform: none;
  }

  .year-content {
    margin-left: 0;
  }

  .timeline-item {
    width: calc(100% - 30px); /* Full container width minus padding */
    max-width: none; /* Remove max-width on mobile */
    min-width: auto; /* Remove min-width on mobile */
    margin-left: 0;
    margin-right: 0;
    padding: 25px;
  }

  .timeline-item::before {
    display: none; /* Hide connector lines on mobile */
  }

  .timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 18px;
  }

  .timeline-content p {
    font-size: 1.02rem;
    line-height: 1.75;
    text-align: left; /* Better readability on mobile */
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .header-top {
    flex-direction: column;
    gap: 15px;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .year-marker {
    padding: 8px 14px;
    font-size: 1.1rem;
  }

  .timeline-item {
    padding: 20px;
    margin-bottom: 35px;
  }

  .timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .timeline-content p {
    font-size: 1rem;
    line-height: 1.7;
  }

  .timeline-image {
    height: 200px;
  }

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

/* Responsive Design */
@media (max-width: 1024px) {
  .story-timeline {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .timeline-line {
    display: none;
  }

  .timeline-item.left,
  .timeline-item.right {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .story-title {
    font-size: 2.2rem;
  }

  .story-subtitle {
    font-size: 1rem;
  }

  .story-container {
    margin-top: 140px;
    padding: 40px 0;
  }

  .timeline-item {
    padding: 20px;
  }

  .timeline-title {
    font-size: 1.2rem;
  }

  .story-section {
    padding: 25px;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .timeline-images {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timeline-image {
    height: 120px;
  }
}

@media (max-width: 480px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
  }

  .story-title {
    font-size: 1.8rem;
  }

  .timeline-item {
    padding: 15px;
  }

  .story-section {
    padding: 20px;
  }
}