/* Existing Styles */
.anv-viewer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}
.anv-pdf-display {
  flex: 3;
  min-width: 300px;
}
.anv-pdf-display embed {
  border: 1px solid #ccc;
}
.anv-archive {
  flex: 1;
  min-width: 200px;
}
.anv-archive h3 {
  margin-top: 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}
.anv-archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.anv-archive-list li {
  margin-bottom: 5px;
}
/* Base link structure */
.anv-archive-link {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #eee;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

/* --- FORCEFUL STYLES TO OVERRIDE THEME --- */

/* Default state for all links (including visited) */
.anv-archive-link:link,
.anv-archive-link:visited {
    background-color: #f9f9f9 !important;
    color: #555 !important;
    font-weight: normal !important;
}

/* Hover state for non-active links */
.anv-archive-link:hover {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

/* Active state (overrides everything else) */
.anv-archive-link.active,
.anv-archive-link.active:hover {
    background-color: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
    font-weight: bold !important;
}

/* NEW Subscription Form Styles */
.anv-subscribe-section {
  width: 100%;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}
#anv-subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 500px;
}
#anv-subscribe-email {
  flex-grow: 1;
  padding: 8px;
}
#anv-subscribe-message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 4px;
  display: none;
}
#anv-subscribe-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}
#anv-subscribe-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.anv-pdf-scroll-wrapper {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    height: 800px; /* Match the height of the iframe */
    border: 1px solid #ddd;
}

.anv-pdf-scroll-wrapper iframe {
    border: none;
}

.anv-pdf-display-fallback {
    text-align: center;
    border: 2px dashed #ccc;
    padding: 30px;
    background: #f9f9f9;
}
#anv-pdf-link {
    display: inline-block;
    padding: 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}
#anv-pdf-link:hover {
    background: #005a87;
}
#anv-pdf-thumb {
    max-width: 200px;
    height: auto;
    border: 1px solid #ddd;
    display: block;
    margin: 0 auto 15px;
}

/* --- Device Visibility CSS --- */

.anv-desktop-viewer,
.anv-mobile-viewer {
    flex: 3;
    min-width: 300px;
}

/* By default, show the desktop viewer and hide the mobile one */
.anv-mobile-viewer {
    display: none;
}
.anv-desktop-viewer {
    display: block;
}

/* On screens 1024px or less (tablets and phones) */
@media (max-width: 1294px) {
    .anv-desktop-viewer {
        display: none !important;
    }
    .anv-mobile-viewer {
        display: block !important;
    }
}