/* Archiv novin (PDF) – frontend styles
   Scoped under .anv-archive to avoid collisions with the theme.
*/

.anv-archive{
  --anv-bg: #ffffff;
  --anv-surface: #ffffff;
  --anv-surface-2: #f6f7f9;
  --anv-border: rgba(17,24,39,.12);
  --anv-text: #111827;
  --anv-muted: rgba(17,24,39,.65);
  --anv-link: #0b57d0;
  --anv-radius: 0;
  --anv-radius-sm: 0;
  --anv-shadow: 0 10px 24px rgba(17,24,39,.10);
  --anv-shadow-sm: 0 6px 14px rgba(17,24,39,.10);
  --anv-gap: 14px;
  /* Force light UI for native form controls even if the OS/browser prefers dark mode. */
  color-scheme: light;
  color: var(--anv-text);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 900px){
  .anv-archive{ padding: 0; }
}

/*
  Dark mode styling was intentionally removed.
  Reason: the archive should render consistently (light) regardless of user's OS/browser theme.
  NOTE: If a visitor uses a forced-dark browser extension (e.g. Dark Reader), it may still invert colors.
*/

/* Filters */
.anv-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--anv-border);
  border-radius: var(--anv-radius);
  background: var(--anv-surface);
  box-shadow: var(--anv-shadow-sm);
  margin: 0 0 14px;
}

.anv-filter{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--anv-muted);
  min-width: 160px;
}

.anv-filter-label{ display:none; }

.anv-filters select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px 36px 10px 12px;
  border-radius: 0;
  border: 1px solid var(--anv-border);
  background: var(--anv-surface-2);
  color: var(--anv-text);
  font-size: 14px;
  line-height: 1.2;
  outline: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.anv-filters select:focus{
  box-shadow: 0 0 0 3px rgba(11,87,208,.18);
  border-color: rgba(11,87,208,.45);
}

.anv-filters button{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(11,87,208,.35);
  background: rgba(11,87,208,.10);
  color: var(--anv-text);
  font-weight: 600;
  cursor: pointer;
}

.anv-filters button:hover{ filter: brightness(1.02); }

/* If JS is enabled we auto-submit; hide the button to reduce clutter */
.anv-archive.anv-js .anv-filters button{ display:none; }

@media (max-width: 600px){
  .anv-filter{ min-width: 100%; }
  .anv-filters select{ width: 100%; }
}

/* Toolbar */
.anv-toolbar{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.anv-toggle{
  border: 1px solid var(--anv-border);
  background: transparent;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--anv-muted);
  font-size: 13px;
}

.anv-toggle:hover{ color: var(--anv-text); border-color: rgba(17,24,39,.22); }

/* Hide toolbar if JS not present (buttons would do nothing) */
.anv-archive:not(.anv-js) .anv-toolbar{ display:none; }

/* Year group */
.anv-year{
  font-size: 20px;
  font-weight: 800;
  margin: 18px 0 10px;
}

.anv-year-group{
  border: 1px solid var(--anv-border);
  border-radius: var(--anv-radius);
  background: var(--anv-surface);
  box-shadow: var(--anv-shadow-sm);
  margin: 18px 0;
  overflow: clip;
}

.anv-year-group > summary.anv-year{
  margin: 0;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.anv-year-group > summary::-webkit-details-marker{ display:none; }

.anv-year-group > summary.anv-year::after{
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: .55;
}

.anv-year-group[open] > summary.anv-year::after{ transform: rotate(45deg); opacity: .9; }

/* Month group */
.anv-month{
  border-top: 1px solid var(--anv-border);
}

.anv-month-title{
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  font-weight: 700;
}

.anv-month > summary::-webkit-details-marker{ display:none; }

.anv-month-title::before{
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: .45;
  margin-right: 6px;
}

.anv-month[open] > summary.anv-month-title::before{ transform: rotate(45deg); opacity: .85; }

.anv-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--anv-border);
  color: var(--anv-muted);
  font-weight: 700;
  font-size: 12px;
}

.anv-month-body{ padding: 0 16px 16px; }

/* Issues grid */
.anv-issues{
  display: grid;
  /* Keep cards from stretching when there are only a few items in a row */
  grid-template-columns: repeat(auto-fill, minmax(150px, 206px));
  gap: var(--anv-gap);
  margin-top: 12px;
 justify-content: start;
}

@media (max-width: 520px){
  .anv-issues{ grid-template-columns: 1fr; }
}

.anv-issue{
  border: 1px solid var(--anv-border);
  border-radius: var(--anv-radius);
  background: var(--anv-surface);
  overflow: clip;
  box-shadow: 0 1px 0 rgba(17,24,39,.02);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  min-height: 92px;
}

/* Whole card is clickable */
.anv-issue-link{
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.anv-issue:hover{
  transform: translateY(-1px);
  box-shadow: var(--anv-shadow-sm);
  border-color: rgba(11,87,208,.28);
}

.anv-thumb{
  width: 100%;
  aspect-ratio: 210 / 297;
  background: var(--anv-surface-2);
  overflow: hidden;
  border-bottom: 1px solid var(--anv-border);
}

.anv-thumb-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.anv-issue-body{
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.anv-area{
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 0; 
  color: var(--anv-text);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
    font-family: "Oswald", sans-serif;
}

.anv-title-link{
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--anv-muted);
  font-weight: 400;
  line-height: 1.25;
  font-size: 14px;
}

.anv-issue-link:hover .anv-title-link{ color: var(--anv-link); }

.anv-title-link .anv-icon{
  flex: 0 0 auto;
  margin-top: 1px;
  opacity: .8;
}

.anv-title-link span{
  display: inline;
}

.anv-missing{
  color: rgba(179,45,46,.95);
  font-weight: 700;
  font-size: 13px;
}

/* Accessibility */
.anv-archive a:focus,
.anv-archive button:focus,
.anv-archive select:focus,
.anv-archive summary:focus{
  outline: none;
}

.anv-archive a:focus-visible,
.anv-archive button:focus-visible,
.anv-archive select:focus-visible,
.anv-archive summary:focus-visible{
  box-shadow: 0 0 0 3px rgba(11,87,208,.22);
  border-radius: 0;
}
