/*
 * PA Notary Downloads — Frontend Styles
 * Version: 1.0.0
 * All selectors prefixed with #pand-wrap or .pand- to avoid theme conflicts.
 */

/* ── Reset scoped to our wrapper ────────────────────────────── */
#pand-wrap *,
#pand-wrap *::before,
#pand-wrap *::after {
    box-sizing: border-box;
}

/* ── Design tokens ───────────────────────────────────────────── */
#pand-wrap {
    --pand-red:      #CC0000;
    --pand-red-deep: #9E0000;
    --pand-yellow:   #F5C518;
    --pand-black:    #0F0F0F;
    --pand-ink:      #1C1917;
    --pand-muted:    #78716C;
    --pand-subtle:   #A8A29E;
    --pand-ghost:    #D6D3D1;
    --pand-surface:  #F5F4F2;
    --pand-border:   #E7E5E4;
    --pand-green:    #166534;

    font-family: 'Source Sans 3', sans-serif;
    color: var(--pand-ink);
    font-size: 16px;
    line-height: 1.6;
}

/* ── Dark header ─────────────────────────────────────────────── */
#pand-header {
    background: var(--pand-black);
    padding: 36px 36px 0;
    margin: 0 -20px;
    position: relative;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

/* Grid texture */
#pand-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(204,0,0,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(204,0,0,0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Glow overlays */
#pand-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 110% at -8% 65%, rgba(204,0,0,0.26) 0%, transparent 55%),
        radial-gradient(ellipse 40% 60% at 108% 18%, rgba(245,197,24,0.10) 0%, transparent 50%);
    pointer-events: none;
}

.pand-header-inner {
    position: relative;
    z-index: 2;
}

.pand-header-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Title block */
.pand-title-block { max-width: 520px; }

.pand-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--pand-red);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pand-eyebrow::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--pand-red);
    border-radius: 2px;
}

.pand-title-line1 {
    font-family: 'Merriweather', serif;
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -1px;
    display: block;
    margin-bottom: 2px;
}

.pand-title-line2 {
    font-family: 'Merriweather', serif;
    font-size: 48px;
    font-weight: 900;
    font-style: italic;
    line-height: 1.0;
    letter-spacing: -2px;
    display: block;
    margin-bottom: 14px;
    background: linear-gradient(
        105deg,
        #FF2020 0%, #CC0000 20%, #FF4500 42%,
        #F5C518 62%, #FF8C00 78%, #CC0000 92%, #FF2020 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pand-shimmer 6s linear infinite;
}

@keyframes pand-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.pand-subtitle {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.50);
    line-height: 1.6;
    max-width: 380px;
    border-left: 2px solid rgba(204,0,0,0.5);
    padding-left: 12px;
}

/* Search */
.pand-search-wrap {
    flex-shrink: 0;
    width: 320px;
    position: relative;
    align-self: center;
}

.pand-search-wrap input {
    width: 100%;
    background: rgba(255,255,255,0.09);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    padding: 13px 18px 13px 44px;
    font-size: 15px;
    font-family: 'Source Sans 3', sans-serif;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.pand-search-wrap input::placeholder { color: rgba(255,255,255,0.52); font-style: italic; }
.pand-search-wrap input:focus {
    border-color: var(--pand-red);
    background: rgba(204,0,0,0.10);
}

.pand-search-ico {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.52);
    pointer-events: none;
}

/* Tabs */
.pand-tabs {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 0 -36px;
    padding: 0 36px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.pand-tabs::-webkit-scrollbar { display: none; }

.pand-tab {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Source Sans 3', sans-serif;
    position: relative;
    transition: color 0.2s;
}

.pand-tab::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pand-red), #FF6B35, var(--pand-yellow));
    opacity: 0;
    transition: opacity 0.2s;
}

.pand-tab:hover { color: var(--pand-yellow); }
.pand-tab:hover::after { opacity: 0.7; }
.pand-tab.active { color: #fff; font-weight: 700; }
.pand-tab.active::after { opacity: 1; }

.pand-tab-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.35);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}
.pand-tab.active .pand-tab-count {
    background: rgba(245,197,24,0.2);
    color: var(--pand-yellow);
}

/* ── Content area ────────────────────────────────────────────── */
#pand-content { padding: 28px 0 72px; }

/* Filter bar */
.pand-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.pand-filter-btn {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1.5px solid var(--pand-border);
    background: #fff;
    color: var(--pand-muted);
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.pand-filter-btn:hover {
    border-color: var(--pand-red);
    color: var(--pand-red);
}

.pand-filter-btn.active {
    background: var(--pand-red);
    border-color: var(--pand-red);
    color: #fff;
}

/* Section label */
.pand-sec-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.pand-sec-title {
    font-family: 'Merriweather', serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.3px;
    background: linear-gradient(90deg, var(--pand-red) 0%, #E8442A 55%, #CC5500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.pand-sec-label::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, rgba(204,0,0,0.2), transparent);
}

.pand-sec-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--pand-muted);
    background: var(--pand-surface);
    border: 1px solid var(--pand-border);
    padding: 3px 11px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Card grid ───────────────────────────────────────────────── */
.pand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 22px;
    margin-bottom: 48px;
}

@media (max-width: 1100px) { .pand-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .pand-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .pand-grid { grid-template-columns: 1fr; } }

/* Card */
.pand-card {
    display: flex;
    flex-direction: column;
    animation: pand-card-up 0.32s ease both;
}

@keyframes pand-card-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Book cover */
.pand-cover {
    aspect-ratio: 2 / 3;
    border-radius: 4px 10px 10px 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    box-shadow:
        -4px 0 8px rgba(0,0,0,0.18),
        0 6px 20px rgba(0,0,0,0.14),
        inset -4px 0 10px rgba(0,0,0,0.10);
    cursor: pointer;
}

.pand-card:not(.pand-card--locked):hover .pand-cover {
    transform: translateY(-8px) rotate(-1.5deg) scale(1.02);
    box-shadow:
        -6px 4px 14px rgba(0,0,0,0.25),
        0 20px 40px rgba(0,0,0,0.18),
        inset -4px 0 10px rgba(0,0,0,0.10);
}

.pand-card--locked .pand-cover { cursor: default; }

/* Spine */
.pand-cover::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 6px;
    background: rgba(0,0,0,0.28);
    z-index: 3;
}

/* Grid texture overlay */
.pand-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
    z-index: 2;
}

/* Cover color themes */
.wc-1 { background: linear-gradient(160deg, #CC0000 0%, #880000 55%, #3D0000 100%); }
.wc-2 { background: linear-gradient(160deg, #0F2044 0%, #1B3D73 50%, #0A1E38 100%); }
.wc-3 { background: linear-gradient(160deg, #1A1A1A 0%, #2E2E2E 50%, #0D0D0D 100%); }
.wc-4 { background: linear-gradient(160deg, #14532D 0%, #166534 55%, #052E16 100%); }
.wc-5 { background: linear-gradient(160deg, #78350F 0%, #92400E 55%, #431407 100%); }
.wc-6 { background: linear-gradient(160deg, #1E1B4B 0%, #312E81 55%, #0F0D2A 100%); }
.wc-7 { background: linear-gradient(160deg, #831843 0%, #9D174D 55%, #4A0726 100%); }
.wc-8 { background: linear-gradient(160deg, #164E63 0%, #155E75 55%, #083344 100%); }

/* Cover inner content */
.pand-cover-inner {
    position: absolute;
    inset: 0;
    z-index: 4;
    padding: 16px 14px 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pand-cover-logo {
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
}

.pand-cover-mid {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
}

.pand-cover-type {
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 8px;
}

.pand-cover-accent {
    width: 30px;
    height: 3px;
    border-radius: 2px;
    background: var(--pand-yellow);
    margin-bottom: 10px;
}
.pand-cover-accent.red   { background: var(--pand-red); }
.pand-cover-accent.white { background: rgba(255,255,255,0.35); }
.pand-cover-accent.green { background: #4ADE80; }

.pand-cover-title {
    font-family: 'Merriweather', serif;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    line-height: 1.28;
    letter-spacing: -0.2px;
}

.pand-cover-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pand-cover-pages {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
}

.pand-cover-fmt {
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.5);
    padding: 2px 6px;
    border-radius: 2px;
}

/* New badge */
.pand-badge-new {
    position: absolute;
    top: 10px;
    right: -4px;
    z-index: 5;
    font-family: 'Oswald', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--pand-yellow);
    color: var(--pand-black);
    padding: 3px 10px 3px 8px;
    border-radius: 2px;
    box-shadow: -2px 2px 6px rgba(0,0,0,0.3);
}

.pand-badge-new::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    border-left: 4px solid #B8952E;
    border-bottom: 5px solid transparent;
}

/* Lock overlay */
.pand-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    background: rgba(0,0,0,0.60);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.pand-lock-ico { font-size: 24px; }

.pand-lock-lbl {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

/* Card info */
.pand-info {
    padding: 0 2px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pand-info-cat {
    font-size: 12px;
    font-weight: 700;
    color: var(--pand-subtle);
    margin-bottom: 4px;
}

.pand-info-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--pand-ink);
    line-height: 1.35;
    margin-bottom: 8px;
}

.pand-info-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--pand-muted);
    margin-bottom: 12px;
}

.pand-dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--pand-ghost);
    display: inline-block;
}

/* Buttons */
.pand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: auto;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    text-decoration: none !important;
}

.pand-btn--dl {
    background: var(--pand-red);
    color: #fff !important;
}
.pand-btn--dl:hover { background: var(--pand-red-deep); }

.pand-btn--read {
    background: var(--pand-black);
    color: #fff !important;
}
.pand-btn--read:hover { background: #2a2a2a; }

.pand-btn--locked {
    background: var(--pand-surface);
    color: var(--pand-subtle) !important;
    border: 1.5px solid var(--pand-border);
    cursor: not-allowed;
    pointer-events: none;
}

/* Empty state */
.pand-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--pand-muted);
    font-size: 16px;
}
.pand-empty strong {
    display: block;
    font-size: 20px;
    color: var(--pand-ink);
    margin-bottom: 8px;
}

/* Support bar */
.pand-support {
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--pand-red);
    box-shadow: 0 4px 18px rgba(204,0,0,0.28);
    flex-wrap: wrap;
}

.pand-support-text { flex: 1; min-width: 200px; }
.pand-support-title { font-size: 18px; font-weight: 700; color: #fff; }
.pand-support-sub   { font-size: 15px; color: rgba(255,255,255,0.75); margin-top: 3px; }

.pand-support-btn {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 11px 22px;
    border-radius: 4px;
    background: var(--pand-yellow);
    color: var(--pand-black) !important;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none !important;
    transition: box-shadow 0.2s;
}
.pand-support-btn:hover { box-shadow: 0 0 18px rgba(245,197,24,0.55); }

/* ── Modal ───────────────────────────────────────────────────── */
.pand-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pand-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(3px);
}

.pand-modal-panel {
    position: relative;
    z-index: 2;
    background: #fff;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.35);
    border-radius: 12px;
    overflow: hidden;
    animation: pand-modal-in 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pand-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pand-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--pand-border);
    background: var(--pand-black);
    flex-shrink: 0;
}

.pand-modal-title {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.pand-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    flex-shrink: 0;
}
.pand-modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.pand-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    -webkit-overflow-scrolling: touch;
}

.pand-modal-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--pand-muted);
    font-size: 16px;
}

/* ── Single item inside modal ────────────────────────────────── */
.pand-single-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pand-single-cat  { font-size: 12px; font-weight: 700; color: var(--pand-subtle); }

.pand-single-type {
    font-size: 11px;
    font-weight: 700;
    background: var(--pand-surface);
    border: 1px solid var(--pand-border);
    color: var(--pand-muted);
    padding: 2px 9px;
    border-radius: 10px;
}

.pand-single-pages,
.pand-single-size { font-size: 12px; color: var(--pand-muted); }

.pand-single-article {
    font-size: 16px;
    line-height: 1.8;
    color: var(--pand-ink);
    margin-bottom: 32px;
}

.pand-single-article p    { margin: 0 0 16px; }
.pand-single-article h3   { font-family: 'Merriweather', serif; font-size: 18px; font-weight: 900; color: var(--pand-ink); margin: 28px 0 12px; }
.pand-single-article ul,
.pand-single-article ol   { padding-left: 24px; margin: 0 0 16px; }
.pand-single-article li   { margin-bottom: 6px; }
.pand-single-article strong { color: var(--pand-ink); }

.pand-single-download {
    border-top: 1px solid var(--pand-border);
    padding-top: 24px;
}

.pand-btn--full { max-width: 320px; margin-bottom: 8px; }

.pand-dl-info {
    font-size: 12px;
    color: var(--pand-muted);
    margin: 0;
}
