/* ============================================================
   MyQuran.or.id — Main stylesheet
   Design language: editorial, confident, calm.
   ============================================================ */

:root {
  --bg: #f7f5f1;              /* warm off-white */
  --bg-alt: #ffffff;
  --ink: #141414;             /* near-black */
  --ink-soft: #3a3a3a;
  --ink-muted: #6b6b6b;
  --line: #e6e2db;
  --line-strong: #cbc6bc;
  --accent: #0f766e;          /* teal */
  --accent-soft: #ccfbf1;
  --serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }

/* ------------------------------------------------------------
   Utilities
   ------------------------------------------------------------ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.cat-pill {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  line-height: 1.4;
}

/* ------------------------------------------------------------
   Top bar
   ------------------------------------------------------------ */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 13px;
  color: var(--ink-muted);
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; padding-bottom: 8px;
}
.topbar .date { font-variant-numeric: tabular-nums; }
.topbar .social a { margin-left: 14px; color: var(--ink-muted); }
.topbar .social a:hover { color: var(--ink); }

/* ------------------------------------------------------------
   Masthead
   ------------------------------------------------------------ */
.masthead {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.masthead .container {
  padding-top: 28px;
  padding-bottom: 20px;
  text-align: center;
}
.masthead .logo {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.masthead .logo span.accent { color: var(--accent); }
.masthead .tagline {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */
.nav {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0; padding-bottom: 0;
}
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }
.nav li a {
  display: inline-block;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 3px solid transparent;
}
.nav li a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav li a.active { color: var(--accent); border-bottom-color: var(--accent); }

.search-btn {
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  padding: 8px 10px; color: var(--ink);
}
.search-btn:hover { color: var(--accent); }

.search-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,20,0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
.search-overlay.open { display: flex; }
.search-box {
  width: min(680px, 92vw);
  background: var(--bg-alt);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.2);
  overflow: hidden;
}
.search-box input {
  width: 100%;
  padding: 22px 24px;
  border: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 22px;
  outline: none;
  background: transparent;
}
.search-box .results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}
.search-box .result-item {
  display: block;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.search-box .result-item:hover { background: var(--bg); }
.search-box .close-search {
  position: absolute;
  top: -40px; right: 0;
  background: none; border: none;
  color: #fff; font-size: 28px; cursor: pointer;
}
.search-empty {
  padding: 24px;
  color: var(--ink-muted);
  text-align: center;
}

/* ------------------------------------------------------------
   Hero / featured article
   ------------------------------------------------------------ */
.hero {
  padding: 36px 0 48px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
  align-items: stretch;
}
.hero-card {
  background: var(--bg-alt);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.hero-card .cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eee;
}
.hero-card .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.hero-card:hover .cover img { transform: scale(1.04); }
.hero-card .body { padding: 28px 32px 32px; flex: 1; display: flex; flex-direction: column; }
.hero-card h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 12px 0 10px;
}
.hero-card h2 a { color: var(--ink); }
.hero-card h2 a:hover { color: var(--accent); }
.hero-card .dek {
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0 0 16px;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.meta .author { font-weight: 600; color: var(--ink-soft); }

/* Hero right column — "Latest" list */
.latest {
  background: var(--bg-alt);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.latest h3 {
  font-family: var(--serif);
  font-size: 20px;
  margin: 0;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.latest h3::before {
  content: "";
  display: inline-block;
  width: 28px; height: 4px;
  background: var(--accent);
  border-radius: 2px;
}
.latest ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.latest li {
  border-bottom: 1px solid var(--line);
}
.latest li:last-child { border-bottom: none; }
.latest li a {
  display: block;
  padding: 16px 24px;
  color: var(--ink);
}
.latest li a:hover { background: var(--bg); color: var(--accent); }
.latest .num {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--line-strong);
  margin-right: 12px;
  font-weight: 700;
}
.latest .title-line {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   Section headings
   ------------------------------------------------------------ */
.section { padding: 40px 0 20px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 34px);
  margin: 0; letter-spacing: -0.01em;
}
.section-head .view-all {
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.section-head .view-all:hover { color: var(--accent); }

/* ------------------------------------------------------------
   Article grid (3 columns)
   ------------------------------------------------------------ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card {
  display: flex; flex-direction: column;
  background: transparent;
}
.card .cover {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #e9e4db;
  margin-bottom: 14px;
}
.card .cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .cover img { transform: scale(1.05); }
.card .cat-pill { margin-bottom: 10px; }
.card h3 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  margin: 6px 0 8px;
  letter-spacing: -0.005em;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); }
.card .excerpt {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 12px;
}

/* ------------------------------------------------------------
   Category page layout
   ------------------------------------------------------------ */
.page-banner {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.page-banner .cat-pill { margin-bottom: 14px; font-size: 14px; padding: 6px 16px; }
.page-banner h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 56px);
  margin: 0; letter-spacing: -0.02em;
  line-height: 1.05;
}
.page-banner p {
  max-width: 640px;
  color: var(--ink-muted);
  margin: 14px 0 0;
  font-size: 17px;
}
.category-grid {
  padding: 36px 0 80px;
}
.category-grid .grid-3 { padding-top: 4px; }

/* ------------------------------------------------------------
   Article detail page
   ------------------------------------------------------------ */
.article-header {
  padding: 40px 0 24px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.article-header .cat-pill { margin-bottom: 16px; }
.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.1;
  margin: 0 auto 16px;
  letter-spacing: -0.02em;
  max-width: 900px;
}
.article-header .subtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(18px, 2.5vw, 24px);
  max-width: 700px;
  margin: 0 auto;
}
.article-meta {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 14px;
}
.article-meta .author-name { font-weight: 700; color: var(--ink); }

.article-cover {
  margin: 28px auto 0;
  max-width: 1100px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #e9e4db;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.article-body {
  max-width: 720px;
  margin: 40px auto 60px;
  padding: 0 24px;
}
.article-body p {
  font-size: 19px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 22px;
}
.article-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 5.2em;
  float: left;
  line-height: 0.85;
  margin-right: 10px;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 700;
}
.article-body .author-bio {
  margin-top: 40px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink-muted);
  border-left: 3px solid var(--accent);
  font-style: italic;
}

.article-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 24px auto;
  max-width: 720px;
  padding: 0 24px;
}
.tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  color: var(--ink-muted);
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* Related articles */
.related {
  padding: 40px 0 80px;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------
   Static pages (About, Privacy, Terms, Contact)
   ------------------------------------------------------------ */
.static-page { padding: 48px 0 100px; }
.static-page h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  margin: 0 0 32px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.static-page h2 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}
.static-page p, .static-page li {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.static-page ul { padding-left: 22px; }
.static-page .content { max-width: 780px; }
.static-page a { color: var(--accent); text-decoration: underline; }
.static-page a:hover { color: var(--ink); }

.contact-form {
  max-width: 560px;
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-alt);
  outline: none;
  transition: border-color .15s ease;
}
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--accent);
}
.contact-form button {
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}
.contact-form button:hover { background: var(--accent); }

/* Sitemap */
.sitemap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 40px; }
.sitemap-group h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 28px 0 12px;
  color: var(--accent);
}
.sitemap-group a { display: block; padding: 4px 0; font-size: 15px; color: var(--ink-soft); }
.sitemap-group a:hover { color: var(--accent); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer {
  background: var(--ink);
  color: #d1cdc4;
  padding: 56px 0 28px;
}
.footer .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer h4 {
  font-family: var(--serif);
  font-size: 18px;
  color: #fff;
  margin: 0 0 14px;
}
.footer .brand .footer-logo {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px;
}
.footer .brand .footer-logo span { color: var(--accent-soft); }
.footer .brand p { font-size: 14px; line-height: 1.7; color: #9a968d; margin: 0; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer ul li { margin-bottom: 8px; }
.footer ul li a { color: #b9b5ac; font-size: 14px; }
.footer ul li a:hover { color: var(--accent-soft); }

.footer-bottom {
  padding-top: 22px;
  display: flex; justify-content: space-between;
  font-size: 13px;
  color: #9a968d;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer .container {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 18px; }
  .topbar .social { display: none; }
  .masthead .container { padding-top: 22px; padding-bottom: 14px; }
  .nav li a { padding: 12px 12px; font-size: 13px; }
  .grid-3 { grid-template-columns: 1fr; gap: 24px; }
  .hero-card .body { padding: 22px; }
  .article-body p { font-size: 17px; }
  .footer .container { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
}

/* Image loading fallback */
.card .cover, .hero-card .cover, .article-cover {
  background:
    linear-gradient(135deg, #e9e4db 0%, #d4cfc4 100%);
}
