/* ============================================================
   मान्याचीवाडी ग्रामपंचायत ग्रंथालय
   WARM EDITORIAL DESIGN SYSTEM
   Cream paper • Deep teal • Terracotta • Editorial serif
   Mobile-app on phones, software on desktop
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anek+Devanagari:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800;9..144,900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* ============ PAPER & SURFACES ============ */
    --paper: #FAF8F3;           /* Main cream background */
    --paper-warm: #F5F1E8;      /* Warmer accent surface */
    --paper-deep: #EDE8DA;      /* Borders/dividers */
    --paper-soft: #FDFCF8;      /* Lightest variant */
    --white: #FFFFFF;
    --ink: #1A1612;             /* Near-black text */

    /* ============ PRIMARY: DEEP TEAL ============ */
    --teal: #0F766E;            /* Main brand color */
    --teal-dark: #134E48;
    --teal-darker: #0A3B36;
    --teal-light: #14B8A6;
    --teal-pale: #CCFBF1;
    --teal-bg: #F0FDFA;

    /* ============ ACCENT: WARM TERRACOTTA ============ */
    --terra: #C2410C;
    --terra-dark: #9A3412;
    --terra-light: #F97316;
    --terra-pale: #FFEDD5;
    --terra-bg: #FFF7ED;

    /* ============ GOLD ACCENT (rules, dividers) ============ */
    --gold: #D4A017;
    --gold-light: #F4CF5F;
    --gold-pale: #FEF6E0;

    /* ============ TEXT HIERARCHY ============ */
    --text: #1A1612;            /* Headings */
    --text-body: #3D3530;       /* Body text */
    --text-soft: #6B5D52;       /* Secondary */
    --text-mute: #9C8F82;       /* Tertiary */
    --text-faint: #C4B8A8;      /* Disabled, hints */

    /* ============ SEMANTIC ============ */
    --success: #15803D;
    --success-bg: #F0FDF4;
    --danger: #B91C1C;
    --danger-bg: #FEF2F2;
    --warning: #B45309;
    --warning-bg: #FFFBEB;
    --info: #1D4ED8;
    --info-bg: #EFF6FF;

    /* ============ BORDERS ============ */
    --border: #E8E2D5;          /* Default border */
    --border-soft: #F0EBE0;     /* Subtle */
    --border-strong: #D4CCBC;   /* Emphasis */

    /* ============ SHADOWS — Real, refined ============ */
    --shadow-xs: 0 1px 2px rgba(26, 22, 18, 0.04);
    --shadow-sm: 0 1px 3px rgba(26, 22, 18, 0.06), 0 1px 2px rgba(26, 22, 18, 0.04);
    --shadow: 0 4px 6px -1px rgba(26, 22, 18, 0.08), 0 2px 4px -1px rgba(26, 22, 18, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(26, 22, 18, 0.08), 0 4px 6px -2px rgba(26, 22, 18, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(26, 22, 18, 0.1), 0 10px 10px -5px rgba(26, 22, 18, 0.04);
    --shadow-teal: 0 8px 24px -8px rgba(15, 118, 110, 0.35);

    /* ============ RADIUS ============ */
    --r-xs: 4px;
    --r-sm: 8px;
    --r: 12px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-full: 9999px;

    /* ============ FONTS ============ */
    --font-serif: 'Fraunces', 'Anek Devanagari', Georgia, serif;
    --font-sans: 'Inter', 'Anek Devanagari', system-ui, sans-serif;
    --font-mr: 'Anek Devanagari', sans-serif;

    /* ============ SPACING ============ */
    --space-xs: 4px;
    --space-sm: 8px;
    --space: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;

    /* ============ MOBILE BOTTOM NAV ============ */
    --bottom-nav-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--paper);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Subtle paper texture */
    background-image:
        radial-gradient(at 20% 30%, rgba(212, 160, 23, 0.015) 0%, transparent 50%),
        radial-gradient(at 80% 70%, rgba(15, 118, 110, 0.015) 0%, transparent 50%);
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.015em;
    font-variation-settings: "opsz" 144;
}

h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 28px; font-weight: 600; }
h3 { font-size: 22px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }

.serif { font-family: var(--font-serif); }
.sans { font-family: var(--font-sans); }
.mr, [lang="mr"] { font-family: var(--font-mr); font-weight: 500; }

/* Editorial number style - serif numerals */
.editorial-num {
    font-family: var(--font-serif);
    font-weight: 600;
    font-variation-settings: "opsz" 144;
    letter-spacing: -0.03em;
    font-feature-settings: "tnum" 1;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { color: var(--teal-dark); }

/* ============ GOLD RULE - Editorial divider ============ */
.gold-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
    border: none;
    margin: var(--space-md) 0;
}

.gold-rule-short {
    width: 60px;
    height: 2px;
    background: var(--gold);
    border: none;
    margin: 0 0 var(--space) 0;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    min-height: 42px;
    letter-spacing: -0.005em;
}

.btn-primary {
    background: var(--teal);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--teal-dark);
    color: var(--white);
    box-shadow: var(--shadow-teal);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-accent {
    background: var(--terra);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}
.btn-accent:hover {
    background: var(--terra-dark);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--teal);
    border-color: var(--teal);
}
.btn-outline:hover {
    background: var(--teal);
    color: var(--white);
}

.btn-soft {
    background: var(--paper-warm);
    color: var(--text);
    border-color: var(--border);
}
.btn-soft:hover {
    background: var(--paper-deep);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
}
.btn-ghost:hover {
    background: var(--paper-warm);
    color: var(--text);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    min-height: 50px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
}

.btn-icon {
    padding: 0;
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-sans);
}

.form-label .req {
    color: var(--terra);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    transition: all 0.15s;
    outline: none;
    -webkit-appearance: none;
}

.form-control:hover {
    border-color: var(--border-strong);
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.form-control::placeholder {
    color: var(--text-faint);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230F766E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

/* Custom checkbox - editorial style */
.check-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}

input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r-xs);
    background: var(--white);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.15s;
}
input[type="checkbox"]:hover { border-color: var(--teal); }
input[type="checkbox"]:checked {
    background: var(--teal);
    border-color: var(--teal);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============ CARDS ============ */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--terra);
    margin-bottom: 6px;
    display: block;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 24px 28px 28px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 18px;
    border-radius: var(--r-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    border: 1px solid;
    border-left-width: 3px;
}

.alert svg { flex-shrink: 0; margin-top: 2px; }

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: #BBF7D0;
    border-left-color: var(--success);
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #FECACA;
    border-left-color: var(--danger);
}
.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: #FDE68A;
    border-left-color: var(--warning);
}
.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: #BFDBFE;
    border-left-color: var(--info);
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--r-full);
    background: var(--paper-warm);
    color: var(--text-soft);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-sans);
}
.badge-teal { background: var(--teal-bg); color: var(--teal-dark); border-color: var(--teal-pale); }
.badge-terra { background: var(--terra-bg); color: var(--terra-dark); border-color: var(--terra-pale); }
.badge-gold { background: var(--gold-pale); color: #92760A; border-color: #FBE491; }
.badge-success { background: var(--success-bg); color: var(--success); border-color: #BBF7D0; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #FECACA; }

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-muted { color: var(--text-mute); }
.text-soft { color: var(--text-soft); }
.text-teal { color: var(--teal); }
.text-terra { color: var(--terra); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.font-serif { font-family: var(--font-serif); }

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terra);
    font-family: var(--font-sans);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-warm); }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
    border: 2px solid var(--paper-warm);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* ============ MOBILE TOUCH TARGETS ============ */
@media (max-width: 768px) {
    .btn { min-height: 48px; padding: 14px 24px; }
    .btn-sm { min-height: 40px; padding: 10px 18px; }
    .form-control { padding: 14px 16px; font-size: 16px; /* prevent iOS zoom */ }
    h1 { font-size: 28px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }
    .card-header { padding: 18px 20px 16px; }
    .card-body { padding: 18px 20px 22px; }
}
