/* ============================================
   Berita Global Terbaru — Professional News Portal
   Premium look · Mobile-first · No pinch-zoom-out
   ============================================ */

:root {
  --primary: #b91c1c;
  --primary-dark: #991b1b;
  --primary-light: #dc2626;
  --primary-soft: rgba(185, 28, 28, 0.1);
  --accent: #0f172a;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 999px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
  --max-width: 1180px;
  --header-h: 60px;
}

[data-theme="dark"] {
  --primary: #ef4444;
  --primary-dark: #dc2626;
  --primary-light: #f87171;
  --primary-soft: rgba(239, 68, 68, 0.15);
  --accent: #e2e8f0;
  --bg: #0b1120;
  --bg-card: #111827;
  --bg-header: #0f172a;
  --bg-elevated: #1e293b;
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

ul {
  list-style: none;
}

/* Prevent accidental zoom on inputs (iOS) */
input,
select,
textarea {
  font-size: 16px !important;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35);
}

.logo span {
  display: none;
}

@media (min-width: 400px) {
  .logo span {
    display: inline;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-desktop::-webkit-scrollbar {
  display: none;
}

.nav-desktop a {
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 7px;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 1.15rem;
  transition: background var(--transition), color var(--transition), transform 0.15s ease;
}

.btn-icon:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-icon:active {
  transform: scale(0.94);
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 10px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 960px) {
  .nav-desktop {
    display: flex;
  }
  .hamburger {
    display: none;
  }
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 10px 16px 18px;
  gap: 2px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  padding: 13px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: background var(--transition), color var(--transition);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

/* ---------- Search bar ---------- */
.search-bar {
  display: none;
  padding: 10px 16px 14px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}

.search-bar.open {
  display: block;
}

.search-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.search-wrapper input {
  width: 100%;
  padding: 13px 46px 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px !important;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-wrapper .clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 0.85rem;
  transition: background var(--transition);
}

.search-wrapper .clear-search:hover {
  background: var(--border);
  color: var(--text);
}

.search-wrapper .clear-search.visible {
  display: flex;
}

/* ---------- Breaking News Ticker ---------- */
.breaking-news {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  color: #fff;
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.breaking-label {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.25);
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  z-index: 2;
  gap: 4px;
}

.ticker-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  animation: ticker 45s linear infinite;
  padding-left: 12px;
}

.ticker:hover {
  animation-play-state: paused;
}

.ticker a {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.95;
}

.ticker a:hover {
  text-decoration: underline;
  opacity: 1;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 20px 0 8px;
}

.hero-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .hero {
    padding: 28px 0 12px;
  }
  .hero-card {
    grid-template-columns: 1.25fr 1fr;
  }
}

.hero-image {
  position: relative;
  min-height: 200px;
  background: var(--border);
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-image {
    min-height: 320px;
  }
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.5s ease;
}

.hero-card:hover .hero-image img {
  transform: scale(1.03);
}

.hero-content {
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

@media (min-width: 768px) {
  .hero-content {
    padding: 28px 28px 28px 24px;
  }
}

.hero-welcome {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.28;
  color: var(--text);
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 1.65rem;
  }
}

.hero-title a:hover {
  color: var(--primary);
}

.hero-summary {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: transform var(--transition), box-shadow var(--transition);
  width: fit-content;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(185, 28, 28, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ---------- Main layout ---------- */
.main-content {
  padding: 16px 0 48px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
  }
}

/* ---------- Filters & Sort ---------- */
.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.category-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  .category-filters {
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

.cat-btn {
  padding: 8px 15px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.cat-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.3);
}

.sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.sort-select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.sort-select:focus {
  border-color: var(--primary);
}

.results-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- News Grid ---------- */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 560px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

.news-card {
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--border);
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.news-card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 7px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.card-title a:hover {
  color: var(--primary);
}

.card-summary {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  transition: gap var(--transition);
}

.btn-read:hover {
  gap: 8px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
  padding: 8px 0;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.3);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 2px;
  font-weight: 600;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 960px) {
  .sidebar {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

.sidebar-box {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2.5px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.popular-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity var(--transition);
}

.popular-item:hover {
  opacity: 0.85;
}

.popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-item:first-child {
  padding-top: 0;
}

.popular-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}

.popular-info h4 {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-info h4:hover {
  color: var(--primary);
}

.popular-info .meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- Detail page ---------- */
.detail-view {
  display: none;
}

.detail-view.active {
  display: block;
}

.home-view.hidden {
  display: none;
}

.detail-container {
  padding: 24px 18px 80px;
  max-width: 720px;
}

@media (min-width: 768px) {
  .detail-container {
    padding: 32px 24px 60px;
    max-width: 760px;
  }
}

.article-header {
  margin-bottom: 20px;
}

.article-badge {
  margin-bottom: 12px;
}

.article-title {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 14px;
  letter-spacing: -0.015em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 1.85rem;
    line-height: 1.35;
  }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
  line-height: 1.5;
}

.article-image {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--border);
  max-height: 440px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

.article-body {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text);
  letter-spacing: 0.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-body p {
  margin-bottom: 1.35em;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body strong {
  font-weight: 700;
}

.article-source {
  margin-top: 32px;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  line-height: 1.5;
}

.article-source a {
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  transition: all var(--transition);
}

.btn-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.related-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

@media (min-width: 560px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- States ---------- */
.loading,
.error-state,
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.error-state p,
.empty-state p {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.btn-retry {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
  transition: transform var(--transition);
}

.btn-retry:hover {
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer .logo {
  justify-content: center;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.site-footer p {
  margin-top: 6px;
  line-height: 1.5;
}

/* ---------- Placeholder image ---------- */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 2.5rem;
}

[data-theme="dark"] .img-placeholder {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #475569;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Touch-friendly targets */
@media (max-width: 959px) {
  .cat-btn,
  .page-btn,
  .btn-icon,
  .btn-read,
  .btn-primary,
  .btn-back {
    min-height: 44px;
  }

  .page-btn {
    min-width: 44px;
    height: 44px;
  }
}

/* ---------- About text ---------- */
.about-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.about-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ---------- Social links (sidebar) ---------- */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.95;
}

.social-btn:active {
  transform: translateY(0);
}

.social-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
}

.social-tiktok { background: linear-gradient(135deg, #010101 0%, #25f4ee 50%, #fe2c55 100%); }
.social-ig { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%); }
.social-fb { background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%); }
.social-x { background: linear-gradient(135deg, #14171a 0%, #000 100%); }
.social-yt { background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%); }
.social-web { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }

[data-theme="dark"] .social-x {
  background: linear-gradient(135deg, #333 0%, #111 100%);
  border: 1px solid #444;
}

/* ---------- WhatsApp button ---------- */
.sidebar-wa .wa-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff !important;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp:active {
  transform: translateY(0);
}

.wa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-whatsapp-footer {
  width: auto;
  padding: 12px 22px;
  font-size: 0.88rem;
}

/* ---------- Footer enhanced ---------- */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 36px 0 96px;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (min-width: 768px) {
  .site-footer {
    padding-bottom: 40px;
  }
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.footer-brand .logo {
  justify-content: center;
  margin-bottom: 8px;
  font-size: 1rem;
}

.footer-tagline {
  max-width: 420px;
  line-height: 1.55;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-social-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.footer-soc {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform var(--transition), box-shadow var(--transition);
}

.footer-soc:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-md);
}

.footer-tiktok { background: #010101; }
.footer-ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.footer-fb { background: #1877f2; }
.footer-x { background: #000; }
.footer-yt { background: #ff0000; }
.footer-web { background: var(--primary); }

[data-theme="dark"] .footer-tiktok,
[data-theme="dark"] .footer-x {
  background: #1e293b;
  border: 1px solid #334155;
}

.footer-copy {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  position: fixed;
  bottom: 22px;
  right: 18px;
  z-index: 999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.6);
}

.wa-float:active {
  transform: scale(0.96);
}

.wa-float-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #25d366;
  animation: wa-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.wa-float-label {
  position: absolute;
  right: 68px;
  background: #111827;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.wa-float-label::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #111827;
}

.wa-float:hover .wa-float-label {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 480px) {
  .wa-float {
    bottom: 18px;
    right: 14px;
    width: 56px;
    height: 56px;
  }
  .wa-float-label {
    display: none;
  }
}

@supports (padding: max(0px)) {
  .wa-float {
    bottom: max(22px, env(safe-area-inset-bottom));
    right: max(18px, env(safe-area-inset-right));
  }
}
