*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family: 'Inter', sans-serif;
  background:#f5f6f8;
  color:#222;
}

/* CONTAINER */
.container{
  max-width:1200px;
  margin:auto;
  padding:100px 15px 20px;
}

/* NAVBAR */
.navbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  background:#fff;
  z-index:1000;
  padding:12px 20px;
  box-shadow:0 2px 15px rgba(0,0,0,0.08);
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.nav-logo{
  height:40px;
}

.nav-menu{
  display:flex;
  gap:15px;
  list-style:none;
}

.nav-link{
  text-decoration:none;
  color:#333;
  padding:6px 12px;
  border-radius:8px;
  transition:0.2s;
}

.nav-link:hover{
  background:#f0f0f0;
}

.nav-link.active{
  background:#007bff;
  color:#fff;
}

/* HERO */
.hero{
  position:relative;
  height:300px;
  border-radius:16px;
  overflow:hidden;
  margin-bottom:20px;
}

.hero-slide{
  position:absolute;
  width:100%;
  height:100%;
  opacity:0;
  transition:0.5s;
}

.hero-slide.active{
  opacity:1;
}

.hero img,
.hero video{
  width:100%;
  height:100%;
  object-fit:cover;
}





/* GRID */
.news-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:20px;
}

/* CARD */
.news-card{
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 4px 15px rgba(0,0,0,0.06);
  transition:0.3s;
}

.news-card:hover{
  transform:translateY(-5px);
  box-shadow:0 10px 25px rgba(0,0,0,0.1);
}

/* MEDIA */
.card-media{
  height:180px;
  overflow:hidden;
}

.card-media img,
.card-media video{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:0.3s;
}

.news-card:hover .card-media img{
  transform:scale(1.05);
}

/* CONTENT */
.card-content{
  padding:15px;
}

.card-text{
  font-size:15px;
  font-weight:600;
  margin-bottom:6px;
}

.card-meta{
  font-size:13px;
  color:#888;
}

/* BUTTON */
.detail-btn{
  margin-top:10px;
  padding:8px 16px;
  border:none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color:#fff;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  font-size: 14px;
}

.detail-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* PAGINATION */
.pagination{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-top:25px;
}

.pagination a{
  padding:8px 14px;
  background:#fff;
  border-radius:8px;
  border:1px solid #ddd;
  text-decoration:none;
}

.pagination a.active{
  background:#007bff;
  color:#fff;
}

/* MODAL - Enhanced */
#messageDetailModal,
#globalImageModal{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.7);
  display:none;
  justify-content:center;
  align-items:center;
  opacity:0;
  transition: opacity 0.3s ease;
  z-index: 10000;
}

#messageDetailModal.modal-show,
#globalImageModal.modal-show {
  opacity: 1;
}

.modal-show{
  display:flex !important;
}

#zoomModalContent {
  background:#fff;
  border-radius:16px;
  padding:20px;
  max-width:500px;
  width:90%;
}

#detailModalContent {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  width: 90%;
  max-width: 550px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#detailClose {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  z-index: 10;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

#detailClose:hover {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  transform: scale(1.1);
}

.detail-header {
  padding: 25px 30px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-sender {
  font-weight: 700;
  font-size: 18px;
}

.detail-date {
  background: rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.detail-content {
  padding: 0 30px 25px;
  max-height: 50vh;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.7;
  user-select: text;
}

#detailFullText {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.detail-footer {
  padding: 0 30px 30px;
  text-align: right;
}

.copy-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(40, 167, 69, 0.6);
}

.copy-btn:active {
  transform: translateY(0);
}

/* Dark Mode Modal */
body.dark #detailModalContent {
  background: rgba(30,30,30,0.95);
  color: #eee;
}

body.dark .detail-header {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.dark .detail-content {
  color: #eee;
}

/* Responsive */
@media (max-width: 768px) {
  #detailModalContent {
    margin: 20px;
    width: calc(100% - 40px);
    max-height: 85vh;
  }
  
  .detail-header {
    padding: 20px;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .detail-content {
    padding: 0 20px;
  }
  
  .detail-footer {
    padding: 0 20px 25px;
  }
}

/* RESPONSIVE */
@media(max-width:768px){
  .hero{height:220px;}
  
 }

.skeleton {
  background: linear-gradient(90deg, #eee, #ddd, #eee);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {background-position: -200% 0;}
  100% {background-position: 200% 0;}
}

.skeleton-card {
  height: 250px;
}

.breaking-news {
  background: #e60023;
  color: #fff;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  border-radius: 8px;
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  from {opacity: 1;}
  to {opacity: 0.7;}
}
body.dark {
  background: #121212;
  color: #eee;
}

body.dark .news-card {
  background: #1e1e1e;
}

body.dark .navbar {
  background: #1a1a1a;
}
.card-text:hover {
  color: #007bff;
}


.hero-content{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  padding:20px;
  color:#fff;
  background:linear-gradient(to top, rgba(0,0,0,0.85), transparent);

  max-height: 90px; /* 🔥 batasi total tinggi */
  overflow: hidden;
}

.hero-content h2{
  font-size:20px;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 🔥 maksimal 2 baris */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3em;
  max-height: 2.6em;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* 🔥 PENTING: matikan elemen lain kalau ada */
.hero-content p{
  display:none;
}

.hero-content{
  padding:12px 16px; /* lebih proporsional */
}