/* ============================================================
   AssetLens Insights — WordPress layer
   Sits on top of the main-site styles.css (tokens: --teal, --navy, …).
   Section 1 is copied verbatim from insights.html / the static
   article template so WordPress pages match them exactly.
   ============================================================ */

/* ---- 1. From insights.html + insights/article-template.html ---- */
.insight-card.card { display: block; text-decoration: none; color: inherit; }
.insight-card-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); background: rgba(53,145,138,0.1); padding: 4px 10px; border-radius: 4px; margin-bottom: 14px; }
.insight-card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.insight-card p { font-size: 0.92rem; color: var(--mid-grey); margin-bottom: 20px; line-height: 1.6; }
.insight-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; color: var(--mid-grey); border-top: 1px solid var(--light-grey); padding-top: 16px; }
.insight-readmore { color: var(--teal); font-weight: 600; }

.insight-article { max-width: 760px; margin: 0 auto; }
.insight-meta-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.insight-article h2 { font-size: 1.4rem; color: var(--navy); margin: 36px 0 16px; }
.insight-article h3 { font-size: 1.15rem; color: var(--navy); margin: 28px 0 12px; }
.insight-article p { font-size: 1rem; line-height: 1.85; color: var(--charcoal); margin-bottom: 18px; }
.insight-article ul, .insight-article ol { margin: 0 0 18px 0; padding-left: 22px; }
.insight-article li { font-size: 1rem; line-height: 1.8; color: var(--charcoal); margin-bottom: 8px; }
.insight-article blockquote { border-left: 4px solid var(--teal); padding: 4px 24px; margin: 24px 0; font-style: italic; color: var(--navy); }
.insight-article img { width: 100%; border-radius: 10px; margin: 24px 0; }
.insight-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--teal); text-decoration: none; margin-bottom: 24px; }
.insight-back:hover { color: var(--teal-dark); }
.insight-cta-box { margin-top: 48px; padding: 28px 32px; background: var(--bg-light); border-radius: 10px; border-left: 4px solid var(--teal); }

/* ---- 2. WordPress chrome ---- */
.al-main { display: block; }

.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .nav { top: 0; } }

.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; word-wrap: normal !important;
}
.al-skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100030;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600; transition: top var(--transition);
}
.al-skip-link:focus { top: 12px; color: #fff; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}

/* ---- 3. Banner ---- */
/* Photo banner: same rendering as insights.html (image at natural size). */
.hero-inner .section-label a { color: inherit; }
.hero-inner .section-label a:hover { color: var(--teal-light); }
.al-hero-article h1 { max-width: 900px; }
.al-hero .container { width: 100%; } /* auto margins in the flex column would otherwise shrink-wrap short titles */
.al-hero .breadcrumb { flex-wrap: wrap; }
.al-crumb-current { color: rgba(255,255,255,0.5) !important; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-dot { color: rgba(255,255,255,0.35); }
.hero-inner .insight-meta-row { margin-top: 8px; }

/* ---- 4. Listing: toolbar ---- */
.al-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 40px;
}
.al-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.al-filter {
  display: inline-flex; align-items: center;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--light-grey); background: var(--bg-white);
  font-size: 0.84rem; font-weight: 600; color: var(--charcoal);
  transition: all var(--transition);
}
.al-filter:hover { border-color: var(--teal); color: var(--teal); }
.al-filter.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }

.al-search { position: relative; flex: 0 1 300px; min-width: 220px; }
.al-search .fa { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mid-grey); font-size: 0.9rem; pointer-events: none; }
.al-search input[type="search"] {
  width: 100%; height: 42px; padding: 0 16px 0 38px;
  border: 1px solid var(--light-grey); border-radius: 999px;
  font-family: var(--font-main); font-size: 0.9rem; color: var(--charcoal);
  background: var(--bg-white); transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.al-search input[type="search"]:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(var(--teal-rgb),0.12); }

/* ---- 5. Listing: cards ---- */
.al-card { padding: 0; overflow: hidden; display: flex !important; flex-direction: column; height: 100%; }
.al-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--navy); }
.al-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.al-card:hover .al-card-media img { transform: scale(1.04); }
.al-card-placeholder {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 20px 24px;
  background: linear-gradient(135deg, var(--navy) 55%, var(--teal-dark) 100%);
}
.al-card-placeholder::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(var(--teal-rgb),0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--teal-rgb),0.12) 1px, transparent 1px);
  background-size: 36px 36px;
}
.al-card-placeholder span {
  position: relative; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.6);
}
.al-card-body { display: flex; flex-direction: column; flex: 1; padding: 28px 28px 24px; }
.al-card-body .insight-card-tag { align-self: flex-start; }
.al-card-body h3 { color: var(--navy); transition: color var(--transition); }
.al-card:hover .al-card-body h3 { color: var(--teal-dark); }
.al-card-body .insight-card-meta { margin-top: auto; gap: 12px; }
.al-card .insight-readmore { white-space: nowrap; }

/* Latest article — spans the full row */
.al-card-featured { grid-column: 1 / -1; flex-direction: row !important; }
.al-card-featured .al-card-media { flex: 0 0 56%; aspect-ratio: auto; min-height: 360px; }
.al-card-featured .al-card-body { padding: 44px 44px 36px; justify-content: center; }
.al-card-featured h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); margin-bottom: 14px; }
.al-card-featured p { font-size: 1rem; }
.al-card-featured .insight-card-meta { margin-top: 8px; }
.al-card-kicker {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mid-grey);
}
.al-card-kicker::before { content: ''; width: 24px; height: 2px; background: var(--teal); border-radius: 1px; }

/* ---- 6. Pagination ---- */
.al-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 56px; }
.al-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 42px; height: 42px; padding: 0 14px;
  border: 1px solid var(--light-grey); border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; color: var(--charcoal); background: var(--bg-white);
  transition: all var(--transition);
}
.al-pagination a.page-numbers:hover { border-color: var(--teal); color: var(--teal); }
.al-pagination .page-numbers.current { background: var(--teal); border-color: var(--teal); color: #fff; }
.al-pagination .page-numbers.dots { border-color: transparent; background: none; }

/* ---- 7. Empty state ---- */
.al-empty { text-align: center; max-width: 520px; margin: 24px auto; padding: 56px 32px; border: 1px dashed var(--light-grey); border-radius: 10px; }
.al-empty-icon { width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 12px; background: rgba(var(--teal-rgb),0.1); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.al-empty h2 { font-size: 1.35rem; margin-bottom: 10px; }
.al-empty .btn { margin-top: 8px; }

/* ---- 8. Article ---- */
.al-article-section { padding-top: 64px; }
.al-featured { margin: 0 0 32px; }
.al-featured img { margin: 0; aspect-ratio: 16 / 9; object-fit: cover; }
.al-featured figcaption, .al-content figcaption, .al-content .wp-element-caption {
  font-size: 0.82rem; color: var(--mid-grey); text-align: center; margin-top: 10px; line-height: 1.5;
}

.al-content { font-size: 1rem; color: var(--charcoal); }
.al-content > *:first-child { margin-top: 0; }
.al-content h2, .al-content h3 { scroll-margin-top: 96px; }
.al-content h4 { font-size: 1.02rem; color: var(--navy); margin: 24px 0 10px; }
.al-content h5, .al-content h6 { font-size: 0.95rem; color: var(--navy); margin: 20px 0 8px; }
.al-content a:not(.wp-block-button__link):not(.btn) { color: var(--teal-dark); text-decoration: underline; text-decoration-color: rgba(var(--teal-rgb),0.4); text-underline-offset: 3px; }
.al-content a:not(.wp-block-button__link):not(.btn):hover { color: var(--teal); text-decoration-color: var(--teal); }
.al-content strong { color: var(--navy); }
.al-content ul { list-style: disc; }
.al-content ol { list-style: decimal; }
.al-content li::marker { color: var(--teal); font-weight: 700; }
.al-content li > ul, .al-content li > ol { margin: 8px 0 0; }
.al-content blockquote p { color: var(--navy); font-size: 1.08rem; margin-bottom: 8px; }
.al-content blockquote cite, .al-content .wp-block-quote cite { display: block; font-size: 0.82rem; font-style: normal; color: var(--mid-grey); margin-top: 6px; }
.al-content .wp-block-pullquote { border-top: 3px solid var(--teal); border-bottom: 3px solid var(--teal); padding: 28px 0; margin: 36px 0; text-align: center; }
.al-content .wp-block-pullquote blockquote { border: 0; padding: 0; margin: 0; }
.al-content .wp-block-pullquote p { font-size: 1.3rem; font-weight: 600; font-style: normal; line-height: 1.5; }

.al-content figure { margin: 28px 0; }
.al-content figure img, .al-content .wp-block-image img { margin: 0; }
.al-content .wp-block-image.alignleft, .al-content .alignleft { float: left; margin: 6px 28px 16px 0; max-width: 50%; }
.al-content .wp-block-image.alignright, .al-content .alignright { float: right; margin: 6px 0 16px 28px; max-width: 50%; }
.al-content .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.al-content .alignwide { margin-left: -120px; margin-right: -120px; max-width: none; }
.al-content .alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.al-content .alignfull img { border-radius: 0; }
.al-content::after { content: ''; display: table; clear: both; }

.al-content .wp-block-gallery { gap: 12px; }
.al-content .wp-block-gallery img { border-radius: 8px; }

.al-content hr, .al-content .wp-block-separator { border: 0; height: 1px; background: var(--light-grey); margin: 40px 0; }
.al-content .wp-block-separator.is-style-dots { background: none; height: auto; text-align: center; }
.al-content .wp-block-separator.is-style-dots::before { color: var(--teal); letter-spacing: 1em; }

.al-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0; }
.al-content .wp-block-table { margin: 28px 0; overflow-x: auto; }
.al-content th, .al-content td { padding: 12px 14px; border-bottom: 1px solid var(--light-grey); text-align: left; vertical-align: top; }
.al-content thead th { background: var(--navy); color: #fff; font-weight: 600; border-bottom: 0; }
.al-content thead th:first-child { border-top-left-radius: 8px; }
.al-content thead th:last-child { border-top-right-radius: 8px; }
.al-content tbody tr:nth-child(even) td { background: var(--bg-light); }
.al-content .wp-block-table.is-style-stripes { border-bottom: 0; }

.al-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--bg-light); padding: 2px 6px; border-radius: 4px; color: var(--navy); }
.al-content pre { background: var(--navy); color: #E8F1F0; padding: 20px 24px; border-radius: 10px; overflow-x: auto; margin: 24px 0; font-size: 0.88rem; line-height: 1.6; }
.al-content pre code { background: none; color: inherit; padding: 0; }

.al-content .wp-block-buttons { margin: 28px 0; gap: 12px; }
.al-content .wp-block-button__link {
  display: inline-flex; align-items: center; padding: 14px 28px; border-radius: var(--radius);
  background: var(--teal); color: #fff; font-size: 0.93rem; font-weight: 600; text-decoration: none;
  border: 2px solid var(--teal); transition: all var(--transition); line-height: 1;
}
.al-content .wp-block-button__link:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.al-content .is-style-outline .wp-block-button__link { background: transparent; color: var(--teal); }
.al-content .is-style-outline .wp-block-button__link:hover { background: var(--teal); color: #fff; }

.al-content .wp-block-embed { margin: 28px 0; }
.al-content .wp-block-embed iframe, .al-content iframe { max-width: 100%; border-radius: 10px; }
.al-content .wp-block-file { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--bg-light); border-radius: 10px; }
.al-content .wp-block-file .wp-block-file__button { background: var(--teal); color: #fff; border-radius: var(--radius); padding: 8px 16px; text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.al-content .has-background { padding: 24px 28px; border-radius: 10px; }
.al-content .wp-block-details { border: 1px solid var(--light-grey); border-radius: 10px; padding: 16px 20px; margin: 16px 0; }
.al-content .wp-block-details summary { font-weight: 700; color: var(--navy); cursor: pointer; }

/* Brand palette classes for the block editor */
.has-al-teal-color { color: var(--teal) !important; }
.has-al-teal-dark-color { color: var(--teal-dark) !important; }
.has-al-navy-color { color: var(--navy) !important; }
.has-al-charcoal-color { color: var(--charcoal) !important; }
.has-al-mid-grey-color { color: var(--mid-grey) !important; }
.has-al-light-color { color: var(--bg-light) !important; }
.has-al-white-color { color: #fff !important; }
.has-al-teal-background-color { background-color: var(--teal) !important; }
.has-al-teal-dark-background-color { background-color: var(--teal-dark) !important; }
.has-al-navy-background-color { background-color: var(--navy) !important; }
.has-al-charcoal-background-color { background-color: var(--charcoal) !important; }
.has-al-mid-grey-background-color { background-color: var(--mid-grey) !important; }
.has-al-light-background-color { background-color: var(--bg-light) !important; }
.has-al-white-background-color { background-color: #fff !important; }
.al-content .has-al-navy-background-color p, .al-content .has-al-teal-background-color p,
.al-content .has-al-teal-dark-background-color p { color: rgba(255,255,255,0.88); }

.al-page-links { display: flex; gap: 8px; align-items: center; margin: 24px 0; font-size: 0.9rem; }

/* Tags + share */
.al-article-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--light-grey);
}
.al-tags { margin-top: 0; }
.al-tags .tag:hover { background: var(--teal); color: #fff; }
.al-share { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.al-share-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid-grey); margin-right: 4px; }
.al-share a, .al-share button {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-light); color: var(--navy); border: 0; cursor: pointer; font-size: 0.95rem;
  transition: all var(--transition);
}
.al-share a:hover, .al-share button:hover { background: var(--teal); color: #fff; }
.al-share-copied {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 4px 8px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition); white-space: nowrap;
}
.al-share-copy.is-copied .al-share-copied { opacity: 1; }

/* Prev / next */
.al-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.al-post-nav-item {
  display: flex; flex-direction: column; gap: 6px; padding: 20px 22px;
  border: 1px solid var(--light-grey); border-radius: 10px; transition: all var(--transition);
}
.al-post-nav-item:hover { border-color: var(--teal-light); box-shadow: var(--shadow-sm); }
.al-next { text-align: right; grid-column: 2; }
.al-post-nav-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); }
.al-post-nav-title { font-size: 0.95rem; font-weight: 600; color: var(--navy); line-height: 1.4; }

/* Related */
.al-related-header { margin-bottom: 40px; }
.al-related-header h2 { margin-top: 0; }

/* ---- 9. Comments ---- */
.al-comments { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--light-grey); }
.al-comments-title, .al-comments .comment-reply-title { font-size: 1.2rem; color: var(--navy); margin-bottom: 20px; }
.al-comment-list, .al-comment-list .children { list-style: none; padding: 0; margin: 0; }
.al-comment-list .children { margin-left: 32px; }
.al-comment-list .comment-body { padding: 20px 0; border-bottom: 1px solid var(--light-grey); }
.al-comment-list .comment-author { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--navy); }
.al-comment-list .comment-author img { border-radius: 50%; margin: 0; width: 44px; }
.al-comment-list .comment-metadata { font-size: 0.8rem; margin: 4px 0 10px 56px; }
.al-comment-list .comment-metadata a { color: var(--mid-grey); }
.al-comment-list .reply a { font-size: 0.82rem; font-weight: 600; }
.al-comments .comment-form label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.al-comments .comment-form input[type="text"], .al-comments .comment-form input[type="email"],
.al-comments .comment-form input[type="url"], .al-comments .comment-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--light-grey); border-radius: var(--radius);
  font-family: var(--font-main); font-size: 0.95rem; margin-bottom: 16px;
}
.al-comments .comment-form textarea:focus, .al-comments .comment-form input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(var(--teal-rgb),0.12); }
.al-comments .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; }
.al-comments .comment-form-cookies-consent label { font-weight: 400; color: var(--mid-grey); }

/* ---- 10. 404 ---- */
.al-404-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 64px; padding-bottom: 40px; border-bottom: 1px solid var(--light-grey); }
.al-404-actions .al-search { flex: 1 1 320px; max-width: 420px; }

/* ---- 12. Responsive ---- */
@media (max-width: 1024px) {
  .card-grid-3.al-grid { grid-template-columns: repeat(2, 1fr); }
  .al-card-featured .al-card-media { flex-basis: 50%; min-height: 320px; }
  .al-card-featured .al-card-body { padding: 32px; }
  .al-content .alignwide { margin-left: 0; margin-right: 0; }
}

@media (max-width: 768px) {
  .card-grid-3.al-grid { grid-template-columns: 1fr; }
  .al-card-featured { flex-direction: column !important; }
  .al-card-featured .al-card-media { flex-basis: auto; aspect-ratio: 16 / 10; min-height: 0; }
  .al-card-featured .al-card-body { padding: 28px 24px 24px; }
  .al-toolbar { display: block; margin-bottom: 32px; }
  .al-toolbar .al-filters { margin-bottom: 14px; }
  .al-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -24px; padding: 0 24px 4px; scrollbar-width: none; }
  .al-filters::-webkit-scrollbar { display: none; }
  .al-filter { flex: 0 0 auto; }
  .al-search { min-width: 0; width: 100%; }
  .al-article-section { padding-top: 48px; }
  .al-content .alignleft, .al-content .alignright, .al-content .wp-block-image.alignleft, .al-content .wp-block-image.alignright { float: none; max-width: 100%; margin: 24px 0; }
  .al-share { margin-left: 0; }
  .al-post-nav { grid-template-columns: 1fr; }
  .al-next { grid-column: 1; }
  .insight-cta-box { padding: 24px 22px; }
  .al-crumb-current { max-width: 24ch; }
}

@media (max-width: 480px) {
  .al-filters { margin: 0 -16px; padding: 0 16px 4px; }
  .al-card-body { padding: 24px 22px 20px; }
  .insight-card-meta { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .al-card-media img, .al-card, .al-filter { transition: none; }
  .al-card:hover .al-card-media img { transform: none; }
}
