/*
Theme Name: Free Mining
Theme URI: https://freemining.in
Author: Free Mining
Description: A fast, minimal, mobile-first blog theme for AI, UI/UX design, web development and digital business. General Sans headings, Open Sans body, no page builder, no jQuery.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: free-mining
Tags: blog, news, one-column, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready
*/

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "General Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/general-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("assets/fonts/open-sans-latin-var.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
	--bg: #F5F5F5;
	--title: #0A0A0A;
	--text: #181818;
	--muted: #666666;
	--line: #DEDEDE;
	--tile-1: #E6E6E6;
	--tile-2: #DDDDDD;
	--display: "General Sans", "Helvetica Neue", Arial, sans-serif;
	--body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 1rem; line-height: 1.65; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--title); outline-offset: 3px; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; color: var(--title); font-family: var(--display); font-weight: 600; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip-path: none; background: var(--title); color: var(--bg); padding: 10px 16px; z-index: 100; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.label { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding-block: 64px; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-block: 22px 14px; }
.logo { display: block; color: var(--title); line-height: 0; }
.logo svg { height: 30px; width: 169px; display: block; }
.nav-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; font-size: 0.8125rem; }
.nav-list a { display: inline-block; text-decoration: none; color: var(--muted); padding-block: 4px; border-bottom: 1px solid transparent; }
.nav-list a:hover { color: var(--title); }
.nav-list .current-menu-item > a,
.nav-list .current-menu-ancestor > a,
.nav-list .current-cat > a,
.nav-list .current-post-ancestor > a { color: var(--title); border-bottom-color: var(--title); }
.search-link { position: absolute; right: clamp(16px, 4vw, 32px); top: 26px; color: var(--muted); line-height: 0; padding: 6px; }
.search-link:hover { color: var(--title); }

/* ---------- Article grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; padding-block: 48px 24px; }
.card .img { display: block; text-decoration: none; aspect-ratio: 3 / 2; background: var(--tile-1); overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .img .ph { display: block; width: 100%; height: 100%; }
.card:nth-child(3n+2) .img { background: var(--tile-2); }
.card .label { display: block; margin-top: 16px; }
.card .label a { text-decoration: none; }
.card h2 { font-size: 1.3125rem; line-height: 1.25; margin-top: 8px; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card .ex { font-size: 0.8125rem; line-height: 1.6; margin-top: 10px; }
.card .more { display: inline-block; margin-top: 12px; font-size: 0.75rem; text-underline-offset: 3px; }

.view-all { display: flex; justify-content: center; padding-block: 24px 64px; }
.btn, .wpforms-submit, .comment-form .submit { display: inline-block; background: var(--title); color: var(--bg); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 13px 28px; border: 0; border-radius: 0; }
.btn:hover, .wpforms-submit:hover, .comment-form .submit:hover { background: #2a2a2a; }
.btn-o { display: inline-block; background: transparent; color: var(--title); border: 1px solid var(--title); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 10px 20px; }
.btn-o:hover { background: var(--title); color: var(--bg); }

/* ---------- Ads ---------- */
.ad { width: 100%; margin: 8px auto; text-align: center; }
.grid > .ad { grid-column: 1 / -1; }
.ad-label { display: block; font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: #8a8a8a; margin-bottom: 6px; }
.ad-box { display: grid; place-items: center; width: 100%; max-width: 728px; min-height: 90px; margin-inline: auto; padding: 8px; background: repeating-linear-gradient(45deg, #ECECEC 0 10px, #E8E8E8 10px 20px); border: 1px dashed #B3B3B3; color: #767676; font-size: 0.75rem; }
.ad-box.ad-rect { max-width: 336px; min-height: 280px; }
.ad-box.is-live { display: block; padding: 0; background: none; border: 0; }
.ad-inline { margin-block: 2em; }
.prose > .ad-inline { margin-block: 2em; }
@media (max-width: 600px) { .ad-box { min-height: 100px; } .ad-box.ad-rect { min-height: 250px; } }

/* ---------- Newsletter ---------- */
.news { border-top: 1px solid var(--line); padding-block: 56px; text-align: center; }
.news h2 { font-size: 1.5rem; }
.news .sub { margin: 8px auto 0; max-width: 42ch; font-size: 0.875rem; color: var(--muted); }
.news-form { max-width: 460px; margin: 22px auto 0; text-align: left; }
.nl-form { display: flex; flex-wrap: wrap; gap: 8px; }
.nl-form input[type="email"] { flex: 1 1 220px; min-width: 0; padding: 12px 14px; border: 1px solid #b9b9b9; background: #fff; color: var(--text); font: inherit; font-size: 0.875rem; border-radius: 0; }
.nl-form .fm-captcha { flex: 1 1 100%; margin: 6px 0 0; }
.nl-status { min-height: 1.5em; margin-top: 10px; font-size: 0.8125rem; color: var(--muted); text-align: center; }
.nl-status.is-ok { color: #1f6b3a; }
.nl-status.is-error { color: #a12b2b; }
.nl-fine { margin-top: 4px; font-size: 0.75rem; color: var(--muted); text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 48px; font-size: 0.8125rem; }
.foot { display: flex; flex-wrap: wrap; gap: 32px 72px; }
.foot-title { font-size: 0.8125rem; margin-bottom: 10px; }
.foot li { margin-bottom: 6px; }
.foot a { text-decoration: none; color: var(--muted); }
.foot a:hover { color: var(--title); text-decoration: underline; text-underline-offset: 3px; }
.foot-logo { display: block; color: var(--title); }
.foot-logo svg { height: 22px; width: 124px; display: block; margin-bottom: 12px; }
.foot-about { max-width: 30ch; color: var(--muted); }
.legal { margin-top: 32px; font-size: 0.75rem; color: #6f6f6f; }

/* ---------- Cookie notice ---------- */
.cookie { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; background: var(--title); color: var(--bg); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px clamp(16px, 4vw, 32px); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); font-size: 0.8125rem; }
.cookie[hidden] { display: none; }
.cookie button { background: var(--bg); color: var(--title); border: 0; padding: 6px 16px; font-weight: 600; font-size: 0.75rem; }
.cookie a { color: var(--bg); }
.cookie :focus-visible { outline-color: var(--bg); }

/* ---------- Page and archive headers ---------- */
.page-head { max-width: 760px; margin-inline: auto; padding-block: 56px 28px; text-align: center; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin-block: 10px 12px; }
.page-head .dek { color: var(--muted); font-size: 1.0625rem; max-width: 52ch; margin-inline: auto; }
.page-body { max-width: 680px; margin-inline: auto; padding-bottom: 72px; }
.page-wide { max-width: 860px; margin-inline: auto; padding-bottom: 72px; }
.tile { margin: 0 0 36px; background: var(--tile-2); }
.tile img { display: block; width: 100%; }
.edit-link { margin-top: 32px; }

.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-bottom: 8px; }
.filters a { font-size: 0.75rem; padding: 5px 14px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.filters a:hover { color: var(--title); border-color: var(--title); }
.filters a[aria-current="page"] { background: var(--title); color: var(--bg); border-color: var(--title); }

.pagination { padding-block: 24px 72px; font-size: 0.8125rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers { padding: 6px 14px; border: 1px solid var(--line); text-decoration: none; }
.pagination a.page-numbers:hover { border-color: var(--title); }
.pagination .page-numbers.current { background: var(--title); color: var(--bg); border-color: var(--title); }
.pagination .dots { border-color: transparent; }

/* ---------- Single post ---------- */
.crumbs { padding-top: 28px; text-align: center; }
.crumbs a { text-decoration: none; }
.art-head { max-width: 760px; margin-inline: auto; padding-block: 20px 28px; text-align: center; }
.art-head h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; margin-block: 10px 14px; }
.art-head .dek { color: var(--muted); font-size: 1.0625rem; }
.art-head .meta { margin-top: 14px; }
.art-img { max-width: 960px; margin: 0 auto 44px; background: var(--tile-2); }
.art-img img { display: block; width: 100%; }
.art-body { max-width: 680px; margin-inline: auto; padding-bottom: 8px; }

.toc { border: 1px solid var(--line); padding: 16px 20px; margin-bottom: 32px; font-size: 0.875rem; line-height: 1.65; }
.prose > .toc + * { margin-top: 0; }
.toc .toc-title { font-size: 0.8125rem; line-height: 1.65; margin: 0 0 8px; }
.prose .toc ol, .toc ol { columns: 2; column-gap: 24px; padding: 0; list-style: none; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc a { color: var(--muted); text-underline-offset: 3px; }
.toc a:hover { color: var(--title); }
@media (max-width: 600px) { .toc ol { columns: 1; } }

.prose { font-size: 1.0625rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-size: 1.6rem; line-height: 1.2; margin-top: 2em; scroll-margin-top: 24px; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose h4 { font-size: 1rem; line-height: 1.3; margin-top: 1.8em; letter-spacing: 0.02em; }
.prose a { text-underline-offset: 3px; }
.prose ul { list-style: disc; padding-left: 1.25em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { margin-inline: 0; padding: 0 0 0 20px; border-inline-start: 2px solid var(--title); font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.4; color: var(--title); }
.prose blockquote p + p { margin-top: 0.8em; }
.prose blockquote.prompt, .prose .is-style-prompt { font-family: var(--body); font-weight: 400; font-size: 1rem; line-height: 1.7; color: var(--text); background: #ECECEC; padding: 14px 18px; }
.prose pre { background: #ECECEC; padding: 16px 18px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; }
.prose code { font-size: 0.9em; }
.cite { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.prose figure { margin-inline: 0; }
.prose figcaption, .wp-caption-text { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.prose th, .prose td, .wp-block-table th, .wp-block-table td { text-align: left; padding: 10px 16px 10px 0; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th, .wp-block-table th { font-family: var(--display); font-weight: 600; color: var(--title); border-bottom-color: var(--title); }
.wp-block-table { overflow-x: auto; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.sticky, .bypostauthor { display: block; }

.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 40px; }
.share button, .share .share-btn { background: transparent; border: 1px solid var(--title); padding: 5px 14px; font-size: 0.75rem; color: var(--title); text-decoration: none; }
.share button:hover, .share .share-btn:hover { background: var(--title); color: var(--bg); }

.author-box { margin-top: 32px; padding-block: 24px; border-block: 1px solid var(--line); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; font-size: 0.9375rem; line-height: 1.6; }
.avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--title); color: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 1; }
.author-box strong { display: block; font-family: var(--display); font-weight: 600; color: var(--title); font-size: 1.05rem; }
.author-box strong a { text-decoration: none; }
.creds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.creds li { border: 1px solid var(--title); padding: 2px 10px; font-size: 0.75rem; }

.related { border-top: 1px solid var(--line); margin-top: 64px; }
.related > h2 { text-align: center; font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 48px; }
.related .grid { padding-bottom: 64px; }
.related .card .ex, .related .card .more { display: none; }

/* ---------- Search, 404 ---------- */
.search-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 520px; margin: 22px auto 0; }
.search-form input[type="search"] { flex: 1 1 240px; min-width: 0; padding: 12px 14px; border: 1px solid #b9b9b9; background: #fff; color: var(--text); font: inherit; font-size: 0.9375rem; border-radius: 0; }
.results-count { margin-bottom: 12px; }
.result { padding-block: 24px; border-top: 1px solid var(--line); }
.result:last-child { border-bottom: 1px solid var(--line); }
.result h2 { font-size: 1.3rem; line-height: 1.25; margin-top: 6px; }
.result h2 a { text-decoration: none; }
.result h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.result p { font-size: 0.875rem; margin-top: 8px; }
.nf { text-align: center; padding-block: 72px 96px; }
.nf .big { font-family: var(--display); font-weight: 600; font-size: clamp(5rem, 18vw, 10rem); line-height: 1; color: var(--title); }
.nf h1 { font-size: 1.6rem; margin-block: 8px 10px; }
.nf .sub { color: var(--muted); max-width: 44ch; margin-inline: auto; }
.nf .go { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }

/* ---------- Forms (comments, WPForms, newsletter plugins) ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea, select { border-radius: 0; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea,
.wpforms-form input[type="text"], .wpforms-form input[type="email"], .wpforms-form textarea, .wpforms-form select,
.news-form input[type="email"], .news-form input[type="text"] { width: 100%; padding: 12px 14px; border: 1px solid #b9b9b9; background: #fff; color: var(--text); font: inherit; font-size: 0.9375rem; }
.comment-form p { margin-bottom: 16px; }
.comment-form label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; color: var(--title); }
.wpforms-field-label { font-size: 0.8125rem; font-weight: 600; color: var(--title); }
.comments { margin-top: 56px; }
.comments-title { font-size: 1.2rem; margin-bottom: 20px; }
.comment-list { list-style: none; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding-block: 18px; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.comment-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; }
.comment-author .avatar { float: left; margin-right: 12px; width: 40px; height: 40px; }

/* ---------- Spam protection and contact form ---------- */
.fm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fm-captcha { margin-bottom: 18px; }
.fm-captcha label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; color: var(--title); }
.fm-captcha input[type="text"] { width: 100%; max-width: 160px; padding: 12px 14px; border: 1px solid #b9b9b9; background: #fff; color: var(--text); font: inherit; font-size: 0.9375rem; }
.fm-form { margin: 0; font-size: 1rem; line-height: 1.65; }
.fm-form .field { margin: 0 0 18px; }
.fm-form label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 6px; color: var(--title); }
.fm-form input[type="text"], .fm-form input[type="email"], .fm-form select, .fm-form textarea { width: 100%; padding: 12px 14px; border: 1px solid #b9b9b9; background: #fff; color: var(--text); font: inherit; font-size: 0.9375rem; border-radius: 0; }
.fm-form textarea { min-height: 150px; resize: vertical; }
.fm-notice { padding: 12px 14px; font-size: 0.875rem; margin-bottom: 18px; border-left: 3px solid var(--title); background: #ECECEC; }
.fm-notice.is-error { border-left-color: #a12b2b; }
.fm-notice.is-ok { border-left-color: #1f6b3a; }
.fm-protect { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 32px; }
	.nav-list { gap: 4px 18px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}

/* ---------- Two-column pages (Contact) ---------- */
.page-body.is-wide { max-width: none; }
.page-body.is-wide .prose { font-size: 1rem; line-height: 1.65; }
.page-body.is-wide .wp-block-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; margin: 0; }
.page-body.is-wide .wp-block-column { flex-basis: auto !important; width: auto; min-width: 0; }
.page-body.is-wide .wp-block-column + .wp-block-column { font-size: 0.9375rem; }
.page-body.is-wide .wp-block-column + .wp-block-column h2 { font-size: 1rem; line-height: 1.65; margin: 22px 0 6px; }
.page-body.is-wide .wp-block-column + .wp-block-column h2:first-child { margin-top: 0; }
.page-body.is-wide .wp-block-column + .wp-block-column p { margin-top: 0; }
@media (max-width: 700px) {
	.page-body.is-wide .wp-block-columns { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
