/* ==========================================================================
   Kingfish Blog — overview styles. Scoped under .kfb-root so nothing leaks
   into the theme/Divi. Tailwind (CDN on test, compiled on prod) supplies
   utilities; this file supplies the bespoke bits the prototype used.
   ========================================================================== */

/* APOC Normal — bundled, licensed display serif (matches thekingfishcompany.com) */
@font-face {
	font-family: 'Apoc Normal';
	font-display: swap;
	src: url('../fonts/apoc/apoc-normal.woff2') format('woff2'),
	     url('../fonts/apoc/apoc-normal.woff') format('woff'),
	     url('../fonts/apoc/apoc-normal.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
}

/* Full-bleed: let the pale background span the full viewport width even when
   nested inside the theme / Divi content container. Content stays centered
   via each section's own max-w-7xl + mx-auto. */
.kfb-root {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Reveal-on-scroll */
.kfb-root .reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.kfb-root .reveal.active { opacity: 1; transform: translateY(0); }

/* Image hover zoom */
.kfb-root .img-hover-zoom { overflow: hidden; }
.kfb-root .img-hover-zoom img { transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.kfb-root .group:hover .img-hover-zoom img { transform: scale(1.05); }

/* View toggle (grid / list) */
.kfb-root .view-toggle-btn { transition: all 0.2s ease; }
.kfb-root .view-toggle-btn.active { background: #0B1C2E; color: #fff; }
.kfb-root .view-toggle-btn:not(.active) { color: #9ca3af; }
.kfb-root .view-toggle-btn:not(.active):hover { color: #0B1C2E; }

/* List view — desktop baseline */
.kfb-root .list-view {
	grid-template-columns: 1fr !important;
	column-gap: 0 !important;
	row-gap: 1.25rem !important;
}
.kfb-root .list-view .article-card { flex-direction: row; gap: 1.5rem; align-items: flex-start; }
.kfb-root .list-view .article-card .card-image {
	width: 28%;
	max-width: 16rem;
	flex-shrink: 0;
	flex-grow: 0;
	margin-bottom: 0;
	aspect-ratio: 4 / 3;
	height: auto;
	align-self: flex-start;
}
.kfb-root .list-view .article-card .card-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; }

/* List view — mobile */
@media (max-width: 640px) {
	.kfb-root .list-view .article-card { gap: 1rem; align-items: stretch; }
	.kfb-root .list-view .article-card .card-image { width: 35%; aspect-ratio: auto; align-self: stretch; }
	.kfb-root .list-view .article-card h3 { min-height: 2.75em; }
}

/* Hidden scrollbar (pills row, if enabled) */
.kfb-root .no-scrollbar::-webkit-scrollbar { display: none; }
.kfb-root .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Trending / Most Read list */
.kfb-root .toc-link { transition: all 0.3s ease; }
.kfb-root .toc-link .toc-bar { transition: all 0.3s ease; }
.kfb-root .toc-link:hover .toc-bar { background-color: rgba(11, 28, 46, 0.4); }
.kfb-root .toc-link:hover .toc-title { color: #0B1C2E; }

/* --------------------------------------------------------------------------
   Theme/Divi reset overrides. Tailwind preflight is disabled (to protect the
   theme header/footer), so we strip the specific defaults that leak into our
   own elements: default list markers + Divi button chrome.
   -------------------------------------------------------------------------- */
.kfb-root ol,
.kfb-root ul { list-style: none !important; margin: 0; padding: 0; }

/* Grid/List toggle — clean segmented control (kill Divi button bg/shadow/border) */
.kfb-root .view-toggle-btn { background: transparent !important; box-shadow: none !important; border: 0 !important; }
.kfb-root .view-toggle-btn.active { background: #0B1D4D !important; color: #fff !important; }

/* Load More — transparent outlined pill (kill Divi button fill/shadow) */
.kfb-root #kfb-load-more {
	background: transparent !important;
	box-shadow: none !important;
	border: 1px solid rgba(11, 29, 77, 0.25) !important;
	color: #0B1D4D !important;
}
.kfb-root #kfb-load-more:hover { border-color: #0B1D4D !important; background: transparent !important; }

/* Inquiry card — keep heading/text light on the dark card (theme colours h-tags dark) */
.kfb-root [data-feature="inquiry-card"] h4 { color: #fff !important; }
.kfb-root [data-feature="inquiry-card"] p { color: #d1d5db !important; }

/* Most Read card outline — ensure the border renders over the theme */
.kfb-root .kfb-outline-card { border: 1px solid rgba(11, 29, 77, 0.25) !important; border-radius: 1rem; }

/* Delivery-heatmap DRAWER form — appended to <body> (outside .kfb-root).
   Force dark, visible text in case the theme styles form fields white. */
#delivery-heatmap-drawer .dh-label { color: #4b5563 !important; }
#delivery-heatmap-drawer .dh-input,
#delivery-heatmap-drawer .dh-select,
#delivery-heatmap-drawer .dh-textarea { color: #0B1C2E !important; }
#delivery-heatmap-drawer .dh-form-intro p { color: #6b7280 !important; }

/* --------------------------------------------------------------------------
   Mobile delivery medallion — floating mini delivery-map (MOBILE ONLY).
   Fixed to the viewport; sibling of .kfb-root so styles are NOT scoped under it.
   Hidden on desktop (>=769px). Flies in, hides on scroll-down, returns on up.
   -------------------------------------------------------------------------- */
.kfb-medallion {
	position: fixed;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	z-index: 990;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 24px;
	max-width: calc(100vw - 32px);
	background: #0a1733;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(11, 29, 77, 0.32);
	cursor: pointer;
	font-family: 'Lato', sans-serif;
	transition: transform 0.42s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.3s ease;
}
.kfb-medallion.kfb-hidden {
	transform: translate(-50%, 190%);
	opacity: 0;
	pointer-events: none;
}
.kfb-medallion .kfb-med-t1 {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #fff;
	white-space: nowrap;
}
.kfb-medallion .kfb-med-chev {
	flex: 0 0 auto;
	display: flex;
	color: rgba(255, 255, 255, 0.7);
}
.kfb-medallion .kfb-med-chev svg { width: 15px; height: 15px; }

/* Desktop: never show the medallion. */
@media (min-width: 769px) {
	.kfb-medallion { display: none !important; }
}

/* (Leaflet map overrides removed with the delivery heatmap — v0.9.0) */

/* --- Filter pills: semantic states (v0.10.1). Idle = transparent bg, solid navy
   border + navy text; Active = solid navy. Single source of truth #0B1D4D. --- */
.kfb-root .kfb-pill {
	border: 1px solid #0B1D4D;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.kfb-root .kfb-pill-idle { background: transparent; color: #0B1D4D; }
.kfb-root .kfb-pill-idle:hover { background: rgba(11, 29, 77, 0.08); }
.kfb-root .kfb-pill-active { background: #0B1D4D; color: #fff; }

/* --- Skeleton cards shown while a filter loads (mimic the article card) --- */
.kfb-root .kfb-skel-img { aspect-ratio: 4 / 3; border-radius: 0.75rem; margin-bottom: 1.25rem; }
.kfb-root .kfb-skel-line { height: 12px; border-radius: 6px; margin-bottom: 10px; }
.kfb-root .kfb-shimmer {
	background: linear-gradient(90deg, rgba(11, 29, 77, 0.07) 25%, rgba(11, 29, 77, 0.15) 50%, rgba(11, 29, 77, 0.07) 75%);
	background-size: 200% 100%;
	animation: kfb-shimmer 1.1s linear infinite;
}
@keyframes kfb-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .kfb-root .kfb-shimmer { animation: none; } }
