/*
Theme Name: The Data Engineer Hub
Theme URI: https://thedataengineerhub.com
Author: The Data Engineer Hub
Description: Fast, clean blog theme for The Data Engineer Hub — navy and teal, built for tutorials with code, tables, PDF downloads and ad slots.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: tdeh
*/

:root {
	--navy: #0b1f3a;
	--navy-2: #13294b;
	--teal: #0d9488;
	--teal-2: #0f766e;
	--teal-soft: #e6f6f4;
	--ink: #1e293b;
	--muted: #5b6b80;
	--line: #e3e8ef;
	--bg: #ffffff;
	--bg-alt: #f6f8fb;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 4px 16px rgba(11, 31, 58, .06);
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
	--wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--font); }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--teal-2); text-decoration: none; }
a:hover { color: var(--teal); text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; font-weight: 750; letter-spacing: -.01em; margin: 1.6em 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.15em; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; width: auto; height: auto; clip: auto; background: #fff; padding: 8px 14px; border-radius: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 650; font-size: .98rem; line-height: 1.2; border: 2px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-decoration: none !important; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-2); color: #fff; }
.btn-outline { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.btn-ghost { border-color: var(--line); color: var(--navy); background: #fff; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-2); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; text-decoration: none !important; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: #5eead4; font: 700 .85rem var(--mono); }
.brand img { max-height: 40px; width: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-weight: 550; font-size: .95rem; text-decoration: none; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_parent > a { background: var(--teal-soft); color: var(--teal-2); }
.header-search { position: relative; }
.search-form { display: flex; align-items: center; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.search-form input[type="search"] { border: 0; background: transparent; padding: 9px 12px; font: inherit; font-size: .92rem; width: 190px; color: var(--ink); }
.search-form input[type="search"]:focus { outline: none; }
.search-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.search-form button { border: 0; background: transparent; padding: 8px 10px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 10px; cursor: pointer; color: var(--navy); }

@media (max-width: 960px) {
	.nav-toggle { display: inline-flex; }
	.main-nav, .header-search { display: none; }
	.site-header.is-open .header-inner { flex-wrap: wrap; padding-bottom: 14px; }
	.site-header.is-open .main-nav, .site-header.is-open .header-search { display: block; width: 100%; margin: 0; }
	.site-header.is-open .main-nav ul { flex-direction: column; }
	.site-header.is-open .search-form input[type="search"] { width: 100%; }
	.site-header.is-open .search-form { width: 100%; }
}

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(13,148,136,.35), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #dbe7f3; padding: 84px 0 92px; }
.hero h1 { color: #fff; margin: 0 0 18px; max-width: 820px; font-size: clamp(2rem, 4.6vw, 3.15rem); }
.hero h1 .accent { color: #5eead4; }
.hero p.lead { font-size: 1.15rem; max-width: 640px; margin-bottom: 30px; color: #c4d3e3; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.eyebrow { display: inline-block; font: 600 .78rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #5eead4; background: rgba(94,234,212,.1); border: 1px solid rgba(94,234,212,.25); padding: 5px 10px; border-radius: 999px; margin-bottom: 20px; }
.topic-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.topic-pills a { color: #dbe7f3; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 5px 12px; font-size: .86rem; text-decoration: none; }
.topic-pills a:hover { border-color: #5eead4; color: #fff; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }

/* Cards */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-thumb { display: block; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--navy), var(--teal-2)); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb .thumb-fallback { display: grid; place-items: center; height: 100%; color: #5eead4; font: 600 1.05rem var(--mono); padding: 16px; text-align: center; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.15rem; margin: 8px 0 8px; }
.card-title a { color: var(--navy); text-decoration: none; }
.card-title a:hover { color: var(--teal-2); }
.card-excerpt { color: var(--muted); font-size: .95rem; margin: 0 0 14px; }
.card .btn { margin-top: auto; align-self: flex-start; }
.cat-badge { display: inline-block; font: 600 .74rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--teal-2); background: var(--teal-soft); border-radius: 6px; padding: 3px 8px; text-decoration: none !important; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .86rem; }
.meta span + span::before { content: "·"; margin-right: 14px; color: #b6c2d1; }

/* Why */
.why-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.why-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.why-item .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-2); display: grid; place-items: center; font: 700 1rem var(--mono); margin-bottom: 14px; }
.why-item h3 { margin: 0 0 8px; font-size: 1.08rem; }
.why-item p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Newsletter */
.newsletter { background: var(--navy); color: #c4d3e3; border-radius: 16px; padding: 40px; display: grid; gap: 24px; grid-template-columns: 1.2fr 1fr; align-items: center; }
.newsletter h2, .newsletter h3 { color: #fff; margin: 0 0 8px; }
.newsletter p { margin: 0; }
.nl-form { display: flex; gap: 10px; flex-wrap: wrap; }
.nl-form input[type="email"] { flex: 1 1 220px; min-width: 0; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; border-radius: 10px; padding: 12px 14px; font: inherit; }
.nl-form input[type="email"]::placeholder { color: #8fa3ba; }
.nl-note { font-size: .82rem; color: #8fa3ba; margin-top: 8px; }
.notice { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: .95rem; }
.notice-ok { background: #e7f8f1; color: #065f46; border: 1px solid #a7e3c9; }
.notice-err { background: #fdecec; color: #8a1c1c; border: 1px solid #f5b5b5; }
.hp-field { position: absolute; left: -9999px; }
@media (max-width: 820px) { .newsletter { grid-template-columns: 1fr; padding: 28px; } }

/* Layout with sidebar */
.layout { display: grid; gap: 44px; grid-template-columns: minmax(0, 1fr) 300px; padding: 48px 0 72px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.sidebar .widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 22px; font-size: .95rem; }
.sidebar .widget-title { font-size: 1rem; margin: 0 0 12px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar .sticky-ad { position: sticky; top: 90px; }

/* Ad slots */
.ad-slot { margin: 28px 0; text-align: center; }
.ad-slot-placeholder { border: 2px dashed #c9d4e1; border-radius: var(--radius); color: var(--muted); font-size: .85rem; padding: 26px 14px; background: var(--bg-alt); }
.grid > .ad-slot { grid-column: 1 / -1; margin: 0; }

/* Page header & archive */
.page-hero { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 44px 0 36px; }
.page-hero h1 { margin: 0 0 8px; }
.page-hero p { color: var(--muted); margin: 0; max-width: 720px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cat-filter a { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: .88rem; color: var(--ink); text-decoration: none; }
.cat-filter a:hover, .cat-filter a.active { border-color: var(--teal); color: var(--teal-2); background: var(--teal-soft); }
.post-list { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pagination { margin-top: 36px; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.pagination .current { background: var(--navy); border-color: var(--navy); color: #fff; }
.empty-state { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); }

/* Single post */
.entry-header { margin-bottom: 26px; }
.entry-header h1 { margin: 12px 0 14px; }
.entry-thumb { margin: 0 0 30px; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; }
.entry-content { font-size: 1.06rem; }
.entry-content > * { max-width: 100%; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--teal); background: var(--teal-soft); border-radius: 0 10px 10px 0; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { color: var(--muted); font-size: .86rem; text-align: center; margin-top: 8px; }
.entry-content img { border-radius: 10px; }
.entry-content :not(pre) > code { font-family: var(--mono); font-size: .88em; background: #eef2f7; color: #b4235a; padding: 2px 6px; border-radius: 5px; }
.entry-content pre, .wp-block-code { position: relative; margin: 1.5em 0; background: #0d1b2e !important; color: #e2e8f0; border-radius: 12px; padding: 0 !important; overflow: hidden; border: 1px solid #1d3354; }
.entry-content pre code { display: block; padding: 20px 22px !important; overflow-x: auto; font: 400 .9rem/1.65 var(--mono); background: transparent !important; color: inherit; tab-size: 4; }
.copy-btn { position: absolute; top: 8px; right: 8px; border: 1px solid #2a4468; background: #13294b; color: #b8c7da; font: 500 .74rem var(--mono); padding: 4px 10px; border-radius: 6px; cursor: pointer; opacity: .8; }
.copy-btn:hover { opacity: 1; color: #fff; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content .wp-block-table { overflow-x: auto; margin: 1.5em 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.entry-content thead th { background: var(--navy); color: #fff; border-color: var(--navy); }
.entry-content tbody tr:nth-child(even) { background: var(--bg-alt); }
.pdf-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 40px 0 10px; padding: 22px 24px; background: var(--teal-soft); border: 1px solid #b9e6df; border-radius: var(--radius); }
.pdf-cta h3 { margin: 0 0 4px; font-size: 1.1rem; }
.pdf-cta p { margin: 0; color: var(--muted); font-size: .94rem; }
.author-box { display: flex; gap: 16px; align-items: center; margin-top: 40px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.author-box img { border-radius: 50%; }
.author-box h3 { margin: 0 0 4px; font-size: 1rem; }
.author-box p { margin: 0; color: var(--muted); font-size: .93rem; }
.post-nav { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin-top: 32px; }
.post-nav a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--navy); font-weight: 600; text-decoration: none; }
.post-nav a:hover { border-color: var(--teal); }
.post-nav small { display: block; color: var(--muted); font-weight: 400; }
.tags a { display: inline-block; margin: 0 6px 6px 0; font-size: .85rem; border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; color: var(--muted); }

/* Notes, practice tests, forms */
.note-card .card-body { padding: 24px; }
.note-icon { width: 46px; height: 46px; border-radius: 10px; background: #fdecec; color: #b42318; display: grid; place-items: center; font: 700 .78rem var(--mono); margin-bottom: 12px; }
.price-card { border: 2px solid var(--teal); border-radius: 16px; padding: 30px; background: #fff; box-shadow: var(--shadow); max-width: 460px; }
.price { font-size: 2.6rem; font-weight: 800; color: var(--navy); line-height: 1; margin: 10px 0 6px; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.checklist { list-style: none; padding: 0; margin: 18px 0 24px; }
.checklist li { padding-left: 28px; position: relative; margin-bottom: 8px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
.disclaimer-note { margin-top: 18px; font-size: .86rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; }
.placeholder-flag { display: inline-block; background: #fff7e0; color: #7a5300; border: 1px dashed #e7c25b; padding: 1px 8px; border-radius: 6px; font-size: .85em; }
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.form-grid label { font-weight: 600; font-size: .93rem; color: var(--navy); display: block; margin-bottom: 6px; }
.form-grid input, .form-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; color: var(--ink); background: #fff; }
.form-grid input:focus, .form-grid textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.page-content { max-width: 780px; }

/* Footer */
.site-footer { background: var(--navy); color: #a9bad0; padding: 56px 0 28px; margin-top: 0; font-size: .94rem; }
.footer-grid { display: grid; gap: 36px; grid-template-columns: 1.3fr 1fr 1.3fr; }
.site-footer h4 { color: #fff; margin: 0 0 14px; font-size: 1rem; }
.site-footer a { color: #d3dfed; }
.site-footer a:hover { color: #5eead4; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); color: #d3dfed; }
.social a:hover { border-color: #5eead4; color: #5eead4; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .86rem; }
.footer-bottom ul { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer .nl-form input[type="email"] { background: rgba(255,255,255,.06); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }

/* WordPress core alignment */
.alignwide { max-width: 100%; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.wp-caption-text { color: var(--muted); font-size: .86rem; }
.sticky .cat-badge { background: #fff3d6; color: #7a5300; }
