/* =====================================================================
   New York Lawyers Directory — main.css
   Professional, authoritative palette suited for a legal directory.
   Navy + warm gold + cream, serif headings, sans body.
   Mobile-first, progressive-enhanced layout.
   ===================================================================== */

/* ---------- Design tokens ------------------------------------------- */
:root {
	--ld-navy:       #0f1e3d;
	--ld-navy-dark:  #0a1428;
	--ld-gold:       #c9a961;
	--ld-gold-dark:  #a8894a;
	--ld-charcoal:   #2c2c2c;
	--ld-text:       #1f2937;
	--ld-text-muted: #6b7280;
	--ld-border:     #e5e7eb;
	--ld-bg:         #ffffff;
	--ld-bg-soft:    #faf8f3;
	--ld-bg-dark:    #f3f4f6;
	--ld-success:    #15803d;
	--ld-danger:     #991b1b;

	--ld-radius:     6px;
	--ld-radius-lg:  12px;
	--ld-shadow-sm:  0 1px 2px rgba(15, 30, 61, 0.06);
	--ld-shadow:     0 4px 14px rgba(15, 30, 61, 0.08);
	--ld-shadow-lg:  0 10px 30px rgba(15, 30, 61, 0.12);

	--ld-font-head:  'Playfair Display', Georgia, 'Times New Roman', serif;
	--ld-font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	--ld-max-width:  1200px;
}

/* ---------- Reset-ish base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--ld-font-body);
	color: var(--ld-text);
	background: var(--ld-bg);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--ld-navy);
	text-decoration: none;
	transition: color 0.15s ease;
}
a:hover, a:focus {
	color: var(--ld-gold-dark);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ld-font-head);
	color: var(--ld-navy);
	line-height: 1.25;
	margin: 0 0 0.6em;
	font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 2.2vw + 1rem, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.6vw + 0.9rem, 2.125rem); }
h3 { font-size: clamp(1.25rem, 1.1vw + 0.85rem, 1.625rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.25em; margin: 0 0 1em; }

hr {
	border: 0;
	border-top: 1px solid var(--ld-border);
	margin: 2em 0;
}

.ld-skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	background: var(--ld-navy);
	color: #fff;
	padding: 0.5rem 1rem;
	z-index: 1000;
}
.ld-skip-link:focus { left: 1rem; top: 1rem; }

.ld-container {
	width: 100%;
	max-width: var(--ld-max-width);
	margin: 0 auto;
	padding: 0 1.25rem;
}

/* ---------- Header -------------------------------------------------- */
.ld-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--ld-bg);
	border-bottom: 1px solid var(--ld-border);
	box-shadow: var(--ld-shadow-sm);
}

.ld-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 1rem;
	padding-bottom: 1rem;
	gap: 1rem;
}

.ld-branding .custom-logo-link,
.ld-site-title {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--ld-navy);
	font-family: var(--ld-font-head);
	font-size: 1.25rem;
	font-weight: 700;
}
.ld-logo-img { max-height: 40px; width: auto; }
.ld-site-name { white-space: nowrap; }

.ld-nav-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 40px;
	height: 40px;
	background: transparent;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius);
	cursor: pointer;
	padding: 0 8px;
}
.ld-nav-toggle .ld-bar {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--ld-navy);
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.ld-nav-toggle[aria-expanded="true"] .ld-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ld-nav-toggle[aria-expanded="true"] .ld-bar:nth-child(2) { opacity: 0; }
.ld-nav-toggle[aria-expanded="true"] .ld-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.ld-primary-nav {
	display: none;
	width: 100%;
	order: 3;
}
.ld-primary-nav.is-open { display: block; }

.ld-menu {
	list-style: none;
	padding: 0;
	margin: 1rem 0 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}
.ld-menu a {
	display: block;
	padding: 0.625rem 0.75rem;
	border-radius: var(--ld-radius);
	color: var(--ld-navy);
	font-weight: 500;
}
.ld-menu a:hover, .ld-menu a:focus,
.ld-menu .current-menu-item > a {
	background: var(--ld-bg-soft);
	color: var(--ld-gold-dark);
}

@media (min-width: 768px) {
	.ld-nav-toggle { display: none; }
	.ld-primary-nav { display: block; width: auto; order: 0; }
	.ld-menu { flex-direction: row; margin: 0; gap: 0.25rem; }
}

/* ---------- Main ---------------------------------------------------- */
.ld-site-main {
	display: block;
	min-height: 50vh;
}

/* ---------- Hero ---------------------------------------------------- */
.ld-hero {
	position: relative;
	min-height: 800px;
	background: var(--ld-navy-dark) center / cover no-repeat fixed; /* parallax-ish */
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4rem 1.25rem;
	overflow: hidden;
}
.ld-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(10, 20, 40, 0.82), rgba(10, 20, 40, 0.55));
	z-index: 1;
}
.ld-hero-inner {
	position: relative;
	z-index: 2;
	text-align: center;
	max-width: 800px;
}
.ld-hero-title {
	color: #fff;
	font-size: clamp(2rem, 4vw + 1rem, 4rem);
	margin-bottom: 0.5em;
}
.ld-hero-subtitle {
	font-size: clamp(1rem, 0.5vw + 0.9rem, 1.25rem);
	color: #e5e7eb;
	max-width: 48rem;
	margin-left: auto;
	margin-right: auto;
}

/* Fixed-attach can break on iOS; fall back to normal scroll there. */
@supports (-webkit-touch-callout: none) {
	.ld-hero { background-attachment: scroll; }
}

/* ---------- Shared section scaffolding ----------------------------- */
.ld-search-section,
.ld-browse-section,
.ld-popular-section,
.ld-articles-section {
	padding: 4rem 0;
}
.ld-browse-section,
.ld-articles-section {
	background: var(--ld-bg-soft);
}
.ld-section-heading {
	margin-bottom: 1.5rem;
	position: relative;
	padding-bottom: 0.75rem;
}
.ld-section-heading::after {
	content: '';
	display: block;
	width: 3rem;
	height: 3px;
	background: var(--ld-gold);
	margin-top: 0.75rem;
	border-radius: 2px;
}
.ld-h3 { font-size: 1.625rem; }

/* ---------- Search form -------------------------------------------- */
.ld-search-row {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
	background: #fff;
	padding: 1.5rem;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius-lg);
	box-shadow: var(--ld-shadow);
}
@media (min-width: 640px) {
	.ld-search-row { grid-template-columns: 1fr 1fr; }
}
.ld-field { display: flex; flex-direction: column; gap: 0.35rem; }
.ld-field-label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ld-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.ld-select {
	appearance: none;
	-webkit-appearance: none;
	padding: 0.75rem 2.25rem 0.75rem 0.875rem;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius);
	background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%230f1e3d' d='M6 8L0 0h12z'/></svg>") no-repeat right 0.875rem center;
	font: inherit;
	color: var(--ld-text);
	width: 100%;
	cursor: pointer;
}
.ld-select:focus {
	outline: 2px solid var(--ld-gold);
	outline-offset: 1px;
	border-color: var(--ld-gold);
}
.ld-select:disabled {
	background-color: var(--ld-bg-dark);
	color: var(--ld-text-muted);
	cursor: not-allowed;
}

/* ---------- Cards / Grids ------------------------------------------ */
.ld-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
}
@media (min-width: 640px) { .ld-grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .ld-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .ld-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .ld-grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .ld-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .ld-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.ld-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius-lg);
	overflow: hidden;
	box-shadow: var(--ld-shadow-sm);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	color: inherit;
	text-decoration: none;
}
.ld-card:hover, .ld-card:focus-within {
	transform: translateY(-2px);
	box-shadow: var(--ld-shadow-lg);
	border-color: var(--ld-gold);
}
.ld-card-img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
	background: var(--ld-bg-dark);
}
.ld-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1 1 auto; }
.ld-card-title { margin: 0; font-size: 1.1rem; }
.ld-card-title a { color: var(--ld-navy); }
.ld-card-title a:hover { color: var(--ld-gold-dark); }

.ld-card-meta, .ld-card-count, .ld-card-address, .ld-card-desc, .ld-card-excerpt {
	color: var(--ld-text-muted);
	font-size: 0.9rem;
	margin: 0;
}
.ld-card-count { font-weight: 600; color: var(--ld-navy); }

.ld-card-hours, .ld-card-topics {
	margin-top: 0.25rem;
	font-size: 0.875rem;
}
.ld-card-hours summary, .ld-card-topics summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--ld-navy);
	padding: 0.25rem 0;
}

/* ---------- Rating -------------------------------------------------- */
.ld-rating {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: 600;
	color: var(--ld-charcoal);
}
.ld-star { color: var(--ld-gold); font-size: 1.1em; line-height: 1; }
.ld-rating-value { color: var(--ld-navy); }
.ld-rating-count { color: var(--ld-text-muted); font-weight: 400; font-size: 0.875em; }

/* ---------- Single listing ----------------------------------------- */
.ld-single-listing { padding-bottom: 3rem; }
.ld-listing-header { padding: 2rem 0 1rem; }
.ld-listing-title { margin-bottom: 0.5rem; }
.ld-listing-rating { margin-bottom: 0.5rem; font-size: 1.125rem; }
.ld-back-link { font-size: 0.95rem; color: var(--ld-text-muted); }

.ld-listing-hero {
	margin: 1rem 0 2rem;
	border-radius: var(--ld-radius-lg);
	overflow: hidden;
	max-height: 500px;
	background: var(--ld-bg-dark);
}
.ld-listing-hero img {
	width: 100%;
	max-height: 500px;
	object-fit: cover;
}

.ld-listing-body {
	display: grid;
	gap: 2rem;
	grid-template-columns: 1fr;
}
@media (min-width: 900px) {
	.ld-listing-body { grid-template-columns: minmax(0, 1fr) 360px; }
}

.ld-section {
	background: #fff;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius-lg);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}
.ld-section h2 {
	font-size: 1.25rem;
	margin-bottom: 1rem;
	border-bottom: 1px solid var(--ld-border);
	padding-bottom: 0.5rem;
}
.ld-section h3 { font-size: 1.05rem; margin: 0.75rem 0 0.5rem; }
.ld-section h4 {
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ld-text-muted);
	margin: 0.75rem 0 0.5rem;
}

.ld-prose { color: var(--ld-text); }

/* Work time */
.ld-work-time {
	list-style: none;
	padding: 0;
	margin: 0;
}
.ld-work-time li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.45rem 0;
	border-bottom: 1px dashed var(--ld-border);
}
.ld-work-time li:last-child { border-bottom: 0; }
.ld-day { font-weight: 600; color: var(--ld-navy); }
.ld-hours { color: var(--ld-text-muted); text-align: right; }
.ld-closed { color: var(--ld-text-muted); font-style: italic; }

/* Contact list */
.ld-contact-list { list-style: none; padding: 0; margin: 0; }
.ld-contact-list li { padding: 0.35rem 0; word-break: break-word; }
.ld-contact-list .ld-label { font-weight: 600; color: var(--ld-navy); }

.ld-address { margin-bottom: 1rem; }

/* Buttons */
.ld-btn {
	display: inline-block;
	width: 100%;
	text-align: center;
	padding: 0.7rem 1.1rem;
	background: var(--ld-navy);
	color: #fff !important;
	border-radius: var(--ld-radius);
	font-weight: 600;
	border: 1px solid var(--ld-navy);
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ld-btn:hover, .ld-btn:focus {
	background: var(--ld-gold-dark);
	border-color: var(--ld-gold-dark);
	color: #fff !important;
}
.ld-btn-ghost {
	background: transparent;
	color: var(--ld-navy) !important;
	border-color: var(--ld-navy);
}
.ld-btn-ghost:hover, .ld-btn-ghost:focus {
	background: var(--ld-navy);
	color: #fff !important;
}

/* Attributes */
.ld-attributes { display: flex; flex-direction: column; gap: 1rem; }
.ld-chip-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.ld-chip {
	display: inline-block;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	font-size: 0.825rem;
	font-weight: 500;
	border: 1px solid var(--ld-border);
	background: var(--ld-bg-soft);
	color: var(--ld-charcoal);
}
.ld-chip-yes { border-color: rgba(21, 128, 61, 0.3); background: rgba(21, 128, 61, 0.08); color: var(--ld-success); }
.ld-chip-no  { border-color: rgba(153, 27, 27, 0.25); background: rgba(153, 27, 27, 0.06); color: var(--ld-danger); text-decoration: line-through; }

/* Review topics */
.ld-topics { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ld-topic-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	background: var(--ld-bg-soft);
	border: 1px solid var(--ld-border);
	font-size: 0.85rem;
}
.ld-topic-label { color: var(--ld-charcoal); }
.ld-topic-count {
	background: var(--ld-navy);
	color: #fff;
	border-radius: 999px;
	padding: 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
}

/* Breadcrumbs */
.ld-breadcrumbs {
	padding: 1rem 0 0;
	font-size: 0.9rem;
	color: var(--ld-text-muted);
}
.ld-breadcrumbs ol {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.ld-breadcrumbs li + li::before {
	content: '›';
	padding-right: 0.4rem;
	color: var(--ld-text-muted);
}
.ld-breadcrumbs a { color: var(--ld-navy); }
.ld-breadcrumbs a:hover { color: var(--ld-gold-dark); }
.ld-breadcrumbs [aria-current="page"] { color: var(--ld-text-muted); }

/* Related */
.ld-related { background: var(--ld-bg-soft); padding: 3rem 0; margin-top: 2rem; }
.ld-related-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
}
@media (min-width: 640px) { .ld-related-grid { grid-template-columns: repeat(2, 1fr); } }

/* Taxonomy / archive */
.ld-tax-page,
.ld-archive,
.ld-page,
.ld-single { padding: 2rem 0 3rem; }
.ld-page-header { margin-bottom: 2rem; }
.ld-page-title { margin-bottom: 0.5rem; }
.ld-term-description, .ld-archive-description {
	color: var(--ld-text-muted);
	max-width: 48rem;
}
.ld-no-results {
	text-align: center;
	padding: 2rem;
	color: var(--ld-text-muted);
	background: var(--ld-bg-soft);
	border-radius: var(--ld-radius-lg);
}

/* Pagination */
.ld-pagination {
	margin-top: 2rem;
	display: flex;
	justify-content: center;
}
.ld-pagination .page-numbers {
	display: inline-block;
	padding: 0.5rem 0.85rem;
	margin: 0 0.15rem;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius);
	color: var(--ld-navy);
	font-weight: 500;
}
.ld-pagination .page-numbers:hover,
.ld-pagination .page-numbers.current {
	background: var(--ld-navy);
	color: #fff;
	border-color: var(--ld-navy);
}

/* Blog single / generic page */
.ld-page-article .ld-page-featured,
.ld-single-article .ld-page-featured {
	margin: 1rem 0 2rem;
	border-radius: var(--ld-radius-lg);
	overflow: hidden;
}
.ld-post-meta { color: var(--ld-text-muted); font-size: 0.9rem; }

/* ---------- Footer -------------------------------------------------- */
.ld-site-footer {
	background: var(--ld-navy);
	color: #cbd5e1;
	padding: 3rem 0 1.5rem;
	margin-top: 4rem;
}
.ld-footer-inner { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) {
	.ld-footer-inner { grid-template-columns: 2fr 1fr; align-items: start; }
}
.ld-footer-logo { max-height: 44px; width: auto; margin-bottom: 1rem; filter: brightness(0) invert(1); opacity: 0.9; }
.ld-footer-tagline { color: #cbd5e1; max-width: 32rem; }

.ld-footer-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.ld-footer-menu a { color: #e5e7eb; }
.ld-footer-menu a:hover, .ld-footer-menu a:focus { color: var(--ld-gold); }

.ld-footer-bottom {
	grid-column: 1 / -1;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding-top: 1.25rem;
	margin-top: 0.5rem;
	color: #94a3b8;
	font-size: 0.875rem;
	text-align: center;
}

/* ---------- Utility ------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
