/* =============================================================================
   STYLE.CSS — GOLDSBORO MADE & MADE HERE
   =============================================================================
   Palette:
     --gold       #E8A020  (Wayne County gold — primary accent)
     --brick      #C03A2B  (industrial brick red — secondary accent)
     --navy       #1A2B45  (deep Carolina night — header/footer bg)
     --cream      #FAF6EF  (warm page background)
     --charcoal   #2C2C2C  (body text)
     --mid        #6B6B6B  (secondary text, captions)
     --card-bg    #FFFFFF  (grid card background)
     --border     #E0D8CC  (subtle dividers)

   Typography:
     Display  — 'Playfair Display' (Google Fonts, loaded in <head>)
     Body     — 'Source Sans 3'   (Google Fonts, loaded in <head>)
     Utility  — system-ui fallback for admin/meta text

   Grid breakpoints:
     1 col  — default (phone)
     2 cols — 480px+
     3 cols — 680px+
     4 cols — 900px+
     5 cols — 1100px+
     6 cols — 1350px+
     7 cols — 1600px+
   ============================================================================= */

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

:root {
    --gold:     #E8A020;
    --gold-dk:  #B87D10;
    --brick:    #C03A2B;
    --brick-dk: #8E2920;
    --navy:     #1A2B45;
    --navy-lt:  #253D63;
    --cream:    #FAF6EF;
    --charcoal: #2C2C2C;
    --mid:      #6B6B6B;
    --card-bg:  #FFFFFF;
    --border:   #E0D8CC;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Source Sans 3', 'Segoe UI', Arial, sans-serif;

    /* Larger-than-usual type scale */
    --text-xs:   0.875rem;   /*  14px */
    --text-sm:   1.0rem;     /*  16px */
    --text-base: 1.2rem;     /*  19px — base body is larger than typical */
    --text-lg:   1.45rem;    /*  23px */
    --text-xl:   1.75rem;    /*  28px */
    --text-2xl:  2.2rem;     /*  35px */
    --text-3xl:  3rem;       /*  48px */
    --text-4xl:  3.75rem;    /*  60px */

    --radius:    6px;
    --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
    --shadow-md: 0 6px 20px rgba(0,0,0,.12);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.18);
    --transition: 0.22s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--cream);
    color: var(--charcoal);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--brick);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover,
a:focus {
    color: var(--brick-dk);
    text-decoration: underline;
}

/* ── SITE HEADER ──────────────────────────────────────────────────────────── */
.site-header {
    background: var(--navy);
    color: #fff;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: 1700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 1rem;
}

.site-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.site-logo .logo-main {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -0.02em;
}

.site-logo .logo-sub {
    font-size: var(--text-xs);
    color: rgba(255,255,255,.65);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.header-tagline {
    font-size: var(--text-sm);
    color: rgba(255,255,255,.70);
    font-style: italic;
    display: none; /* shown on wider screens */
}

@media (min-width: 680px) {
    .header-tagline { display: block; }
    .site-logo .logo-main { font-size: var(--text-2xl); }
}

/* ── HERO BANNER ──────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lt) 55%, var(--gold-dk) 100%);
    color: #fff;
    padding: 3.5rem 1.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Decorative stripes — purely visual */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 30px,
        rgba(255,255,255,.025) 30px,
        rgba(255,255,255,.025) 31px
    );
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero h1 span {
    color: var(--gold);
}

.hero p {
    font-size: var(--text-lg);
    color: rgba(255,255,255,.80);
    max-width: 620px;
    margin: 0 auto 1.5rem;
    line-height: 1.55;
}

.hero-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

@media (min-width: 680px) {
    .hero { padding: 5rem 2rem 4rem; }
    .hero h1 { font-size: var(--text-4xl); }
}

/* ── CATEGORY FILTER BAR ──────────────────────────────────────────────────── */
.filter-bar {
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    padding: 0.85rem 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.filter-bar-inner {
    max-width: 1700px;
    margin: 0 auto;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.filter-label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid);
    margin-right: 0.4rem;
    flex-shrink: 0;
}

/* Filter buttons are driven by PHP output, but styled here */
.filter-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--charcoal);
    background: transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ── MAIN GRID ────────────────────────────────────────────────────────────── */
.grid-section {
    padding: 2rem 1rem 3rem;
    max-width: 1700px;
    margin: 0 auto;
}

.grid-section-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--navy);
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--gold);
    display: inline-block;
}

/* CSS Grid — responsive from 1 to 7 columns */
.business-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;                           /* 1 col: phone */
}

@media (min-width: 480px) {
    .business-grid { grid-template-columns: repeat(2, 1fr); }   /* 2 cols */
}

@media (min-width: 680px) {
    .business-grid { grid-template-columns: repeat(3, 1fr); }   /* 3 cols */
}

@media (min-width: 900px) {
    .business-grid { grid-template-columns: repeat(4, 1fr); }   /* 4 cols */
}

@media (min-width: 1100px) {
    .business-grid { grid-template-columns: repeat(5, 1fr); }   /* 5 cols */
}

@media (min-width: 1350px) {
    .business-grid { grid-template-columns: repeat(6, 1fr); }   /* 6 cols */
}

@media (min-width: 1600px) {
    .business-grid { grid-template-columns: repeat(7, 1fr); }   /* 7 cols */
}

/* ── BUSINESS CARD ────────────────────────────────────────────────────────── */
.biz-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

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

/* Featured card gets a gold top border accent */
.biz-card.featured {
    border-top: 4px solid var(--gold);
}

.biz-card.featured::after {
    content: '★ Featured';
    position: absolute;
    top: 0.55rem;
    right: 0.6rem;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* Category ribbon at top of card */
.card-category {
    background: var(--navy);
    color: rgba(255,255,255,.85);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 0.85rem;
    flex-shrink: 0;
}

.biz-card.featured .card-category {
    background: var(--navy-lt);
}

/* Card body */
.card-body {
    padding: 1.1rem 1.1rem 0.9rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.55rem;
}

.card-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}

.card-tagline {
    font-size: var(--text-sm);
    color: var(--charcoal);
    line-height: 1.5;
    flex: 1;
}

.card-phone {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--brick);
    letter-spacing: 0.02em;
}

.card-phone a {
    color: inherit;
}

.card-phone a:hover {
    color: var(--brick-dk);
}

/* Card CTA link */
.card-link {
    display: block;
    margin-top: 0.85rem;
    background: var(--navy);
    color: #fff;
    text-align: center;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background var(--transition);
    text-decoration: none;
}

.card-link:hover,
.card-link:focus {
    background: var(--brick);
    color: #fff;
    text-decoration: none;
}

/* ── BUSINESS DETAIL PAGE ─────────────────────────────────────────────────── */
.biz-detail-wrap {
    max-width: 960px;
    margin: 2.5rem auto;
    padding: 0 1.25rem 4rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: var(--text-sm);
    color: var(--mid);
    margin-bottom: 1.75rem;
}

.breadcrumb a {
    color: var(--navy);
    font-weight: 600;
}

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

.breadcrumb .sep { margin: 0 0.45rem; color: var(--border); }

/* Business hero section */
.biz-hero {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--border);
}

@media (min-width: 600px) {
    .biz-hero {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }
}

.biz-logo-wrap {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.biz-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* Placeholder when no logo */
.biz-logo-wrap.no-logo {
    background: var(--navy);
    color: var(--gold);
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
}

.biz-headline {
    flex: 1;
}

.biz-category-pill {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.biz-detail-name {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--navy);
    line-height: 1.1;
    margin-bottom: 0.65rem;
}

@media (max-width: 600px) {
    .biz-detail-name { font-size: var(--text-2xl); }
}

.biz-detail-tagline {
    font-size: var(--text-lg);
    color: var(--charcoal);
    margin-bottom: 1rem;
    font-style: italic;
    line-height: 1.45;
}

.biz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    font-size: var(--text-base);
}

.biz-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: var(--charcoal);
}

.biz-meta-icon {
    color: var(--brick);
    font-size: 1.1em;
    line-height: 1.5;
    flex-shrink: 0;
}

.biz-meta-item strong {
    color: var(--brick);
    font-weight: 700;
}

/* Body copy */
.biz-body {
    margin-bottom: 2.5rem;
}

.biz-body p {
    font-size: var(--text-base);
    line-height: 1.75;
    color: var(--charcoal);
    margin-bottom: 1.35rem;
}

/* Photo gallery */
.biz-gallery {
    margin-bottom: 2.5rem;
}

.gallery-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--gold);
    display: inline-block;
}

/* Up to 5 images in a responsive grid */
.gallery-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 680px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* First image always full width */
.gallery-grid figure:first-child {
    grid-column: 1 / -1;
}

.gallery-grid figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--border);
    aspect-ratio: 4/3;
}

.gallery-grid figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-grid figure:hover img {
    transform: scale(1.03);
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--navy);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background var(--transition);
    margin-top: 1rem;
}

.back-btn:hover {
    background: var(--brick);
    color: #fff;
    text-decoration: none;
}

/* ── SITE FOOTER ──────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,.65);
    text-align: center;
    padding: 2.5rem 1.5rem;
    font-size: var(--text-sm);
    line-height: 1.7;
}

.site-footer strong {
    color: var(--gold);
}

.site-footer a {
    color: rgba(255,255,255,.5);
    text-decoration: underline;
}

.site-footer a:hover {
    color: var(--gold);
}

/* ── ADMIN DASHBOARD ──────────────────────────────────────────────────────── */
.admin-wrap {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.25rem 4rem;
}

.admin-header {
    background: var(--navy);
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--gold);
}

.admin-header p {
    font-size: var(--text-sm);
    color: rgba(255,255,255,.7);
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.admin-card-info {
    flex: 1;
    min-width: 200px;
}

.admin-card-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--navy);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.admin-card-id {
    font-family: monospace;
    font-size: var(--text-sm);
    color: var(--mid);
    background: var(--cream);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.admin-card-meta {
    font-size: var(--text-sm);
    color: var(--mid);
}

.admin-card-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.btn-primary   { background: var(--navy);  color: #fff; }
.btn-primary:hover { background: var(--navy-lt); color:#fff; text-decoration:none; }
.btn-danger    { background: var(--brick); color: #fff; }
.btn-danger:hover { background: var(--brick-dk); color:#fff; text-decoration:none; }
.btn-outline   { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; text-decoration:none; }

.admin-notice {
    background: #FFF8E7;
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: var(--text-sm);
    margin-bottom: 1.5rem;
    color: var(--charcoal);
}

.admin-notice strong { color: var(--navy); }

.count-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    margin-left: 0.5rem;
}

/* ── UTILITY ──────────────────────────────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* "No businesses" empty state */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--mid);
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--navy);
    margin-bottom: 0.75rem;
}

/* Advertise banner */
.advertise-bar {
    background: var(--brick);
    color: #fff;
    text-align: center;
    padding: 1.25rem 1.5rem;
}

.advertise-bar p {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.advertise-bar a.cta-btn {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-weight: 800;
    font-size: var(--text-sm);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    transition: background var(--transition);
}

.advertise-bar a.cta-btn:hover {
    background: #fff;
    color: var(--brick);
}

/* 404 / error page */
.error-wrap {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 1.25rem;
    text-align: center;
}

.error-wrap h1 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--navy);
    margin-bottom: 0.75rem;
}

.error-wrap p {
    font-size: var(--text-lg);
    color: var(--mid);
    margin-bottom: 1.75rem;
}
