/*
 * SPDX-FileCopyrightText: 2023-2025 Legadilo contributors
 *
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

:root {
  --content-footer-height: 104px;
  --content-mobile-footer-height: 248px;
  --content-header-height: 56px;
}

html {
  scroll-padding-top: var(--content-header-height);
}

.content-body {
  display: grid;
  grid-template: "main" 1fr "footer" var(--content-mobile-footer-height) / 1fr;
  min-height: 100vh;
}

.content-footer {
  height: var(--content-mobile-footer-height);
  background-color: var(--bs-dark);
}

[data-bs-theme="dark"] .content-footer {
  background-color: var(--bs-tertiary-bg);
}

.content-body > .content-main-container {
  grid-area: main;
  padding-bottom: 2rem;
}

.content-body > .content-footer {
  grid-area: footer;
}

#reading-list-group,
#article-side-actions,
#article-side-toc {
  position: fixed;
  width: 15.5%;
}

.bi {
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentcolor;
}

.btn-primary img.bi,
.btn-danger img.bi {
  filter: invert(1) !important;
}

[data-bs-theme="dark"] img.bi {
  filter: invert(0.715);
}

.htmx-indicator,
.icon-indicator .indicator {
  display: none;
  opacity: 0;
}

.htmx-request.htmx-indicator,
.htmx-request .icon-indicator .indicator {
  display: inline;
  opacity: 1;
  transition: opacity 200ms ease-in;
}

.htmx-request.icon-indicator .bi {
  display: none;
}

.htmx-request.htmx-indicator,
.htmx-request.icon-indicator .indicator {
  display: inline;
  opacity: 1;
  transition: opacity 200ms ease-in;
}

.infinite-scrolling-icon-indicator {
  height: 60px;
  text-align: center;
}

.infinite-scrolling-icon-indicator img {
  max-height: 100%;
}

.read-on-scroll-even-bottom {
  height: 100vh;
}

.article-card-container.htmx-swapping {
  opacity: 0;
  max-height: 0;
  transition:
    opacity 1s ease-out,
    max-height 1s ease-out;
}

.refresh-btn {
  right: 0.5rem;
  bottom: 0.5rem;
  width: max-content;
  margin-left: auto;
  display: block;
}

@media (width >= 768px) {
  .article-card-container {
    max-height: 500px;
  }

  .card main {
    max-height: 200px;
    overflow-y: hidden;
  }

  .card main img {
    max-height: 200px;
  }
}

@media (width >= 768px) {
  .content-body {
    grid-template: "main" 1fr "footer" var(--content-footer-height) / 1fr;
  }

  .content-footer {
    height: var(--content-footer-height);
  }
}

/* For the theme switcher */
svg.bi {
  width: 1rem;
  height: 1rem;
}

.bd-navbar .dropdown-menu .active .bi {
  display: block !important;
}

/* For the honeypot field */
input[name="email_address_confirmation"] {
  position: absolute;
  right: -9999px;
}
