/* =========================================================================
   1. ZMIENNE (THEMING) I CZCIONKI
   ========================================================================= */
:root {
  --color-primary: #0f5132;
  --color-primary-hover: #0b3d25;
  --color-secondary: #1a2536;
  --color-accent: #e5a93c;
  --color-accent-hover: #ce932a;
  --color-bg-main: #f8f9fa;
  --color-bg-card: #ffffff;
  --color-border: #e2e8f0;
  --color-text-muted: #64748b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #198754;
    --color-primary-hover: #146c43;
    --color-secondary: #f8f9fa;
    --color-bg-main: #0b111a;
    --color-bg-card: #1a2536;
    --color-border: #2d3748;
    --color-text-muted: #94a3b8;
  }
}

@font-face {
  font-display: swap;
  font-family: "Varela Round";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/varela-round-v21-latin-regular.woff2") format("woff2");
}

/* =========================================================================
   2. RESET I STYLE GLOBALNE
   ========================================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    Segoe UI,
    Helvetica,
    Arial,
    sans-serif;
}

body {
  background-color: #f0f2f5;
  color: #050505;
  padding-top: 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-main-content {
  flex: 1 0 auto;
  width: 100%;
}

.site-footer {
  flex-shrink: 0;
  background-color: #ffffff;
  border-top: 1px solid var(--color-border, #e4e6eb);
  padding: 16px 0;
  width: 100%;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.02);
  font-family: sans-serif;
  margin-top: auto;
}

/* =========================================================================
   3. GÓRNY PASEK NAWIGACJI
   ========================================================================= */
.fb-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
}

.nav-left,
.nav-center,
.nav-right {
  flex: 1;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.nav-left h1 {
  font-family: "Varela Round", sans-serif;
  white-space: nowrap;
  font-size: 22px;
  color: #214e87;
  letter-spacing: -0.3px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-bar {
  background-color: #f0f2f5;
  border: none;
  border-radius: 50px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  width: 240px;
  max-width: 100%;
  transition: width 0.2s ease;
}

.nav-center {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 100%;
  color: #65676b;
  font-size: 20px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.nav-icon:hover {
  background-color: #f2f2f2;
  border-radius: 8px;
  height: 90%;
  margin-top: 3px;
}

.nav-icon.active {
  color: #1877f2;
  border-bottom-color: #1877f2;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

.user-name {
  font-weight: 600;
  font-size: 15px;
}

.user-nav-link.active-profile {
  border-bottom: 3px solid #1877f2;
  height: 56px;
  padding-top: 3px;
}

.logout-btn,
.login-btn {
  color: #1877f2;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
}

.logout-btn:hover,
.login-btn:hover {
  background-color: #f0f2f5;
}

/* =========================================================================
   4. DROPDOWN MENU
   ========================================================================= */
.nav-dropdown-container {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  background-color: #f0f2f5;
  color: #050505;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.nav-dropdown-btn:hover {
  background-color: #e4e6eb;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  background-color: #ffffff;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px;
  z-index: 200;
}

.nav-dropdown-content.show {
  display: block;
}

.dropdown-item {
  color: #050505;
  padding: 10px 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #f2f2f2;
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  color: #65676b;
}

.dropdown-item.logout-link:hover {
  background-color: #ffebe9;
  color: #bc2525;
}

.dropdown-item.logout-link:hover i {
  color: #bc2525;
}

.dropdown-divider {
  border: 0;
  border-top: 1px solid #e4e6eb;
  margin: 6px 0;
}

/* =========================================================================
   5. GŁÓWNY KONTENER I BOCZNE PANELE
   ========================================================================= */
.main-container {
  display: grid;
  grid-template-columns: minmax(150px, 320px) 650px minmax(150px, 320px);
  justify-content: center;
  gap: 24px;
  max-width: 1424px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
  flex: 1 0 auto;
  align-items: start;
}

.left-sidebar,
.right-sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  height: fit-content;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
}

.sidebar-item:hover {
  background-color: #e4e6eb;
}

.sidebar-item i {
  font-size: 20px;
  color: #1877f2;
  width: 28px;
  text-align: center;
}

.right-sidebar h4 {
  color: #65676b;
  margin-bottom: 12px;
  font-size: 17px;
}

/* =========================================================================
   6. FEED I KARTY POSTÓW
   ========================================================================= */
.feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.create-post,
.post-card,
.login-prompt {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
}

.create-post .post-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-post form {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.create-post input {
  flex: 1;
  background-color: #f0f2f5;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 15px;
  outline: none;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.author-info h4 {
  font-size: 15px;
  font-weight: 600;
}

.author-info span {
  font-size: 12px;
  color: #65676b;
}

.post-direct-link:hover {
  color: #1877f2;
}

.follow-btn {
  background: #e4e6eb;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.follow-btn:hover {
  background: #d8dadf;
}

.post-content-html {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: #050505;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.post-image-container {
  margin: 12px -16px;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  width: calc(100% + 32px);
}

.post-media {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  cursor: zoom-in;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.post-media:hover,
.article-featured-image img:hover {
  transform: scale(1.005);
  filter: brightness(1.03);
}

.post-stats {
  display: flex;
  justify-content: space-between;
  color: #65676b;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4e6eb;
}

.likes-count i {
  color: #1877f2;
}

.post-actions {
  display: flex;
  padding: 4px 0;
  border-bottom: 1px solid #e4e6eb;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.post-actions form {
  flex: 1;
}

.post-like-form {
  display: contents;
}

.action-btn {
  background-color: #f0f2f5;
  border: none;
  padding: 0 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: #050505;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
  font-family: sans-serif;
  height: 36px;
  line-height: 36px;
  box-sizing: border-box;
}

.action-btn:hover:not([disabled]) {
  background-color: #f2f2f2;
}

/* =========================================================================
   7. SEKCJA KOMENTARZY I KOMPONENTY INTEGRALNE
   ========================================================================= */
.comments-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-card {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-content {
  background-color: #f0f2f5;
  padding: 8px 12px;
  border-radius: 18px;
  max-width: calc(100% - 40px);
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.comment-content h5 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.comment-content p {
  font-size: 14px;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.comment-form textarea {
  flex: 1;
  background-color: #f0f2f5;
  border: none;
  border-radius: 18px;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
  box-sizing: border-box;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #ddd;
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.file-upload-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background-color: #f0f2f5;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #45bd62;
}
.ql-container.ql-snow {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-color: #dddfe2 !important;
}
.ql-toolbar.ql-snow {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-color: #dddfe2 !important;
  background: #f7f8fa;
}
/* =========================================================================
8. MODALE, LIGHTBOX I POWIĘKSZENIA IMAGES
========================================================================= */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.custom-modal-box {
  background-color: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}
.custom-modal-header {
  padding: 16px;
  border-bottom: 1px solid #e4e6eb;
}
.custom-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1c1e21;
}
.custom-modal-body {
  padding: 20px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #050505;
}
.custom-modal-footer {
  padding: 12px 16px;
  background-color: #f0f2f5;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.custom-modal-footer button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.modal-btn-primary {
  background-color: #1877f2;
  color: #fff;
}
.modal-btn-secondary {
  background-color: #e4e6eb;
  color: #050505;
}
.modal-btn-danger {
  background-color: #bc2525;
  color: #fff;
}
.custom-lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  cursor: zoom-out;
  animation: lightboxFadeIn 0.25s ease-out;
}
.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  user-select: none;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: color 0.15s;
  cursor: pointer;
  z-index: 10001;
}
.lightbox-close:hover {
  color: var(--color-accent, #e5a93c);
}
@keyframes modalFadeIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* =========================================================================
9. LOGOWANIE, REJESTRACJA I PROFIL
========================================================================= */
.login-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 80px auto 0 auto;
  padding: 0 40px;
}
.login-branding {
  max-width: 500px;
  padding-bottom: 40px;
}
.login-branding h1 {
  color: #1877f2;
  font-size: 60px;
  font-weight: bold;
  letter-spacing: -1px;
}
.login-box,
.login-branding {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 396px;
}
.login-box h3 {
  margin-bottom: 12px;
  font-size: 18px;
  color: #1c1e21;
}
.login-box input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dddfe2;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.login-box input:focus {
  border-color: #1877f2;
  box-shadow: 0 0 0 2px #e7f3ff;
}
.login-box hr {
  border: 0;
  border-top: 1px solid #dadde1;
  margin: 20px 0;
}
.login-submit,
.register-submit {
  width: 100%;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  padding: 10px 0;
  cursor: pointer;
  color: #fff;
}
.login-submit {
  background-color: #1877f2;
  font-size: 20px;
}
.register-submit {
  background-color: #42b72a;
  font-size: 17px;
}
.profile-container {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 16px 40px 16px;
}
.profile-header-card {
  background-color: #fff;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.cover-photo-wrapper {
  position: relative;
  width: 100%;
  height: 350px;
  background-color: #f0f2f5;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  overflow: hidden;
}
.cover-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  padding: 0 32px;
  margin-top: -30px;
  position: relative;
  gap: 24px;
  flex-wrap: wrap;
}
.avatar-wrapper {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 5px solid #fff;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.profile-main-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-user-details {
  margin-bottom: 16px;
  flex: 1;
}
.profile-user-details h2 {
  font-size: 32px;
  font-weight: 700;
}
.upload-action-btn,
.profile-follow-btn {
  background-color: #e4e6eb;
  color: #050505;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
}
.profile-follow-btn {
  background-color: #1877f2;
  color: white;
}
.profile-body-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}
.info-box {
  background-color: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* =========================================================================
10. STYLE ARTYKUŁÓW I WIDOKÓW SZCZEGÓŁOWYCH
========================================================================= */
.editorial-article {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  background: #ffffff;
}
.article-header h1 {
  font-size: 38px;
  font-weight: 800;
  color: #1c1e21;
  text-align: center;
  line-height: 1.25;
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
}
.article-text-content p {
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
  padding: 8px 0;
  margin: 0;
  font-size: 16.5px;
  line-height: 1.65;
}
.article-text-content h1,
.article-text-content h2,
.article-text-content h3 {
  text-align: left;
  font-weight: 700;
  color: #1c1e21;
  display: block;
  padding-top: 24px;
  padding-bottom: 12px;
  margin: 0;
}
.article-text-content h1 {
  font-size: 28px;
}
.article-text-content h2 {
  font-size: 24px;
}
.article-text-content h3 {
  font-size: 20px;
}
.article-text-content ul,
.article-text-content ol {
  margin-left: 24px;
  padding: 8px 0;
}
.article-text-content li {
  padding: 4px 0;
  font-size: 16px;
}
.article-featured-image {
  float: right;
  max-width: 40%;
  margin: 0 0 12px 16px;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
}
.post-card .post-static-title,
.post-card .post-title-display h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1c1e21;
  text-align: left;
  padding: 6px 0;
}
/* Likwidacja nadmiarowej przestrzeni */
.page-main-content:has(.login-prompt) + .main-container,
.page-main-content:has(div[style="text-align: center"]) .main-container {
  padding-top: 4px;
}

.fb-navbar .nav-right .user-visitcard {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}
/*
/* Poprawki 
 */
body,
.post-card,
.create-post,
.info-box,
header.fb-navbar,
footer.site-footer {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

.comment-form textarea,
.comment-edit-form-block textarea {
  transition: height 0.15s ease-out;
  min-height: 36px;
  resize: none;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.article-featured-image {
  float: right;
  max-width: 40%;
  width: 300px;
  margin: 4px 0 16px 24px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.article-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Zabezpieczenie dla tekstu, aby nie przyklejał się do grafiki */
.article-text-content {
  display: block;
  min-width: 0;
}

/* KRYTYCZNA POPRAWKA DLA SREDRNICH I MAŁYCH EKRANÓW (RESPONSOWNOŚĆ) */
@media (max-width: 768px) {
  .article-featured-image {
    float: none; /* Wyłącza opływanie na telefonach */
    max-width: 100%; /* Obrazek zajmuje pełną dostępną szerokość */
    width: 100%;
    margin: 0 0 20px 0; /* Margines tylko na dole, oddzielający od tekstu */
  }
}

/* =========================================================================
   REFAKTORYZACJA I WYGLĄD PRZYCISKÓW AKCJI GOŚCIA NA PROFILU
   ========================================================================= */
.profile-guest-actions-mobile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

/* Wspólna klasa bazowa dla przycisków profilu gościa na desktopie */
.profile-follow-btn,
.profile-block-main-btn,
.profile-mail-main-btn,
.profile-guest-actions-mobile .restricted-feature-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
  height: 38px;
  white-space: nowrap;
}

/* Kolorystyka i zachowanie przycisku OBSERWUJ */
.profile-follow-btn {
  background-color: #1877f2;
  color: #ffffff;
}
.profile-follow-btn:hover {
  background-color: #166fe5;
}
.profile-follow-btn.is-following {
  background-color: #42b72a;
}
.profile-follow-btn.is-following:hover {
  background-color: #36a420;
}

/* Kolorystyka i zachowanie przycisku ZABLOKUJ */
.profile-block-main-btn {
  background-color: #bc2525;
  color: #ffffff;
}
.profile-block-main-btn:hover {
  background-color: #a31f1f;
}
.profile-block-main-btn.is-blocking {
  background-color: #65676b;
}
.profile-block-main-btn.is-blocking:hover {
  background-color: #57585a;
}

/* Kolorystyka i zachowanie przycisku WYŚLIJ WIADOMOŚĆ */
.profile-mail-main-btn {
  background-color: #42b72a;
  color: #ffffff;
}
.profile-mail-main-btn:hover {
  background-color: #36a420;
}

/* Przycisk maila z blokadą dla niezweryfikowanych */
.profile-guest-actions-mobile .restricted-feature-trigger {
  background-color: #e4e6eb;
  color: #65676b;
}
.profile-guest-actions-mobile .restricted-feature-trigger:hover {
  background-color: #d8dadf;
}

/* Efekt aktywnego kliknięcia micro-UX */
.profile-guest-actions-mobile button:active {
  transform: scale(0.98);
}

/* Zmiana tła przycisku po asynchronicznej aktywacji obserwowania */
.profile-follow-btn.is-following {
  background-color: #e4e6eb !important;
  color: #050505 !important;
}

/* Zmiana tła przycisku po asynchronicznej aktywacji blokady */
.profile-block-main-btn.is-blocking {
  background-color: #4a5568 !important;
  color: #ffffff !important;
}

/* =========================================================================
   ZOPTYMALIZOWANY WYGLĄD PRZYCISKÓW AKCJI PROFILU (KONTRAST UX)
   ========================================================================= */

/* Domyślny stan przycisku OBSERWUJ (Niebieski, ikona Solid) */
.profile-follow-btn {
  background-color: #1877f2 !important;
  color: #ffffff !important;
}
/* Stan AKTYWNY - OBSERWUJESZ (Czysty, głęboki zielony, ikona pozostaje wyraźna i biała) */
.profile-follow-btn.is-following {
  background-color: #0f5132 !important; /* Bezpieczny, głęboki zielony */
  color: #ffffff !important;
}

/* Domyślny stan przycisku ZABLOKUJ (Karminowy czerwony, ikona Solid) */
.profile-block-main-btn {
  background-color: #bc2525 !important;
  color: #ffffff !important;
}
/* Stan AKTYWNY - ZABLOKOWANY (Stonowany, ciemny grafit, informujący o odcięciu relacji) */
.profile-block-main-btn.is-blocking {
  background-color: #212529 !important; /* Ciemny grafitowy/czarny */
  color: #ffffff !important;
}

/* Przycisk wysyłki wiadomości (Zawsze zielony) */
.profile-mail-main-btn {
  background-color: #198754 !important;
  color: #ffffff !important;
}

/* Wymuszenie ostrego, białego koloru ikon wewnątrz okręgów na mobile */
@media (max-width: 600px) {
  .profile-guest-actions-mobile i {
    color: #ffffff !important; /* Wszystkie ikony są zawsze białe i idealnie widoczne! */
    font-size: 16px !important;
  }
}

/* 1. Nadanie stopce kontekstu pozycjonowania (Kotwica) */
.site-footer {
  position: relative; /* Gwarantuje, że elementy pozycjonowane absolutnie wewnątrz stopki nie uciekną */
  overflow: visible; /* Pozwala odznace delikatnie wystawać, jeśli stopka jest za niska */
}

/* Całkowite i bezpieczne ukrycie odznaki reCAPTCHA (zgodne z wytycznymi Google) */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* =========================================================================
   KOMPONENT DWUKOLOROWEGO PRZEŁĄCZNIKA SUWAKOWEGO (ZIELONY/CZERWONY)
   ========================================================================= */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  vertical-align: middle;
  flex-shrink: 0; /* Zabezpieczenie przed zgnieceniem suwaka w tabelach i flexboxach */
}

/* Ukrywamy domyślny natywny checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Domyślny stan suwaka: WYŁĄCZONY (Czerwony - dynamiczne przejście koloru tła) */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #bc2525; /* Charakterystyczna czerwony kolor systemu Pole Opinii */
  border-radius: 22px;
  /* Płynna animacja zmiany tła przy użyciu krzywej sprzętowej */
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: background-color;
}

/* Biała, okrągła gałka suwaka */
.slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  /* Animacja przesunięcia realizowana za pomocą transformacji GPU dla optymalizacji Mobile */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Stan: WŁĄCZONY (Zielony - aktywowany po zaznaczeniu checkboxa) */
.switch input:checked + .slider {
  background-color: #146c43; /* Bezpieczny, kontrastowy zielony kolor */
}

/* Przemieszczenie gałki suwaka (W prawo) przy użyciu akceleracji sprzętowej */
.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* Feedback wizualny podczas wykonywania asynchronicznego Fetch API (Ochrona przed double-click) */
.switch input:disabled + .slider {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Subtelny focus ring ułatwiający nawigację klawiaturą (WCAG Accessibility) */
.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1877f2;
}

/* =========================================================================
   OPTYMALIZACJA WYMIARÓW I ROZCIĄGANIA EDYTORA QUILL (PIONOWY RESIZE)
   ========================================================================= */

/* Kontener zewnętrzny Quill */
.ql-container.ql-snow {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-color: #dddfe2 !important;
  
  /* Włączenie natywnego chwytaka do rozciągania kontenera w pionie */
  resize: vertical; 
  overflow: auto;
  
  /* Definiujemy bezpieczne ramy wymiarów */
  min-height: 120px;
  max-height: 600px; 
}

/* Wewnętrzny obszar roboczy edytora (obszar wpisywania tekstu) */
.ql-snow .ql-editor {
  min-height: 100%;
  height: 100%;
  overflow-y: auto;
  
  /* Zapewniamy ładne łamanie wyrazów i estetyczny padding */
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.6;
}

/* Stylizacja deweloperska paska chwytaka re-size w prawym dolnym rogu (Micro-UX) */
.ql-container.ql-snow::-webkit-resizer {
  background-image: linear-gradient(135deg, transparent 40%, #65676b 40%, #65676b 60%, transparent 60%, transparent 80%, #65676b 80%);
  background-size: 8px 8px;
  background-repeat: no-repeat;
  background-position: bottom right;
  cursor: ns-resize;
}
/* Upewnienie się, że okna alertów i potwierdzeń są zawsze na samym wierzchu */
#custom-confirm-modal,
#custom-alert-modal,
#custom-loading-modal {
  z-index: 10020 !important;
}

.mobile-panel-indicator {
  display: none;
}

/* =========================================================================
   ALTERNATYWNY WIDOK PORTALOWY (KARTY PRASOWE)
   ========================================================================= */
.view-switch-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: #ffffff;
  border: 1px solid #dddfe2;
  color: #65676b;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.view-switch-btn.active,
.view-switch-btn:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
}

.portal-news-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border, #e4e6eb);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-news-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.portal-card-image-link {
  display: block;
  width: 100%;
  max-height: 360px;
  overflow: hidden;
  background: #f0f2f5;
}

.portal-card-image {
  width: 100%;
  height: 300px; /* Stała lub maksymalna wysokość ramki */
  object-fit: cover; /* Wypełnienie całej szerokości bez zniekształceń */
  object-position: top center; /* Zakotwiczenie kadru na górnej krawędzi obrazu */
  display: block;
  transition: transform 0.3s ease;
}

.portal-news-card:hover .portal-card-image {
  transform: scale(1.02);
}

.portal-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: #65676b;
}

.portal-author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #1c1e21;
  font-weight: 600;
}

.portal-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.portal-card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

.portal-card-title a {
  text-decoration: none;
  color: #1c1e21;
  transition: color 0.15s ease;
}

.portal-card-title a:hover {
  color: #1877f2;
}

.portal-reply-badge {
  font-size: 12.5px;
  color: #65676b;
}

.portal-reply-badge a {
  color: #1877f2;
  font-weight: 600;
  text-decoration: none;
}

.portal-card-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
  text-align: justify;
}

.portal-card-footer {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #e4e6eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.portal-card-stats {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: #65676b;
}

.portal-read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-primary, #0f5132);
  color: #ffffff !important;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.portal-read-more-btn:hover {
  background-color: var(--color-primary-hover, #0b3d25);
}
