/*
Theme Name: Caller Directory
Theme URI: https://example.com/caller-directory
Description: A clean, accessible, search-first theme for community phone-number directories. Pairs with the Phone Reports Engine plugin but never depends on it for its data: switching themes keeps all directory data.
Version: 1.1.0
Requires at least: 6.2
Requires PHP: 7.4
Author: Caller Directory
License: GPL-2.0-or-later
Text Domain: caller-directory
Domain Path: /languages
*/

:root {
	--cd-ink: #0d1b2a;
	--cd-ink-2: #16293d;
	--cd-primary: #0a7f86;
	--cd-primary-dark: #075c62;
	--cd-primary-soft: #e0f3f4;
	--cd-amber: #ffb000;
	--cd-alert: #d9423b;
	--cd-bg: #edf2f4;
	--cd-surface: #ffffff;
	--cd-border: #d3dde3;
	--cd-text: #17222d;
	--cd-muted: #51606e;
	--cd-radius: 12px;
	--cd-shadow: 0 1px 2px rgba(13, 27, 42, .06), 0 6px 18px rgba(13, 27, 42, .05);
	--cd-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Mapped on body so they win over the plugin's :root defaults regardless of stylesheet order. */
body {
	--pre-primary: var(--cd-primary);
	--pre-primary-dark: var(--cd-primary-dark);
	--pre-surface: #f2f6f8;
	--pre-border: var(--cd-border);
	--pre-text: var(--cd-text);
	--pre-muted: var(--cd-muted);
	--pre-radius: 10px;
	--pre-ink: var(--cd-ink);
	--pre-signal: var(--cd-primary);
	--pre-amber: var(--cd-amber);
	--pre-alert: var(--cd-alert);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--cd-font); font-size: 1rem; line-height: 1.6; color: var(--cd-text); background: var(--cd-bg); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--cd-primary-dark); }
a:hover { color: var(--cd-ink); }
h1, h2, h3 { line-height: 1.2; color: var(--cd-ink); letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--cd-amber); outline-offset: 2px; }

.cd-skip { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: .75rem 1rem; z-index: 1000; }
.cd-skip:focus { left: 8px; top: 8px; }
.cd-container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Header */
.cd-header { background: var(--cd-surface); border-bottom: 1px solid var(--cd-border); position: relative; z-index: 20; }
.cd-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.cd-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--cd-ink); letter-spacing: -.02em; }
.cd-brand svg { flex: none; }
.cd-nav { display: flex; align-items: center; gap: 1.25rem; }
.cd-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; }
.cd-nav a { text-decoration: none; font-weight: 600; color: var(--cd-text); padding: .5rem 0; display: inline-block; }
.cd-nav a:hover, .cd-nav .current-menu-item > a { color: var(--cd-primary); }
.cd-nav .cd-nav__cta { background: var(--cd-ink); color: #fff; padding: .55rem 1rem; border-radius: 10px; }
.cd-nav .cd-nav__cta:hover { background: var(--cd-primary-dark); color: #fff; }
.cd-nav-toggle { display: none; }
@media (max-width: 860px) {
	.js .cd-nav-toggle { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 1px solid var(--cd-border); border-radius: 10px; padding: .5rem .8rem; font: inherit; font-weight: 600; cursor: pointer; }
	.js .cd-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--cd-surface); border-bottom: 1px solid var(--cd-border); padding: .5rem 20px 1rem; z-index: 50; flex-direction: column; align-items: stretch; }
	.js .cd-nav.is-open { display: flex; }
	.cd-nav ul { flex-direction: column; }
	.cd-header__bar { flex-wrap: wrap; }
}

/* Hero */
.cd-hero { background: var(--cd-ink); color: #e7eef5; padding: 2.75rem 0 3.25rem; position: relative; overflow: hidden; }
.cd-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1.5px, transparent 1.5px); background-size: 26px 26px; mask-image: linear-gradient(90deg, transparent 0%, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%); pointer-events: none; }
.cd-hero__grid { display: grid; gap: 2rem; position: relative; }
@media (min-width: 960px) { .cd-hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 3rem; } }
.cd-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 .75rem; max-width: 17ch; }
.cd-hero p { margin: 0 0 1.5rem; max-width: 40rem; font-size: 1.1rem; color: #bfd0df; }
.cd-hero .pre-hint { color: #9db3c8; margin-top: .6rem; font-size: .9rem; }
.cd-hero .pre-input { border-color: transparent; border-radius: 12px; }
.cd-hero .pre-btn--primary { background: var(--cd-amber); border-color: var(--cd-amber); color: #1b1300; border-radius: 12px; }
.cd-hero .pre-btn--primary:hover { background: #ffc233; color: #1b1300; }
.cd-hero__stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.5rem; color: #9db3c8; font-size: .95rem; }
.cd-hero__stats strong { display: block; color: #fff; font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.1; }

/* Live panel in hero */
.cd-live { background: #fff; color: var(--cd-text); border-radius: 16px; padding: 1.1rem 1.25rem 1.25rem; box-shadow: 0 20px 40px rgba(0,0,0,.28); }
.cd-live h2 { margin: 0 0 .15rem; font-size: 1.05rem; }
.cd-live > p { color: var(--cd-muted); font-size: .875rem; margin: 0 0 .5rem; max-width: none; }
.cd-live ul { list-style: none; margin: 0; padding: 0; }
.cd-live li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-top: 1px solid #e6edf1; }
.cd-live li a { font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; text-decoration: none; color: var(--cd-ink); font-variant-numeric: tabular-nums; }
.cd-live li a:hover { text-decoration: underline; }
.cd-live__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #9aa7b6; }
.cd-live .lvl-1 .cd-live__dot { background: var(--cd-primary); }
.cd-live .lvl-2 .cd-live__dot { background: var(--cd-amber); }
.cd-live .lvl-3 .cd-live__dot { background: var(--cd-alert); }
.cd-live__meta { margin-left: auto; font-size: .8rem; color: var(--cd-muted); text-align: right; }
.cd-live__empty { color: var(--cd-muted); font-size: .95rem; margin: .5rem 0 0; }

/* Sections */
.cd-section { padding: 2.75rem 0; }
.cd-section--alt { background: var(--cd-surface); border-block: 1px solid var(--cd-border); }
.cd-section h2 { font-size: 1.6rem; margin: 0 0 .35rem; }
.cd-section__lead { color: var(--cd-muted); margin: 0 0 1.5rem; max-width: 46rem; }
.cd-section__more { margin-top: 1.25rem; font-weight: 600; }
.cd-grid { display: grid; gap: 1rem; }
.cd-grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cd-card { background: var(--cd-surface); border: 1px solid var(--cd-border); border-radius: var(--cd-radius); padding: 1rem 1.25rem; box-shadow: var(--cd-shadow); }
.cd-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }

/* Call right now strip */
.cd-now { margin-top: -1.75rem; position: relative; z-index: 2; padding: 0 0 1rem; }
.cd-now__grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.cd-now__item { background: #fff; border-radius: 12px; padding: 1rem 1.2rem; box-shadow: var(--cd-shadow); border-top: 4px solid var(--cd-primary); }
.cd-now__item:nth-child(2) { border-top-color: var(--cd-amber); }
.cd-now__item:nth-child(3) { border-top-color: var(--cd-alert); }
.cd-now__item h2 { font-size: 1.05rem; margin: 0 0 .25rem; }
.cd-now__item p { margin: 0; font-size: .95rem; color: var(--cd-muted); }

/* Call type tiles */
.cd-types { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cd-type { display: block; text-decoration: none; color: inherit; background: var(--cd-bg); border-radius: 12px; padding: .9rem 1rem .9rem 1.15rem; border-left: 5px solid var(--t, var(--cd-primary)); transition: transform .12s ease, box-shadow .12s ease; }
.cd-type:hover { transform: translateY(-2px); box-shadow: var(--cd-shadow); }
.cd-type strong { display: flex; justify-content: space-between; gap: .5rem; color: var(--cd-ink); }
.cd-type strong span { color: var(--cd-muted); font-weight: 600; font-size: .875rem; white-space: nowrap; }
.cd-type small { display: block; color: var(--cd-muted); margin-top: .2rem; font-size: .875rem; line-height: 1.4; }

/* Area code finder */
.cd-finder { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .cd-finder { grid-template-columns: 1fr 1fr; align-items: center; } }
.cd-finder form { display: flex; gap: .5rem; }
.cd-finder .pre-input { font-size: 1.15rem; max-width: 12rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* FAQ */
.cd-faq { display: grid; gap: .6rem; max-width: 50rem; }
.cd-faq details { background: #fff; border: 1px solid var(--cd-border); border-radius: 12px; padding: .85rem 1.1rem; }
.cd-faq summary { cursor: pointer; font-weight: 700; color: var(--cd-ink); }
.cd-faq details[open] summary { margin-bottom: .4rem; }
.cd-faq p { margin: 0; color: var(--cd-muted); }

/* Closing call to action */
.cd-cta { background: var(--cd-ink); color: #fff; border-radius: 16px; padding: 2rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.cd-cta h2 { color: #fff; margin: 0 0 .25rem; }
.cd-cta p { margin: 0; color: #bfd0df; max-width: 36rem; }
.cd-cta .pre-btn--primary { background: var(--cd-amber); border-color: var(--cd-amber); color: #1b1300; font-size: 1.1rem; padding: .85rem 1.4rem; }

/* Mini report card (theme template part) */
.cd-mini-report { display: block; text-decoration: none; color: inherit; }
.cd-mini-report:hover h3 { text-decoration: underline; }
.cd-mini-report__num { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--cd-ink); }
.cd-mini-report__meta { font-size: .8rem; color: var(--cd-muted); }

/* Layout with sidebar */
.cd-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); padding: 1.5rem 0 3rem; }
@media (min-width: 960px) { .cd-layout--sidebar { grid-template-columns: minmax(0, 1fr) 300px; } }
.cd-sidebar .cd-card { margin-bottom: 1rem; }
.cd-sidebar h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.cd-sidebar ul { margin: 0; padding-left: 1.1rem; }
.cd-ad { min-height: 0; text-align: center; }

/* Content */
.cd-entry { background: var(--cd-surface); border: 1px solid var(--cd-border); border-radius: var(--cd-radius); padding: 1.75rem; box-shadow: var(--cd-shadow); margin-bottom: 1.25rem; }
.cd-entry h1 { margin-top: 0; }
.cd-draft-banner { background: #fff3cd; border: 1px solid #e6cf7a; color: #5a4600; padding: .75rem 1rem; border-radius: var(--cd-radius); margin-bottom: 1rem; font-size: .95rem; }

/* Directory pages (plugin markup) */
.pre-main .pre-container { max-width: none; padding: 0; }
.cd-layout .pre-report-page, .cd-layout .pre-search-page, .cd-layout .pre-latest, .cd-layout .pre-areacode, .cd-layout .pre-areacodes, .cd-layout .pre-calltypes { background: var(--cd-surface); border: 1px solid var(--cd-border); border-radius: var(--cd-radius); padding: 1.5rem; box-shadow: var(--cd-shadow); }
.cd-layout .pre-phone { margin-top: .25rem; }

/* Footer */
.cd-footer { background: var(--cd-ink); color: #bfd0df; padding: 2.75rem 0 1.5rem; margin-top: 2.5rem; }
.cd-footer a { color: #fff; }
.cd-footer__cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cd-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 .5rem; }
.cd-footer ul { list-style: none; margin: 0; padding: 0; }
.cd-footer li { margin: .3rem 0; }
.cd-footer__legal { border-top: 1px solid #243a52; margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; }
.cd-pagination .page-numbers { display: inline-block; padding: .4rem .7rem; border: 1px solid var(--cd-border); border-radius: 8px; margin: 0 .15rem .3rem 0; text-decoration: none; background: #fff; }
.cd-pagination .current { background: var(--cd-ink); color: #fff; border-color: var(--cd-ink); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print { .cd-header, .cd-footer, .cd-sidebar, .cd-nav-toggle, .cd-hero::before { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

/* ---- v1.1.0: trending + checker band ---- */
.cd-trend { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cd-trend a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: #fff; border: 1px solid #dbe4e8; border-radius: 12px; padding: .75rem 1rem; text-decoration: none; color: var(--cd-ink); font-weight: 700; }
.cd-trend a:hover { border-color: var(--cd-primary); }
.cd-trend small { font-weight: 600; color: #4a5b66; }
.cd-checker-band { background: var(--cd-ink); color: #fff; border-radius: 16px; padding: 1.5rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 1.5rem; }
.cd-checker-band h2 { color: #fff; margin: 0 0 .25rem; font-size: 1.25rem; }
.cd-checker-band p { margin: 0; color: #cfdbe2; }
