/* Blog drużyny — styl spójny z resztą strony (zmienne :root z index.html) */

#blogRoot {
  max-width: 820px;
}

@keyframes blogIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.blog-anim {
  animation: blogIn .45s ease both;
}

/* ---------- pola formularzy ---------- */
.blog-label {
  display: block;
  margin-bottom: 8px;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}

.blog-input,
.blog-textarea {
  width: 100%;
  background: rgba(233, 223, 199, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--sand-light);
  font: inherit;
  font-size: .95rem;
  transition: border-color .2s ease, background .2s ease;
}

.blog-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.blog-input::placeholder,
.blog-textarea::placeholder {
  color: rgba(245, 240, 226, 0.35);
}

.blog-input:hover,
.blog-textarea:hover {
  background: rgba(233, 223, 199, 0.07);
}

.blog-input:focus,
.blog-textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(233, 223, 199, 0.08);
}

/* ---------- logowanie ---------- */
.blog-login {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 140% at 10% 0%, rgba(207, 154, 58, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(233, 223, 199, 0.05), rgba(233, 223, 199, 0.015));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  max-width: 460px;
}

.blog-lock {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(207, 154, 58, 0.15);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

/* ---------- pasek użytkownika ---------- */
.blog-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(233, 223, 199, 0.03);
}

.blog-bar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  color: rgba(245, 240, 226, 0.8);
}

.blog-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(207, 154, 58, 0.18);
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: .95rem;
}

.blog-badge {
  display: inline-block;
  vertical-align: middle;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #16190f;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- przyciski tekstowe ---------- */
.blog-btn {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}

.blog-btn[disabled] {
  opacity: .55;
  cursor: default;
}

.blog-btn-sm {
  padding: 6px 14px;
  font-size: .8rem;
}

.blog-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: .8rem;
  color: rgba(245, 240, 226, 0.55);
  transition: color .2s ease;
}

.blog-link:hover {
  color: var(--gold);
}

.blog-link.danger:hover {
  color: #e48f7e;
}

/* ---------- komunikaty ---------- */
.blog-msg {
  margin-top: 12px;
  font-size: .85rem;
  min-height: 1.2em;
}

.blog-msg.err {
  color: #e48f7e;
}

.blog-msg.ok {
  color: #9ccf9a;
}

/* ---------- wpisy ---------- */
.blog-post {
  padding: 28px;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ember);
}

.blog-meta .dot {
  opacity: .5;
}

.blog-post-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.2;
  margin: 10px 0 16px;
  color: var(--sand-light);
}

.blog-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.75;
  color: rgba(245, 240, 226, 0.84);
}

/* ---------- zdjęcia wpisów ---------- */
.post-media {
  margin-top: 18px;
  margin-bottom: 20px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
}

.post-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 75vh;
  cursor: zoom-in;
  transition: transform .35s ease;
}

.post-media:hover .post-img {
  transform: scale(1.015);
}

.post-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 20px;
}

.post-gallery-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  height: 180px;
  cursor: zoom-in;
}

.post-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.post-gallery-item:hover img {
  transform: scale(1.04);
}

/* ---------- odpowiedzi ---------- */
.blog-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.blog-comments-head h4 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--sand-light);
}

.blog-comment {
  margin-top: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.blog-comment .blog-comment {
  margin-left: 2px;
}

.blog-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: .82rem;
}

.blog-comment-author {
  font-weight: 600;
  color: var(--gold);
}

.blog-comment-date {
  color: rgba(245, 240, 226, 0.4);
  font-size: .75rem;
}

.blog-comment-body {
  margin-top: 6px;
  font-size: .93rem;
}

.blog-comment-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.blog-reply-form {
  margin-top: 12px;
}

.blog-reply-form .blog-textarea {
  min-height: 80px;
}

.blog-empty {
  text-align: center;
  padding: 42px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: rgba(245, 240, 226, 0.55);
}

details.blog-settings>summary {
  cursor: pointer;
  list-style: none;
  font-size: .85rem;
  color: rgba(245, 240, 226, 0.65);
  transition: color .2s ease;
}

details.blog-settings>summary::-webkit-details-marker {
  display: none;
}

details.blog-settings>summary:hover {
  color: var(--gold);
}

/* ---------- zakładki Wpisy / Memy na samej górze ---------- */
.blog-tabs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(233, 223, 199, 0.05);
}

.blog-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  color: rgba(245, 240, 226, 0.7);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .22s ease;
}

.blog-nav-tab:hover {
  color: var(--sand-light);
  background: rgba(233, 223, 199, 0.06);
}

.blog-nav-tab.active {
  background: var(--gold);
  color: #14170f;
  box-shadow: 0 4px 14px rgba(207, 154, 58, 0.25);
}

.blog-nav-tab svg {
  flex-shrink: 0;
}

.blog-tabs {
  display: inline-flex;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(233, 223, 199, 0.03);
}

.blog-tab {
  padding: 8px 22px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  color: rgba(245, 240, 226, 0.65);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}

.blog-tab:hover {
  color: var(--sand-light);
}

.blog-tab.active {
  background: var(--gold);
  color: #16190f;
}

/* ---------- memy ---------- */
.meme-file {
  display: none !important;
}

.meme-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meme-preview {
  position: relative;
  display: inline-block;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.meme-preview img {
  display: block;
  max-height: 220px;
  max-width: 100%;
}

.meme-preview-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 23, 15, 0.85);
  color: var(--sand-light);
  border: 1px solid var(--line);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.meme-preview-x:hover {
  background: var(--gold);
  color: #16190f;
}

.meme-card {
  padding: 22px 24px;
}

.meme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.meme-who {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  font-size: .92rem;
  color: var(--sand-light);
}

.meme-date {
  font-size: .8rem;
  color: rgba(245, 240, 226, 0.5);
}

.meme-dot {
  color: rgba(245, 240, 226, 0.35);
  font-size: 0.75rem;
  user-select: none;
}

.meme-del {
  margin-left: auto;
}

.meme-text {
  margin-top: 8px;
  margin-bottom: 16px;
  font-size: .98rem;
  line-height: 1.6;
  color: rgba(245, 240, 226, 0.9);
}

.meme-media {
  margin-top: 12px;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
}

.meme-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  cursor: zoom-in;
  transition: transform .35s ease;
}

.meme-media:hover .meme-img {
  transform: scale(1.015);
}

.meme-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.meme-comments {
  margin-top: 4px;
}

.meme-comment-form {
  margin-top: 14px;
}

.meme-comment-form .blog-input {
  flex: 1;
  padding: 9px 12px;
}

.meme-usage {
  height: 8px;
  border-radius: 999px;
  background: rgba(233, 223, 199, 0.08);
  overflow: hidden;
}

.meme-usage>span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--ember));
}

.meme-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  cursor: zoom-out;
  background: rgba(10, 12, 8, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: blogIn .25s ease both;
}

.meme-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .blog-login {
    padding: 24px 20px;
  }

  .blog-post {
    padding: 20px 18px;
  }

  .blog-comment {
    padding-left: 10px;
  }

  .meme-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-anim {
    animation: none !important;
  }
}