/*
Theme Name: CounselCorner
Theme URI: https://counselcorner.com
Author: CounselCorner
Description: Attorney directory and legal resource hub. Custom theme with practice-area/location search, attorney profile listings, and premium (Stripe-powered) listing tiers.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: counselcorner
*/

/* ==========================================================================
   DESIGN TOKENS
   Palette grounded in the legal pad + docket motif, not generic navy/gold.
   ========================================================================== */
:root {
  /* Color */
  --cc-ink-navy: #16243d;
  --cc-paper-white: #fbfaf6;
  --cc-pad-cream: #f4efd3;
  --cc-margin-red: #b33a3a;
  --cc-pen-blue: #2a4490;
  --cc-slate: #5b6472;
  --cc-ink-navy-80: rgba(22, 36, 61, 0.85);
  --cc-line: rgba(22, 36, 61, 0.12);
  --cc-cream-line: rgba(179, 58, 58, 0.18);

  /* Type */
  --cc-font-display: "Newsreader", "Iowan Old Style", serif;
  --cc-font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --cc-font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --cc-max: 1180px;
  --cc-radius: 3px;
  --cc-margin-rule-width: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--cc-font-body);
  color: var(--cc-ink-navy);
  background: var(--cc-paper-white);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--cc-font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--cc-ink-navy);
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a { color: var(--cc-pen-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--cc-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cc-pen-blue);
  outline-offset: 2px;
}

/* ==========================================================================
   SIGNATURE DEVICE: the margin rule
   A thin red vertical line, like the rule down a legal pad, marking the
   left edge of key content blocks instead of a generic divider.
   ========================================================================== */
.margin-rule {
  border-left: var(--cc-margin-rule-width) solid var(--cc-margin-red);
  padding-left: 22px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  background: var(--cc-ink-navy);
  color: var(--cc-paper-white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 24px;
}

.site-logo {
  font-family: var(--cc-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cc-paper-white);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-logo span { color: var(--cc-margin-red); }

.primary-nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.primary-nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; flex-wrap: wrap; }
.primary-nav a {
  color: rgba(251, 250, 246, 0.88);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.primary-nav a:hover { color: var(--cc-paper-white); text-decoration: none; border-bottom: 2px solid var(--cc-margin-red); }

.btn-claim {
  background: var(--cc-margin-red);
  color: var(--cc-paper-white) !important;
  padding: 9px 18px;
  border-radius: var(--cc-radius);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
}
.btn-claim:hover { background: #962f2f; text-decoration: none; }

.menu-toggle { display: none; background: none; border: none; color: var(--cc-paper-white); font-size: 1.6rem; cursor: pointer; }

@media (max-width: 880px) {
  .primary-nav { display: none; flex-direction: column; align-items: flex-start; width: 100%; background: var(--cc-ink-navy); position: absolute; left: 0; top: 100%; padding: 20px 24px 28px; }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 14px; width: 100%; }
  .menu-toggle { display: block; }
}

/* ==========================================================================
   HERO / SEARCH (homepage)
   ========================================================================== */
.hero {
  background: var(--cc-ink-navy);
  color: var(--cc-paper-white);
  padding: 72px 0 0;
  position: relative;
}
.hero-inner { max-width: 760px; }
.hero .eyebrow {
  font-family: var(--cc-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--cc-margin-red);
  margin-bottom: 14px;
  display: inline-block;
}
.hero h1 { color: var(--cc-paper-white); }
.hero p.lede { color: rgba(251, 250, 246, 0.78); font-size: 1.1rem; max-width: 580px; }

/* The search panel rendered like an intake form clipped to a folder tab */
.search-panel {
  background: var(--cc-pad-cream);
  border-radius: var(--cc-radius) var(--cc-radius) 0 0;
  margin-top: 40px;
  padding: 28px 28px 22px;
  box-shadow: 0 -2px 0 rgba(0,0,0,0.04) inset;
}
.search-panel .panel-tab {
  font-family: var(--cc-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cc-margin-red);
  margin-bottom: 14px;
  display: block;
}
.search-form { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.search-form .field { flex: 1 1 220px; }
.search-form label {
  display: block;
  font-family: var(--cc-font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cc-ink-navy);
  margin-bottom: 6px;
}
.search-form select, .search-form input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  background: var(--cc-paper-white);
  font-family: var(--cc-font-body);
  font-size: 0.95rem;
  color: var(--cc-ink-navy);
}
.search-form button {
  background: var(--cc-ink-navy);
  color: var(--cc-paper-white);
  border: none;
  padding: 12px 26px;
  border-radius: var(--cc-radius);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.search-form button:hover { background: var(--cc-pen-blue); }

/* ==========================================================================
   DOCKET / LISTING CARDS
   The signature element: every listing reads like a case file, complete
   with an auto-generated docket number and (for paid tier) a rotated
   rubber-stamp badge — both grounded in real legal recordkeeping.
   ========================================================================== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.docket-card {
  background: var(--cc-paper-white);
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  padding: 22px 22px 20px;
  position: relative;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.docket-card:hover { box-shadow: 0 6px 18px rgba(22,36,61,0.08); transform: translateY(-2px); }

.docket-no {
  font-family: var(--cc-font-mono);
  font-size: 0.72rem;
  color: var(--cc-slate);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 10px;
}

.docket-card h3 { margin-bottom: 4px; }
.docket-card h3 a { color: var(--cc-ink-navy); }
.docket-card h3 a:hover { text-decoration: none; color: var(--cc-pen-blue); }

.docket-meta { font-size: 0.88rem; color: var(--cc-slate); margin-bottom: 10px; }

.practice-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.practice-tag {
  font-size: 0.74rem;
  font-family: var(--cc-font-mono);
  background: var(--cc-pad-cream);
  color: var(--cc-ink-navy);
  padding: 3px 9px;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

.stamp {
  position: absolute;
  top: 16px;
  right: -6px;
  transform: rotate(7deg);
  border: 2px solid var(--cc-margin-red);
  color: var(--cc-margin-red);
  font-family: var(--cc-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 3px;
  font-weight: 600;
  background: rgba(179,58,58,0.04);
  pointer-events: none;
}

.docket-card.is-premium { border-color: rgba(179,58,58,0.35); }

.view-profile-link { font-family: var(--cc-font-mono); font-size: 0.82rem; font-weight: 600; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding: 64px 0; }
.section.alt { background: var(--cc-pad-cream); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; gap: 20px; flex-wrap: wrap; }
.section-head .see-all { font-family: var(--cc-font-mono); font-size: 0.85rem; font-weight: 600; }

.practice-area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.practice-area-pill {
  display: block;
  padding: 18px 20px;
  background: var(--cc-paper-white);
  border: 1px solid var(--cc-line);
  border-left: var(--cc-margin-rule-width) solid var(--cc-margin-red);
  border-radius: 0 var(--cc-radius) var(--cc-radius) 0;
  color: var(--cc-ink-navy);
  font-weight: 600;
}
.practice-area-pill:hover { background: var(--cc-pad-cream); text-decoration: none; }
.practice-area-pill .count { display: block; font-family: var(--cc-font-mono); font-size: 0.78rem; color: var(--cc-slate); font-weight: 400; margin-top: 4px; }

/* Article cards (blog) */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.article-card .eyebrow {
  font-family: var(--cc-font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-margin-red);
}
.article-card h3 { margin-top: 8px; }
.article-card .excerpt { color: var(--cc-slate); font-size: 0.94rem; }

/* ==========================================================================
   PROFILE (single attorney)
   ========================================================================== */
.profile-header { background: var(--cc-ink-navy); color: var(--cc-paper-white); padding: 48px 0; }
.profile-header .docket-no { color: rgba(251,250,246,0.6); }
.profile-header h1 { color: var(--cc-paper-white); margin-bottom: 6px; }
.profile-header .firm-meta { color: rgba(251,250,246,0.75); }

.profile-body { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; padding: 48px 0; }
@media (max-width: 800px) { .profile-body { grid-template-columns: 1fr; } }

.profile-photo { width: 100%; border-radius: var(--cc-radius); margin-bottom: 18px; }
.profile-card {
  background: var(--cc-pad-cream);
  border-radius: var(--cc-radius);
  padding: 22px;
}
.profile-card dt { font-family: var(--cc-font-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--cc-slate); margin-top: 14px; }
.profile-card dt:first-child { margin-top: 0; }
.profile-card dd { margin: 2px 0 0; font-weight: 600; }

.btn-primary {
  display: inline-block;
  background: var(--cc-margin-red);
  color: var(--cc-paper-white);
  padding: 12px 22px;
  border-radius: var(--cc-radius);
  font-weight: 600;
  margin-top: 16px;
}
.btn-primary:hover { background: #962f2f; text-decoration: none; color: var(--cc-paper-white); }

/* ==========================================================================
   FORMS (claim profile / pricing)
   ========================================================================== */
.form-panel { background: var(--cc-paper-white); border: 1px solid var(--cc-line); border-radius: var(--cc-radius); padding: 32px; max-width: 640px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  font-family: var(--cc-font-body);
  font-size: 0.95rem;
}
.form-hint { font-size: 0.82rem; color: var(--cc-slate); margin-top: 4px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 820px; }
.pricing-card { border: 1px solid var(--cc-line); border-radius: var(--cc-radius); padding: 28px; background: var(--cc-paper-white); }
.pricing-card.is-featured { border-color: var(--cc-margin-red); position: relative; }
.pricing-card .price { font-family: var(--cc-font-display); font-size: 2.4rem; margin: 10px 0; }
.pricing-card .price span { font-size: 1rem; font-family: var(--cc-font-body); color: var(--cc-slate); }
.pricing-card ul { padding-left: 18px; margin: 18px 0; color: var(--cc-slate); }
.pricing-card li { margin-bottom: 6px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background: var(--cc-ink-navy); color: rgba(251,250,246,0.75); padding: 48px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: var(--cc-paper-white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--cc-font-mono); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(251,250,246,0.75); }
.site-footer a:hover { color: var(--cc-paper-white); }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(251,250,246,0.12); font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Empty / no results state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--cc-slate); }
.empty-state h3 { color: var(--cc-ink-navy); }

/* Pagination */
.cc-pagination { display: flex; gap: 8px; margin-top: 32px; font-family: var(--cc-font-mono); font-size: 0.85rem; }
.cc-pagination a, .cc-pagination span { padding: 7px 12px; border: 1px solid var(--cc-line); border-radius: var(--cc-radius); color: var(--cc-ink-navy); }
.cc-pagination .current { background: var(--cc-ink-navy); color: var(--cc-paper-white); border-color: var(--cc-ink-navy); }

/* Notices */
.cc-notice { padding: 14px 18px; border-radius: var(--cc-radius); margin-bottom: 20px; font-size: 0.92rem; }
.cc-notice.success { background: #e7f3e8; color: #265c2c; border: 1px solid #bfe0c3; }
.cc-notice.error { background: #fbe9e9; color: #8a2424; border: 1px solid #f0c2c2; }
