/*
Theme Name: DPS Alter Law
Theme URI: https://dpsalterlaw.net/
Author: DPS Alter Law Editorial
Author URI: https://dpsalterlaw.net/about/
Description: Editorial legal magazine theme with topic hubs, featured guides, and a classic sidebar.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dpsalterlaw
*/

:root {
  --ink: #1b2430;
  --navy: #10263b;
  --navy-soft: #1b3a55;
  --gold: #b3894e;
  --gold-soft: #d9bd92;
  --cream: #faf8f4;
  --paper: #ffffff;
  --muted: #5c6b7a;
  --line: #e4ded3;
  --line-soft: #efeae1;
  --shadow: 0 18px 40px -28px rgba(16, 38, 59, 0.45);
  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 4px;
  --wrap: 1160px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy-soft); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4, h5 { font-family: var(--serif); color: var(--navy); line-height: 1.22; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 10px 16px; z-index: 999; }
.skip-link:focus { left: 12px; top: 12px; }

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

/* Top bar */
.topbar { background: var(--navy); color: #cfdbe6; font-size: 12.5px; letter-spacing: 0.02em; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar-note { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.topbar-nav { display: flex; gap: 18px; }
.topbar-nav a { color: #cfdbe6; }
.topbar-nav a:hover { color: #fff; }

/* Masthead */
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-top: 26px; padding-bottom: 26px; }
.brand-mark { display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1; color: var(--navy); letter-spacing: -0.02em; }
.brand-mark span { color: var(--gold); }
.brand-sub { margin: 8px 0 0; font-size: 13px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.masthead-tools { width: 300px; max-width: 40%; }

/* Search */
.searchform { display: flex; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); overflow: hidden; }
.searchform label { flex: 1; display: block; }
.searchform .search-field { width: 100%; border: 0; padding: 11px 14px; font-size: 14px; font-family: var(--sans); background: transparent; color: var(--ink); outline: none; }
.searchform .search-submit { border: 0; background: var(--navy); color: #fff; padding: 0 18px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.searchform .search-submit:hover { background: var(--gold); }

/* Nav */
.nav { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.nav .wrap { display: flex; align-items: center; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; width: 100%; }
.nav-list > li { position: relative; }
.nav-list > li > a { display: block; padding: 15px 16px; font-size: 13px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--navy); border-bottom: 3px solid transparent; }
.nav-list > li > a:hover, .nav-list > li.current-menu-item > a, .nav-list > li.current-menu-parent > a, .nav-list > li.current-menu-ancestor > a { border-bottom-color: var(--gold); color: var(--navy); }
.nav-list .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--line); min-width: 220px; padding: 8px 0; list-style: none; margin: 0; box-shadow: var(--shadow); z-index: 50; }
.nav-list li:hover > .sub-menu { display: block; }
.nav-list .sub-menu a { display: block; padding: 9px 16px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; border: 0; }
.nav-list .sub-menu a:hover { background: var(--cream); }

/* Hero */
.hero { padding: 34px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 28px; align-items: stretch; }
.hero-main { position: relative; background: var(--navy); border-radius: var(--radius); overflow: hidden; min-height: 430px; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.hero-main .thumb { position: absolute; inset: 0; }
.hero-main .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,38,59,0.05) 20%, rgba(16,38,59,0.88) 100%); }
.hero-main .hero-body { position: relative; z-index: 2; padding: 34px; color: #fff; }
.hero-main .hero-body h1, .hero-main .hero-body h2 { color: #fff; font-size: clamp(26px, 3.2vw, 38px); margin: 12px 0 10px; }
.hero-main .hero-body p { color: #e6edf3; font-size: 15px; margin-bottom: 14px; max-width: 46ch; }
.hero-main .meta, .hero-main .meta a { color: #cdd9e4; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; align-items: center; transition: border-color .15s ease, transform .15s ease; }
.hero-item:hover { border-color: var(--gold-soft); transform: translateY(-1px); }
.hero-item .thumb { border-radius: 3px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--line-soft); }
.hero-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-item h3 { font-size: 15.5px; margin: 4px 0 0; line-height: 1.32; }
.hero-item .chip { font-size: 10px; }

/* Chips + meta */
.chip { display: inline-block; font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); background: rgba(179,137,78,0.12); padding: 4px 8px; border-radius: 2px; }
.chip.on-dark { color: #f0dcc0; background: rgba(255,255,255,0.14); }
.meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.meta a { color: inherit; }
.meta .dot::before { content: "/"; margin-right: 10px; color: var(--line); }

/* Sections */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 24px; }
.section-title { margin: 0; font-size: 24px; }
.section-kicker { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; font-weight: 700; }
.section-link { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy); white-space: nowrap; }
.section-link:hover { color: var(--gold); }

/* Top guides */
.guides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.guide-card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px 20px; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.guide-card .num { font-family: var(--serif); font-size: 42px; line-height: 1; color: var(--gold-soft); margin-bottom: 10px; }
.guide-card h3 { font-size: 19px; margin-bottom: 8px; }
.guide-card p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.guide-card .read { margin-top: auto; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy); }
.guide-card .read::after { content: " \2192"; }

/* Layout + post grid */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 26px; }
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--navy), var(--navy-soft)); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .thumb img { transform: scale(1.03); }
.post-card .card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card h2, .post-card h3 { font-size: 20px; margin: 8px 0 8px; }
.post-card p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.post-card .meta { margin-top: auto; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 74px; }
.widget { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.widget-title { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--sans); font-weight: 700; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--gold); display: inline-block; }
.widget p { font-size: 14px; color: var(--muted); }
.widget .searchform { border-color: var(--line); }
.cat-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { border-bottom: 1px solid var(--line-soft); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.cat-list a:hover { color: var(--gold); }
.cat-list .count { color: var(--muted); font-weight: 400; font-size: 12px; }
.recent-list li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { font-family: var(--serif); font-size: 15px; line-height: 1.35; color: var(--navy); }
.recent-list .date { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-top: 3px; }
.widget-about .text-link { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Article */
.article-wrap { padding: 30px 0 50px; }
.article { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.article-head { padding: 34px 42px 0; }
.breadcrumbs { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 6px; color: var(--line); }
.article-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 12px 0 14px; }
.dek { font-size: 19px; line-height: 1.55; color: var(--muted); font-family: var(--serif); margin-bottom: 20px; }
.byline { display: flex; align-items: center; gap: 12px; padding: 14px 0 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 17px; flex: none; }
.byline strong { color: var(--ink); font-weight: 600; }
.article-figure { margin: 0; }
.article-figure img { width: 100%; }
.article-figure figcaption { font-size: 12px; color: var(--muted); padding: 10px 42px; border-bottom: 1px solid var(--line-soft); }
.article-body { padding: 28px 42px 10px; font-family: var(--serif); font-size: 18.5px; line-height: 1.78; color: #22303d; }
.article-body > p:first-of-type::first-letter { float: left; font-size: 62px; line-height: 0.82; padding: 6px 10px 0 0; color: var(--gold); font-weight: 700; }
.article-body h2 { font-size: 27px; margin: 38px 0 12px; padding-top: 8px; }
.article-body h3 { font-size: 21px; margin: 28px 0 10px; }
.article-body a { color: var(--navy-soft); text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 0 0 1.2em; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote { margin: 26px 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--gold); font-size: 20px; color: var(--navy); font-style: italic; }
.article-body table { width: 100%; border-collapse: collapse; margin: 22px 0; font-family: var(--sans); font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.article-body th { background: var(--cream); font-weight: 700; }
.article-body img { border-radius: 3px; }

.toc { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 8px 0 26px; font-family: var(--sans); }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 20px; font-size: 14px; }
.toc li { margin-bottom: 4px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--gold); }

.callout { background: #f4f7fa; border-left: 3px solid var(--navy-soft); padding: 16px 20px; margin: 24px 0; font-family: var(--sans); font-size: 15px; }
.callout p:last-child { margin-bottom: 0; }

.article-foot { padding: 10px 42px 34px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.tags a { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line); padding: 5px 10px; border-radius: 2px; color: var(--muted); }
.tags a:hover { border-color: var(--gold); color: var(--gold); }

.author-box { display: flex; gap: 16px; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 26px 0 0; font-family: var(--sans); }
.author-box .avatar { width: 54px; height: 54px; font-size: 22px; }
.author-box h3 { font-size: 17px; margin: 0 0 4px; }
.author-box p { font-size: 13.5px; color: var(--muted); margin: 0; }

.related { margin-top: 34px; }
.related h2 { font-size: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }

/* Page */
.page-hero { background: var(--navy); color: #fff; padding: 46px 0; }
.page-hero h1 { color: #fff; margin: 0; font-size: clamp(30px, 4vw, 44px); }
.page-hero p { color: #cfdbe6; margin: 10px 0 0; max-width: 62ch; }
.page-body { padding: 40px 0 56px; }
.page-content { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 42px; font-family: var(--serif); font-size: 18px; line-height: 1.78; }
.page-content h2 { font-size: 26px; margin-top: 32px; }
.page-content h3 { font-size: 21px; margin-top: 26px; }
.page-content a { text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 3px; }
.page-content ul, .page-content ol { padding-left: 24px; }
.page-content table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; margin: 20px 0; }
.page-content th, .page-content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }

/* Archive */
.archive-head { background: var(--paper); border-bottom: 1px solid var(--line); padding: 36px 0 28px; }
.archive-head h1 { font-size: clamp(28px, 3.4vw, 38px); margin: 6px 0 8px; }
.archive-head p { color: var(--muted); max-width: 70ch; margin: 0; }
.archive-wrap { padding: 34px 0 50px; }

/* Pagination */
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-flex; min-width: 38px; height: 38px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink); border-radius: 2px; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; padding: 40px 0; margin-top: 20px; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 6px; font-size: 26px; }
.cta-band p { color: #cfdbe6; margin: 0; font-size: 15px; }
.btn { display: inline-block; background: var(--gold); color: #fff; padding: 13px 24px; border-radius: 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.btn:hover { background: #c99a58; color: #fff; }

/* Footer */
.footer { background: #0c1d2d; color: #a9b8c6; padding: 46px 0 0; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 34px; }
.footer h3 { color: #fff; font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 14px; }
.footer p { color: #a9b8c6; font-size: 13.5px; line-height: 1.65; }
.footer .brand-mark { font-size: 26px; color: #fff; }
.footer .brand-mark span { color: var(--gold-soft); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: #a9b8c6; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 34px; padding: 16px 0; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #8496a6; }

/* Page + archive extras */
.page-hero .breadcrumbs, .page-hero .breadcrumbs a { color: #a9bccd; }
.page-hero .breadcrumbs span { color: #4a6379; }
.archive-desc p { color: var(--muted); margin: 0; max-width: 72ch; }
.thumb-fallback { display: block; }

/* 404 */
.nf { text-align: center; padding: 70px 20px 90px; }
.nf .code { font-family: var(--serif); font-size: 90px; color: var(--gold-soft); line-height: 1; }
.nf h1 { margin: 10px 0; }
.nf p { color: var(--muted); max-width: 48ch; margin: 0 auto 22px; }

/* Responsive */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 34px; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { min-height: 360px; }
  .hero-side { display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-item { grid-template-columns: 1fr; }
  .hero-item .thumb { aspect-ratio: 16 / 9; }
  .guides { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .topbar-in { justify-content: center; }
  .topbar-nav { display: none; }
  .masthead-in { flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 20px; padding-bottom: 20px; }
  .masthead-tools { width: 100%; max-width: 100%; }
  .brand-mark { font-size: 28px; }
  .nav { position: static; }
  .nav-list { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .nav-list > li > a { white-space: nowrap; padding: 12px 12px; font-size: 12px; }
  .hero-side { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .guides { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .article-head, .article-body, .article-foot { padding-left: 22px; padding-right: 22px; }
  .article-figure figcaption { padding-left: 22px; padding-right: 22px; }
  .article-body { font-size: 17.5px; }
  .page-content { padding: 24px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cta-band .wrap { flex-direction: column; align-items: flex-start; }
}
