/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

/* HEADER */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

header h1 {
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
}

header p {
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* NAVIGATION */
nav {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav a {
  color: white;
  margin: 0 15px;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 25px;
  display: inline-block;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: #ffd700;
}

@media (max-width: 600px) {
  nav a {
    display: block;
    margin: 8px 0;
  }
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1rem;
  color: #ddd;
}

/* MAIN CONTAINER */
main.preview-container,
main#content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  padding: 2.5rem;
  max-width: 1200px;
  margin: auto;
}

/* PREVIEW CARD */
.preview-block {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
}

.preview-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.preview-block:hover::before {
  transform: scaleX(1);
}

.preview-block:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.3);
}

/* IMAGE WRAPPER */
.image-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* prevent click interfering */
}

/* TEXT CONTENT */
.preview-block h3 {
  margin: 1.2rem 1.2rem 0.6rem;
  font-size: 1.3rem;
  color: #1a1a1a;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.preview-block:hover h3 {
  color: #667eea;
}

.preview-block p {
  margin: 0 1.2rem 1.2rem;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
}

/* 2-line Clamp */
.preview-text {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}
.pagination-controls {
  text-align: center;
  margin: 3rem auto;
  font-size: 1rem;
}

.pagination-controls button {
  margin: 0 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.pagination-controls button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pagination-controls button:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.pagination-controls span {
  color: white;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}


/* FOOTER */
footer {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #ccc;
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.9rem;
  margin-top: 3rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

footer a {
  color: #ffd700;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
  .image-wrapper {
    height: 140px;
  }

  header h1 {
    font-size: 1.8rem;
  }
}
