/* =============================================================================
   SIDEBAR LOGOS — THG (Tallinna Haabersti Gümnaasium)
   Sidebar vertical layout (news/article pages) + front page horizontal strip.
   Sidebar classes: sl-sidebar, paragraph--type--sidebar-logo-item
   Front page classes: fp-logos, fp-logos__strip, fp-logos__item
   ============================================================================= */

/* ── SIDEBAR — Vertical layout (sidebar_first region) ─────────────────────── */

.sl-sidebar {
  padding: 1.5rem 1rem;
}

.sl-sidebar .block-title,
.sl-sidebar h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--thg-green-forest, #2d5a30);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--thg-orange, #e8720c);
}

.sl-sidebar .paragraph--type--sidebar-logo-item {
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sl-sidebar .paragraph--type--sidebar-logo-item:last-child {
  border-bottom: none;
}

/* ── SIDEBAR — Image theming ──────────────────────────────────────────────── */

.sl-sidebar .paragraph--type--sidebar-logo-item img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: grayscale(30%);
  opacity: 0.85;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  vertical-align: middle;
}

.sl-sidebar .paragraph--type--sidebar-logo-item a:hover img,
.sl-sidebar .paragraph--type--sidebar-logo-item img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

/* ── SIDEBAR — Link reset (overrides style.css animated-underline selectors) ─
   style.css targets: .block__content a:not(.btn)..., .field__item a:not(.btn)...
   These are inside .sl-sidebar, so we match: .sl-sidebar .block__content a, etc.
   Using !important to beat the long :not() chains.
   ──────────────────────────────────────────────────────────────────────────── */

.sl-sidebar a,
.sl-sidebar .block__content a,
.sl-sidebar .field__item a,
.sl-sidebar .paragraph--type--sidebar-logo-item a {
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  color: inherit !important;
  text-decoration: none !important;
  display: inline-block;
}

.sl-sidebar a:hover,
.sl-sidebar .block__content a:hover,
.sl-sidebar .field__item a:hover,
.sl-sidebar .paragraph--type--sidebar-logo-item a:hover {
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  text-decoration: none !important;
}


/* ── FRONT PAGE — Horizontal logo strip ───────────────────────────────────── */

.fp-logos {
  padding: 60px 0 80px;
  background: var(--thg-body-bg, #f8f7f4);
}

.fp-logos__strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem 3rem;
}

.fp-logos__item {
  text-align: center;
  flex: 0 0 auto;
}

/* ── FRONT PAGE — Image theming ───────────────────────────────────────────── */

.fp-logos__item img {
  max-width: 140px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(40%);
  opacity: 0.75;
  transition: filter 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
  vertical-align: middle;
}

.fp-logos__item a:hover img,
.fp-logos__item img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.08);
}

/* ── FRONT PAGE — Link reset ──────────────────────────────────────────────── */

.fp-logos__item a,
.fp-logos .fp-logos__item a {
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  color: inherit !important;
  text-decoration: none !important;
  display: inline-block;
}

.fp-logos__item a:hover,
.fp-logos .fp-logos__item a:hover {
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  text-decoration: none !important;
}


/* ── DARK MODE ────────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] .sl-sidebar .block-title,
[data-bs-theme="dark"] .sl-sidebar h2 {
  color: #a8d5aa;
}

[data-bs-theme="dark"] .sl-sidebar .paragraph--type--sidebar-logo-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .sl-sidebar .paragraph--type--sidebar-logo-item img {
  filter: grayscale(30%) brightness(0.9);
  opacity: 0.8;
}

[data-bs-theme="dark"] .sl-sidebar .paragraph--type--sidebar-logo-item a:hover img,
[data-bs-theme="dark"] .sl-sidebar .paragraph--type--sidebar-logo-item img:hover {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
}

/* Dark mode link reset for sidebar */
[data-bs-theme="dark"] .sl-sidebar a,
[data-bs-theme="dark"] .sl-sidebar .block__content a,
[data-bs-theme="dark"] .sl-sidebar .field__item a {
  background-image: none !important;
  background-size: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  color: inherit !important;
  text-decoration: none !important;
}

[data-bs-theme="dark"] .sl-sidebar a:hover,
[data-bs-theme="dark"] .sl-sidebar .block__content a:hover,
[data-bs-theme="dark"] .sl-sidebar .field__item a:hover {
  background-image: none !important;
  background-size: 0 !important;
}

[data-bs-theme="dark"] .fp-logos {
  background: #111814;
}

[data-bs-theme="dark"] .fp-logos__item img {
  filter: grayscale(40%) brightness(0.85);
  opacity: 0.7;
}

[data-bs-theme="dark"] .fp-logos__item a:hover img,
[data-bs-theme="dark"] .fp-logos__item img:hover {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
}


/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */

/* Sidebar becomes horizontal on tablet when below content */
@media (max-width: 991.98px) {
  .sl-sidebar .field--name-field-sidebar-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
  }

  .sl-sidebar .paragraph--type--sidebar-logo-item {
    border-bottom: none;
    padding: 0.5rem;
  }

  .sl-sidebar .paragraph--type--sidebar-logo-item img {
    max-width: 120px;
    max-height: 60px;
  }
}

/* Front page logos shrink on mobile */
@media (max-width: 575.98px) {
  .fp-logos {
    padding: 40px 0 50px;
  }

  .fp-logos__strip {
    gap: 1.25rem 2rem;
  }

  .fp-logos__item img {
    max-width: 100px;
    max-height: 50px;
  }
}
