/*
Theme Name: Council Business Directory
Theme URI: https://demo.sbarron.com/bizdir
Author: Shane Barron
Author URI: https://sbarron.com
Description: A council business directory theme with search, filtering, and API sync. Custom post type with structured data fields, industry filtering, and responsive card layouts.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bizdir
Tags: directory, business, council, custom-post-type, api, search
*/

/* ============================================
   RESET & VARIABLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-navy: #1B365D;
    --color-navy-dark: #122442;
    --color-navy-light: #254A7A;
    --color-navy-overlay: rgba(27, 54, 93, 0.92);
    --color-teal: #0097A7;
    --color-teal-dark: #00798A;
    --color-teal-light: #00B8CC;
    --color-teal-bg: rgba(0, 151, 167, 0.08);
    --color-white: #FFFFFF;
    --color-bg: #F5F5F5;
    --color-bg-alt: #EAEAEA;
    --color-card: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-border: #DDDDDD;
    --color-border-light: #EEEEEE;
    --color-success: #2E7D32;
    --color-success-bg: rgba(46, 125, 50, 0.08);
    --color-amber: #F59E0B;
    --color-amber-bg: rgba(245, 158, 11, 0.08);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;

    --max-width: 1200px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

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

a {
    color: var(--color-teal);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--color-teal-dark); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   HEADER BAR
   ============================================ */
.site-header {
    background: var(--color-navy);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.council-logo {
    height: 40px;
    width: auto;
}

.council-name {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: -0.01em;
}

.council-name:hover {
    color: var(--color-teal-light);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.header-nav a {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    padding: 0 1rem;
    height: 64px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.header-nav a:hover,
.header-nav a.current {
    color: var(--color-white);
    border-bottom-color: var(--color-teal);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.return-link {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    border: 1.5px solid rgba(255,255,255,0.3);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.return-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    color: var(--color-white);
}

.header-search-toggle {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-search-toggle:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

.header-search-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--color-white);
}

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-white);
    position: absolute;
    left: 8px;
    transition: all 0.3s ease;
}

.nav-toggle span:nth-child(1) { top: 10px; }
.nav-toggle span:nth-child(2) { top: 17px; }
.nav-toggle span:nth-child(3) { top: 24px; }

.nav-toggle.is-active span:nth-child(1) {
    top: 17px;
    transform: rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
    top: 17px;
    transform: rotate(-45deg);
}

/* Expandable header search */
.header-search-form {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: var(--shadow-lg);
    z-index: 99;
}

.header-search-form.is-open {
    display: flex;
    gap: var(--spacing-xs);
}

.header-search-form input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.header-search-form input:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px var(--color-teal-bg);
}

.header-search-form button {
    padding: 0.65rem 1.5rem;
    background: var(--color-navy);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.header-search-form button:hover {
    background: var(--color-navy-light);
}

/* Breadcrumb */
.breadcrumb-bar {
    background: var(--color-navy-dark);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.breadcrumb {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    padding: 0.6rem 0;
}

.breadcrumb a {
    color: rgba(255,255,255,0.7);
}

.breadcrumb a:hover {
    color: var(--color-teal-light);
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: rgba(255,255,255,0.3);
}

/* ============================================
   HERO SECTION
   ============================================ */
.directory-hero {
    position: relative;
    background: var(--color-navy);
    padding: var(--spacing-3xl) 0 7rem;
    text-align: center;
    overflow: hidden;
}

.directory-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 151, 167, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(0, 151, 167, 0.1) 0%, transparent 50%);
}

.directory-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, transparent 0%, var(--color-bg) 100%);
    z-index: 1;
}

.directory-hero .container {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-teal-light);
    background: rgba(0, 151, 167, 0.12);
    border: 1px solid rgba(0, 151, 167, 0.2);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.directory-hero h1 {
    font-size: 2.8rem;
    color: var(--color-white);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
    font-weight: 800;
}

.directory-hero .subtitle {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.7);
    max-width: 620px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.7;
    font-family: var(--font-body);
}

/* Hero search bar */
.hero-search {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.04);
}

.hero-search input[type="text"] {
    flex: 1;
    padding: 1rem 1.25rem;
    border: none;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--color-text);
    min-width: 0;
}

.hero-search input::placeholder {
    color: var(--color-text-muted);
}

.hero-search input:focus {
    outline: none;
}

.hero-search .search-divider {
    width: 1px;
    background: var(--color-border-light);
    margin: 0.7rem 0;
}

.hero-search select {
    padding: 1rem 2.5rem 1rem 1.2rem;
    border: none;
    font-size: 0.9rem;
    font-family: var(--font-ui);
    color: var(--color-text-muted);
    background: transparent;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.hero-search select:focus {
    outline: none;
}

.hero-search .btn-search {
    padding: 1rem 2rem;
    background: var(--color-teal);
    color: var(--color-white);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-search .btn-search:hover {
    background: var(--color-teal-dark);
}

.hero-search .btn-search svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Hero stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-family: var(--font-ui);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-white);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.hero-stat-label {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--color-navy);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.section-header p {
    color: var(--color-text-light);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================
   RESULTS / ARCHIVE SECTION
   ============================================ */
.results-section {
    padding: var(--spacing-xl) 0 var(--spacing-3xl);
}

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.results-count {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.results-count strong {
    color: var(--color-text);
    font-weight: 700;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.control-btn {
    height: 36px;
    padding: 0 0.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.control-btn:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.control-btn.active {
    background: var(--color-navy);
    border-color: var(--color-navy);
    color: var(--color-white);
}

.control-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.control-select {
    height: 36px;
    padding: 0 2rem 0 0.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}

/* Filter panel */
.filter-panel {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--color-border-light);
}

.filter-row {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group-label {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--color-navy);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-tag {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: var(--color-bg);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    user-select: none;
}

.filter-tag:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.filter-tag.active {
    background: var(--color-teal-bg);
    border-color: var(--color-teal);
    color: var(--color-teal);
    font-weight: 600;
}

.filter-toggle {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-toggle:hover {
    border-color: var(--color-teal);
}

.filter-toggle.active {
    background: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
    font-weight: 600;
}

.filter-toggle .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.filter-clear {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0.4rem 0.5rem;
}

.filter-clear:hover {
    color: var(--color-text);
}

/* ============================================
   BUSINESS CARDS
   ============================================ */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--spacing-md);
}

.listing-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border-light);
    position: relative;
    overflow: hidden;
}

.listing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-navy), var(--color-teal));
    opacity: 0;
    transition: opacity 0.3s;
}

.listing-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.listing-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.card-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-logo .placeholder-icon {
    font-family: var(--font-ui);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-white);
    background: var(--color-navy);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-info h3 {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.card-info h3 a {
    color: var(--color-navy);
    transition: color 0.2s;
}

.card-info h3 a:hover {
    color: var(--color-teal);
}

.card-detail {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 0.15rem;
    line-height: 1.4;
}

.card-detail svg {
    width: 13px;
    height: 13px;
    fill: var(--color-teal);
    flex-shrink: 0;
}

.card-detail a {
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-detail a:hover {
    color: var(--color-teal);
}

.card-badges {
    display: flex;
    gap: 0.4rem;
    margin-bottom: var(--spacing-xs);
    flex-wrap: wrap;
}

.card-overview {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin: var(--spacing-xs) 0 var(--spacing-sm);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: var(--spacing-sm);
}

.tag {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: var(--color-bg);
    color: var(--color-text-light);
    letter-spacing: 0.01em;
}

.card-footer {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: auto;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border-light);
}

.btn-outline {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--color-navy);
    border-radius: var(--radius);
    color: var(--color-navy);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-ui);
    text-align: center;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-outline:hover {
    background: var(--color-navy);
    color: var(--color-white);
}

.btn-primary {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--color-teal);
    border: 1.5px solid var(--color-teal);
    border-radius: var(--radius);
    color: var(--color-white);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-ui);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-primary:hover {
    background: var(--color-teal-dark);
    border-color: var(--color-teal-dark);
    color: var(--color-white);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-connections {
    background: var(--color-teal-bg);
    color: var(--color-teal);
}

.badge-opportunities {
    background: var(--color-amber-bg);
    color: #D97706;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================
   SINGLE LISTING PAGE
   ============================================ */
.listing-profile-hero {
    background: var(--color-navy);
    padding: var(--spacing-xl) 0 6rem;
    position: relative;
    overflow: hidden;
}

.listing-profile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 151, 167, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(0, 151, 167, 0.08) 0%, transparent 40%);
}

.listing-profile-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, transparent 0%, var(--color-bg) 100%);
}

.listing-profile-hero .container {
    position: relative;
    z-index: 2;
}

.profile-hero-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.profile-logo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.profile-logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.profile-logo .placeholder-icon {
    font-family: var(--font-ui);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-white);
    background: rgba(255,255,255,0.15);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.profile-hero-text h1 {
    font-size: 2rem;
    color: var(--color-white);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.profile-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.profile-hero-meta .badge {
    font-size: 0.75rem;
}

.profile-hero-meta .abn-text {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}

/* Profile content area */
.profile-content {
    position: relative;
    margin-top: -3rem;
    padding-bottom: var(--spacing-3xl);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.profile-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border-light);
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-bg);
}

.profile-card-header svg {
    width: 20px;
    height: 20px;
    fill: var(--color-teal);
}

.profile-card-header h2 {
    font-size: 1.15rem;
    color: var(--color-navy);
    letter-spacing: -0.01em;
}

.profile-card p,
.profile-card div.rich-text {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--color-text-light);
}

.profile-card p + p,
.profile-card div.rich-text + div.rich-text {
    margin-top: 1em;
}

.profile-subsection {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border-light);
}

.profile-subsection h3 {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-subsection h3 svg {
    width: 16px;
    height: 16px;
    fill: var(--color-teal);
}

/* Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.sidebar-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border-light);
}

.sidebar-card h3 {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--color-bg);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--color-border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row svg {
    width: 16px;
    height: 16px;
    fill: var(--color-teal);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.info-row a {
    color: var(--color-text-light);
    word-break: break-all;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.info-row a:hover {
    color: var(--color-teal);
}

.info-row span {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.info-label {
    font-weight: 600;
    color: var(--color-text);
    min-width: 80px;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

/* Social links */
.social-links {
    display: flex;
    gap: 0.5rem;
    padding-top: var(--spacing-xs);
}

.social-link {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.social-link:hover {
    background: var(--color-teal-bg);
    color: var(--color-teal);
    border-color: var(--color-teal);
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================
   FEATURED SECTION (Homepage)
   ============================================ */
.featured-section {
    padding: var(--spacing-xl) 0 var(--spacing-3xl);
}

.cta-section {
    background: var(--color-navy);
    padding: var(--spacing-2xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 151, 167, 0.1) 0%, transparent 60%);
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    color: var(--color-white);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.cta-section p {
    color: rgba(255,255,255,0.6);
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
}

.btn-large {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: var(--color-teal);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-large:hover {
    background: var(--color-teal-dark);
    color: var(--color-white);
    transform: translateY(-1px);
}

.btn-large svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--color-navy-dark);
    color: rgba(255,255,255,0.4);
    padding: 0;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-xl);
    padding: var(--spacing-2xl) 0;
}

.footer-about p {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-top: var(--spacing-sm);
    color: rgba(255,255,255,0.45);
}

.footer-col h4 {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    padding: 0.2rem 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--color-teal-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: var(--spacing-sm) 0;
    text-align: center;
}

.footer-bottom p {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    margin: 0;
}

.footer-bottom a {
    color: rgba(255,255,255,0.5);
}

.footer-bottom a:hover {
    color: var(--color-teal-light);
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-hero {
    background: var(--color-navy);
    padding: var(--spacing-xl) 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 151, 167, 0.08) 0%, transparent 50%);
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, transparent 0%, var(--color-bg) 100%);
}

.page-hero .container {
    position: relative;
    z-index: 2;
}

.page-hero h1 {
    font-size: 2.2rem;
    color: var(--color-white);
    letter-spacing: -0.01em;
}

.page-hero .subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.page-content {
    position: relative;
    margin-top: -2rem;
    padding-bottom: var(--spacing-3xl);
}

.page-content .content-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-2xl);
    border: 1px solid var(--color-border-light);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.page-content .content-card h2 {
    font-size: 1.3rem;
    color: var(--color-navy);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.page-content .content-card h2:first-child {
    margin-top: 0;
}

.page-content .content-card p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-text-light);
    margin-bottom: 1em;
}

.page-content .content-card ul,
.page-content .content-card ol {
    padding-left: 1.5rem;
    margin-bottom: 1em;
}

.page-content .content-card li {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-text-light);
    margin-bottom: 0.3rem;
}

/* Contact grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.contact-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
}

.contact-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--color-teal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--color-teal);
}

.contact-item h4 {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 0.2rem;
}

.contact-item p {
    font-size: 0.85rem !important;
    color: var(--color-text-light);
    margin-bottom: 0 !important;
}

.contact-item a {
    color: var(--color-teal);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    padding: var(--spacing-xl) 0;
}

.pagination a,
.pagination span,
.pagination button {
    padding: 0.45rem 0.85rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-white);
    transition: all 0.2s;
    cursor: pointer;
}

.pagination a:hover,
.pagination button:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.pagination .current {
    background: var(--color-navy);
    border-color: var(--color-navy);
    color: var(--color-white);
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading-spinner {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-muted);
}

.loading-spinner .spinner-ring {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--spacing-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--color-text-light);
}

.no-results svg {
    width: 64px;
    height: 64px;
    fill: var(--color-border);
    margin-bottom: var(--spacing-md);
}

.no-results h3 {
    font-family: var(--font-ui);
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
}

.no-results p {
    font-size: 0.95rem;
}

/* ============================================
   404 PAGE
   ============================================ */
.error-page {
    text-align: center;
    padding: var(--spacing-3xl) 0;
}

.error-page .error-code {
    font-family: var(--font-ui);
    font-size: 6rem;
    font-weight: 800;
    color: var(--color-border);
    line-height: 1;
    margin-bottom: var(--spacing-sm);
}

.error-page h1 {
    font-size: 1.5rem;
    color: var(--color-navy);
    margin-bottom: var(--spacing-sm);
}

.error-page p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   GSAP
   ============================================ */
.reveal-up {
    visibility: hidden;
}

body.gsap-ready .reveal-up {
    visibility: visible;
}

/* Card entrance animation for Alpine-rendered cards */
.listing-card {
    animation: cardEnter 0.4s ease both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.listing-card:nth-child(1) { animation-delay: 0s; }
.listing-card:nth-child(2) { animation-delay: 0.05s; }
.listing-card:nth-child(3) { animation-delay: 0.1s; }
.listing-card:nth-child(4) { animation-delay: 0.15s; }
.listing-card:nth-child(5) { animation-delay: 0.2s; }
.listing-card:nth-child(6) { animation-delay: 0.25s; }
.listing-card:nth-child(7) { animation-delay: 0.3s; }
.listing-card:nth-child(8) { animation-delay: 0.35s; }
.listing-card:nth-child(9) { animation-delay: 0.4s; }
.listing-card:nth-child(10) { animation-delay: 0.45s; }
.listing-card:nth-child(11) { animation-delay: 0.5s; }
.listing-card:nth-child(12) { animation-delay: 0.55s; }

/* Focus states for keyboard accessibility */
.filter-tag:focus-visible,
.filter-toggle:focus-visible,
.control-btn:focus-visible,
.btn-primary:focus-visible,
.btn-outline:focus-visible,
.btn-large:focus-visible,
.social-link:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

/* Gradient placeholder icons per-letter color */
.card-logo .placeholder-icon {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
}

.profile-logo .placeholder-icon {
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.08) 100%);
}

/* Active filter count indicator */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-teal);
    color: var(--color-white);
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.3rem;
}

/* Smooth scroll-to-top on pagination */
html {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    .site-header,
    .header-search-form,
    .hero-search,
    .results-toolbar,
    .filter-panel,
    .pagination,
    .cta-section,
    .site-footer,
    .card-footer {
        display: none !important;
    }

    .directory-hero {
        background: none !important;
        color: #000 !important;
        padding: 1rem 0 !important;
    }

    .directory-hero h1 {
        color: #000 !important;
    }

    .listing-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }

    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .directory-hero h1 { font-size: 2.2rem; }
    .profile-grid { grid-template-columns: 1fr; }
    .listings-grid { grid-template-columns: 1fr; }

    .hero-search {
        flex-direction: column;
        border-radius: var(--radius-lg);
    }

    .hero-search .search-divider {
        width: auto;
        height: 1px;
        margin: 0;
    }

    .hero-search select {
        border-top: 1px solid var(--color-border-light);
    }

    .hero-stats {
        gap: var(--spacing-lg);
    }

    .hero-stat-number {
        font-size: 1.5rem;
    }

    .filter-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--color-navy-dark);
        flex-direction: column;
        padding: var(--spacing-xs) 0;
        border-top: 1px solid rgba(255,255,255,0.08);
        box-shadow: var(--shadow-lg);
        z-index: 99;
    }

    .header-nav.is-open {
        display: flex;
    }

    .header-nav a {
        height: auto;
        padding: 0.75rem var(--spacing-md);
        border-bottom: none;
        font-size: 0.9rem;
    }

    .header-nav a:hover,
    .header-nav a.current {
        background: rgba(255,255,255,0.06);
        border-bottom: none;
    }

    .nav-toggle {
        display: flex;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header .container {
        flex-wrap: wrap;
    }

    .header-left {
        order: 1;
    }

    .header-right {
        order: 2;
    }

    .return-link {
        display: none;
    }

    .directory-hero {
        padding: var(--spacing-2xl) 0 6rem;
    }

    .directory-hero h1 { font-size: 1.8rem; }

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .card-footer {
        flex-direction: column;
    }

    .listing-profile-hero h1 {
        font-size: 1.5rem;
    }

    .profile-hero-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-hero-meta {
        justify-content: center;
    }

    .page-content .content-card {
        padding: var(--spacing-md);
    }

    .results-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
