/* ============================================
        COLOR VARIABLES | COLOR VARIABLES
   ============================================ */
:root {
  --color-bg: #121212;
  --color-surface: #1b1b1d;
  --color-surface-hover: #232325;
  --color-border: #2e2e31;

  --color-turquoise: #14e0b4;
  --color-purple: #8a0aa0;
  --color-pink: #ff3e7f;
  --color-yellow: #ffd100;

  --color-text: #f2f2f2;
  --color-text-muted: #9a9a9e;

  --font-display: "Montserrat", sans-serif;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
}

/* ============================================
    HEADER | HEADER | HEADER | HEADER | HEADER
   ============================================ */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 3rem;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.footer-list,
.nav-list {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-button {
  display: inline-block;
  color: var(--color-surface);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  background-color: var(--color-turquoise);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: transform 0.2s ease;
}

.nav-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--color-pink);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.nav-button:hover::before {
  transform: translateX(0);
}

.nav-button:hover {
  color: var(--color-text);
  transform: translateY(-1px);
}

/* ============================================
    FOOTER | FOOTER | FOOTER | FOOTER | FOOTER
   ============================================ */
footer {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding: 2rem 0 1.5rem 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ============================================
   BLOG GRID | BLOG GRID | BLOG GRID | BLOG GRID
   ============================================ */
.blog-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 220px;
  grid-auto-flow: dense;
  gap: 1.75rem;
  padding: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* 9-elemes ismétlődő minta */
.single-post-container:nth-child(9n + 1) {
  grid-column: span 2;
  grid-row: span 2;
}

.single-post-container:nth-child(9n + 4) {
  grid-column: span 2;
  grid-row: span 2;
}

.single-post-container:nth-child(9n + 5) {
  grid-column: span 1;
  grid-row: span 2;
}

.single-post-container:nth-child(9n + 6) {
  grid-row: span 2;
}

.single-post-container:nth-child(9n + 8) {
  grid-column: span 1;
}

.single-post-container:nth-child(9n + 9) {
  grid-column: span 4;
  grid-row: span 2;
}

.single-post-container {
  position: relative;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s ease;
  min-height: 0;
}

.single-post-container:hover {
  transform: translateY(-3px);
}

/* Rotating border */
.single-post-container::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    120deg,
    var(--color-turquoise),
    var(--color-pink),
    var(--color-purple),
    var(--color-turquoise)
  );
  background-size: 300% 300%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  animation: shift-border 3.5s ease infinite;
}

@keyframes shift-border {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.blog-item {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-item:hover {
  color: var(--color-turquoise);
}

.blog-content {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  flex-shrink: 0;
}

.post-image {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* ============================================
        CREATE POST FORM | CREATE POST FORM
   ============================================ */
.create-post-section {
  position: relative;
  max-width: 600px;
  margin: 3rem auto;
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  isolation: isolate;
}

.create-post-section::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    120deg,
    var(--color-turquoise),
    var(--color-pink),
    var(--color-purple),
    var(--color-turquoise)
  );
  background-size: 300% 300%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  animation: shift-border 3.5s ease infinite;
}

.create-post-section form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.create-post-section label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.create-post-section input[type="text"],
.create-post-section input[type="password"],
.create-post-section textarea {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: 0.6rem;
  font-family: var(--font-display);
}

.red-star {
  color: red;
}

.create-post-section input[type="file"] {
  color: var(--color-text-muted);
}

.create-post-section button {
  margin-top: 1.5rem;
  align-self: flex-start;
  background-color: var(--color-turquoise);
  color: #0a0a0a;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.create-post-section button:hover {
  opacity: 0.85;
}

.create-post-section input[type="file"] {
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.create-post-section input[type="file"]::file-selector-button {
  background-color: var(--color-purple);
  color: var(--color-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin-right: 1rem;
  transition: background-color 0.2s ease;
}

.create-post-section input[type="file"]::file-selector-button:hover {
  background-color: var(--color-pink);
}

/* ============================================
     SINGLE POST | SINGLE POST | SINGLE POST | 
   ============================================ */
.single-post-section {
  max-width: 720px;
  margin: 3rem auto 5rem auto;
  padding: 0 1.5rem;
  overflow: hidden;
  justify-items: center;
}

.single-post-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(
    90deg,
    var(--color-turquoise),
    var(--color-pink)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.single-post-image {
  max-width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  margin: 1.5rem 0;
  display: block;
}

.single-post-content {
  color: var(--color-text-muted);
  line-height: 1.8;
  font-size: 1.05rem;
  white-space: pre-line;
}

/* ============================================
   RESPONSIVE | KISEBB MONITOR (max 1200px)
   ============================================ */
@media (max-width: 1200px) {
  .blog-items {
    padding: 2rem;
    grid-auto-rows: 200px;
  }

  .single-post-container:nth-child(9n + 9) {
    grid-column: span 4;
  }
}

/* ============================================
   RESPONSIVE | TABLET (max 1000px)
   ============================================ */
@media (max-width: 1000px) {
  .header-nav {
    padding: 1.25rem 1.5rem;
  }

  .blog-items {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-auto-rows: 260px;
    gap: 1.25rem;
    padding: 1.5rem;
  }

  .single-post-container:nth-child(9n + 1),
  .single-post-container:nth-child(9n + 4) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .single-post-container:nth-child(9n + 5),
  .single-post-container:nth-child(9n + 6) {
    grid-row: span 1;
  }

  .single-post-container:nth-child(9n + 9) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .single-post-title {
    font-size: 1.9rem;
  }

  .single-post-section {
    max-width: 100%;
  }

  .create-post-section {
    max-width: 100%;
    margin: 2rem 1.5rem;
  }
}

/* ============================================
   RESPONSIVE | MOBIL (max 600px)
   ============================================ */
@media (max-width: 600px) {
  .header-nav {
    padding: 1rem;
  }

  .nav-list {
    gap: 0.6rem;
  }

  .nav-button {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .blog-items {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 1.25rem;
    padding: 1rem;
  }

  /* mobilon minden kártya egyforma, egy oszlopos legyen */
  .single-post-container:nth-child(9n + 1),
  .single-post-container:nth-child(9n + 4),
  .single-post-container:nth-child(9n + 5),
  .single-post-container:nth-child(9n + 6),
  .single-post-container:nth-child(9n + 8),
  .single-post-container:nth-child(9n + 9) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .single-post-container {
    padding: 1.1rem;
    min-height: 320px;
  }

  .post-image {
    height: 180px;
    flex: none;
  }

  .single-post-title {
    font-size: 1.5rem;
  }

  .single-post-content {
    font-size: 0.95rem;
  }

  .single-post-image {
    max-height: 260px;
  }

  .create-post-section {
    padding: 1.25rem;
    margin: 1.5rem 1rem;
  }
}