/* ================================================================
   library.css  —  LNMS College Library Page
   Design system: same tokens, fonts & patterns as home.css
   Sections:
     1.  Mini Hero  (identical to principals_list pattern)
     2.  AOS Scroll Reveal
     3.  Quick Info Strip
     4.  Library Rules Area Shell
     5.  Section Title
     6.  Rules Grid & Cards
     7.  Restricted Books Sub-list
     8.  Closing Notice
     9.  Responsive
   ================================================================ */

/* ── Font import ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Noto+Sans+Devanagari:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Design tokens (mirror of home.css) ─────────────────────── */
:root {
    --blue:        #1E3A8A;
    --blue-dark:   #162d6e;
    --blue-mid:    #2a4fa8;
    --blue-light:  #dbeafe;
    --green:       #22C55E;
    --green-dark:  #16a34a;
    --green-light: #dcfce7;
    --amber:       #F59E0B;
    --amber-dark:  #b45309;
    --amber-light: #fef3c7;
    --bg:          #F8FAFC;
    --card:        #ffffff;
    --text:        #0F172A;
    --text-muted:  #475569;
    --border:      #e2e8f0;
    --shadow-sm:   0 2px 10px rgba(15,23,42,.08);
    --shadow-md:   0 6px 24px rgba(15,23,42,.12);
    --shadow-lg:   0 16px 48px rgba(15,23,42,.18);
    --shadow-blue: 0 8px 28px rgba(30,58,138,.28);
    --r-sm:        8px;
    --r-md:        14px;
    --r-lg:        20px;
    --r-xl:        28px;
    --r-pill:      50px;
    --t:           0.3s ease;
    --font:        'Poppins','Noto Sans Devanagari',sans-serif;
    --font-deva:   'Noto Sans Devanagari','Poppins',sans-serif;
}


/* ================================================================
   1. MINI HERO  (identical structure to principals_list)
   ================================================================ */
.lib-mini-hero {
    position: relative;
    width: 100%;
    height: 320px;
    min-height: 260px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1E3A8A 55%, #2a4fa8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
}

/* Noise overlay */
.lib-mini-hero__overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.22;
    pointer-events: none;
    z-index: 1;
}

/* Decorative rings */
.lib-mini-hero__ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}
.lib-mini-hero__ring--lg {
    top: -90px;
    right: -90px;
    width: 340px;
    height: 340px;
    border: 64px solid rgba(30,58,138,.22);
}
.lib-mini-hero__ring--sm {
    bottom: -55px;
    left: -55px;
    width: 210px;
    height: 210px;
    border: 42px solid rgba(34,197,94,.10);
}

/* Animated grid */
.lib-mini-hero__grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 48px 48px;
    animation: libGridDrift 18s linear infinite;
}
@keyframes libGridDrift {
    from { background-position: 0 0; }
    to   { background-position: 48px 48px; }
}

/* Large decorative book icon — background flair */
.lib-mini-hero__deco {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9rem;
    color: rgba(255,255,255,.04);
    pointer-events: none;
    z-index: 3;
    line-height: 1;
    animation: libDecoFloat 6s ease-in-out infinite;
}
@keyframes libDecoFloat {
    0%, 100% { transform: translateY(-50%); }
    50%       { transform: translateY(calc(-50% - 12px)); }
}

/* Content */
.lib-mini-hero__body {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Breadcrumb */
.lib-mini-hero__breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(12px);
    animation: libFadeUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.1s forwards;
}
.lib-mini-hero__bc-link {
    font-size: .78rem;
    font-weight: 500;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .2s ease;
}
.lib-mini-hero__bc-link:hover { color: var(--green); text-decoration: none; }
.lib-mini-hero__bc-sep        { color: rgba(255,255,255,.25); font-size: .78rem; }
.lib-mini-hero__bc-current    { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.80); }

/* Eyebrow badge */
.lib-mini-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34,197,94,.15);
    border: 1px solid rgba(34,197,94,.45);
    color: var(--green);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 5px 18px;
    border-radius: var(--r-pill);
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(14px);
    animation: libFadeUp 0.65s cubic-bezier(0.22,1,0.36,1) 0.25s forwards;
}
.lib-mini-hero__badge-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: libPulse 2s ease-in-out infinite;
}

/* Heading */
.lib-mini-hero__heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.12;
    letter-spacing: -.02em;
    margin: 0 0 12px;
    opacity: 0;
    transform: translateY(20px);
    animation: libFadeUp 0.7s cubic-bezier(0.22,1,0.36,1) 0.42s forwards;
}
.lib-mini-hero__heading em {
    font-style: normal;
    color: var(--green);
    position: relative;
}
.lib-mini-hero__heading em::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 3px;
    background: var(--green);
    border-radius: 2px;
    transform-origin: left;
    transform: scaleX(0);
    animation: libUnderline 0.55s cubic-bezier(0.22,1,0.36,1) 1.1s forwards;
}

/* Sub text */
.lib-mini-hero__sub {
    color: rgba(255,255,255,.62);
    font-size: clamp(.85rem, 1.6vw, 1rem);
    font-weight: 300;
    max-width: 480px;
    line-height: 1.65;
    margin: 0;
    opacity: 0;
    transform: translateY(16px);
    animation: libFadeUp 0.7s cubic-bezier(0.22,1,0.36,1) 0.58s forwards;
}

/* Keyframes */
@keyframes libFadeUp    { to { opacity: 1; transform: translateY(0); } }
@keyframes libUnderline { to { transform: scaleX(1); } }
@keyframes libPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(.8); }
}

/* Mini hero responsive */
@media (max-width: 768px) {
    .lib-mini-hero { height: 260px; min-height: 220px; }
    .lib-mini-hero__ring--lg {
        width: 200px; height: 200px;
        border-width: 40px;
        top: -60px; right: -60px;
    }
    .lib-mini-hero__deco { display: none; }
}
@media (max-width: 480px) {
    .lib-mini-hero { height: 230px; }
    .lib-mini-hero__sub { display: none; }
}


/* ================================================================
   2. AOS SCROLL REVEAL
   ================================================================ */
[data-aos] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.22,1,0.36,1),
                transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}


/* ================================================================
   3. QUICK INFO STRIP
   ================================================================ */
.lib-info-strip {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.lib-info-strip__inner {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

/* Info card */
.lib-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 36px;
    flex: 1 1 200px;
    transition: background var(--t);
}
.lib-info-card:hover { background: var(--bg); }

/* Icon circle */
.lib-info-card__icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: var(--r-sm);
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background var(--t), color var(--t);
}
.lib-info-card:hover .lib-info-card__icon { background: var(--blue); color: #fff; }

.lib-info-card__icon--green { background: var(--green-light); color: var(--green-dark); }
.lib-info-card:hover .lib-info-card__icon--green { background: var(--green-dark); color: #fff; }

.lib-info-card__icon--amber { background: var(--amber-light); color: var(--amber-dark); }
.lib-info-card:hover .lib-info-card__icon--amber { background: var(--amber); color: #fff; }

/* Text */
.lib-info-card__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lib-info-card__label {
    font-family: var(--font);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.lib-info-card__value {
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* Vertical dividers between cards */
.lib-info-strip__divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
    align-self: stretch;
    margin: 14px 0;
}


/* ================================================================
   4. LIBRARY RULES AREA SHELL
   ================================================================ */
.lib-area {
    background: var(--bg);
    padding: 90px 0 100px;
    position: relative;
    overflow: hidden;
}

/* Dot-grid texture */
.lib-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(30,58,138,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

.lib-area .container {
    position: relative;
    z-index: 1;
}


/* ================================================================
   5. SECTION TITLE
   ================================================================ */
.lib-section-title {
    text-align: center;
    margin-bottom: 56px;
}

.lib-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--green);
    background: var(--green-light);
    padding: 5px 14px;
    border-radius: var(--r-pill);
    margin-bottom: 14px;
}

.lib-section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.75rem, 3.5vw, 2.6rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0 0 14px;
}

.lib-section-sub {
    font-family: var(--font-deva);
    font-size: clamp(.88rem, 1.5vw, 1rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}


/* ================================================================
   6. RULES GRID & CARDS
   ================================================================ */
.lib-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 48px;

    /* Wide card spans 2 columns */
    & .lib-card--wide {
        grid-column: span 2;
    }
}

/* Fallback for browsers without nesting */
.lib-card--wide { grid-column: span 2; }

/* ── Single rule card ─────────────────────────────────────────── */
.lib-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 26px 24px 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}

/* Animated top gradient bar */
.lib-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.lib-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-light);
    transform: translateY(-4px);
}
.lib-card:hover::before { transform: scaleX(1); }

/* Every 3rd card: green-variant top bar */
.lib-card:nth-child(3n)::before {
    background: linear-gradient(90deg, var(--green) 0%, var(--blue) 100%);
}

/* ── Card top row (num + icon) ───────────────────────────────── */
.lib-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Ghost serial number */
.lib-card__num {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--blue-light);
    pointer-events: none;
    user-select: none;
    transition: color var(--t);
}
.lib-card:hover .lib-card__num { color: rgba(30,58,138,.15); }

/* Icon box */
.lib-card__icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background var(--t), color var(--t);
}
.lib-card:hover .lib-card__icon { background: var(--blue); color: #fff; }

/* Amber icon variant (Rule 9 – banned books) */
.lib-card__icon--amber { background: var(--amber-light); color: var(--amber-dark); }
.lib-card:hover .lib-card__icon--amber { background: var(--amber); color: #fff; }

/* Every 3rd card: green icon */
.lib-card:nth-child(3n) .lib-card__icon:not(.lib-card__icon--amber) {
    background: var(--green-light);
    color: var(--green-dark);
}
.lib-card:nth-child(3n):hover .lib-card__icon:not(.lib-card__icon--amber) {
    background: var(--green-dark);
    color: #fff;
}

/* Rule text */
.lib-card__text {
    font-family: var(--font-deva);
    font-size: .92rem;
    color: var(--text-muted);
    line-height: 1.85;
    margin: 0;
    transition: color var(--t);
}
.lib-card:hover .lib-card__text { color: var(--text); }
.lib-card__text strong { color: var(--text); font-weight: 700; }


/* ================================================================
   7. RESTRICTED BOOKS SUB-LIST
   ================================================================ */
.lib-restricted {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.lib-restricted__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-deva);
    font-size: .9rem;
    color: var(--text-muted);
    transition: background var(--t), color var(--t);
}
.lib-restricted__item:last-child { border-bottom: none; }
.lib-restricted__item:hover { background: var(--amber-light); color: var(--text); }

.lib-restricted__alpha {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--amber);
    color: #fff;
    font-family: var(--font-deva);
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ================================================================
   8. CLOSING NOTICE
   ================================================================ */
.lib-notice {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    background: linear-gradient(135deg, #0f172a 0%, #1E3A8A 55%, #2a4fa8 100%);
    border-radius: var(--r-xl);
    padding: 32px 36px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-blue);
}

/* Decorative ring inside notice */
.lib-notice::after {
    content: '';
    position: absolute;
    bottom: -55px; right: -55px;
    width: 190px; height: 190px;
    border-radius: 50%;
    border: 42px solid rgba(34,197,94,.10);
    pointer-events: none;
}

/* Info icon */
.lib-notice__icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(34,197,94,.18);
    border: 1px solid rgba(34,197,94,.40);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-top: 2px;
}

.lib-notice__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lib-notice__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.lib-notice__text {
    font-family: var(--font-deva);
    font-size: clamp(.88rem, 1.4vw, .98rem);
    color: rgba(255,255,255,.78);
    line-height: 1.85;
    margin: 0;
}
.lib-notice__text strong { color: var(--green); font-weight: 700; }


/* ================================================================
   9. RESPONSIVE
   ================================================================ */

/* Grid breakpoints */
@media (max-width: 1100px) {
    .lib-grid { grid-template-columns: repeat(3, 1fr); }
    .lib-card--wide { grid-column: span 2; }
}

@media (max-width: 991px) {
    .lib-area { padding: 64px 0 72px; }
    .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .lib-card--wide { grid-column: span 2; }

    /* Info strip */
    .lib-info-strip__inner { max-width: 100%; }
    .lib-info-card { padding: 18px 24px; }
}

@media (max-width: 767px) {
    .lib-area { padding: 50px 0 60px; }
    .lib-section-title { margin-bottom: 36px; }

    .lib-grid { grid-template-columns: 1fr; gap: 14px; }
    .lib-card--wide { grid-column: span 1; }

    /* Info strip stacks */
    .lib-info-strip__inner { flex-direction: column; }
    .lib-info-strip__divider { width: 100%; height: 1px; margin: 0 24px; align-self: auto; }
    .lib-info-card { padding: 16px 24px; }

    /* Notice */
    .lib-notice { flex-direction: column; gap: 14px; padding: 24px 20px; }
}

@media (max-width: 480px) {
    .lib-card  { padding: 20px 16px 18px; }
    .lib-card__num { font-size: 1.8rem; }
    .lib-notice { padding: 20px 16px; }
}
