/* ================================================================
   ഒഴിവുനേരം — Stylesheet
   Literary / magazine aesthetic: warm paper, deep terracotta ink
================================================================ */

:root {
  --paper:      #f4efe3;
  --paper-2:    #ece4d2;
  --surface:    #fffdf7;
  --ink:        #2a2620;
  --ink-soft:   #6c6353;
  --line:       #ddd2b8;
  --accent:     #a4382b;
  --accent-dk:  #802a20;
  --teal:       #1f6f6b;
  --gold:       #b58a3c;
  --ok:         #2f7d4f;
  --warn:       #b07d1e;
  --shadow:     0 18px 40px -22px rgba(60,46,30,.45);
  --radius:     14px;
}

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

html, body { height: 100%; }

body {
  font-family: 'Noto Serif Malayalam', 'Anek Malayalam', Georgia, serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(164,56,43,.05), transparent 38%),
    radial-gradient(circle at 88% 92%, rgba(31,111,107,.05), transparent 40%);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dk); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: 'Anek Malayalam', 'Noto Serif Malayalam', serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

/* ---------------- Masthead ---------------- */
.masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.masthead-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; max-width: 1120px; margin: 0 auto;
  gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand .logo {
  font-family: 'Anek Malayalam', serif;
  font-weight: 800; font-size: 2.5rem; color: var(--accent);
  letter-spacing: -.5px;
}
.brand .tagline {
  font-size: .82rem; color: var(--ink-soft); letter-spacing: 3px;
  text-transform: uppercase; margin-top: 6px;
}
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a {
  font-family: 'Anek Malayalam', sans-serif;
  font-size: .97rem; color: var(--ink); padding: 8px 14px;
  border-radius: 8px; transition: background .15s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.cta {
  background: var(--accent); color: #fff;
}
.nav a.cta:hover { background: var(--accent-dk); color: #fff; }
.nav .credit-chip {
  background: var(--ink); color: var(--gold);
  font-family: 'Anek Malayalam', sans-serif; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; font-size: .9rem;
}

/* ---------------- Hero ---------------- */
.hero {
  text-align: center; padding: 56px 22px 44px;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: 2.7rem; max-width: 760px; margin: 0 auto 14px;
}
.hero p {
  color: var(--ink-soft); max-width: 600px; margin: 0 auto;
  font-size: 1.08rem;
}
.hero .hero-actions { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Anek Malayalam', sans-serif; font-weight: 600;
  font-size: 1rem; padding: 12px 24px; border-radius: 10px;
  border: 1.5px solid var(--accent); background: var(--accent);
  color: #fff; cursor: pointer; transition: transform .12s, background .15s;
}
.btn:hover { background: var(--accent-dk); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); }
.btn.dark:hover { background: #000; }
.btn.teal { background: var(--teal); border-color: var(--teal); }
.btn.teal:hover { background: #155551; }
.btn.full { width: 100%; justify-content: center; }
.btn.sm { padding: 8px 16px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- Section heads ---------------- */
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 40px 0 22px;
}
.section-head h2 { font-size: 1.6rem; white-space: nowrap; }
.section-head .rule { flex: 1; height: 2px; background: var(--line); }

/* ---------------- Article grid ---------------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .thumb {
  height: 168px; background: var(--paper-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card .thumb img { height: 100%; width: 100%; object-fit: cover; }
.card .thumb.placeholder {
  background: linear-gradient(135deg, #2a2620, #3f3a30);
  color: var(--gold); font-family: 'Anek Malayalam', serif;
  font-size: 2.6rem;
}
.card .card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.cat-tag {
  display: inline-block; font-family: 'Anek Malayalam', sans-serif;
  font-size: .76rem; letter-spacing: 1px; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 3px 11px; margin-bottom: 10px; align-self: flex-start;
}
.card h3 { font-size: 1.22rem; margin-bottom: 8px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); }
.card .excerpt { color: var(--ink-soft); font-size: .96rem; }
.card .read-more {
  font-family: 'Anek Malayalam', sans-serif; font-size: .9rem;
  font-weight: 600; color: var(--accent); align-self: flex-start;
  margin-top: 10px;
}
.card .read-more:hover { text-decoration: underline; }
.card .meta {
  margin-top: auto; padding-top: 13px; border-top: 1px dashed var(--line);
  font-family: 'Anek Malayalam', sans-serif; font-size: .87rem;
  color: var(--ink-soft); display: flex; justify-content: space-between;
  gap: 10px;
}
.card .meta .author { color: var(--ink); font-weight: 600; }

/* ---------------- Article page ---------------- */
.article-full { padding: 44px 0 60px; }
.article-full .cat-tag { margin-bottom: 16px; }
.article-full h1 { font-size: 2.4rem; margin-bottom: 18px; }
.byline {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-family: 'Anek Malayalam', sans-serif; color: var(--ink-soft);
  font-size: .96rem; padding-bottom: 22px; margin-bottom: 28px;
  border-bottom: 2px solid var(--ink);
}
.byline .who { color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.article-cover {
  border-radius: var(--radius); margin-bottom: 28px; max-height: 440px;
  width: 100%; object-fit: cover; border: 1px solid var(--line);
}
.article-body { font-size: 1.16rem; line-height: 2.05; }
.article-body p { margin-bottom: 1.3em; }

/* ---------------- Forms ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.panel.tight { padding: 26px; }
.form-title { font-size: 1.7rem; margin-bottom: 6px; }
.form-sub { color: var(--ink-soft); margin-bottom: 24px; font-size: .98rem; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: 'Anek Malayalam', sans-serif;
  font-weight: 600; font-size: .94rem; margin-bottom: 7px; color: var(--ink);
}
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.field input, .field select, .field textarea {
  width: 100%; font-family: 'Noto Serif Malayalam', serif;
  font-size: 1rem; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(164,56,43,.12);
}
.field textarea { resize: vertical; line-height: 1.9; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------------- Alerts ---------------- */
.alert {
  padding: 13px 17px; border-radius: 10px; margin-bottom: 20px;
  font-family: 'Anek Malayalam', sans-serif; font-size: .96rem;
  border: 1px solid;
}
.alert.error  { background: #fbecea; border-color: #e6b3ad; color: #8c2a20; }
.alert.success{ background: #e9f3ec; border-color: #aacfb5; color: #235e3a; }
.alert.info   { background: #eef1f1; border-color: #b9c9c8; color: #1f6f6b; }
.alert.warn   { background: #fbf2dd; border-color: #e2cd97; color: #8a6314; }

/* ---------------- Status pills ---------------- */
.pill {
  display: inline-block; font-family: 'Anek Malayalam', sans-serif;
  font-size: .82rem; font-weight: 600; padding: 4px 12px;
  border-radius: 999px;
}
.st-pending   { background: #fbf2dd; color: #8a6314; }
.st-published { background: #e9f3ec; color: #235e3a; }
.st-resubmit  { background: #fbecea; color: #8c2a20; }

/* ---------------- Dashboard ---------------- */
.dash-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 18px; flex-wrap: wrap; margin: 36px 0 8px;
}
.dash-head h1 { font-size: 2rem; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 22px 0 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; min-width: 150px; flex: 1;
}
.stat .num {
  font-family: 'Anek Malayalam', sans-serif; font-weight: 800;
  font-size: 2rem; color: var(--accent);
}
.stat.gold .num { color: var(--gold); }
.stat.teal .num { color: var(--teal); }
.stat .lbl { font-family: 'Anek Malayalam', sans-serif; color: var(--ink-soft); font-size: .92rem; }

.my-article {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
}
.my-article .row1 {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap;
}
.my-article h3 { font-size: 1.2rem; }
.my-article .sub {
  font-family: 'Anek Malayalam', sans-serif; color: var(--ink-soft);
  font-size: .87rem; margin-top: 4px;
}
.my-article .actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.feedback-box {
  margin-top: 12px; background: #fbecea; border: 1px solid #e6b3ad;
  border-radius: 9px; padding: 11px 15px; font-size: .95rem; color: #8c2a20;
}

/* ---------------- Tables (admin) ---------------- */
.tbl {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-size: .95rem;
}
.tbl th, .tbl td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line);
}
.tbl th {
  font-family: 'Anek Malayalam', sans-serif; background: var(--paper-2);
  font-size: .88rem; letter-spacing: .3px;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fbf8f0; }
.table-scroll { overflow-x: auto; }

/* ---------------- Admin shell ---------------- */
.admin-bar {
  background: var(--ink); color: #fff; border-bottom: 3px solid var(--accent);
}
.admin-bar .inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 22px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
}
.admin-bar .a-logo {
  font-family: 'Anek Malayalam', sans-serif; font-weight: 800;
  font-size: 1.25rem; color: var(--gold);
}
.admin-bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-bar nav a {
  color: #e8e2d4; font-family: 'Anek Malayalam', sans-serif;
  font-size: .94rem; padding: 7px 13px; border-radius: 7px;
}
.admin-bar nav a:hover, .admin-bar nav a.active {
  background: rgba(255,255,255,.12); color: #fff;
}

/* ---------------- Footer ---------------- */
.site-foot {
  border-top: 2px solid var(--ink); margin-top: 60px;
  padding: 30px 22px; text-align: center;
  font-family: 'Anek Malayalam', sans-serif; color: var(--ink-soft);
  font-size: .9rem;
}
.site-foot .fname {
  font-weight: 800; color: var(--accent); font-size: 1.2rem;
  display: block; margin-bottom: 4px;
}

/* ---------------- Misc ---------------- */
.empty {
  text-align: center; padding: 50px 20px; color: var(--ink-soft);
  font-family: 'Anek Malayalam', sans-serif;
}
.center-page {
  min-height: 70vh; display: flex; align-items: center;
  justify-content: center; padding: 40px 22px;
}
.muted-link { font-family: 'Anek Malayalam', sans-serif; font-size: .93rem; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* ---------------- Filter tabs ---------------- */
.filter-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px;
}
.filter-tabs .ftab {
  font-family: 'Anek Malayalam', sans-serif; font-size: .92rem;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper-2);
  color: var(--ink-soft);
}
.filter-tabs .ftab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tabs .ftab.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand .logo { font-size: 2rem; }
  .hero h1 { font-size: 2rem; }
  .article-full h1 { font-size: 1.8rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
}
