/* Public pages for /q/{public_id}: the public question (resources/views/publicQuestion.blade.php, drawn by public/js/public-question.js)
   and the private question note (privateQuestionOnWeb.blade.php). Shared parts: templates/publicPage/*.blade.php.
   Standalone: no Bootstrap, no style.css or other logged-in page styles. Everything is .pq-* so nothing leaks either way.
   The colours follow the logged-in question page (question-page.css) so both look like one product. */

/* Rubik (files in public/fonts/rubik, the same as the Android app): woff2 (small), ttf for very old browsers.
   600 / 800 use Bold (nearest weight). */
@font-face {
    font-family: Rubik;
    src: url('../fonts/rubik/Rubik-Light.woff2') format('woff2'), url('../fonts/rubik/Rubik-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Rubik;
    src: url('../fonts/rubik/Rubik-Regular.woff2') format('woff2'), url('../fonts/rubik/Rubik-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Rubik;
    src: url('../fonts/rubik/Rubik-Medium.woff2') format('woff2'), url('../fonts/rubik/Rubik-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: Rubik;
    src: url('../fonts/rubik/Rubik-Bold.woff2') format('woff2'), url('../fonts/rubik/Rubik-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.pq-page {
    --pq-primary: #2563eb;
    --pq-primary-hover: #1d4ed8;
    --pq-primary-soft: rgba(37, 99, 235, 0.10);
    --pq-text: #0f172a;
    --pq-body: #334155;
    --pq-muted: #64748b;
    --pq-border: #d9dfe7;
    --pq-border-soft: #e2e8f0;
    --pq-surface: #ffffff;
    --pq-surface-alt: #f8fafc;
    --pq-bg: #f1f5f9;
    --pq-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.pq-page *,
.pq-page *::before,
.pq-page *::after {
    box-sizing: border-box;
}

.pq-page {
    margin: 0;
    background: var(--pq-bg);
    color: var(--pq-body);
    font-family: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 500; /* Rubik Medium by default; names / titles / headings stay Bold */
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}
.pq-page a {
    color: var(--pq-primary);
    text-decoration: none;
}
.pq-page a:hover {
    text-decoration: underline;
}
.pq-page img {
    max-width: 100%;
}

/* ---------- App bar ---------- */
.pq-appbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--pq-border-soft);
}
.pq-appbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
    padding: 10px 16px;
}
.pq-page .pq-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--pq-text);
}
.pq-page .pq-brand:hover {
    text-decoration: none;
}
.pq-brand-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}
.pq-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.pq-brand-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pq-brand-sub {
    font-size: 12.5px;
    color: var(--pq-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Buttons ---------- */
.pq-page .pq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: capitalize;
    cursor: pointer;
    transition: background-color .15s ease;
}
.pq-page .pq-btn:hover,
.pq-page .pq-btn:focus {
    text-decoration: none;
}
.pq-page .pq-btn-primary {
    flex: 0 0 auto;
    background: var(--pq-primary);
    color: #fff;
}
.pq-page .pq-btn-primary:hover,
.pq-page .pq-btn-primary:focus {
    background: var(--pq-primary-hover);
    color: #fff;
}
.pq-page .pq-btn-dark {
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--pq-text);
    color: #fff;
    text-transform: none;
}
.pq-page .pq-btn-dark:hover,
.pq-page .pq-btn-dark:focus {
    background: #1e293b;
    color: #fff;
}
.pq-page .pq-btn:focus-visible,
.pq-quoted:focus-visible {
    outline: 2px solid var(--pq-primary);
    outline-offset: 2px;
}

/* ---------- Page ---------- */
.pq-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.pq-page .pq-staff-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--pq-primary);
    font-weight: 700;
    font-size: 14px;
}
.pq-page .pq-staff-link:hover {
    background: #dbeafe;
    text-decoration: none;
}

/* ---------- Cards ---------- */
.pq-card {
    margin-bottom: 12px;
    padding: 26px 22px;
    background: var(--pq-surface);
    border: 1px solid var(--pq-border);
    border-radius: 14px;
    box-shadow: var(--pq-shadow);
}

/* Author */
.pq-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.pq-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}
.pq-avatar-ashkenazi { background: #e0f2fe; color: #075985; }
.pq-avatar-sephardic { background: #fce7f3; color: #9d174d; }
.pq-avatar-unknown   { background: #f3e8ff; color: #6b21a8; }
.pq-avatar-rabbi     { background: var(--pq-primary-soft); color: var(--pq-primary); }
.pq-author-info {
    min-width: 0;
}
.pq-author-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.pq-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--pq-text);
    word-break: break-word;
}
.pq-verified {
    width: 14px;
    height: 14px;
}
.pq-dot {
    color: var(--pq-muted);
}
.pq-date {
    font-size: 12.5px;
    color: var(--pq-muted);
}
.pq-date-today {
    color: #16a34a;
}

/* Badges (private, deleted) */
.pq-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border: 1px solid var(--pq-border-soft);
    border-radius: 6px;
    background: var(--pq-surface-alt);
    color: var(--pq-muted);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    text-transform: capitalize;
}
.pq-badge-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Title and text */
.pq-title {
    margin: 16px 0 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: #333; /* same text colour as the pre-redesign page (Bootstrap's #333) */
    word-wrap: break-word;
}
.pq-title-sm {
    margin-top: 10px;
    font-size: 16px;
}
.pq-text {
    margin-top: 10px;
    /* 17px like the Android app (17dp); line height = Rubik's own line height (1.185em) + 8px extra */
    font-size: 17px;
    line-height: calc(1.185em + 8px);
    color: #333; /* same text colour as the pre-redesign page (Bootstrap's #333) */
    word-wrap: break-word;
}
.pq-answer .pq-text {
    margin-top: 12px;
}

/* Images */
.pq-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 14px;
}
.pq-page .pq-image {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--pq-border-soft);
    border-radius: 10px;
    background: var(--pq-surface-alt);
}
.pq-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}
.pq-image:hover img {
    transform: scale(1.03);
}

/* Quoted question */
.pq-quoted {
    display: block;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--pq-surface-alt);
    border: 1px solid var(--pq-border-soft);
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.pq-quoted:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.pq-quoted-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pq-muted);
}
.pq-quoted-vis {
    margin-left: auto;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.pq-quoted-vis::first-letter {
    text-transform: uppercase;
}
.pq-quoted .pq-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
}
.pq-quoted .pq-text {
    font-size: 15px;
}

/* Categories */
.pq-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.pq-tag {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--pq-bg);
    color: var(--pq-body);
    font-size: 12.5px;
    font-weight: 600;
}

/* Answers heading */
.pq-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 26px 2px 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--pq-text);
    text-transform: capitalize;
}
.pq-count {
    padding: 0 8px;
    border-radius: 999px;
    background: var(--pq-border-soft);
    color: var(--pq-body);
    font-size: 12px;
}

/* "Rabbi X will answer this question" */
.pq-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    font-weight: 600;
}
.pq-info svg {
    flex: 0 0 auto;
}

/* ---------- Private question note ---------- */
.pq-private {
    padding: 36px 24px 32px;
    text-align: center;
}
.pq-private-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--pq-primary-soft);
    color: var(--pq-primary);
}
.pq-private-title {
    margin: 14px 0 0;
    font-size: 21px;
    font-weight: 700;
    color: var(--pq-text);
    text-transform: capitalize;
}
.pq-private-text {
    max-width: 420px;
    margin: 8px auto 20px;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--pq-body);
}
.pq-private .pq-btn-primary {
    height: 40px;
    padding: 0 24px;
}

/* ---------- Get the app ---------- */
.pq-cta {
    margin-top: 32px;
    padding: 28px 20px;
    border-radius: 16px;
    background: var(--pq-surface);
    border: 1px solid var(--pq-border);
    text-align: center;
}
.pq-cta-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}
.pq-cta-name {
    margin-top: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--pq-text);
}
.pq-cta-sub {
    margin-top: 2px;
    color: var(--pq-muted);
}
.pq-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

/* ---------- Small screens ---------- */
@media (max-width: 575px) {
    .pq-main {
        padding: 14px 12px 32px;
    }
    .pq-card {
        padding: 20px 16px;
    }
    .pq-title {
        font-size: 19px;
    }
    /* .pq-text keeps 17px on phones, like the Android app */
    .pq-brand-sub {
        display: none;
    }
    .pq-images {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }
}

/* ---------- Print ---------- */
@media print {
    .pq-appbar, .pq-cta, .pq-staff-link {
        display: none;
    }
    .pq-page {
        background: #fff;
    }
    .pq-card {
        box-shadow: none;
    }
}
