:root {
  --primary-blue: #1B4965;
  --blue-dark: #0D2438;
  --blue-mid: #2E6F97;
  --accent-gold: #C5A059;
  --gold-hover: #B08D48;
  --bg-light: #F7F8FA;
  --bg-white: #FFFFFF;
  --text-main: #111827;
  --text-muted: #4B5563;
  --card-shadow: 0 10px 40px rgba(27, 73, 101, 0.07);
  --card-shadow-hover: 0 20px 50px rgba(27, 73, 101, 0.12);
  --transition-fast: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* Header */
.pub-header {
  background: var(--blue-dark);
  padding: 0.9rem 1.5rem;
  padding-top: max(0.9rem, env(safe-area-inset-top, 0px));
  position: sticky;
  top: 0;
  z-index: 50;
}
.pub-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.pub-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.15rem; }
.pub-logo img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.pub-nav { display: flex; gap: 1.4rem; }
.pub-nav a { color: rgba(255,255,255,0.75); font-weight: 600; font-size: 0.92rem; transition: var(--transition-fast); }
.pub-nav a:hover, .pub-nav a.active { color: var(--accent-gold); }

/* Hero */
.pub-hero {
  background: linear-gradient(145deg, var(--primary-blue), var(--blue-mid));
  color: #fff;
  padding: 3rem 1.5rem 2.2rem;
  text-align: center;
}
.pub-hero h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.6rem; }
.pub-hero p { color: rgba(255,255,255,0.85); max-width: 560px; margin: 0 auto; }
.pub-filters { display: flex; justify-content: center; gap: 10px; margin-top: 1.6rem; flex-wrap: wrap; }
.filter-tag {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition-fast);
}
.filter-tag:hover, .filter-tag.active { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; }

/* Grid */
.pub-main { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem 3rem; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.6rem; justify-content: center; }

.post-card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.post-card-img { position: relative; aspect-ratio: 16/10; background: var(--bg-light); overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--blue-mid); background: #EEF3F6; }
.post-type-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  background: var(--primary-blue);
}
.post-type-badge.post-type-evento { background: var(--accent-gold); }
.post-card-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.post-date { font-size: 0.78rem; color: var(--accent-gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.post-card-body h2 { font-size: 1.08rem; color: var(--primary-blue); }
.post-card-body p { font-size: 0.9rem; color: var(--text-muted); }

.empty-state { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 2.2rem; }
.pagination a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg-white); box-shadow: var(--card-shadow); font-weight: 600; }
.pagination a.active { background: var(--primary-blue); color: #fff; }

/* Single post */
.post-single { max-width: 780px; }
.back-link { display: inline-block; margin-bottom: 1.2rem; color: var(--primary-blue); font-weight: 600; }
.post-single h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--primary-blue); margin: 0.6rem 0; }
.post-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.4rem; }
.post-cover { width: 100%; border-radius: 16px; margin-bottom: 1.6rem; max-height: 420px; object-fit: cover; }
.post-content { font-size: 1.02rem; color: var(--text-main); }
.pub-related { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.pub-related h2 { color: var(--primary-blue); margin-bottom: 1.2rem; }

.pub-footer { text-align: center; padding: 1.8rem 1rem; padding-bottom: max(1.8rem, env(safe-area-inset-bottom, 0px)); color: var(--text-muted); font-size: 0.85rem; background: var(--bg-white); }

@media (max-width: 640px) {
  .pub-hero { padding: 2.2rem 1rem 1.8rem; }
  .pub-main { padding: 2rem 1rem 2.2rem; }
}
