:root {
    --ink: #262319;
    --ink-soft: #5d5843;
    --paper: #f3efe1;
    --card: #ffffff;
    --border: #ddd3ae;
    --brand: #1d3557;
    --brand-dark: #12233b;
    --accent: #8a7b45;
    --accent-dark: #6b5f35;
    --success-bg: #eaf3e6;
    --success-text: #3c5c34;
    --error-bg: #fbe9e7;
    --error-text: #8a2f22;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container.narrow {
    max-width: 720px;
}

a { color: var(--brand-dark); }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; }

/* Header */
.site-header {
    background: var(--card);
    border-bottom: 3px solid var(--brand);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.brand {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--brand-dark);
}
.main-nav a {
    margin-left: 1.25rem;
    text-decoration: none;
    color: var(--ink-soft);
    font-weight: 500;
}
.main-nav a:first-child { margin-left: 0; }
.main-nav a:hover { color: var(--brand-dark); }

/* Hero */
.hero {
    background: linear-gradient(135deg, #e6ddb8, #d8e0e8);
    padding: 4rem 0 3rem;
    text-align: center;
}
.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}
.hero p {
    font-size: 1.15rem;
    color: var(--ink-soft);
    max-width: 640px;
    margin: 0 auto 1.75rem;
}
.hero-actions .btn { margin: 0 0.4rem; }

.page-header {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
}
.page-header p { color: var(--ink-soft); }

.page-banner {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 3px solid var(--brand);
    display: block;
}

/* ZIP radius search */
.zip-search {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}
.zip-search input[type=text] {
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.95rem;
    width: 160px;
}

/* Company card photo */
.company-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.85rem;
}
.company-photo-featured {
    height: 240px;
}

/* Admin approval status */
.status-pending {
    display: inline-block;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}
.status-approved {
    display: inline-block;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

/* Featured company spotlight */
.featured-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-dark);
}
.featured-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 720px) {
    .featured-list { grid-template-columns: repeat(2, 1fr); }
}
.card-featured {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 3px solid var(--brand);
    box-shadow: 0 6px 22px rgba(18,40,63,0.16);
}
.featured-photo-wrap {
    position: relative;
    background: var(--brand);
    padding: 8px;
}
.featured-photo-wrap .company-photo-featured {
    width: 100%;
    height: 270px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0;
    display: block;
}
.badge-featured-overlay {
    position: absolute;
    top: 1.1rem;
    left: 1.1rem;
    background: linear-gradient(135deg, #f4d165, #c99a2e);
    border: 1px solid #a87f1e;
    color: #3a2c05;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.crown-icon {
    width: 0.85em;
    height: 0.85em;
    fill: var(--brand);
    flex-shrink: 0;
}
.featured-content {
    padding: 1.5rem 1.75rem 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.company-category {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand-dark);
    margin-bottom: 0.4rem;
}
.featured-name-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}
.featured-name-row h3 {
    font-size: 1.4rem;
}
.featured-blurb {
    margin: 0.75rem 0 0;
    line-height: 1.6;
    color: var(--ink);
}
.brand-logo-frame {
    flex: 0 0 auto;
    height: 190px;
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: 8px;
    padding: 14px 20px;
    box-sizing: border-box;
}
.brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.badge-featured {
    background: linear-gradient(135deg, #f4d165, #c99a2e);
    border: 1px solid #a87f1e;
    color: #3a2c05;
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    letter-spacing: 0.05em;
}
.featured-story {
    margin-top: 0.75rem;
    line-height: 1.7;
}
.view-profile-link {
    margin-top: auto;
    padding-top: 1rem;
    font-weight: 600;
    color: var(--brand-dark);
    text-decoration: none;
    display: inline-block;
}
.view-profile-link:hover { color: var(--accent); }

/* Feature-listing pricing page */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 1.5rem auto 0;
}
.plan-card {
    position: relative;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.plan-card-highlight {
    border-color: var(--accent);
    background: linear-gradient(160deg, #ffffff, #faf6e8);
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    transform: scale(1.03);
}
.plan-ribbon {
    position: absolute;
    top: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.plan-label {
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.plan-price {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--brand-dark);
}
.plan-billed {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: 1.5rem;
}
.plan-savings {
    display: block;
    color: var(--accent-dark);
    font-weight: 700;
    margin-top: 0.35rem;
}
.plan-cta { width: 100%; }
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    text-align: left;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}
.pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.98rem;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-cta {
    font-size: 1.1rem;
    padding: 0.9rem 2.25rem;
}
.pricing-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.pricing-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;
}
.compare-col {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.compare-col h3 { margin-top: 0; text-align: center; }
.compare-col-highlight {
    border: 2px solid var(--accent);
    background: #fffaf0;
}
.compare-list { list-style: none; padding: 0; margin: 0; }
.compare-list li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.92rem;
    color: var(--ink-soft);
}
.compare-list li:last-child { border-bottom: none; }

@media (max-width: 640px) {
    .pricing-compare { grid-template-columns: 1fr; }
    .pricing-amount { font-size: 2.4rem; }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: transparent; border-color: var(--brand); color: var(--brand-dark); }
.btn-secondary:hover { background: var(--brand); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-small { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-upgrade {
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--brand);
    padding: 0.3rem 0.8rem;
    font-size: 0.82rem;
}
.btn-upgrade:hover { background: var(--accent-dark); color: #fff; }
.btn-danger { background: #a83a2c; color: #fff; }
.btn-danger:hover { background: #8a2f22; }

/* Sections */
section { padding: 2rem 0; }

/* Cards / grids */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
}

.card h3 { margin-top: 0; }

.badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
}

.company-meta {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin: 0.5rem 0 1rem;
}

.company-meta div { margin-bottom: 0.2rem; }
.company-card { display: flex; flex-direction: column; height: 100%; }
.company-card .company-description { flex: 1; }
.company-card .btn { margin-top: 0.75rem; }

.story-card { display: flex; flex-direction: column; height: 100%; }
.story-card .excerpt { color: var(--ink-soft); flex: 1; }
.story-card .btn { margin-top: 1rem; align-self: flex-start; }
.story-meta {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=url],
.form-group input[type=tel],
.form-group input[type=password],
.form-group input[type=date],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}
.form-group textarea { resize: vertical; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    max-width: 640px;
}

/* Tables (admin) */
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.admin-table th, table.admin-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
table.admin-table th { background: #f3efe8; }
table.admin-table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 0.5rem; }
.table-actions form { display: inline; }

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.stat-card .value { font-size: 2rem; font-weight: 700; color: var(--brand-dark); }
.stat-card .label { color: var(--ink-soft); font-size: 0.9rem; }

/* Story body */
.story-body { max-width: 720px; margin: 0 auto; }
.story-cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.5rem; }

/* Footer */
.site-footer {
    border-top: 3px solid var(--brand);
    margin-top: 3rem;
    padding: 1.75rem 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.footer-links a { margin: 0 0.3rem; }
.footer-credit { flex-basis: 100%; text-align: center; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.5rem; }

@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .main-nav a { margin-left: 0; margin-right: 1rem; }
    .footer-inner { flex-direction: column; text-align: center; }
}

/* Print / Save-as-PDF */
.print-only { display: none; }

@media print {
    .site-header, .site-footer, .no-print, .alert { display: none !important; }
    body { background: #fff; color: #000; }
    .container.narrow { max-width: 100%; padding: 0; }
    .story-body { font-size: 12pt; }
    .print-only.print-footer {
        display: block;
        margin-top: 2rem;
        padding-top: 0.75rem;
        border-top: 1px solid #000;
        font-size: 10pt;
        color: #444;
    }
}
