/* Meshkal — Clarity in complexity */
:root {
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --paper: #f7f5f2;
  --paper-2: #efece7;
  --line: #d8d2c8;
  --accent: #c41230;
  --accent-dark: #8e0d23;
  --white: #ffffff;
  --max: 1100px;
  --font-sans: "Libre Franklin", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", "Georgia", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(196, 18, 48, 0.08), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  min-height: 100vh;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

.site-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: relative;
  background: #111 url("/assets/img/header.jpg") center / cover no-repeat;
  color: var(--white);
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0.72) 100%);
}

.site-header .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 0 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.brand-tagline {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 400;
}

/* Nav */
.site-nav {
  background: var(--ink);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  padding: 0.4rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  display: block;
  padding: 0.85rem 0.9rem;
  color: #f3f3f3;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  background: var(--accent);
  color: var(--white);
}

/* Main */
.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.25;
  font-weight: 700;
}

.page-meta {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.prose,
.romlicontainer {
  max-width: 42rem;
}

.prose p,
.romlicontainer p {
  margin: 0 0 1rem;
}

.prose h2,
.romlicontainer h2 {
  font-family: var(--font-display);
  margin: 1.75rem 0 0.75rem;
  font-size: 1.35rem;
}

.prose figure,
.romlicontainer figure {
  margin: 1.5rem 0;
}

.prose figcaption,
.romlicontainer figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.featured-image {
  margin: 0 0 1.5rem;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.featured-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* Article cards / listings */
.article-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-card {
  flex: 1 1 280px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--line);
  animation: rise 0.5s ease both;
}

.article-card:nth-child(2) { animation-delay: 0.06s; }
.article-card:nth-child(3) { animation-delay: 0.12s; }
.article-card:nth-child(4) { animation-delay: 0.18s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-card a {
  color: var(--ink);
  text-decoration: none;
}

.article-card a:hover {
  color: var(--accent);
}

.article-card h2,
.article-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
}

.article-card .excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.article-card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-intro {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.home-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.home-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* Blog list from r-template_blog */
.blog-container {
  width: 100%;
}

.blog-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.blog-card {
  flex: 1 1 280px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.blog-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.blog-title a {
  color: var(--ink);
  text-decoration: none;
}

.blog-title a:hover {
  color: var(--accent);
}

.blog-preview p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  background: #161616;
  color: #d4d4d4;
  padding: 2rem 0 1.5rem;
  margin-top: auto;
}

.site-footer a {
  color: #fff;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-cc {
  max-width: 28rem;
  font-size: 0.9rem;
}

.footer-cc img {
  margin-bottom: 0.5rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: #999;
}

.romlifooter {
  width: 100%;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

/* Mobile */
@media (max-width: 720px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
    margin: 0.5rem 0;
  }

  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-bottom: 0.5rem;
  }

  .site-nav.is-open .nav-menu {
    display: flex;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }
}
