/*
Theme Name: Low-Cost Finder
Theme URI: https://lowcostfinder.com
Author: Low-Cost Finder
Description: A fast, accessible, AdSense-ready theme for the Low-Cost Living & Local Assistance Finder. Includes a resource directory, policy pages, original guides, secure contact form, ads.txt support and a consent option. No plugins required.
Version: 1.0.0
Requires at least: 6.3
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: lowcostfinder
*/

:root {
	--c-primary: #0b5c5a;
	--c-primary-dark: #083f3e;
	--c-ink: #18282b;
	--c-muted: #556467;
	--c-bg: #f7f5ef;
	--c-card: #ffffff;
	--c-line: #e2dfd3;
	--c-accent: #f2a33a;
	--c-accent-dark: #d98a1f;
	--c-soft: #e6f1ef;
	--c-warn: #fff6e0;
	--c-warn-line: #f0d9a0;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16, 40, 42, .06), 0 8px 24px rgba(16, 40, 42, .06);
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--wrap: 1160px;
	--read: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); font: 17px/1.7 var(--font-body); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-dark); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.22; color: var(--c-primary-dark); margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-top: 1.6em; }
h3 { font-size: 1.25rem; margin-top: 1.4em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: .35em; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; background: #fff; color: var(--c-ink); padding: .7rem 1rem; z-index: 1000; border-radius: 8px; box-shadow: var(--shadow); }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* Top bar and header */
.topbar { background: var(--c-primary-dark); color: #e9f3f1; font-size: .9rem; padding: .45rem 0; text-align: center; line-height: 1.4; }
.topbar a { color: #fff; }
.site-header { background: var(--c-card); border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--c-ink); }
.brand svg, .brand img { width: 44px; height: 44px; flex: none; }
.brand-name { display: block; font: 700 1.35rem/1.1 var(--font-head); color: var(--c-primary-dark); }
.brand-tag { display: block; font-size: .78rem; color: var(--c-muted); line-height: 1.3; max-width: 28ch; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; align-items: center; }
.primary-nav li { position: relative; margin: 0; }
.primary-nav a { display: block; padding: .55rem .8rem; border-radius: 8px; text-decoration: none; color: var(--c-ink); font-weight: 600; font-size: .97rem; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { background: var(--c-soft); color: var(--c-primary-dark); }
.primary-nav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 240px; background: #fff; border: 1px solid var(--c-line); border-radius: 10px; box-shadow: var(--shadow); padding: .4rem; list-style: none; margin: 0; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.nav-toggle { display: none; background: var(--c-soft); border: 0; border-radius: 10px; width: 46px; height: 46px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 22px; height: 2px; background: var(--c-primary-dark); content: ""; position: relative; }
.nav-toggle .bars::before { position: absolute; top: -7px; }
.nav-toggle .bars::after { position: absolute; top: 7px; }

@media (max-width: 880px) {
	.nav-toggle { display: inline-flex; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--c-line); padding: .5rem 16px 1rem; box-shadow: var(--shadow); }
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; align-items: stretch; }
	.primary-nav .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 .8rem; }
	.brand-tag { display: none; }
	.admin-bar .site-header { top: 46px; }
}

/* Buttons and forms */
.btn { display: inline-block; background: var(--c-accent); color: #1b1b1b; font: 700 1rem/1 var(--font-body); padding: .95rem 1.4rem; border-radius: 10px; border: 0; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--c-accent-dark); color: #111; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-primary-dark); border: 2px solid var(--c-primary); padding: calc(.95rem - 2px) calc(1.4rem - 2px); }
.btn--ghost:hover { background: var(--c-soft); color: var(--c-primary-dark); }
.btn--small { padding: .6rem .95rem; font-size: .92rem; }
input[type="text"], input[type="email"], input[type="search"], select, textarea { width: 100%; font: inherit; padding: .85rem 1rem; border: 2px solid var(--c-line); border-radius: 10px; background: #fff; color: var(--c-ink); }
input:focus, select:focus, textarea:focus { border-color: var(--c-primary); outline: none; box-shadow: 0 0 0 3px rgba(11, 92, 90, .2); }
label { font-weight: 600; display: block; margin-bottom: .3rem; }
.search-form { display: flex; gap: .6rem; }
.search-form .btn { flex: none; }
.field { margin-bottom: 1.1rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 1rem 1.2rem; border-radius: 10px; margin-bottom: 1.4rem; border: 1px solid; }
.notice--ok { background: #e7f6ec; border-color: #9fd3b0; color: #14532d; }
.notice--error { background: #fdecec; border-color: #f0a8a8; color: #7f1d1d; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%); color: #fff; padding: clamp(2.5rem, 7vw, 5rem) 0; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero-lead { font-size: 1.15rem; max-width: 56ch; color: #dcefec; margin-bottom: 1.6rem; }
.hero .search-form { max-width: 640px; }
.hero .search-form input { border-color: transparent; padding: 1rem 1.1rem; }
.popular { margin-top: 1rem; font-size: .95rem; color: #cfe6e2; }
.popular a { color: #fff; margin-right: .9rem; white-space: nowrap; }

/* Sections */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section--alt { background: #fff; border-block: 1px solid var(--c-line); }
.section-head { max-width: 62ch; margin-bottom: 1.6rem; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--c-muted); margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.tile { display: block; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.2rem; text-decoration: none; color: var(--c-ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--c-primary); color: var(--c-ink); }
.tile-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--c-soft); color: var(--c-primary); display: grid; place-items: center; margin-bottom: .8rem; }
.tile-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { margin: 0 0 .25rem; font-size: 1.15rem; }
.tile p { margin: 0; font-size: .95rem; color: var(--c-muted); line-height: 1.5; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.3rem; display: flex; flex-direction: column; }
.card-cat { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-primary); text-decoration: none; margin-bottom: .4rem; }
.card-title { font-size: 1.22rem; margin: 0 0 .5rem; }
.card-title a { color: var(--c-primary-dark); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-excerpt { color: var(--c-muted); font-size: .97rem; line-height: 1.55; flex: 1; }
.card-more { font-weight: 700; text-decoration: none; margin-top: .4rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; counter-reset: step; }
.step { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.3rem 4rem; position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 1.1rem; top: 1.2rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--c-accent); color: #1b1b1b; font-weight: 800; display: grid; place-items: center; }
.step h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.step p { margin: 0; color: var(--c-muted); font-size: .96rem; line-height: 1.55; }

.cta-band { background: var(--c-primary-dark); color: #fff; border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.4rem); display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin: 0 0 .3rem; font-size: 1.5rem; }
.cta-band p { margin: 0; color: #d3e8e4; max-width: 56ch; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; padding: 1.5rem 0 3rem; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.page-narrow { max-width: var(--read); margin: 0 auto; padding: 1.5rem 0 3.5rem; }
.page-wide { padding: 1.5rem 0 3.5rem; }
.archive-head { padding: 1.5rem 0 1rem; max-width: 70ch; }
.archive-head p { color: var(--c-muted); }

/* Breadcrumbs */
.breadcrumbs { font-size: .88rem; color: var(--c-muted); padding: 1.1rem 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "\203A"; margin-right: .3rem; color: var(--c-line); }
.breadcrumbs a { color: var(--c-muted); }

/* Article */
.article { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: clamp(1.2rem, 4vw, 2.4rem); }
.article-header { margin-bottom: 1.4rem; }
.article-header h1 { margin-bottom: .5rem; }
.article-cat { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; background: var(--c-soft); padding: .25rem .6rem; border-radius: 6px; margin-bottom: .8rem; }
.article-meta { color: var(--c-muted); font-size: .9rem; }
.entry-content { font-size: 1.05rem; }
.entry-content h2 { padding-top: .4rem; border-top: 1px solid var(--c-line); margin-top: 2em; }
.entry-content h2:first-child { border-top: 0; margin-top: 0; }
.entry-content a { font-weight: 600; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .96rem; }
.entry-content th, .entry-content td { border: 1px solid var(--c-line); padding: .6rem .8rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--c-soft); }
.entry-content blockquote { margin: 1.2rem 0; padding: .6rem 1.2rem; border-left: 4px solid var(--c-accent); background: #fbfaf5; }
.entry-content .sources { font-size: .93rem; color: var(--c-muted); }
.lcf-callout { background: var(--c-soft); border-left: 5px solid var(--c-primary); padding: 1rem 1.3rem; border-radius: 0 10px 10px 0; margin: 1.4rem 0; }
.lcf-callout > :last-child { margin-bottom: 0; }
.lcf-callout--warn { background: var(--c-warn); border-left-color: var(--c-accent); }
.lcf-callout h2, .lcf-callout h3, .lcf-callout .callout-title { font: 700 1.05rem var(--font-body); margin: 0 0 .4rem; color: var(--c-primary-dark); border: 0; padding: 0; }
.verify-note { font-size: .93rem; background: var(--c-warn); border: 1px solid var(--c-warn-line); border-radius: 10px; padding: .9rem 1.1rem; margin-top: 2rem; }
.author-box { margin-top: 1.5rem; padding: 1rem 1.2rem; border: 1px solid var(--c-line); border-radius: 10px; font-size: .93rem; color: var(--c-muted); background: #fbfaf5; }
.author-box strong { color: var(--c-ink); }
.related { margin-top: 2.4rem; }
.related h2 { margin-top: 0; }

/* Sidebar */
.sidebar { display: grid; gap: 1.2rem; }
.widget { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.2rem; }
.widget-title { font: 700 1.05rem var(--font-body); margin: 0 0 .7rem; color: var(--c-primary-dark); }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: .45rem 0; border-bottom: 1px solid var(--c-line); font-size: .96rem; margin: 0; }
.widget li:last-child { border-bottom: 0; }
.widget-help { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #e9f3f1; }
.widget-help .widget-title { color: #fff; }
.widget-help p { font-size: .95rem; line-height: 1.55; }
.widget-help strong { color: var(--c-accent); font-size: 1.3rem; }

/* Directory */
.directory-filter { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.2rem; display: grid; grid-template-columns: 1fr 240px auto; gap: .8rem; align-items: end; margin: 1.2rem 0; }
@media (max-width: 760px) { .directory-filter { grid-template-columns: 1fr; } }
.directory-filter label { font-size: .88rem; }
.type-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.type-chips li { margin: 0; }
.type-chips a { display: inline-block; padding: .4rem .85rem; border-radius: 99px; border: 1px solid var(--c-line); background: #fff; text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--c-ink); }
.type-chips a:hover, .type-chips a.is-active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.results-count { color: var(--c-muted); font-size: .95rem; margin-bottom: 1rem; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.2rem; }
@media (max-width: 420px) { .resource-grid { grid-template-columns: 1fr; } }
.resource { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
.resource-type { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-primary); }
.resource h3 { margin: 0; font-size: 1.2rem; }
.resource p { margin: 0; font-size: .96rem; color: var(--c-muted); line-height: 1.55; }
.resource dl { margin: 0; font-size: .93rem; line-height: 1.5; }
.resource dt { font-weight: 700; color: var(--c-ink); margin-top: .4rem; }
.resource dd { margin: 0; color: var(--c-muted); }
.resource-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .6rem; }

/* Pagination */
.pagination { margin: 2rem 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers { padding: .5rem .9rem; border: 1px solid var(--c-line); border-radius: 8px; background: #fff; text-decoration: none; }
.pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* Ads */
.lcf-ad { margin: 2rem 0; text-align: center; min-height: 100px; clear: both; }
.lcf-ad__label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); margin-bottom: .3rem; }
.sidebar .lcf-ad { margin: 0; background: transparent; }

/* Consent */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900; max-width: 760px; margin-inline: auto; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); padding: 1rem 1.2rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 320px; font-size: .92rem; line-height: 1.5; }
.consent-actions { display: flex; gap: .5rem; }

/* Footer */
.site-footer { background: var(--c-primary-dark); color: #cfe3df; padding: 3rem 0 1.5rem; margin-top: 2rem; font-size: .96rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-h { font: 700 1rem var(--font-body); color: #fff; margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 2rem; padding-top: 1.2rem; font-size: .86rem; color: #a9c5c0; }
.footer-legal p { margin-bottom: .5rem; }

/* WordPress core alignment */
.alignleft { float: left; margin: .3rem 1.2rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.2rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .86rem; color: var(--c-muted); }

.not-found { text-align: center; padding: 3rem 0; max-width: 640px; margin: 0 auto; }
.not-found .search-form { margin: 1.5rem 0; }

@media print {
	.topbar, .site-header, .site-footer, .sidebar, .lcf-ad, .consent, .breadcrumbs { display: none !important; }
	body { background: #fff; }
	.layout { display: block; }
	.article { border: 0; padding: 0; }
}
