/* ============================================================
   Universdas — Public site stylesheet
   ============================================================ */

:root {
  /* Brand palette, drawn from the Universdas logo (royal blue + warm orange)
     instead of the generic maroon admin-template look. */
  --maroon: #0a63d6;       /* primary brand blue (kept the old var name so
                               every existing rule below still works) */
  --maroon-dark: #084faf;
  --sidebar-bg: #081a33;   /* deep navy, used for hero / footer gradients */
  --accent: #f7941d;       /* logo orange, used for small highlight accents */
  --accent-dark: #d97700;
  --cream: #f3f7fc;
  --cream-dark: #e8eff8;
  --ink: #142133;
  --muted: #5c6b80;
  --border: #dde6f0;
  --white: #ffffff;
  --green: #1f8a4c; --green-bg: #e3f6ea;
  --blue: #2563c7; --blue-bg: #e5edfb;
  --yellow: #a9790f; --yellow-bg: #fbf0d6;
  --orange: #c05a15; --orange-bg: #fbe6d6;
  --red: #b0231f; --red-bg: #fbe3e2;
  --purple: #7a3fc7; --purple-bg: #efe4fb;
  --gray: #6b6b6b; --gray-bg: #ececec;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(8, 26, 51, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, 'Noto Sans Tamil', sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 40px; width: auto; max-width: 180px; display: block; flex: none; }
.main-nav { display: flex; gap: 28px; flex: 1; justify-content: center; }
.main-nav a { color: var(--muted); font-weight: 600; padding: 8px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--maroon); border-bottom-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); }
.icon-link { font-size: 18px; color: var(--muted); padding: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--maroon); color: var(--maroon); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-light { background: var(--cream-dark); color: var(--ink); }

/* ---------- Alerts ---------- */
.alert { margin: 16px 0; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #bfe6cd; }
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid #f0c3c1; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--sidebar-bg), var(--maroon-dark)); color: #fff; padding: 80px 0; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 44px; line-height: 1.15; margin-bottom: 18px; }
.hero p.lead { font-size: 18px; color: #e9d9cf; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-size: 28px; }
.hero-stats div span { color: #d9c2b6; font-size: 13px; }
.hero-art { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 16px; padding: 28px; backdrop-filter: blur(4px); }
.hero-art .mini-card { background: #fff; color: var(--ink); border-radius: 10px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.hero-art .mini-card:last-child { margin-bottom: 0; }
.hero-art .mini-card h4 { margin: 0 0 4px; font-size: 14px; }
.hero-art .mini-card span { font-size: 12px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--cream); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--accent-dark); text-transform: uppercase; font-size: 12px; letter-spacing: .08em; font-weight: 700; }
.section-head h2 { font-size: 30px; margin-top: 8px; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
/* Book/conference detail pages: fixed-width cover column + flexible content.
   Kept as its own class (not an inline style) so the mobile media query
   below can actually collapse it to one column -- an inline
   grid-template-columns would outrank any stylesheet media query and stay
   stuck at 320px-wide on a phone screen. */
.detail-grid { grid-template-columns: 320px 1fr; align-items: flex-start; }

.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(8, 26, 51, .1); }
.feature-card .ico { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-bg), var(--orange-bg)); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 14px; margin-bottom: 0; }

.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--maroon), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.step h4 { margin: 0 0 4px; font-size: 15px; }
.step p { color: var(--muted); font-size: 13.5px; margin: 0; }

/* ---------- Cards: books / conferences ---------- */
.book-card, .conf-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; height: 100%; transition: transform .15s, box-shadow .15s; }
.book-card:hover, .conf-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(8, 26, 51, .12); }
.book-cover { width: 100%; aspect-ratio: 6.69 / 9.84; height: auto; background: linear-gradient(135deg, var(--maroon), var(--sidebar-bg)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; text-align: center; padding: 14px; font-weight: 700; overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
/* .ratio-book is the explicit book/chapter trim-size ratio (6.69 x 9.84 in) -- same as the default above, named for clarity where it's used alongside .ratio-a4 */
.book-cover.ratio-book { aspect-ratio: 6.69 / 9.84; }
/* Conference covers follow A4 paper proportions instead of the book trim size */
.book-cover.ratio-a4 { aspect-ratio: 1 / 1.4142; }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 16px; margin-bottom: 6px; }
.card-body .meta { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.card-body .desc { color: var(--muted); font-size: 13.5px; flex: 1; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* ---------- Forms ---------- */
.form-page { max-width: 460px; margin: 60px auto; padding: 0 24px; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.form-wide { max-width: 860px; }
.form-card h1 { font-size: 24px; }
.form-card .sub { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(122,20,20,.1); }
textarea { resize: vertical; min-height: 100px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.form-foot a { color: var(--maroon); font-weight: 700; }

/* ---------- Authors list (book/chapter/conference detail pages) ----------
   Stacked, non-bulleted: bold name on its own line, affiliation(s) below
   it, ORCID/email in a smaller muted line -- no <ul>/<li>, no table. */
.authors-list { margin: 10px 0 24px; }
.author-entry { margin-bottom: 14px; }
.author-entry:last-child { margin-bottom: 0; }
.author-name { font-weight: 700; font-size: 15px; }
.author-affil { font-size: 14px; color: var(--ink); margin-top: 2px; }
.author-meta { font-size: 12.5px; margin-top: 2px; }

/* ---------- "How to Cite" / "Download Citation" boxes ---------- */
.cite-box { background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.cite-box-title { font-size: 14px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 2px solid var(--maroon); }
.cite-box .field { margin-bottom: 12px; }
.cite-text { font-size: 13.5px; line-height: 1.6; color: var(--ink); word-break: break-word; }
.cite-text em { font-style: italic; }
.cite-download-link { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--maroon); margin-bottom: 10px; }
.cite-download-link:last-child { margin-bottom: 0; }
.cite-download-link:hover { text-decoration: underline; }

/* ---------- Tables (dashboard, listings) ---------- */
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
th { background: var(--cream); color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }

/* ---------- Page header bar (dashboard/search pages) ---------- */
.page-bar { background: var(--cream); padding: 40px 0; border-bottom: 1px solid var(--border); }
.page-bar h1 { font-size: 28px; margin-bottom: 6px; }
.page-bar p { color: var(--muted); margin: 0; }

.search-bar { display: flex; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.search-bar input[type=text] { flex: 1; min-width: 220px; }
.search-bar select { width: auto; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .ico { font-size: 40px; margin-bottom: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--sidebar-bg); color: #cfd9e8; padding: 56px 0 0; margin-top: 40px; }
.brand-logo-footer { height: 36px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 32px; padding-bottom: 32px; }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #8fa5c7; margin-bottom: 14px; }
.site-footer a { display: block; color: #c3d0e3; font-size: 14px; margin-bottom: 8px; }
.site-footer a:hover { color: #fff; }
.site-footer .muted { color: #92a3bd; font-size: 13.5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: 13px; color: #92a3bd; text-align: center; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
/* Justified body copy (About page, and anywhere else that wants it) --
   headings are left out on purpose, justify only reads well on
   multi-line paragraph/list text. */
.justify-text p, .justify-text li { text-align: justify; text-justify: inter-word; }
.text-justify { text-align: justify; text-justify: inter-word; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; } .mb-24 { margin-bottom: 24px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 240px 1fr; }
}
@media (max-width: 640px) {
  /* The nav is a flex sibling of the logo and the action buttons inside
     site-header-inner (display:flex). Simply toggling it to display:flex
     on mobile left it squeezed into that same row on the left, under/behind
     the logo, instead of opening as its own panel -- it had no positioning
     of its own. Taking it out of the row with position:absolute and giving
     it a background/border makes it drop down as a proper full-width menu. */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: 0 12px 24px rgba(8, 26, 51, .12);
    padding: 6px 0;
    z-index: 60;
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .main-nav a:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn { display: none; }
}
