/* =====================================================================
 * share-card.css — Social Share Card Studio (modal + full-page) styles.
 * The live preview is a <canvas> rendered at export resolution and
 * scaled down with CSS, so the preview is identical to the PNG.
 * ===================================================================== */

.pa-studio { color: var(--pa-ink, #1f2430); }
.pa-studio__grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* ---- Controls ---- */
.pa-studio__controls { display: grid; gap: 18px; align-content: start; }
.pa-studio__section {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 3px 12px rgba(20, 20, 40, 0.06);
}
.pa-studio__h { margin: 0 0 12px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pa-muted, #5c6472); }
.pa-studio__hint { margin: 10px 0 0; font-size: 0.82rem; color: var(--pa-muted, #5c6472); }

.pa-studio__ratios { display: flex; gap: 10px; flex-wrap: wrap; }
.pa-ratio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #f6f7f9;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.82rem;
    min-width: 62px;
}
.pa-ratio__box { width: 34px; background: #dfe3e8; border-radius: 4px; display: block; }
.pa-ratio.is-active { border-color: var(--pa-accent, #d9534f); box-shadow: 0 0 0 2px var(--pa-accent, #d9534f) inset; background: #fff; }
.pa-ratio:focus-visible { outline: 3px solid color-mix(in srgb, var(--pa-accent, #d9534f) 45%, #fff); outline-offset: 2px; }

.pa-studio__themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pa-theme {
    background: #fff; border: 1px solid rgba(0,0,0,0.1); border-radius: 12px; padding: 8px; cursor: pointer;
    display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.pa-theme__swatch {
    width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; border: 2px solid; display: flex;
    flex-direction: column; gap: 5px; padding: 10px; align-items: center; justify-content: center;
}
.pa-theme__line { display: block; width: 70%; height: 6px; border-radius: 3px; background: currentColor; opacity: 0.85; }
.pa-theme__line--s { width: 45%; height: 4px; opacity: 0.55; }
.pa-theme__label { font-size: 0.76rem; color: var(--pa-muted, #5c6472); text-align: center; }
.pa-theme.is-active { border-color: var(--pa-accent, #d9534f); box-shadow: 0 0 0 2px var(--pa-accent, #d9534f); }
.pa-theme:focus-visible { outline: 3px solid color-mix(in srgb, var(--pa-accent, #d9534f) 45%, #fff); outline-offset: 2px; }

/* ---- Background style picker (10 theme-tinted thumbnails) ---- */
.pa-studio__bgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pa-bg {
    background: #fff; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 10px; padding: 6px;
    cursor: pointer; display: flex; flex-direction: column; gap: 5px; align-items: center;
}
.pa-bg__thumb { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.08); }
.pa-bg__label { font-size: 0.68rem; color: var(--pa-muted, #5c6472); text-align: center; line-height: 1.25; }
.pa-bg.is-active { border-color: var(--pa-accent, #d9534f); box-shadow: 0 0 0 2px var(--pa-accent, #d9534f); }
.pa-bg:focus-visible { outline: 3px solid color-mix(in srgb, var(--pa-accent, #d9534f) 45%, #fff); outline-offset: 2px; }

/* ---- Custom background photo controls ---- */
.pa-studio__row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.pa-studio__mini { font-size: 0.82rem; color: var(--pa-muted, #5c6472); }
.pa-filebtn {
    position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    background: var(--pa-accent, #d9534f); color: #fff; border-radius: 999px; padding: 9px 15px;
    font-size: 0.86rem; font-weight: 600; user-select: none;
}
.pa-filebtn:hover { filter: brightness(0.94); }
.pa-filebtn:focus-within { outline: 3px solid color-mix(in srgb, var(--pa-accent, #d9534f) 45%, #fff); outline-offset: 2px; }
.pa-filebtn input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.pa-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; cursor: pointer; }
/* .pa-btn sets display:inline-flex, which beats the UA [hidden] rule — restore it. */
.pa-studio [hidden] { display: none !important; }

.pa-studio__slider { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.9rem; margin-bottom: 12px; }
.pa-studio__slider input[type="range"] { flex: 1; }
.pa-switch { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; margin-bottom: 8px; cursor: pointer; }

.pa-studio__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Preview ---- */
.pa-studio__preview { display: flex; justify-content: center; align-items: flex-start; }
.pa-studio__canvas-wrap {
    width: 100%;
    max-width: 420px;
    background: repeating-conic-gradient(#eef0f3 0% 25%, #f7f8fa 0% 50%) 50% / 22px 22px;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(20, 20, 40, 0.1);
}
.pa-studio__canvas-wrap canvas { width: 100%; height: auto; display: block; border-radius: 6px; }

/* ---- Modal ---- */
.pa-studio-modal {
    position: fixed; inset: 0; z-index: 1000002;
    background: rgba(15, 18, 28, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    animation: pa-fade 0.18s ease;
}
.pa-studio-modal__panel {
    background: #f4f5f7;
    width: 100%;
    max-width: 960px;
    max-height: 100vh;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pa-studio-modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08);
}
.pa-studio-modal__title { margin: 0; font-size: 1.05rem; }
.pa-studio-modal__close {
    border: none; background: #eceef1; width: 38px; height: 38px; border-radius: 10px;
    font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.pa-studio-modal__close:hover { background: #e0e2e6; }
.pa-studio-modal__body { padding: 16px; overflow: auto; flex: 1; }
.pa-noscroll { overflow: hidden; }

@keyframes pa-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Social platform picker (sits above the studio modal) ---- */
.pa-share-sheet {
    position: fixed; inset: 0; z-index: 1000004;
    background: rgba(12, 15, 24, 0.6);
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    animation: pa-fade 0.16s ease;
}
.pa-share-sheet__panel {
    background: #fff; width: 100%; max-width: 480px;
    max-height: calc(100vh - 36px); overflow-y: auto; overscroll-behavior: contain;
    border-radius: 16px; padding: 16px 16px 14px;
    box-shadow: 0 18px 48px rgba(10, 12, 20, 0.32);
}
.pa-share-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pa-share-sheet__title { margin: 0; font-size: 1.02rem; }
.pa-share-sheet__close {
    border: none; background: #eceef1; width: 34px; height: 34px; border-radius: 9px;
    font-size: 1.3rem; line-height: 1; cursor: pointer; flex: 0 0 auto;
}
.pa-share-sheet__close:hover { background: #e0e2e6; }
.pa-share-sheet__sub {
    margin: 10px 0 12px; font-size: 0.98rem; line-height: 1.45;
    color: var(--pa-ink, #1f2430); font-family: 'Noto Sans Gurmukhi', sans-serif;
}
.pa-share-sheet__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pa-share__tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    background: #f6f7f9; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 12px;
    padding: 10px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.pa-share__tile:hover { background: #fff; border-color: var(--pa-accent, #d9534f); }
.pa-share__tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--pa-accent, #d9534f) 45%, #fff); outline-offset: 2px; }
.pa-share__icon { font-size: 1.15rem; line-height: 1.2; }
.pa-share__name { font-size: 0.9rem; font-weight: 600; }
.pa-share__hint { font-size: 0.72rem; color: var(--pa-muted, #5c6472); }
.pa-share-sheet__note { margin: 12px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--pa-muted, #5c6472); }

@media (min-width: 520px) {
    .pa-share-sheet__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Desktop / tablet: two-column studio, modal as large dialog ---- */
@media (min-width: 640px) {
    .pa-studio-modal { padding: 24px; }
    .pa-studio-modal__panel { border-radius: 18px; height: auto; max-height: 92vh; }
    .pa-studio__grid { grid-template-columns: 360px 1fr; }
    .pa-studio__bgs { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 900px) {
    .pa-studio__grid { grid-template-columns: 380px 1fr; }
    .pa-studio__canvas-wrap { max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
    .pa-studio-modal { animation: none; }
}
