/* =============================================================================
   Interactive Map — [interactive_item] card grid
   ============================================================================= */

/* Role filter bar (above the grid)
   --------------------------------------------------------------------------- */
.imap-filter-bar {
	display:     flex;
	align-items: center;
	gap:         8px;
	flex-wrap:   wrap;
	margin-bottom: 4px;
}

.imap-filter-btn {
	display:      inline-flex;
	align-items:  center;
	gap:          6px;
	padding:      6px 14px;
	border-radius: 20px;
	border:       1.5px solid #ddd;
	background:   #fff;
	color:        #555;
	font-size:    13px;
	font-weight:  500;
	cursor:       pointer;
	white-space:  nowrap;
	transition:   background 0.15s, border-color 0.15s, color 0.15s;
	line-height:  1.4;
}

.imap-filter-btn:hover {
	border-color: var( --role-color, #0073aa );
	color:        var( --role-color, #0073aa );
}

.imap-filter-btn.is-active {
	background:   var( --role-color, #1d2327 );
	border-color: var( --role-color, #1d2327 );
	color:        #fff;
}

.imap-filter-count {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	background:      rgba( 0, 0, 0, 0.12 );
	border-radius:   10px;
	font-size:       10px;
	font-weight:     700;
	min-width:       18px;
	height:          18px;
	padding:         0 4px;
	line-height:     1;
}

.imap-filter-btn.is-active .imap-filter-count {
	background: rgba( 255, 255, 255, 0.25 );
}

/* Grid
   --------------------------------------------------------------------------- */
.imap-items-grid {
	display:               grid;
	grid-template-columns: repeat( var( --imap-cols, 3 ), 1fr );
	gap:                   28px;
	margin:                24px 0;
}

/* Card
   --------------------------------------------------------------------------- */
.imap-item-card {
	background:    #fff;
	border-radius: 14px;
	box-shadow:    0 2px 10px rgba( 0, 0, 0, 0.07 ), 0 1px 3px rgba( 0, 0, 0, 0.05 );
	overflow:      hidden;
	position:      relative;
	text-align:    center;
	transition:    transform 0.2s ease, box-shadow 0.2s ease;
}

.imap-item-card:hover {
	transform:  translateY( -4px );
	box-shadow: 0 10px 28px rgba( 0, 0, 0, 0.11 ), 0 3px 8px rgba( 0, 0, 0, 0.07 );
}

/* Banner — top colored zone containing the company logo
   --------------------------------------------------------------------------- */
.imap-item-banner {
	height:          150px;
	display:         flex;
	align-items:     center;
	justify-content: center;
	overflow:        hidden;
	position:        relative;
	/* background-color set via inline style (role color or default) */
}

/* Subtle inner vignette so logos blend nicely regardless of banner color */
.imap-item-banner::after {
	content:    '';
	position:   absolute;
	inset:      0;
	background: linear-gradient( 180deg, transparent 50%, rgba( 0, 0, 0, 0.18 ) 100% );
	pointer-events: none;
}

.imap-item-logo {
	display:    block;
	max-width:  70%;
	max-height: 90px;
	object-fit: contain;
	position:   relative; /* above the ::after vignette */
	z-index:    1;
}

/* Initial letter shown when there is no logo */
.imap-item-logo-initial {
	font-size:   72px;
	font-weight: 900;
	line-height: 1;
	color:       rgba( 255, 255, 255, 0.20 );
	user-select: none;
	position:    relative;
	z-index:     1;
	letter-spacing: -0.04em;
}

/* Avatar circle — shows contact initials, overlaps banner bottom
   --------------------------------------------------------------------------- */
.imap-item-avatar {
	width:         150px;
	height:        150px;
	border-radius: 50%;
	border:        4px solid #fff;
	box-shadow:    0 2px 10px rgba( 0, 0, 0, 0.18 );
	display:       flex;
	align-items:   center;
	justify-content: center;
	margin:        25px auto 0; /* pull up by half height to overlap banner */
	position:      relative;
	z-index:       2;
	flex-shrink:   0;
}

.imap-item-initials {
	color:          #fff;
	font-size:      22px;
	font-weight:    700;
	letter-spacing: -0.03em;
	line-height:    1;
	text-transform: uppercase;
}

/* When a real contact photo is available — no background color needed */
.imap-item-avatar--photo {
	background: #e8e8e8; /* neutral fallback while image loads */
	overflow:   hidden;
}

.imap-item-avatar-photo {
	display:    block;
	width:      100%;
	height:     100%;
	object-fit: cover;
}

/* Body — content below the avatar
   --------------------------------------------------------------------------- */
.imap-item-body {
	display:        flex;
	flex-direction: column;
	align-items:    center;
	gap:            10px;
	padding:        14px 20px 22px;
}

/* Company name
   --------------------------------------------------------------------------- */
.imap-item-name {
	margin:      0;
	font-size:   25px;
	font-weight: 700;
	color:       #1d2327;
	line-height: 1.3;
}

/* Sector badge (below company name, above activity)
   --------------------------------------------------------------------------- */
.imap-item-sector {
	display:        inline-block;
	background:     #f0f4f8;
	color:          #4a5568;
	font-size:      10px;
	font-weight:    700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding:        3px 9px;
	border-radius:  10px;
	border:         1px solid #e2e8f0;
}

/* Activity line (below company name)
   --------------------------------------------------------------------------- */
.imap-item-activity {
	margin:      0;
	font-size:   15px;
	color:       #0073aa;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Contact block
   --------------------------------------------------------------------------- */
.imap-item-contact {
	display:        flex;
	flex-direction: column;
	align-items:    center;
	gap:            2px;
}

.imap-item-contact-name {
	font-size:   16px;
	font-weight: 600;
	color:       #3c434a;
}

.imap-item-contact-job {
	font-size:  14px;
	color:      #8c909a;
	font-style: normal;
}

/* Action buttons — circular icon links
   --------------------------------------------------------------------------- */
.imap-item-actions {
	display:         flex;
	align-items:     center;
	justify-content: center;
	gap:             10px;
	margin-top:      4px;
}

.imap-item-action {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	width:           42px;
	height:          42px;
	border-radius:   50%;
	color:           #fff !important;
	text-decoration: none;
	transition:      background 0.15s, transform 0.15s, box-shadow 0.15s;
	flex-shrink:     0;
	box-shadow:      0 2px 6px rgba( 0, 0, 0, 0.14 );
}

.imap-item-action:hover {
	transform:  scale( 1.1 );
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.22 );
}

.imap-item-email              { background: #0073aa; }
.imap-item-email:hover        { background: #005a87; }

.imap-item-phone              { background: #27ae60; }
.imap-item-phone:hover        { background: #1e8449; }

.imap-item-map                { background: #e74c3c; }
.imap-item-map:hover          { background: #c0392b; }

.imap-item-web                { background: #8e44ad; }
.imap-item-web:hover          { background: #6c3483; }

/* Empty state
   --------------------------------------------------------------------------- */
.imap-items-empty {
	color:      #888;
	font-style: italic;
	padding:    20px 0;
}

/* Responsive — column count capped at each breakpoint
   (overrides the desktop --imap-cols value set by the shortcode)
   --------------------------------------------------------------------------- */
@media ( max-width: 1100px ) {
	.imap-items-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 768px ) {
	.imap-items-grid {
		grid-template-columns: repeat( 2, 1fr );
		gap: 18px;
	}
}

@media ( max-width: 480px ) {
	.imap-items-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}
