/* Companies Page Specific Styles */

/* ==========================================================================
   Company detail page typography
   Sizes match the vacancy page (vacancy-modern.css) for visual continuity:
   h1 = 1.75rem (vacancy hero title), section h2 = 1.5rem, lead = 1.125rem
   ========================================================================== */
/* ==========================================================================
   Company profile page (cover + hero card + sidebar layout)
   Structure follows the company-profile demo; styling uses our design tokens.
   ========================================================================== */

/* Generic panel (card) inside the profile and reviews blocks */
.company-page .panel,
.company-reviews .panel {
  background: var(--color-white);
  border: 1px solid #e9ecef;
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-1);
}

/* --- Cover (placeholder background until a company image is added) --- */
.company-cover {
  height: 255px;
  margin-top: 0.75rem;
  border-radius: var(--radius-lg);
  background-color: #ced4da;
  background-image: url('/images/design/card-bg.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* --- Top grid: hero card + sidebar --- */
.company-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

/* Left column: hero card + about panel stacked together */
.company-main-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* --- Hero card --- */
.company-hero-card {
  padding: 1.5rem;
}

.company-identity {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.company-logo {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
}

.company-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-heading h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.company-intro {
  margin-bottom: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--gray-700);
}

/* --- Contact chips --- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e9ecef;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
  text-decoration: none;
  background: var(--gray-50);
  border: 1px solid #dee2e6;
  border-radius: 999px;
  transition: all var(--dur-fast) var(--ease);
}

.contact-chip i {
  font-size: 1rem;
  color: var(--color-blue);
}

.contact-chip:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
  box-shadow: var(--elev-1);
  transform: translateY(-1px);
  text-decoration: none;
}

.contact-chip--whatsapp i { color: #25d366; }
.contact-chip--whatsapp:hover { color: #128c4b; border-color: #25d366; }
.contact-chip--telegram i { color: #229ed9; }
.contact-chip--telegram:hover { color: #1b7fb4; border-color: #229ed9; }

/* --- Contact reveal: values are blurred until the user clicks "Показать контакты" --- */
.company-contact__label {
  color: var(--gray-700);
  font-weight: 500;
}

.company-contact__value {
  font-weight: 600;
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  transition: filter var(--dur-fast) var(--ease);
}

/* Before reveal: chips are not clickable (no accidental navigation) */
.company-contacts:not(.is-visible) .company-contact {
  pointer-events: none;
  cursor: default;
}

/* After reveal: values become readable, selectable and clickable */
.company-contacts.is-visible .company-contact__value {
  filter: none;
  user-select: text;
  pointer-events: auto;
}

.company-contacts-reveal {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  color: #dc3545;
  border-color: #dc3545;
  background: #fdf1f2;
  pointer-events: auto; /* Always clickable even before .is-visible */
}

.company-contacts-reveal i {
  color: #dc3545;
}

.company-contacts-reveal:hover {
  color: #bb2d3b;
  border-color: #bb2d3b;
  background: #fbe3e5;
}

.company-contacts.is-visible .company-contacts-reveal {
  display: none;
}

/* --- Sidebar --- */
.company-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stats-panel {
  padding: 0.5rem 1.25rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.stat + .stat {
  border-top: 1px solid #f1f3f5;
}

.stat-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-blue);
  background: rgba(13, 110, 253, 0.1);
  border-radius: var(--radius-sm);
}

.stat-icon--gold {
  color: #f59f00;
  background: rgba(255, 193, 7, 0.15);
}

.stat strong {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

.stat strong.stat-age {
  font-size: 0.9375rem;
}

.stat > span:last-child {
  font-size: 0.8125rem;
  color: var(--gray-700);
}

/* Only the review label is a link (the number stays plain);
   the dotted underline matches the text color to hint it's clickable */
.stat-reviews-link {
  font-size: 0.8125rem;
  color: var(--gray-700);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.stat-reviews-link:hover {
  color: var(--color-blue);
}

/* Offset the anchor target below the sticky header */
.company-reviews {
  scroll-margin-top: 90px;
}

/* Safety disclaimer at the bottom of the page */
.company-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 1.5rem 0 2rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--gray-700);
  background: var(--gray-50);
  border: 1px solid #e9ecef;
  border-radius: var(--radius-sm);
}

.company-disclaimer i {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1rem;
  color: var(--gray-700);
}

.company-disclaimer p {
  margin: 0;
}

.company-disclaimer strong {
  font-weight: 600;
  color: var(--gray-900);
}

.sidebar-card {
  padding: 1.25rem;
}

.sidebar-title {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-700);
}

.sidebar-title i {
  color: var(--color-blue);
}

.official-domain {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-blue);
  text-decoration: none;
  word-break: break-all;
}

.official-domain:hover {
  text-decoration: underline;
}

.sidebar-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
  text-decoration: none;
  background: var(--gray-50);
  border: 1px solid #dee2e6;
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease);
}

.sidebar-action:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
  text-decoration: none;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #f1f3f5;
}

.social-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.social-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.social-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.social-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-900);
}

.social-text small {
  overflow: hidden;
  font-size: 0.75rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--gray-700);
}

.social-row b {
  margin-left: auto;
  font-weight: 400;
  color: var(--gray-700);
  transition: color var(--dur-fast) var(--ease);
}

.social-row:hover .social-text strong,
.social-row:hover b {
  color: var(--color-blue);
}

/* --- About panel --- */
.about-panel {
  padding: 1.5rem;
}

.about-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.about-copy {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--gray-900);
}

.about-copy p:last-child {
  margin-bottom: 0;
}

/* --- Rating summary (reviews section) --- */
.rating-summary {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
}

.rating-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
}

.rating-main > strong {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gray-900);
}

.rating-stars {
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: #f5b301;
}

.rating-stars .bi-star {
  color: #dee2e6;
}

.rating-main > small {
  font-size: 0.8125rem;
  color: var(--gray-700);
}

.rating-total {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.rating-total b {
  margin-right: 0.25rem;
  font-size: 1.125rem;
  color: var(--gray-900);
}

.rating-bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rating-bar-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  gap: 0.6rem;
  align-items: center;
}

.rating-bar-label {
  font-size: 0.8125rem;
  white-space: nowrap;
  color: var(--gray-700);
}

.rating-bar-label i {
  font-size: 0.7rem;
  color: #f5b301;
}

.rating-bar {
  display: block;
  height: 8px;
  overflow: hidden;
  background: #e9ecef;
  border-radius: 999px;
}

.rating-bar b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f5b301, #f7c948);
  border-radius: 999px;
}

.rating-bar-row > small {
  font-size: 0.8125rem;
  text-align: right;
  color: var(--gray-700);
}

/* --- Profile page responsive --- */
@media (max-width: 991.98px) {
  .company-top-grid {
    grid-template-columns: 1fr;
  }

  .rating-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .company-cover {
    height: 120px;
  }

  .company-hero-card {
    padding: 1.25rem;
  }

  /* Logo floats as a compact square; the title and intro text wrap around it
     instead of the logo reserving a full-height column */
  .company-identity {
    display: block;
    overflow: hidden;
  }

  .company-logo {
    float: left;
    width: 64px;
    height: 64px;
    margin: 0.15rem 1rem 0.5rem 0;
  }

  .company-heading h1 {
    font-size: 1.375rem;
  }

  .company-intro {
    font-size: 1rem;
  }

  /* Contact chips: keep only icon + value (the label is obvious from the icon),
     so the chips stay compact and fill the row one after another */
  .company-contact__label {
    display: none;
  }
}

.job-postings h2,
.company-reviews h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Company Card */
.company-card {
  background: var(--color-white);
  border: 2px solid #dee2e6;
  border-radius: var(--radius);
  padding: 1rem;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-fast) var(--ease);
  outline: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

.company-card:hover {
  border: 2px solid transparent;
  background: linear-gradient(var(--color-white), var(--color-white)) padding-box,
              var(--brand-grad) border-box;
  border-radius: var(--radius);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--elev-1);
}

.company-card:focus {
  outline: none !important;
  box-shadow: var(--elev-1) !important;
  border: 2px solid transparent;
  background: linear-gradient(var(--color-white), var(--color-white)) padding-box,
              var(--brand-grad) border-box;
  border-radius: var(--radius);
}

/* Gradient title on hover */
.company-card:hover .company-card__title,
.company-card:focus .company-card__title {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Company card title */
.company-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-black);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 0rem;
}

/* Company card meta */
.company-card__meta {
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  height: auto;
  overflow: hidden;
  line-height: 1.4;
}

/* Company card salary/counts */
.company-card__counts {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-blue);
  margin-bottom: 0.75rem;
  height: auto;
}

/* Company card badges */
.company-card__badges {
  margin-top: auto;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  overflow: hidden;
}

.company-card__badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius);
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

.company-card__badge--hot {
  background: rgba(229, 57, 53, 0.1);
  color: var(--color-red);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .company-card {
    padding: 0.75rem;
  }
  
  .company-card__title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .company-card__meta {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }
  
  .company-card__counts {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
  }
  
  .company-card__badge {
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
    margin-right: 0.25rem;
    margin-bottom: 0.125rem;
  }
}

@media (min-width: 768px) {
  .company-card {
    /* min-height: 220px; */
  }
}