/* ============================================================
   Caristyle.co.id — Stylesheet
   Editorial magazine design, mobile-first, English only
   ============================================================ */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f5f2;
  --color-surface: #ffffff;
  --color-border: #e8e6e1;
  --color-text: #1a1a1a;
  --color-text-soft: #5c5c5c;
  --color-muted: #8a8a8a;
  --color-primary: #0f172a;     /* deep ink navy */
  --color-accent: #e11d48;      /* carmine red */
  --color-accent-soft: #fff1f2;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --font-serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1200px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- TYPOGRAPHY ---------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

.lead {
  font-size: 1.15rem;
  color: var(--color-text-soft);
  line-height: 1.7;
}

/* ---------------- TOP BAR ---------------- */
.topbar {
  background: var(--color-primary);
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar a { color: #e2e8f0; }
.topbar a:hover { color: #fff; }
.topbar .date { font-weight: 500; }

/* ---------------- HEADER ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}
.brand .dot {
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
}
.brand:hover { color: var(--color-primary); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.main-nav a {
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-soft);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.main-nav a:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}
.main-nav a.active {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-toggle,
.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
  transition: all 0.2s ease;
}
.search-toggle:hover,
.menu-toggle:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}
.menu-toggle { display: none; }

/* ---------------- SEARCH ---------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 40px;
  backdrop-filter: blur(4px);
}
.search-overlay.open { display: flex; }
.search-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.25s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--color-border);
}
.search-input-wrap i { color: var(--color-muted); }
.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 12px;
  font-size: 1.1rem;
  font-family: inherit;
}
.search-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
}
.search-close:hover { background: var(--color-bg-alt); }
.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}
.search-result-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.search-result-item:hover { background: var(--color-bg-alt); }
.search-result-item .cat {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.search-result-item .ttl {
  font-weight: 600;
  font-size: 0.95rem;
}
.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-muted);
}

/* ---------------- HERO / FEATURED ---------------- */
.hero {
  padding: 32px 0 24px;
}
.featured-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 420px;
}
.featured-card .media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}
.featured-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.featured-card:hover .media img { transform: scale(1.04); }
.featured-card .body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-card .cat-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 16px;
}
.featured-card h1 {
  margin-bottom: 16px;
}
.featured-card h1 a:hover { color: var(--color-accent); }
.featured-card .lead { margin-bottom: 20px; }
.meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--color-muted);
  flex-wrap: wrap;
}
.meta .author { font-weight: 600; color: var(--color-text-soft); }
.meta i { margin-right: 4px; }

/* ---------------- SECTION ---------------- */
.section {
  padding: 40px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}
.section-title {
  position: relative;
  padding-left: 16px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}
.section-title .sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.view-all {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-all:hover { gap: 10px; }

/* ---------------- CARD GRID ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.article-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.article-card:hover { transform: translateY(-4px); }
.article-card .media {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  aspect-ratio: 16 / 10;
}
.article-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover .media img { transform: scale(1.06); }
.article-card .cat-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.article-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  line-height: 1.3;
}
.article-card h3 a:hover { color: var(--color-accent); }
.article-card .excerpt {
  font-size: 0.92rem;
  color: var(--color-text-soft);
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .meta { font-size: 0.78rem; }

/* ---------------- LIST LAYOUT (Recommended) ---------------- */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.list-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}
.list-item:last-child { border-bottom: none; }
.list-item .media {
  flex: 0 0 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.list-item .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.list-item .body { flex: 1; }
.list-item .cat-chip {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}
.list-item h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.3;
  margin: 4px 0 6px;
}
.list-item h4 a:hover { color: var(--color-accent); }
.list-item .meta { font-size: 0.75rem; gap: 10px; }

/* ---------------- CATEGORY GRID ---------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.cat-tile {
  padding: 24px 18px;
  border-radius: var(--radius-md);
  color: #fff;
  text-align: center;
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 140px;
  justify-content: center;
}
.cat-tile:hover { transform: translateY(-4px); color: #fff; }
.cat-tile i { font-size: 1.8rem; opacity: 0.9; }
.cat-tile h3 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
}
.cat-tile .count {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* ---------------- NEWSLETTER ---------------- */
.newsletter {
  background: var(--color-primary);
  color: #fff;
  padding: 56px 0;
  margin: 40px 0 0;
}
.newsletter .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.newsletter h2 { color: #fff; }
.newsletter p { color: #cbd5e1; margin-top: 8px; }
.news-form {
  display: flex;
  gap: 8px;
  background: #fff;
  padding: 6px;
  border-radius: 999px;
}
.news-form input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
}
.news-form button {
  background: var(--color-accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.news-form button:hover { background: #be123c; }

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: #0b1120;
  color: #94a3b8;
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 16px;
}
.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  transition: all 0.2s ease;
}
.footer-social a:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 18px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  font-size: 0.9rem;
  transition: padding-left 0.2s ease;
}
.footer-col ul a:hover {
  color: #fff;
  padding-left: 6px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-bottom .legal a { margin-left: 18px; }

/* ---------------- ARTICLE PAGE ---------------- */
.article-hero {
  padding: 32px 0 0;
}
.article-hero .cat-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 18px;
}
.article-hero h1 {
  margin-bottom: 16px;
}
.article-hero .lead {
  max-width: 720px;
  margin-bottom: 20px;
}
.article-hero .meta {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}
.article-cover {
  margin: 28px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.article-cover img { width: 100%; height: auto; }

.article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 40px;
}
.article-body > * { margin-bottom: 1.4rem; }
.article-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}
.article-body h2, .article-body h3 {
  margin-top: 2.2rem;
  margin-bottom: 1rem;
}
.article-body h2 { font-size: 1.6rem; }
.article-body h3 { font-size: 1.3rem; }
.article-body ul {
  padding-left: 1.4rem;
  list-style: disc;
}
.article-body ul li {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  line-height: 1.7;
}
.article-body blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 12px 24px;
  margin: 1.6rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-text-soft);
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.article-tags span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-soft);
  padding-right: 8px;
}
.tag-pill {
  padding: 5px 14px;
  background: var(--color-bg-alt);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-text-soft);
  transition: all 0.2s ease;
}
.tag-pill:hover {
  background: var(--color-accent);
  color: #fff;
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
}
.share-bar span { font-size: 0.85rem; font-weight: 600; color: var(--color-text-soft); }
.share-bar a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
  color: var(--color-text-soft);
  transition: all 0.2s ease;
}
.share-bar a:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}

.author-box {
  display: flex;
  gap: 18px;
  padding: 24px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  margin: 32px 0;
  align-items: center;
}
.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-family: var(--font-serif);
  font-weight: 700;
  flex-shrink: 0;
}
.author-box h4 { margin-bottom: 4px; }
.author-box p { font-size: 0.9rem; color: var(--color-text-soft); margin: 0; }

/* ---------------- CATEGORY PAGE ---------------- */
.page-header {
  background: var(--color-bg-alt);
  padding: 48px 0 40px;
  margin-bottom: 32px;
}
.page-header .crumb {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 10px;
}
.page-header .crumb a:hover { color: var(--color-accent); }
.page-header h1 { margin-bottom: 8px; }
.page-header p { color: var(--color-text-soft); max-width: 640px; }

/* ---------------- STATIC PAGES ---------------- */
.static-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.static-content h1 { margin-bottom: 8px; }
.static-content .updated {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}
.static-content h2 {
  margin-top: 36px;
  margin-bottom: 12px;
  font-size: 1.4rem;
}
.static-content h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 1.15rem;
  font-family: var(--font-sans);
}
.static-content p {
  margin-bottom: 16px;
  line-height: 1.75;
  color: var(--color-text-soft);
}
.static-content ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin-bottom: 16px;
}
.static-content ul li { margin-bottom: 8px; color: var(--color-text-soft); }

.contact-card {
  background: var(--color-bg-alt);
  padding: 28px;
  border-radius: var(--radius-md);
  margin-top: 20px;
}
.contact-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.contact-row:last-child { margin-bottom: 0; }
.contact-row i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.contact-row .label { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.contact-row .value { color: var(--color-text-soft); font-size: 0.9rem; }

/* ---------------- SITEMAP ---------------- */
.sitemap-section { margin-bottom: 32px; }
.sitemap-section h3 { margin-bottom: 14px; }
.sitemap-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 24px;
}
.sitemap-cols a {
  display: block;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  border-bottom: 1px solid transparent;
}
.sitemap-cols a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---------------- BACK TO TOP ---------------- */
.back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 90;
  transition: all 0.25s ease;
}
.back-top.show { display: flex; }
.back-top:hover {
  background: var(--color-accent);
  transform: translateY(-3px);
}

/* ---------------- UTILITIES ---------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 960px) {
  .featured-card { grid-template-columns: 1fr; min-height: auto; }
  .featured-card .media { min-height: 240px; }
  .featured-card .body { padding: 24px; }
  .newsletter .container { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    gap: 4px;
  }
  .main-nav.open a { width: 100%; padding: 12px 14px; }
  .topbar .date { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .news-form { flex-direction: column; border-radius: var(--radius-md); padding: 12px; }
  .news-form input { padding: 12px; }
  .news-form button { width: 100%; }
  .article-list { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .brand { font-size: 1.35rem; }
  .featured-card .body { padding: 20px; }
  .section { padding: 28px 0; }
  .card-grid { gap: 20px; }
}
