/*
Theme Name: Astra Child
Template: astra
*/

/* ============================================================
   GALAXY2 — FEED (unified image size)
   ============================================================ */

   .galaxy2-feed-item img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

@media (max-width: 768px) {
    .galaxy2-feed-item img {
        height: 220px;
    }
}

.galaxy2-widget {
    margin-bottom: 20px;
    padding: 10px 0;
}

.galaxy2-widget img {
    display: block;
    margin-bottom: 12px;
    border-radius: 6px;
}

.galaxy2-live-preview {
    font-size: 15px;
    line-height: 1.4;
}

/* ============================================================
   GALAXY2 — POST MENU (⋮ Edit / Delete)
   ============================================================ */

.galaxy2-feed-item {
    position: relative;
}

.galaxy2-post-menu {
    position: absolute !important;
    top: 12px;
    right: 12px;
    z-index: 50;
}

.galaxy2-post-menu-trigger {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    padding: 4px 8px;
    color: #000 !important;
    position: relative;
    z-index: 50 !important;
}

.galaxy2-post-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    width: 120px;
    z-index: 50;
}

.galaxy2-post-menu-item {
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
}

.galaxy2-post-menu-item:hover {
    background: #f2f2f2;
}

.meta {
    position: relative;
    z-index: 1;
}

.galaxy2-post-menu-button {
    position: absolute;
    top: 10px;
    right: 10px;
}

.galaxy2-attachments img,
.galaxy2-attachments video {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}

/* ============================================================
   GALAXY2 — HORIZONTAL BAR (4 cards visible + arrows)
   ============================================================ */

   .galaxy2-horizontal-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.galaxy2-horizontal-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 5px;
}

.galaxy2-horizontal-track::-webkit-scrollbar {
    display: none;
}

/* 4 карточки на экране */
.galaxy2-card {
    flex: 0 0 auto;
    width: calc((100% - 3 * 12px) / 4);
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.galaxy2-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galaxy2-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* ARROWS */
.galaxy2-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: none;
    font-size: 22px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    color: #000 !important;
}

.galaxy2-arrow:hover {
    background: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}

.galaxy2-arrow.left { left: 5px; }
.galaxy2-arrow.right { right: 5px; }

/* MOBILE */
@media (max-width: 600px) {
    .galaxy2-card {
        width: 160px;
        height: 100px;
    }
    .galaxy2-arrow {
        display: none;
    }
}

/* ============================================
   GALAXY2 — Right Sidebar Ad Card (Template 1)
   ============================================ */

   .g2-ad-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    text-align: center;
}

.g2-ad-card img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 12px;
    display: block;
}

.g2-ad-button {
    display: inline-block;
    background: #007bff;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.g2-ad-button:hover {
    background: #005fcc;
}

/* ===== Galaxy2 Unified Post Image Size ===== */
.galaxy2-post img,
.entry-content img,
.post img {
    width: 100%;
    height: 260px; /* можно менять: 220, 240, 280 */
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    display: block;
}

/* ===== CTA Buttons Under Statistics ===== */

.galaxy2-cta-buttons {
    text-align: center;
    margin: 30px 0 50px;
  }
  
  .galaxy2-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    margin: 0 10px;
    transition: background 0.2s ease;
  }
  
  .galaxy2-btn-dark {
    background-color: #007bff;
    color: #fff;
  }
  
  .galaxy2-btn-dark:hover {
    background-color: #005fcc;
  }
  
  .galaxy2-btn-light {
    background-color: #e0f0ff;
    color: #007bff;
  }
  
  .galaxy2-btn-light:hover {
    background-color: #cce4ff;
  }

  /* ===== GEO FILTER — PREMIUM UI ===== */

.geo-filter-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a1a1a;
    letter-spacing: 0.3px;
  }
  
  .geo-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #e2e6f0;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease;
  }
  
  .geo-filter:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  }
  
  .geo-filter label {
    font-weight: 600;
    color: #333;
    margin-right: 6px;
    font-size: 15px;
  }
  
  .geo-filter select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #cfd6e3;
    background: #f8faff;
    font-size: 15px;
    min-width: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  
  .geo-filter select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
    outline: none;
  }
  
  .geo-filter-note {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    font-style: italic;
  }
  
  @media (max-width: 768px) {
    .geo-filter {
      flex-direction: column;
      gap: 14px;
    }
    .geo-filter select {
      min-width: 100%;
    }
  }

  /* ===== Galaxy2 — Contact Form Button ===== */

.g2-contact-btn {
    background: #007bff;
    color: #fff;
    padding: 12px 26px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background 0.25s ease, transform 0.2s ease;
  }
  
  .g2-contact-btn:hover {
    background: #005fcc;
    transform: translateY(-2px);
  }
  
  .g2-contact-btn:active {
    transform: translateY(0);
  }

  /* Galaxy2 Classifieds – Main Container */
.galaxy2-classifieds-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.galaxy2-classifieds-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
}

.galaxy2-classifieds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
}

.galaxy2-classifieds-grid a {
  display: block;
  background: #1e73be;
  color: #fff;
  padding: 14px 18px;
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.25s ease;
}

.galaxy2-classifieds-grid a:hover {
  background: #155a94;
  transform: translateY(-2px);
}

/* ====== MINI POSTBOX ====== */
.g2c-postbox-mini {
  background: #ffffff;
  border: 1px solid #d1d5db;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.g2c-postbox-mini:hover {
  border-color: #9ca3af;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* ====== MODAL WINDOW ====== */
.g2c-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.g2c-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}

.g2c-modal-window {
  position: relative;
  width: 480px;
  margin: 80px auto;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  z-index: 10000;
}

.g2c-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.g2c-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
}

/* ====== CREATE NEW LISTING BUTTON ====== */

.g2c-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;

  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(0);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.g2c-create-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.g2c-create-btn:active {
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  transform: translateY(0);
}


/* ============================================
   Galaxy2 Classifieds — Responsive Listing Grid
   ============================================ */

.g2c-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
  padding: 10px 0;
}

/* Tablet */
@media (max-width: 1024px) {
  .g2c-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .g2c-grid {
    grid-template-columns: 1fr;
  }
}

/* Optional: make cards look cleaner in grid mode */
.g2c-card {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
}

.g2c-card {
  position: relative;
}

.g2c-card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
}


/* Square thumbnail like OfferUp */
.g2c-card-thumb {
  width: 100% !important;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f3f3;
}

.g2c-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* Compact OfferUp-style card */
.g2c-card {
  max-height: 320px;
  overflow: hidden;
}

.g2c-card-text {
  font-size: 13px;
  line-height: 1.3;
  max-height: 40px;
  overflow: hidden;
}

.g2c-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  max-height: 36px;
  overflow: hidden;
}

/* Title spacing fix */
.g2c-card-title {
  margin-top: 6px;
}

/* ====== CREATE NEW LISTING — BLUE STYLE ====== */

.g2c-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;

  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(0);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.g2c-create-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.g2c-create-btn:active {
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  transform: translateY(0);
}

/* Galaxy2 Classifieds — Responsive Grid */
.galaxy2-classifieds-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

/* Tablet (3 columns) */
@media (max-width: 1024px) {
  .galaxy2-classifieds-grid {
      grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile (1 column) */
@media (max-width: 600px) {
  .galaxy2-classifieds-grid {
      grid-template-columns: 1fr;
      gap: 15px;
  }
}

/* Admin 3-dots menu */
.g2c-admin-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;
}

.g2c-admin-dots {
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.g2c-admin-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 28px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
}

.g2c-admin-dropdown a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
}

.g2c-admin-dropdown a:hover {
  background: #f2f2f2;
}

.admin-tab {
  color: #000 !important;
}

.g2-pinned-badge {
  display: inline-block;
  background: #ffcc00;
  color: #000;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.g2-pinned-badge {
  display: inline-block;
  background: #ffcc00;
  color: #000;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {

  /* Увеличиваем Postbox */
  .galaxy2-postbox {
    padding: 18px !important;
    border-radius: 10px !important;
  }

  .galaxy2-postbox textarea {
    font-size: 18px !important;
    padding: 14px !important;
    min-height: 100px !important;
  }

  .galaxy2-postbox-actions input[type="file"] {
    font-size: 16px !important;
  }

  .galaxy2-postbox-actions button {
    font-size: 18px !important;
    padding: 12px 22px !important;
  }
}

/* === Galaxy2 Mobile — Base Fix Layer === */
@media (max-width: 768px) {

  body {
    font-size: 18px;
    line-height: 1.45;
  }

  .galaxy2-page-layout {
    padding: 0 12px !important;
    gap: 14px !important;
  }

  .galaxy2-content-center,
  .galaxy2-postbox,
  .galaxy2-feed-item {
    border-radius: 10px !important;
    padding: 12px !important;
  }

  .galaxy2-postbox textarea {
    font-size: 17px !important;
    padding: 10px !important;
  }

  .galaxy2-post-actions button,
  #galaxy2-postbox-submit {
    font-size: 17px !important;
    padding: 12px !important;
  }

  .galaxy2-horizontal-bar-wrapper img,
  .galaxy2-card img {
    height: 140px !important;
  }
}

@media (max-width: 768px) {

  /* Общий текст */
  body {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }

  /* Кнопки */
  button,
  .galaxy2-post-actions button,
  #galaxy2-postbox-submit {
    font-size: 18px !important;
    padding: 14px 18px !important;
    border-radius: 10px !important;
  }

  /* Текст в постбоксе */
  .galaxy2-postbox textarea {
    font-size: 18px !important;
    padding: 12px !important;
  }

  /* Текст в ленте */
  .galaxy2-feed-item {
    font-size: 17px !important;
    padding: 16px !important;
  }

  /* Меню слева (если оно появится) */
  .galaxy2-left-menu-items a {
    font-size: 18px !important;
    padding: 14px !important;
  }

  /* Заголовки */
  h3, h2, h1 {
    font-size: 22px !important;
  }
}

/* ============================================================
   G2 — PRICE & CITY STYLING (BIG, RED, BEAUTIFUL)
   ============================================================ */

/* Общий блок */
.g2c-price-line,
.g2c-city-line {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Иконка $ */
.g2c-price-icon {
    font-size: 26px;
    font-weight: 900;
    color: #d40000;
    line-height: 1;
}

/* Цена */
.g2c-price-value {
    font-size: 26px;
    font-weight: 800;
    color: #e60000;
    padding: 4px 10px;
    border: 2px solid #ff0000;
    border-radius: 6px;
    background: #fff5f5;
}

/* Город */
.g2c-city-value {
    font-size: 20px;
    font-weight: 700;
    color: #cc0000;
}

/* ====== PRICE ====== */
.g2c-price-value {
  font-size: 26px;
  font-weight: 800;
  color: #e60000; /* ярко-красный */
  padding: 4px 10px;
  border: 2px solid #ff0000;
  border-radius: 6px;
  background: #fff5f5;
}

/* ====== CITY ====== */
.g2c-city-value {
  font-size: 20px;
  font-weight: 700;
  color: #008800; /* зелёный */
}

/* === Galaxy2 Home — Fixed Center Column (Desktop) === */
.galaxy2-content-center {
  max-width: 720px !important; /* было 600px → теперь шире */
  margin: 0 auto;
}

/* Page Background */
body {
  background-color: #f0f2f5 !important; 
}

/* Tighter spacing between left, center, and right columns */
.galaxy2-page-layout {
  gap: 12px !important; /* было 20px → теперь плотнее */
}

/* Slightly reduce outer padding to compress layout */
.galaxy2-content-wrapper {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

/* LEFT COLUMN — make it wider without changing text size */
.galaxy2-sidebar-left {
  width: 260px !important; /* было меньше — теперь как у FB */
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* RIGHT COLUMN — make it wider AND move it away from the right edge */
.galaxy2-sidebar-right {
  width: 300px !important; /* шире, как у FB */
  margin-right: 20px !important; /* отодвигаем от правого края */
  padding-left: 10px !important; /* визуально плотнее */
  padding-right: 10px !important;
}

/* DISTANCE BETWEEN COLUMNS — bring right column closer to center */
.galaxy2-page-layout {
  gap: 12px !important; /* компактно, но не слиплось */
}

/* CENTRAL COLUMN — make it wider */
.galaxy2-main-column {
  max-width: 720px !important; /* было меньше — теперь шире */
}

/* === Galaxy2 Home — Wider Right Sidebar === */
.galaxy2-sidebar-right {
  width: 320px !important; /* было меньше — теперь шире */
}

.g2-news-menu ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.g2-news-menu li {
  margin: 3px 0;
}

.g2-menu-title,
.g2-submenu-title {
  font-weight: 700;
  cursor: pointer;
  padding: 6px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.g2-menu-title:hover,
.g2-submenu-title:hover {
  background: #f0f0f0;
}

/* стрелочки */
.g2-menu-title::after,
.g2-submenu-title::after {
  content: "▸";
  float: right;
  transition: transform 0.25s ease;
}

.parent.open > .g2-menu-title::after,
.parent.open > .g2-submenu-title::after {
  transform: rotate(90deg);
}

/* скрытые подменю */
.g2-submenu,
.g2-submenu-inner {
  display: none;
  margin-left: 12px;
  animation: fadeIn 0.25s ease;
}

/* открытые подменю */
.parent.open > .g2-submenu,
.parent.open > .g2-submenu-title + .g2-submenu-inner {
  display: block;
}

/* ссылки */
.g2-news-menu a {
  display: block;
  padding: 4px 6px;
  border-radius: 4px;
  color: #222;
  text-decoration: none;
  transition: background 0.2s;
}

.g2-news-menu a:hover {
  background: #f5f5f5;
}

/* активный пункт */
.g2-news-menu a.active {
  background: #e0f0ff;
  font-weight: 600;
}

/* анимация */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.g2-news-menu ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.g2-news-menu li {
  margin: 3px 0;
}

.g2-menu-title,
.g2-submenu-title {
  font-weight: 700;
  cursor: pointer;
  padding: 6px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.g2-menu-title:hover,
.g2-submenu-title:hover {
  background: #f0f0f0;
}

/* стрелочки */
.g2-menu-title::after,
.g2-submenu-title::after {
  content: "▸";
  float: right;
  transition: transform 0.25s ease;
}

.parent.open > .g2-menu-title::after,
.parent.open > .g2-submenu-title::after {
  transform: rotate(90deg);
}

/* скрытые подменю */
.g2-submenu,
.g2-submenu-inner {
  display: none;
  margin-left: 12px;
  animation: fadeIn 0.25s ease;
}

/* открытые подменю */
.parent.open > .g2-submenu,
.parent.open > .g2-submenu-title + .g2-submenu-inner {
  display: block;
}

/* ссылки */
.g2-news-menu a {
  display: block;
  padding: 4px 6px;
  border-radius: 4px;
  color: #222;
  text-decoration: none;
  transition: background 0.2s;
}

.g2-news-menu a:hover {
  background: #f5f5f5;
}

/* активный пункт */
.g2-news-menu a.active {
  background: #e0f0ff;
  font-weight: 600;
}

/* анимация */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.g2-classifieds-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.g2-bottom-nav {
  margin-top: 40px;
}

.g2-nav-btn {
  padding: 10px 20px;
  background: #1d4ed8;
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s ease;
}

.g2-nav-btn:hover {
  background: #1e40af;
}

.g2-category-nav {
  outline: 3px solid red;
}

/* Galaxy2 — улучшенная кнопка Back */
.g2-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0073aa;
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none !important;
  margin-bottom: 20px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.g2-back-link:hover {
  background: #005a87;
  transform: translateY(-2px);
}

/* === Galaxy2 Feed — Text Truncation (3 lines) === */
.galaxy2-content {
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: 4.8em;
  transition: max-height 0.25s ease;
}

.galaxy2-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff);
  pointer-events: none;
}

.galaxy2-content.g2-expanded {
  -webkit-line-clamp: unset;
  max-height: none;
}

.galaxy2-content.g2-expanded::after {
  display: none;
}

.g2-readmore-button {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #005bb5;
  cursor: pointer;
  user-select: none;
}

/* === FIX: кнопка ⋯ поверх fade-out === */
.galaxy2-post-menu-button {
  position: relative;
  z-index: 50;
}

/* === Galaxy2 — фиксируем кнопку ⋯ в правом верхнем углу === */
.galaxy2-feed-item {
  position: relative;
}

.galaxy2-post-menu-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
}

/* === Galaxy2 — внешний слой поста (как у Facebook) === */
.galaxy2-feed-item-wrapper {
  background: #ffffff;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 22px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  position: relative; /* кнопка ⋯ будет привязана сюда */
}

/* Кнопка ⋯ — всегда в правом верхнем углу внешнего слоя */
.galaxy2-feed-item-wrapper .galaxy2-post-menu-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
}

/* Контент внутри карточки */
.galaxy2-feed-item {
  position: relative;
  z-index: 1;
}

/* Чтобы изображение не перекрывало кнопку */
.galaxy2-attachments img,
.galaxy2-attachments video {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  width: 100%;
  height: auto;
  display: block;
}

/* === Galaxy2 — прозрачный внешний слой для кнопки ⋯ === */
.galaxy2-feed-item-wrapper {
  position: relative; /* нужен только для кнопки */
  padding-top: 0;     /* не меняем внешний вид */
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  margin: 0;          /* не добавляем отступов */
  background: transparent; /* полностью прозрачный */
  border: none;
  box-shadow: none;
}

/* Кнопка ⋯ — всегда в правом верхнем углу внешнего слоя */
.galaxy2-feed-item-wrapper .galaxy2-post-menu-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;
}

.g2-search {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 200px;
  z-index: 9999;
}

#g-search-input {
  width: 100%;
  height: 32px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

#g-search-results {
  position: absolute;
 top: 36px;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.g-search-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.g-search-item:hover {
  background: #f5f5f5;
}

/* === Make entire post content clickable === */
.g2-post-clickable {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ===== GALAXY FB GALLERY ===== */

.g2-gallery {
  display: grid;
  gap: 4px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

/* 1 PHOTO */
.g2-gallery[data-count="1"] {
  grid-template-columns: 1fr;
}
.g2-gallery[data-count="1"] .g2-photo-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* 2 PHOTOS */
.g2-gallery[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}
.g2-gallery[data-count="2"] .g2-photo-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

/* 3 PHOTOS */
.g2-gallery[data-count="3"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
}
.g2-gallery[data-count="3"] .g2-photo-item:nth-child(1) {
  grid-column: span 2;
}
.g2-gallery[data-count="3"] .g2-photo-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}
.g2-gallery[data-count="3"] .g2-photo-item:nth-child(1) img {
  height: 350px;
}

/* 4+ PHOTOS */
.g2-gallery[data-count="4"],
.g2-gallery[data-count]:not([data-count="1"]):not([data-count="2"]):not([data-count="3"]) {
  grid-template-columns: 1fr 1fr;
}
.g2-gallery[data-count="4"] .g2-photo-item img,
.g2-gallery[data-count]:not([data-count="1"]):not([data-count="2"]):not([data-count="3"]) .g2-photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* VIDEO BLOCK */
.g2-videos video {
  width: 100%;
  max-height: 400px;
  border-radius: 8px;
  margin-top: 10px;
  object-fit: cover;
}

/* AUTHOR BLOCK — FIXED, CLEAN, FINAL */
.g2-author-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* AVATAR — FIXED SIZE, NEVER STRETCHES */
.g2-author-avatar img {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  min-width: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

/* ============================
   REPORT DROPDOWN (VISIBLE)
   ============================ */

   .galaxy2-report-dropdown {
    position: absolute;
    top: 40px; /* под кнопкой меню */
    right: 10px;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;

    padding: 10px 0;
    width: 220px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.15);

    z-index: 9999;

    display: none; /* JS включает display:block */
}

.galaxy2-report-title {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-bottom: 1px solid #eee;
}

.galaxy2-report-reason {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
}

.galaxy2-report-reason:hover {
    background: #f5f5f5;
}

/* ===== Galaxy2 Edit Post Modal — Fix Visibility ===== */

#g2-edit-post-modal {
  color: #111; /* общий тёмный текст */
}

#g2-edit-post-modal div {
  color: #111;
}

#g2-edit-post-modal button {
  color: #111;
}

/* Заголовок */
#g2-edit-post-modal div:first-child div {
  color: #111 !important;
}

/* Крестик */
#g2-edit-post-modal button {
  color: #111 !important;
  opacity: 1 !important;
}

/* Иконка закрытия */
#g2-edit-post-modal button:hover {
  color: #000 !important;
}

/* Текст в textarea */
#g2-edit-post-modal textarea {
  color: #111 !important;
}

#g2c-message-modal {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* скрыта по умолчанию */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 999999;
}

#g2c-message-modal .g2c-modal-inner {
  background: #fff;
  padding: 20px;
  width: 90%;
  max-width: 420px;
  border-radius: 10px;
  position: relative;
}

#g2c-message-modal .g2c-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}

#g2c-message-modal .g2c-modal-inner {
  margin: auto;
}

/* === GALAXY2 GLOBAL SEARCH — строгий стиль === */
.g2-search-wrapper {
  width: 100%;
  display: flex;
  gap: 6px;
  margin-bottom: 14px; /* ← воздух (вариант 2) */
}

#g2-global-search {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #b9c7dd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  color: #1f3b68;
}

#g2-global-search:focus {
  border-color: #005bb5;
}

#g2-global-search-btn {
  padding: 8px 12px;
  border: 1px solid #b9c7dd;
  border-radius: 6px;
  background: #e7eef9;
  cursor: pointer;
  font-size: 14px;
  color: #1f3b68;
  font-weight: 600;
}

#g2-global-search-btn:hover {
  background: #d6e4fb;
}

.g2-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.g2-search-modal-inner {
  background: #ffffff;
  width: 90%;
  max-width: 720px;
  max-height: 80vh;
  padding: 18px 18px 16px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.g2-search-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: #1f3b68;
}

.g2-search-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  float: right;
  color: #666;
}

.g2-search-results {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e0e4ef;
  overflow-y: auto;
  flex: 1;
}

.g2-search-item {
  padding: 10px 4px;
  border-bottom: 1px solid #f0f2f7;
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.g2-search-item:hover {
  background: #f7f9ff;
}

.g2-search-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: #e3e7f2;
}

.g2-search-meta {
  font-size: 11px;
  color: #7a8499;
  margin-bottom: 2px;
}

.g2-search-title-line {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #1f3b68;
}

.g2-search-excerpt {
  font-size: 12px;
  color: #4a5670;
}

.g2-search-loading,
.g2-search-empty,
.g2-search-error {
  padding: 10px 0;
  font-size: 13px;
  color: #4a5670;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  .g2-search-modal-inner {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .g2-search-results {
    padding-bottom: 10px;
  }

  .g2-search-item {
    padding: 10px 8px;
  }
}

.galaxy2-comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.g2-comment-avatar img {
  border-radius: 50%;
}

.g2-comment-body {
  display: flex;
  flex-direction: column;
}

.g2-comment-author {
  font-weight: bold;
  font-size: 14px;
}

.g2-comment-date {
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}

.g2-comment-text {
  font-size: 14px;
}

.g2-comment-avatar img.avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover;
}

.g2-comment-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.g2-comment-avatar {
  flex-shrink: 0;
}

.g2-comment-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.g2-comment-avatar img,
.g2-comment-avatar .avatar {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover;
}

.galaxy2-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
}

.g2-comment-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Make ONLY the Classifieds button blue like ANC/Posts */
.galaxy2-left-menu-items a[href*="classifieds-2"] {
  background: #4aa3ff !important;
  color: #ffffff !important;
}

/* Change ONLY the HOME button color to green */
.g2-county-btn[href="/"] {
  background: #4CAF50 !important; /* красивый чистый зелёный */
  color: #ffffff !important;
}


