/* === Linklist – System 6 Retro Overrides === */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Desktop wrapper centres the window */
.linklist-desktop {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* Window chrome */
.linklist-window {
  width: 100%;
  margin: 0;
}

.linklist-window .title-bar {
  position: relative;
}

.linklist-window .title-bar .close {
  display: block;
  background-color: #fff;
  border: 4px solid #000;
  cursor: pointer;
  height: 40px;
  width: 40px;
  margin: 0 0.2rem;
  position: relative;
  transform: scale(0.5);
  text-decoration: none;
}

.linklist-window .title-bar .close::before,
.linklist-window .title-bar .close::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
}

.linklist-window .title-bar .close::before {
  background:
    linear-gradient(#000, #000) 0,
    linear-gradient(#000, #000) 100%,
    linear-gradient(#000, #000) top,
    linear-gradient(#000, #000) bottom;
  background-repeat: no-repeat;
  background-size: 30% 4px, 30% 4px, 4px 30%, 4px 30%;
}

.linklist-window .title-bar .close::after {
  background:
    linear-gradient(#000, #000) 0,
    linear-gradient(#000, #000) 100%,
    linear-gradient(#000, #000) top,
    linear-gradient(#000, #000) bottom;
  background-repeat: no-repeat;
  background-size: 22.5% 3.64px, 22.5% 3.64px, 3.64px 22.5%, 3.64px 22.5%;
  transform: rotate(45deg) scale(1.1);
}

.linklist-window .title-bar .close:hover::before,
.linklist-window .title-bar .close:hover::after,
.linklist-window .title-bar .close:active::before,
.linklist-window .title-bar .close:active::after {
  opacity: 1;
}

/* Window pane: scrollable content area */
.linklist-pane {
  padding: 1.25rem 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 6rem);
}

/* Logo */
.linklist-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.linklist-logo img {
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* Entry list */
.linklist-entries {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Each link entry as a system.css button */
.linklist-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.125rem 0.375rem;
  text-decoration: none;
  color: #000;
  font-family: Chicago_12, Chicago, 'Lucida Grande', sans-serif;
  font-size: 18px;
  line-height: 1.3;
  cursor: pointer;
  min-height: 44px;
  text-align: left;
  /* Match thumbnail corners; avoid overflow:hidden so system.css border-image isn’t clipped */
  border-radius: 4px;
}

/* Subtle hover; :active keeps inverted “pressed” look */
.linklist-btn:hover,
.linklist-btn:focus-visible {
  background: #d8d8d8;
  color: #000;
  border-radius: 4px;
}

.linklist-btn:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.linklist-btn:active {
  background: #000;
  color: #fff;
  border-radius: 4px;
}

.linklist-btn:active .linklist-btn-img {
  filter: invert(1);
}

.linklist-btn.is-disabled {
  pointer-events: none;
  opacity: 0.45;
  cursor: default;
}

/* Thumbnail image inside button */
.linklist-btn-img {
  box-sizing: content-box;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: cover;
  image-rendering: auto;
  border: none;
  border-radius: 4px;
}

.linklist-btn-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Empty state */
.linklist-empty {
  font-family: Geneva_9, Geneva, 'Lucida Grande', sans-serif;
  font-size: 14px;
  text-align: center;
  padding: 2rem 0;
}

/* Back link at the bottom */
.linklist-back {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1.5px dotted #000;
  text-align: center;
}

.linklist-back .btn {
  font-size: 14px;
  text-decoration: none;
}

.linklist-back-arrow {
  display: inline-block;
  font-size: 1.45em;
  line-height: 1;
  vertical-align: -0.1em;
  margin-right: 0.15em;
}

/* Footer with company info (from site()->firma_content()) */
.linklist-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1.5px dotted #000;
  text-align: center;
  font-family: Chicago_12, Chicago, 'Lucida Grande', sans-serif;
  font-size: 20px;
  line-height: 1.5;
}

.linklist-footer p {
  margin: 0;
}

.linklist-footer a {
  color: #000;
}

.linklist-footer a:hover {
  background: #000;
  color: #fff;
}

/* Legal links (from site()->footer_links()) */
.linklist-legal {
  margin-top: 1.5rem;
  text-align: center;
  font-family: Chicago_12, Chicago, 'Lucida Grande', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.linklist-legal p {
  margin: 0;
}

.linklist-legal a {
  color: #000;
}

.linklist-legal a:hover {
  background: #000;
  color: #fff;
}

/* Footer meta text (copyright) */
.linklist-footer-copyright {
  margin: 0;
  text-align: center;
  font-family: Geneva_9, Geneva, 'Lucida Grande', sans-serif;
  font-size: 20px;
  line-height: 1.4;
  margin-top: 1.25rem;
}

/* Responsive tweaks */
@media (max-width: 560px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .linklist-desktop {
    max-width: none;
  }

  .linklist-window {
    border-left: none;
    border-right: none;
    min-width: 0;
  }

  .linklist-pane {
    max-height: none;
  }
}
