/*
Theme Name: BIP Directory Theme
Description: A professional directory theme optimized for millions of listings across multiple countries. Works with BIP Directory plugin.
Author: Bip Dev Team
Author URI: https://bippermedia.com
Version: 1.0.2
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bip-directory-theme
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
Tags: directory, business, listings, local, multi-country
*/

/* Import our unified CSS system */
@import url('assets/css/variables.css');
@import url('assets/css/components.css');
@import url('css/directory-navigation.css');
@import url('css/homepage.css');

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--bip-font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--bip-default-900);
    background-color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--bip-default-900);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

p {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1em;
    color: var(--bip-default-700);
}

a {
    color: var(--bip-primary-500);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--bip-primary-700);
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.bip-site-main {
    min-height: 70vh;
}
.bip-wrapper {
    padding-right: 3rem;
    padding-left: 3rem;
    padding-top: 1rem;
    padding-bottom: 2rem;
}
.bip-container {
    max-width: 1180px;
    margin: 0 auto;
}
.bip-section {
    padding: 3rem 0;
}
@media (max-width: 1023px) {
    .bip-wrapper {
        padding-right: 2rem;
        padding-left: 2rem;
    }
}
@media (max-width: 767px) {
    .bip-wrapper {
        padding-right: 1.2rem;
        padding-left: 1.2rem;
    }
}

/* ---------------------------------------------------------------
   Brand typography
   Display serif on headings, sans on body. The contrast between the
   two faces is what gives the directory an editorial rather than
   generic-SaaS feel, so keep headings on the display face.
   --------------------------------------------------------------- */
/* Typography only. Colour is deliberately NOT set here.
   An earlier version set `color: var(--bip-primary)` on this same list.
   Because `.bip-hero-title` is a class, it matched at equal specificity to
   homepage.css's `.bip-hero-title { color: white }` — and style.css loads
   after homepage.css, so it silently won and painted the hero heading navy
   on a navy hero. A blanket heading colour will always break the first dark
   section it meets; let components own their own colour. */
h1, h2, h3,
.bip-hero-title,
.bip-section-title,
.bip-listing-title {
    font-family: var(--bip-font-display);
    font-weight: var(--bip-weight-semibold);
    letter-spacing: -0.015em;
    line-height: 1.15;
}

/* Element selectors only (specificity 0,0,1) so any component class that
   sets its own colour — like .bip-hero-title on the dark hero — still wins
   no matter which stylesheet loads last. */
h1, h2, h3 {
    color: var(--bip-primary);
}

h4, h5, h6 {
    font-family: var(--bip-font-body);
    font-weight: var(--bip-weight-semibold);
    letter-spacing: -0.005em;
}

/* Brass hairline used under section headings and in the header. */
.bip-rule-accent {
    display: block;
    width: 48px;
    height: 2px;
    background: var(--bip-accent);
    border: 0;
    margin: 14px 0 0;
}

/* ---------------------------------------------------------------
   Brand lockup
   Mark + wordmark. The mark is inline SVG so it inherits colour and
   the wordmark is real text so it uses the loaded webfont; see
   inc/brand.php for why that matters.
   --------------------------------------------------------------- */
.bip-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    /* Drives the three colours inside the mark. */
    --bip-brand-knockout: var(--bip-surface, #fff);
    --bip-brand-accent: var(--bip-accent, #b8863b);
    color: var(--bip-primary, #0f2a44);
}

.bip-brand:hover { text-decoration: none; }

.bip-brand-mark { display: block; flex-shrink: 0; }
.bip-brand-mark .bip-brand-pin { fill: currentColor; }
.bip-brand-mark .bip-brand-col { fill: var(--bip-brand-knockout); }
.bip-brand-mark .bip-brand-pediment { fill: var(--bip-brand-accent); }

.bip-brand-text {
    display: flex;
    flex-direction: column;
    /* Optical alignment: the wordmark sits a touch high against the pin,
       whose visual mass is above its geometric centre. */
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.bip-brand-name {
    font-family: var(--bip-font-display);
    font-weight: var(--bip-weight-semibold);
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: currentColor;
    white-space: nowrap;
}

.bip-brand-tagline {
    font-family: var(--bip-font-body);
    font-weight: var(--bip-weight-semibold);
    /* 11px is the floor for uppercase tracked text; below that the
       letter-spacing stops reading as style and starts reading as noise. */
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--bip-accent);
    white-space: nowrap;
}

/* On dark grounds the pin inverts and the knockout takes the ground colour. */
.bip-brand--inverse {
    color: #fff;
    --bip-brand-knockout: var(--bip-primary, #0f2a44);
}
.bip-brand--inverse .bip-brand-name { color: #fff; }
.bip-brand--inverse .bip-brand-tagline { color: var(--bip-accent-300, #ddc079); }

/* Narrow screens: mark only. The wordmark is the first thing to go —
   the mark alone still identifies the site, a truncated name does not. */
@media (max-width: 782px) {
    .bip-brand-text { display: none; }
}
