/* Sindhi Swayamvar. One stylesheet, no build step, no third-party assets. */

:root {
    --ink: #2b1d22;
    --ink-soft: #6a5a5f;
    --paper: #fbf6ef;
    --card: #ffffff;
    --line: #e7dccf;
    --maroon: #7b1e3a;
    --maroon-dark: #5c1229;
    --gold: #b8842f;
    --gold-soft: #f6ead3;
    --ok: #1f6b45;
    --ok-bg: #e4f3ea;
    --warn: #8a5a00;
    --warn-bg: #fbefd2;
    --error: #a3261f;
    --error-bg: #fbe6e3;
    --info: #24507a;
    --info-bg: #e5eef7;
    --radius: 10px;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font: 16px/1.6 var(--sans);
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 56px; }
main.narrow { max-width: 620px; }
main.prose { max-width: 760px; }

h1, h2, h3, legend { font-family: var(--serif); color: var(--maroon-dark); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: 1.25rem; margin: 0 0 10px; }
p { margin: 0 0 14px; }
a { color: var(--maroon); text-underline-offset: 3px; }
a:hover { color: var(--maroon-dark); }
code { font-size: 0.85em; background: var(--gold-soft); padding: 1px 5px; border-radius: 4px; }

.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 62ch; }
.muted, .help { color: var(--ink-soft); font-size: 0.92rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; color: var(--gold); font-weight: 700; margin-bottom: 6px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Header and footer */
.site-header { background: var(--maroon-dark); color: #fff; border-bottom: 3px solid var(--gold); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--maroon-dark); font-size: 1.05rem; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a, .nav .link { color: #f6e9d6; text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav .link:hover { color: #fff; text-decoration: underline; }
.nav form { margin: 0; }
.nav .btn { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); }

.site-footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 0.9rem; color: var(--ink-soft); background: #f6eee3; }
.site-footer p { margin: 0 0 4px; }

/* Buttons */
.btn {
    display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
    background: var(--maroon); color: #fff; border: 2px solid var(--maroon); border-radius: 8px; padding: 10px 20px;
}
.btn:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); color: #fff; }
.btn-small { padding: 6px 14px; font-size: 0.92rem; }
.btn-ghost { background: transparent; color: var(--maroon); }
.btn-ghost:hover { background: var(--gold-soft); color: var(--maroon-dark); }
.btn-accent { background: var(--gold); border-color: var(--gold); color: var(--maroon-dark); }
.btn-accent:hover { background: #a37325; border-color: #a37325; color: #fff; }
.btn-danger { background: var(--error); border-color: var(--error); }
.btn-danger:hover { background: #7f1b16; border-color: #7f1b16; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--maroon); text-decoration: underline; cursor: pointer; text-underline-offset: 3px; }
.link-danger { color: var(--error); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.actions form { margin: 0; }

/* Cards, notices, pills */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 18px; }
.card-danger { border-color: #e3b4b0; }
.card-private { background: #fdfaf4; border-style: dashed; }

.notice { border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; border: 1px solid; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-ok { background: var(--ok-bg); border-color: #b5dcc5; color: var(--ok); }
.notice-error { background: var(--error-bg); border-color: #efbdb8; color: var(--error); }
.notice-info { background: var(--info-bg); border-color: #bcd1e6; color: var(--info); }

.pill { display: inline-block; font: 600 0.78rem/1 var(--sans); padding: 5px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--warn); vertical-align: middle; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-error { background: var(--error-bg); color: var(--error); }
.pill-info { background: var(--info-bg); color: var(--info); }

/* Forms */
.form { margin: 0 0 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font-size: 1.15rem; padding: 0; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; }
.field { margin: 0 0 14px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: 0.93rem; margin-bottom: 4px; }
.req { color: var(--error); }
input, select, textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cdbfb0; border-radius: 8px; padding: 9px 11px;
}
input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin: 3px 0 0; accent-color: var(--maroon); }
input[type="file"] { padding: 7px; background: #fdfaf4; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--maroon); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.error { color: var(--error); font-size: 0.9rem; margin: 4px 0 0; }
.help { margin: 4px 0 0; }
.check { display: flex; gap: 10px; font-weight: 400; margin-bottom: 12px; }
.code-input { font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; max-width: 260px; }
.inline-form { margin: 0 0 14px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-row .field { flex: 1 1 220px; margin-bottom: 0; }
.form-row input { min-width: 140px; }
.filter { margin-bottom: 20px; }

/* Home */
.hero { padding: 36px 0 28px; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3rem); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 20px 0 32px; }
.grid-3 .card { margin: 0; border-top: 3px solid var(--gold); }
.steps ol { padding-left: 22px; max-width: 70ch; }
.steps li { margin-bottom: 8px; }

/* Dashboard */
.status-card { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.meter-box { min-width: 200px; }
.meter-label { font-weight: 700; margin-bottom: 4px; }
progress { width: 100%; height: 12px; accent-color: var(--maroon); }
.todo { padding-left: 20px; margin: 0; columns: 2 220px; }

/* Profile editor */
.editor { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tabs a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 0.95rem; }
.tabs a:hover { background: var(--gold-soft); }
.tabs a.active { background: var(--maroon); color: #fff; font-weight: 600; }
.tabs-row { flex-direction: row; flex-wrap: wrap; margin: 0 0 22px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }

/* Profile view */
.profile-head { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; margin-bottom: 22px; align-items: start; }
.profile-photo img, .photo-empty { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--gold-soft); }
.photo-empty { display: grid; place-items: center; color: var(--ink-soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 22px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; height: auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 20px; margin: 0; }
.facts .wide { grid-column: 1 / -1; }
dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
dd { margin: 0; overflow-wrap: anywhere; }

/* Photos */
.photo-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.photo-grid .card { margin: 0; padding: 12px; }
.photo-grid img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 10px; background: var(--gold-soft); }
.photo-grid p { margin-bottom: 8px; }

/* Sessions */
.sessions { list-style: none; padding: 0; margin: 12px 0; }
.sessions li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sessions form { margin: 0; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 0 0 20px; }
.stats .card { margin: 0; }
.stats dd { font: 600 2rem/1.2 var(--serif); color: var(--maroon-dark); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); background: #faf4ea; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
.pager { display: flex; gap: 18px; justify-content: center; align-items: center; margin: 18px 0; }

.error-page { padding-top: 80px; }

@media (max-width: 760px) {
    .editor, .profile-head { grid-template-columns: 1fr; }
    .tabs { flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
    .tabs a { white-space: nowrap; }
    .profile-photo { max-width: 260px; }
    main.wrap { padding-top: 22px; }
}

/* Legal pages */
.legal h2 { margin-top: 28px; }
.legal ol { padding-left: 22px; }
.legal li { margin-bottom: 7px; }
