/*
Theme Name: LD Tech
Theme URI: https://linkedindaily.com/
Description: Child block theme of Twenty Twenty-Five for LinkedIn Daily. Deep ink and white, one cool accent, mono kicker labels, 16:9 card grid, lead-story hero, sticky light header, dark footer. Self-hosted OFL fonts (Inter, JetBrains Mono). No plugins, no page builder, no CDN.
Author: LinkedIn Daily
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ld-tech
*/

/* ---------- Base ---------- */
:root { --ld-radius: 12px; --ld-shadow: 0 1px 2px rgba(11,18,32,.06), 0 8px 24px -12px rgba(11,18,32,.18); }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11","ss01"; }
::selection { background: var(--wp--preset--color--ld-accent-bright); color: var(--wp--preset--color--ld-ink); }
a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--wp--preset--color--ld-accent-bright); outline-offset: 2px; border-radius: 4px; }
img { height: auto; }

/* ---------- Header (sticky, light) ---------- */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--wp--preset--color--ld-line); }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
.ld-header .wp-block-site-title { font-weight: 800; letter-spacing: -.03em; font-size: 1.35rem; line-height: 1; margin: 0; }
.ld-header .wp-block-site-title a { color: var(--wp--preset--color--ld-ink); text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; }
.ld-header .wp-block-site-title a::before { content: ""; width: .7rem; height: .7rem; border-radius: 2px; background: var(--wp--preset--color--ld-accent); box-shadow: .35rem .35rem 0 -.1rem var(--wp--preset--color--ld-accent-bright); margin-right: .2rem; }
.ld-header .wp-block-navigation { font-family: var(--wp--preset--font-family--ld-mono); font-size: .8125rem; letter-spacing: .02em; text-transform: uppercase; font-weight: 500; }
.ld-header .wp-block-navigation a { color: var(--wp--preset--color--ld-slate); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.ld-header .wp-block-navigation a:hover, .ld-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--ld-ink); border-bottom-color: var(--wp--preset--color--ld-accent); }
.ld-header .wp-block-navigation__responsive-container.is-menu-open { background: #fff; padding: 1.5rem; }

/* ---------- Masthead band (homepage H1) ---------- */
.ld-masthead { background: var(--wp--preset--color--ld-ink); color: #fff; background-image: linear-gradient(135deg, rgba(60,200,232,.10), transparent 40%), linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: auto, 32px 32px, 32px 32px; }
.ld-masthead h1 { color: #fff; margin: 0; max-width: 22ch; }
.ld-masthead .ld-kicker { color: var(--wp--preset--color--ld-accent-bright); }

/* ---------- Kickers, pills ---------- */
.ld-kicker { font-family: var(--wp--preset--font-family--ld-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--wp--preset--color--ld-accent); margin: 0; }
.ld-pill, .ld-pill a { font-family: var(--wp--preset--font-family--ld-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; text-decoration: none; }
.ld-pill a { display: inline-block; padding: .25rem .6rem; border-radius: 999px; background: var(--wp--preset--color--ld-accent-tint); color: var(--wp--preset--color--ld-accent); }
.ld-pill a:hover { background: var(--wp--preset--color--ld-accent); color: #fff; }
.ld-meta, .ld-meta a { font-family: var(--wp--preset--font-family--ld-mono); font-size: .75rem; color: var(--wp--preset--color--ld-muted); text-decoration: none; letter-spacing: .02em; }

/* ---------- Card grid (home + archives) ---------- */
.ld-grid { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); list-style: none; }
.ld-grid > li.wp-block-post { margin: 0; }
.ld-card { height: 100%; display: flex; flex-direction: column; gap: .75rem; background: #fff; border: 1px solid var(--wp--preset--color--ld-line); border-radius: var(--ld-radius); overflow: hidden; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.ld-card:hover { box-shadow: var(--ld-shadow); transform: translateY(-2px); border-color: #cbd5e1; }
.ld-card .wp-block-post-featured-image { margin: 0; }
.ld-card .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.ld-card__body { padding: .25rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.ld-card .wp-block-post-title { margin: 0; font-size: 1.125rem; line-height: 1.3; letter-spacing: -.015em; font-weight: 700; }
.ld-card .wp-block-post-title a { color: var(--wp--preset--color--ld-ink); text-decoration: none; }
.ld-card .wp-block-post-title a:hover { color: var(--wp--preset--color--ld-accent); }
.ld-card .wp-block-post-excerpt { display: none; }
.ld-card .ld-meta { margin-top: auto; }
.ld-card .wp-block-post-terms { margin: 0; }

/* Lead story = first card, page 1 of the homepage only (no duplicate query, native /page/N/ pagination kept) */
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child { grid-column: 1 / -1; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .ld-card { flex-direction: row; align-items: stretch; gap: 0; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .wp-block-post-featured-image { flex: 0 0 58%; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .wp-block-post-featured-image img { height: 100%; aspect-ratio: 16/9; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .ld-card__body { padding: clamp(1.25rem, 3vw, 2.25rem); justify-content: center; gap: .9rem; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .wp-block-post-title { font-size: clamp(1.6rem, 2.6vw, 2.25rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 800; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .wp-block-post-excerpt { display: block; color: var(--wp--preset--color--ld-slate); margin: 0; }
body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .ld-card__body::before { content: "Lead story"; font-family: var(--wp--preset--font-family--ld-mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--wp--preset--color--ld-muted); }

/* ---------- Archive header ---------- */
.ld-archive-head { background: var(--wp--preset--color--ld-mist); border-bottom: 1px solid var(--wp--preset--color--ld-line); }
.ld-archive-head h1 { margin: .25rem 0 0; }
.ld-archive-head .wp-block-term-description { color: var(--wp--preset--color--ld-slate); max-width: 60ch; margin-top: .75rem; }

/* ---------- Pagination ---------- */
.wp-block-query-pagination { font-family: var(--wp--preset--font-family--ld-mono); font-size: .8125rem; gap: .35rem; justify-content: center; margin-top: 2.5rem; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { padding: .45rem .8rem; border: 1px solid var(--wp--preset--color--ld-line); border-radius: 8px; text-decoration: none; color: var(--wp--preset--color--ld-ink); }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--ld-ink); border-color: var(--wp--preset--color--ld-ink); color: #fff; }
.wp-block-query-pagination a:hover { border-color: var(--wp--preset--color--ld-accent); color: var(--wp--preset--color--ld-accent); }

/* ---------- Single post ---------- */
.ld-article-head h1 { letter-spacing: -.035em; text-wrap: balance; }
.ld-article .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--ld-radius); }
.ld-article .entry-content, .ld-article .wp-block-post-content { font-size: 1.125rem; line-height: 1.75; overflow-wrap: anywhere; }
.wp-block-post-content :where(h2) { margin-top: 2.2em; letter-spacing: -.025em; }
.wp-block-post-content :where(h3) { margin-top: 1.8em; letter-spacing: -.02em; }
.wp-block-post-content :where(blockquote) { border-left: 3px solid var(--wp--preset--color--ld-accent); padding-left: 1.25rem; margin-left: 0; color: var(--wp--preset--color--ld-slate); font-size: 1.05em; }
.wp-block-post-content :where(table) { border-collapse: collapse; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.wp-block-post-content :where(th, td) { border: 1px solid var(--wp--preset--color--ld-line); padding: .6rem .8rem; text-align: left; }
.wp-block-post-content :where(th) { background: var(--wp--preset--color--ld-mist); font-family: var(--wp--preset--font-family--ld-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.wp-block-post-content :where(code) { font-family: var(--wp--preset--font-family--ld-mono); font-size: .9em; background: var(--wp--preset--color--ld-mist); padding: .1em .35em; border-radius: 4px; }
.wp-block-post-content :where(img) { border-radius: 8px; }
/* content leftovers: empty centered divs left by earlier imports */
.wp-block-post-content > div:empty, .wp-block-post-content > p:empty { display: none; }

/* Author box (uses the existing WP user profile only) */
.ld-author-box { border: 1px solid var(--wp--preset--color--ld-line); border-left: 4px solid var(--wp--preset--color--ld-accent); border-radius: var(--ld-radius); background: var(--wp--preset--color--ld-mist); padding: 1.25rem 1.5rem; margin-top: 3rem; }
.ld-author-box .ld-kicker { margin-bottom: .35rem; }
.ld-author-box .wp-block-post-author-name { font-weight: 700; font-size: 1.1rem; }
.ld-author-box .wp-block-post-author-name a { color: var(--wp--preset--color--ld-ink); text-decoration: none; }
.ld-author-box .wp-block-post-author__bio { margin: .35rem 0 0; color: var(--wp--preset--color--ld-slate); font-size: .95rem; }

/* Prev / next */
.ld-postnav { border-top: 1px solid var(--wp--preset--color--ld-line); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .95rem; }
.ld-postnav a { text-decoration: none; font-weight: 600; color: var(--wp--preset--color--ld-ink); }
.ld-postnav a:hover { color: var(--wp--preset--color--ld-accent); }

/* ---------- Buttons / search ---------- */
.wp-block-button__link, .wp-element-button { transition: background .15s ease, transform .15s ease; }
.wp-block-button__link:hover, .wp-element-button:hover { transform: translateY(-1px); }

/* ---------- Footer (dark) ---------- */
.wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }
.ld-footer { background: var(--wp--preset--color--ld-ink); color: #cbd5e1; }
.ld-footer a { color: #e2e8f0; text-decoration: none; }
.ld-footer a:hover { color: var(--wp--preset--color--ld-accent-bright); text-decoration: underline; }
.ld-footer .wp-block-site-title { font-weight: 800; letter-spacing: -.03em; font-size: 1.35rem; margin: 0; }
.ld-footer .wp-block-site-title a { color: #fff; }
.ld-footer .wp-block-site-tagline { color: #94a3b8; font-size: .9rem; max-width: 42ch; }
.ld-footer .ld-kicker { color: var(--wp--preset--color--ld-accent-bright); margin-bottom: .75rem; }
.ld-footer .wp-block-navigation { font-size: .95rem; }
.ld-footer .ld-legal { border-top: 1px solid rgba(255,255,255,.12); color: #94a3b8; font-family: var(--wp--preset--font-family--ld-mono); font-size: .75rem; letter-spacing: .02em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ld-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .ld-card { flex-direction: column; }
  body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .wp-block-post-featured-image { flex-basis: auto; }
  body.home:not(.paged) .ld-grid > li.wp-block-post:first-child .wp-block-post-featured-image img { height: auto; }
}
@media (max-width: 600px) {
  .ld-grid { grid-template-columns: 1fr; }
  .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; }
  .ld-article .wp-block-post-content { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
