/* ==========================================================================
   ServiceDZ — Archive Visual Layer (compatibility shim)
   ==========================================================================

   Version 5 — reduced from the previous v3+v4 combined layer.

   ── Why this file is now small ─────────────────────────────────────────────

   Before the archive refactor, this file provided a *shared* visual layer
   for every archive page:

     .sdz-archive-wrapper          (procedure, document, letter, faq)
     .sdz-archive-faq              (faq)
     .sdz-es-archive               (eservice)
     .sdz-authorities-container    (authority)
     .sdz-archive-sp               (service point)

   Each archive template now owns its scoped CSS under a dedicated root
   class:

     .sdz-procedure-archive        (procedure)
     .sdz-document-archive         (document)
     .sdz-faq-archive              (faq)
     .sdz-authority-archive        (authority)
     .sdz-eservice-archive         (eservice)
     .sdz-service-point-archive    (service point)
     .sdz-letter-archive           (letter)
     .sdz-archive-fallback         (consulate / state / district / municipality)

   As a result, the old v3 and v4 selectors in this file no longer match
   any real HTML, and the ~60 !important overrides that used to fight the
   template styles are no longer needed.

   ── What remains here ──────────────────────────────────────────────────────

   1. A single body-level guard that gives archive pages the ServiceDZ
      background. Kept intentionally narrow: matches only the archive
      body classes WordPress generates for ServiceDZ CPTs.

   2. Legacy letter-card classes still emitted by:
        templates/archive-letter.php
        includes/ajax/ajax-letter.php

      The letter template styles these through `.sdz-letter-archive` scope
      on its own page, but keeping a minimal standalone definition here
      makes the card reusable elsewhere (widgets, related lists, future
      shortcodes) without dragging in the whole letter archive stylesheet.

   3. prefers-reduced-motion reset scoped to the legacy classes only.

   ── What remains owned elsewhere ───────────────────────────────────────────

     Archive-specific visuals  → each template's inline <style>
     Global design tokens      → assets/css/design-system.css
     Progressive enhancement   → assets/css/frontend-enhancements.css
     Icons                     → assets/css/icon-system.css
     Shared widgets            → assets/css/premium-ui.css
                               → assets/css/experience-redesign.css

   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Body-level archive background
   -------------------------------------------------------------------------- */

body.post-type-archive-procedure,
body.post-type-archive-document,
body.post-type-archive-faq,
body.post-type-archive-authority,
body.post-type-archive-eservice,
body.post-type-archive-service_point,
body.post-type-archive-letter,
body.post-type-archive-consulate,
body.post-type-archive-state,
body.post-type-archive-district,
body.post-type-archive-municipality {
	background: var(--sdz-background, #f7f9fc);
}

/* --------------------------------------------------------------------------
   2. Legacy letter-card classes
      Still emitted by templates/archive-letter.php and its AJAX handler.
      Kept minimal and self-contained so the card works outside the
      .sdz-letter-archive scope too.
   -------------------------------------------------------------------------- */

.sdz-archive-redesign-v4-link {
	display: block;
	min-width: 0;
	height: 100%;
	color: inherit;
	text-decoration: none;
	outline: none;
}

.sdz-archive-redesign-v4-link:focus-visible {
	border-radius: 14px;
	outline: 3px solid rgba(240, 180, 41, 0.4);
	outline-offset: 3px;
}

.sdz-archive-redesign-v4-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	padding: 20px;
	border: 1px solid var(--sdz-border, #e4e8ef);
	border-radius: 14px;
	background: var(--sdz-surface, #ffffff);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
	overflow: hidden;
	transition:
		transform 200ms ease,
		border-color 200ms ease,
		box-shadow 200ms ease;
}

.sdz-archive-redesign-v4-link:hover .sdz-archive-redesign-v4-card,
.sdz-archive-redesign-v4-link:focus-visible .sdz-archive-redesign-v4-card {
	transform: translateY(-4px);
	border-color: #c9d9d0;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.sdz-archive-type-letter .sdz-card-accent {
	position: absolute;
	top: 0;
	inset-inline: 0;
	height: 3px;
	background: linear-gradient(
		90deg,
		transparent,
		var(--sdz-primary, #006B3F),
		transparent
	);
	opacity: 0;
	transition: opacity 200ms ease;
	pointer-events: none;
}

.sdz-archive-redesign-v4-link:hover .sdz-card-accent,
.sdz-archive-redesign-v4-link:focus-visible .sdz-card-accent {
	opacity: 1;
}

/* --------------------------------------------------------------------------
   3. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.sdz-archive-redesign-v4-link,
	.sdz-archive-redesign-v4-card,
	.sdz-archive-type-letter .sdz-card-accent {
		transform: none !important;
		transition: none !important;
	}
}