/**
 * GrBiz Business Pages — Public Profile Styles
 *
 * Single-column layout following the original site template:
 * centered header, one continuous label/value list, documents.
 * All-white, theme font, one consistent type scale.
 *
 * @package GrBiz_Business_Pages
 * @since   1.2.2
 */

/* ── Design Tokens ────────────────────────────────── */
.grbiz-profile {
    --grbiz-ink:        #1a2332;   /* headings */
    --grbiz-text:       #333d4d;   /* body text */
    --grbiz-muted:      #6b7486;   /* labels, footer */
    --grbiz-accent:     #b8860b;   /* gold accents (links, rules) */
    --grbiz-border:     #e5e8ee;
    --grbiz-radius:     10px;
}

/* ── White background everywhere ──────────────────── */
/* Class added to <body> by public-profile.js */
body.grbiz-profile-page,
body.grbiz-profile-page #wrapper,
body.grbiz-profile-page #main,
body.grbiz-profile-page .page-wrapper {
    background: #ffffff !important;
}

/* ── Base Wrapper ─────────────────────────────────── */
.grbiz-profile {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px 56px;
    background: #ffffff;
    font-family: inherit;          /* match the site's theme font */
    font-size: 16px;
    color: var(--grbiz-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
.grbiz-profile *,
.grbiz-profile *::before,
.grbiz-profile *::after {
    box-sizing: border-box;
}

/* ── Typography normalization ─────────────────────── */
/* Profile content comes from rich-text editors and ΓΕΜΗ imports that
   carry their own inline sizes/fonts — force one consistent scale. */
.grbiz-profile p,
.grbiz-profile span,
.grbiz-profile li,
.grbiz-profile td,
.grbiz-profile th,
.grbiz-profile div,
.grbiz-profile font,
.grbiz-profile strong,
.grbiz-profile em {
    font-family: inherit !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
    color: var(--grbiz-text) !important;
}
.grbiz-profile strong,
.grbiz-profile th {
    font-weight: 600 !important;
}

/* ── Header (centered: title, logo, intro) ────────── */
.grbiz-profile-hero {
    background: #ffffff;
    text-align: center;
    padding: 36px 20px 32px;
    border-bottom: 2px solid var(--grbiz-accent);
    margin-bottom: 8px;
}
.grbiz-profile-hero h1,
.grbiz-profile-hero-title {
    font-family: inherit;
    font-size: 1.9rem !important;
    font-weight: 700;
    color: var(--grbiz-ink) !important;
    letter-spacing: -0.01em;
    line-height: 1.25 !important;
    margin: 0 0 22px;
}
.grbiz-profile-hero h1 * {
    font-size: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
}
.grbiz-profile-logo {
    max-width: 420px;
    margin: 0 auto 22px;
}
.grbiz-profile-logo img {
    max-width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;           /* never crop logos */
    border-radius: var(--grbiz-radius);
    background: #ffffff;
}
.grbiz-profile-intro {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

/* ── Label / value rows (original table, modernized) ── */
.grbiz-profile-rows {
    margin-top: 12px;
}
.grbiz-profile-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 8px 28px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--grbiz-border);
}
.grbiz-profile-row:last-child { border-bottom: none; }
.grbiz-profile-row-label {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grbiz-muted) !important;
    padding-top: 3px;
}
.grbiz-profile-row-value {
    word-break: break-word;
    min-width: 0;
}
.grbiz-profile-row-value > :first-child { margin-top: 0 !important; }
.grbiz-profile-row-value > :last-child  { margin-bottom: 0 !important; }

/* Lists inside values (e.g. Δραστηριότητες from ΓΕΜΗ) */
.grbiz-profile-row-value ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}
.grbiz-profile-row-value ul li {
    padding: 4px 0 4px 18px;
    position: relative;
}
.grbiz-profile-row-value ul li::before {
    content: '›';
    position: absolute;
    left: 2px;
    color: var(--grbiz-accent);
    font-weight: 700;
}

/* Tables inside values (Εταίροι / Διαχειριστής from ΓΕΜΗ) */
.grbiz-profile table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
    background: #ffffff;
}
.grbiz-profile table th,
.grbiz-profile table td {
    text-align: left;
    padding: 8px 10px !important;
    border-bottom: 1px solid var(--grbiz-border) !important;
    background: #ffffff !important;
}
.grbiz-profile table tr:last-child td { border-bottom: none !important; }

/* ── Documents (centered, as in the original) ─────── */
.grbiz-profile-files {
    text-align: center;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid var(--grbiz-accent);
}
.grbiz-profile-files-title {
    font-family: inherit;
    font-size: 1.3rem !important;
    font-weight: 700;
    color: var(--grbiz-ink) !important;
    margin: 0 0 20px;
}
.grbiz-profile-documents {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.grbiz-profile-doc {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: #ffffff;
    border: 1px solid var(--grbiz-border);
    border-radius: calc(var(--grbiz-radius) - 2px);
    text-decoration: none;
    max-width: 100%;
}
.grbiz-profile-doc:hover {
    border-color: var(--grbiz-accent);
}
.grbiz-profile-doc-icon { flex-shrink: 0; }
.grbiz-profile-doc-name {
    font-weight: 500 !important;
    word-break: break-word;
}

/* ── Links ────────────────────────────────────────── */
.grbiz-profile a {
    color: var(--grbiz-accent) !important;
    text-decoration: none;
    font-weight: 500;
}
.grbiz-profile a:hover {
    color: var(--grbiz-ink) !important;
    text-decoration: underline;
}

/* ── Footer ───────────────────────────────────────── */
.grbiz-profile-footer {
    text-align: center;
    padding: 32px 16px 0;
    margin-top: 36px;
    border-top: 1px solid var(--grbiz-border);
}
.grbiz-profile-footer p,
.grbiz-profile-footer span {
    font-size: 0.85rem !important;
    color: var(--grbiz-muted) !important;
    margin: 0 0 4px;
}
.grbiz-print-btn {
    background: #ffffff;
    border: 1px solid var(--grbiz-border);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.9rem !important;
    color: var(--grbiz-text) !important;
    cursor: pointer;
    margin-bottom: 14px;
}
.grbiz-print-btn:hover { border-color: var(--grbiz-accent); }

/* ── Preview note (owner viewing unpublished page) ── */
.grbiz-profile-preview-note { font-size: 0.95rem; }

/* ── Unpublished / Empty State ────────────────────── */
.grbiz-profile-unpublished {
    text-align: center;
    padding: 70px 24px;
}
.grbiz-profile-unpublished h2 {
    font-size: 1.4rem !important;
    font-weight: 700;
    color: var(--grbiz-ink) !important;
    margin: 0 0 10px;
}
.grbiz-profile-unpublished p {
    max-width: 440px;
    margin: 0 auto;
    color: var(--grbiz-muted) !important;
}
.grbiz-profile-unpublished-icon { font-size: 2rem; margin-bottom: 10px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .grbiz-profile { padding: 20px 14px 44px; }
    .grbiz-profile-hero { padding: 24px 8px 22px; }
    .grbiz-profile-hero h1,
    .grbiz-profile-hero-title { font-size: 1.5rem !important; }
    .grbiz-profile-logo { max-width: 300px; }
    .grbiz-profile-logo img { max-height: 180px; }

    /* Stack label above value on small screens */
    .grbiz-profile-row {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 12px 2px;
    }
    .grbiz-profile-row-label { padding-top: 0; }
}

/* ══════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════ */
@media print {
    .grbiz-profile { max-width: 100%; padding: 0; }
    .grbiz-profile-hero { border-bottom: 2px solid #000; padding: 16px 0; }
    .grbiz-profile-row { break-inside: avoid; padding: 8px 0; }
    .grbiz-profile-logo img { max-height: 100px; }
    .grbiz-print-btn { display: none; }
    a[href]::after { content: ' (' attr(href) ')'; font-size: 0.75em; color: #666; }
}
