/*
Theme Name: Purple Directory
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com/
Description: A clean, modern directory theme with a purple accent and listings custom post type.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: purple-directory
*/

:root{
  --color-primary: #6B21A8;
  --color-primary-700: #581C87;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-2: #f7f7fb;
  --color-border: #e7e7ef;
  --color-text: #151515;
  --color-muted: #5f6368;
  --color-charcoal: #1f2937;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 10px 25px rgba(0,0,0,.08);

  --container: 1120px;

  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
a{ color: inherit; text-decoration: none; }
a:hover{ color: var(--color-primary); }
img{ max-width: 100%; height: auto; display: block; }
.container{ width: min(var(--container), calc(100% - 32px)); margin: 0 auto; }

.skip-link{
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus{
  left: 16px; top: 16px; width: auto; height: auto; padding: 10px 12px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); z-index: 9999;
}

.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner{
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0;
}
.brand{ display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark{
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #8B5CF6);
  box-shadow: var(--shadow-sm);
}
.brand-name{ font-size: 16px; color: var(--color-charcoal); }

.nav{ display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a{
  font-weight: 600; font-size: 14px; color: var(--color-charcoal);
  padding: 8px 10px; border-radius: 10px;
}
.nav a:hover{ background: var(--color-surface-2); color: var(--color-primary); }

@media (max-width: 720px){
  .header-inner{ flex-direction: column; align-items: stretch; }
  .nav{ justify-content: flex-start; }
}

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  user-select: none;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--color-primary); color: #fff; box-shadow: 0 12px 22px rgba(107,33,168,.20); }
.btn-primary:hover{ background: var(--color-primary-700); color:#fff; }
.btn-ghost{ background: var(--color-surface); border-color: var(--color-border); color: var(--color-charcoal); }
.btn-ghost:hover{ background: var(--color-surface-2); border-color: #d9d9e6; color: var(--color-primary); }

.field{ width: 100%; display:flex; flex-direction: column; gap: 6px; }
label{ font-size: 12px; font-weight: 700; color: var(--color-muted); }
input[type="text"],input[type="search"],input[type="email"],input[type="url"],input[type="tel"],select,textarea{
  width: 100%; padding: 12px 12px; border-radius: 12px; border: 1px solid var(--color-border);
  background: var(--color-surface); outline: none; font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea{ min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(107,33,168,.55); box-shadow: 0 0 0 4px rgba(107,33,168,.12);
}

.section{ padding: 56px 0; }
.section-tight{ padding: 28px 0; }
.section-header{ display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:18px; }
.section-title{ font-size: clamp(18px, 2.2vw, 26px); line-height:1.2; margin:0; letter-spacing:-0.02em; }
.section-subtitle{ margin:6px 0 0; color: var(--color-muted); font-size: 14px; }

.hero{
  padding: 64px 0 34px;
  background:
    radial-gradient(1200px 400px at 20% -10%, rgba(107,33,168,.18), transparent 60%),
    radial-gradient(900px 400px at 85% 0%, rgba(139,92,246,.16), transparent 55%),
    linear-gradient(180deg, #fff, #fff);
}
.hero-grid{ display:grid; grid-template-columns: 1.25fr .75fr; gap:24px; align-items:center; }
.hero h1{ margin:0 0 10px; font-size: clamp(28px, 4vw, 44px); line-height:1.06; letter-spacing:-0.03em; }
.hero p{ margin:0 0 18px; color: var(--color-muted); font-size:16px; max-width:58ch; }
.hero-card{
  background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-lg); padding:18px; box-shadow: var(--shadow-md);
}
.hero-kpis{ display:grid; gap:12px; }
.kpi{ border:1px solid var(--color-border); background: var(--color-surface-2); border-radius:14px; padding:12px; }
.kpi strong{ display:block; font-size:18px; letter-spacing:-0.02em; }
.kpi span{ color: var(--color-muted); font-size:13px; }
@media (max-width: 900px){ .hero-grid{ grid-template-columns:1fr; } }

.searchbar{
  margin-top:18px; background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-lg); padding:14px; box-shadow: var(--shadow-sm);
}
.searchbar form{ display:grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap:12px; align-items:end; }
@media (max-width: 900px){ .searchbar form{ grid-template-columns:1fr; } }

.grid{ display:grid; gap:16px; }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px){ .grid-3{ grid-template-columns: repeat(2, 1fr);} }
@media (max-width: 640px){ .grid-3{ grid-template-columns:1fr;} }

.card{
  background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow:hidden; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .22s ease, border-color .2s ease;
}
.card:hover{ transform: translateY(-2px); border-color: rgba(107,33,168,.25); box-shadow: 0 14px 30px rgba(0,0,0,.10); }
.card-media{ aspect-ratio: 16 / 10; background:#f2f2f8; overflow:hidden; }
.card-media img{ width:100%; height:100%; object-fit:cover; }
.card-body{ padding:14px 14px 16px; }
.card-title{ margin:0 0 6px; font-size:16px; line-height:1.25; letter-spacing:-0.01em; }
.card-meta{ display:flex; flex-wrap:wrap; gap:8px 10px; color: var(--color-muted); font-size:13px; margin-bottom:10px; }
.badge{
  display:inline-flex; align-items:center; gap:8px; padding:6px 10px;
  border-radius:999px; border:1px solid var(--color-border);
  background: var(--color-surface-2); color: var(--color-charcoal);
  font-size:12px; font-weight:700;
}
.badge-primary{ border-color: rgba(107,33,168,.22); background: rgba(107,33,168,.10); color: var(--color-primary-700); }

.layout{ display:grid; grid-template-columns: 1fr 320px; gap:20px; align-items:start; }
@media (max-width: 960px){ .layout{ grid-template-columns:1fr; } }
.sidebar{ position: sticky; top: 86px; }
.widget{
  background: var(--color-surface); border:1px solid var(--color-border);
  border-radius: var(--radius-lg); padding:14px; box-shadow: var(--shadow-sm); margin-bottom:14px;
}
.widget-title{ margin:0 0 10px; font-size:14px; color: var(--color-charcoal); letter-spacing:-0.01em; }
.filter-list{ display:grid; gap:8px; }
.filter-list a{
  display:flex; justify-content:space-between; padding:10px 10px;
  border-radius:12px; border:1px solid var(--color-border);
  background: var(--color-surface-2); font-size:13px; font-weight:700;
}
.filter-list a:hover{ border-color: rgba(107,33,168,.25); color: var(--color-primary); }

.single-header{ display:grid; grid-template-columns: 1.4fr .6fr; gap:20px; align-items:start; }
@media (max-width: 960px){ .single-header{ grid-template-columns:1fr; } }
.single-title{ margin:0 0 8px; font-size: clamp(24px, 3vw, 38px); line-height:1.1; letter-spacing:-0.03em; }
.single-lede{ margin:0; color: var(--color-muted); max-width:70ch; }
.detail-grid{ display:grid; gap:10px; margin-top:12px; }
.detail{
  display:flex; gap:10px; padding:10px;
  border:1px solid var(--color-border); background: var(--color-surface-2);
  border-radius:14px; font-size:14px;
}
.detail strong{ width:92px; color: var(--color-charcoal); }
.detail a{ color: var(--color-primary); }

.gallery-grid{ display:grid; gap:10px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px){ .gallery-grid{ grid-template-columns: repeat(2, 1fr); } }
.gallery-grid img{ border-radius:14px; border:1px solid var(--color-border); }

.pagination{ display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }
.pagination a, .pagination span{
  padding:10px 12px; border-radius:12px;
  border:1px solid var(--color-border); background: var(--color-surface);
  font-weight:700; font-size:13px;
}
.pagination .current{
  border-color: rgba(107,33,168,.35); background: rgba(107,33,168,.10); color: var(--color-primary-700);
}

.site-footer{ border-top: 1px solid var(--color-border); background: var(--color-surface); padding:32px 0; margin-top:30px; }
.footer-inner{ display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; align-items:center; color: var(--color-muted); font-size:13px; }
