/* ==========================================================
   JTME News System — news.css
   Include in: news.html  AND  index.html
   ========================================================== */

/* ---- Fallback variables (if estilo.css doesn't define them) ---- */
:root {
  --tibia-gold: #d4af37;
  --menu-orange: #e07b39;
  --news-dark: #0d0b08;
  --news-panel: rgba(20, 16, 8, 0.85);
  --news-border: rgba(212, 175, 55, 0.18);
  --news-border-h: rgba(212, 175, 55, 0.5);
  --news-text: #d0c4a0;
  --news-sub: #8a7a5a;
  --news-radius: 10px;
}

/* ==========================================================
   NEWS PAGE — news.html
   ========================================================== */

.news-page-header {
  text-align: center;
  padding: 24px 20px;
}

.news-page-header .section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--tibia-gold);
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  margin-bottom: 6px;
}

.news-page-header .section-subtitle {
  color: var(--news-sub);
  font-size: 1rem;
}

#news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 16px 28px;
}

.news-filter-btn {
  background: rgba(30, 22, 8, 0.7);
  border: 1px solid var(--news-border);
  border-radius: 20px;
  color: var(--news-text);
  cursor: pointer;
  font-size: .82rem;
  padding: 5px 14px;
  transition: all .22s ease;
}

.news-filter-btn:hover,
.news-filter-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--tibia-gold);
  color: var(--tibia-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding: 0 0 40px;
}

.news-card {
  background: var(--news-panel);
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  animation: newsCardIn .35s ease both;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--news-border-h);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.12);
}

@keyframes newsCardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-card-img-wrap {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #0a0800;
}

.news-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

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

.news-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.news-card-title {
  color: #e8dab8;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.news-card-date {
  color: var(--news-sub);
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-card-excerpt {
  color: var(--news-text);
  font-size: .87rem;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.news-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--cat-color, #a5d6a7) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, #a5d6a7) 40%, transparent);
  color: var(--cat-color, #a5d6a7);
  width: fit-content;
}

.news-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  color: var(--tibia-gold);
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
  padding: 7px 14px;
  text-decoration: none;
  transition: all .2s ease;
}

.news-read-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--tibia-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.news-empty,
.news-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--news-sub);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.news-error {
  color: #ef9a9a;
}

#news-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--news-sub);
}

.news-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--tibia-gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================
   MODAL — full article
   ========================================================== */
.news-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .25s ease;
}

.news-modal-overlay.news-modal-in {
  opacity: 1;
}

.news-modal-overlay.news-modal-out {
  opacity: 0;
}

.news-modal {
  background: #130f07;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(212, 175, 55, 0.08);
  transform: translateY(12px);
  transition: transform .25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}

.news-modal-overlay.news-modal-in .news-modal {
  transform: translateY(0);
}

.news-modal-close {
  position: sticky;
  top: 12px;
  float: right;
  margin: 12px 12px 0 0;
  background: rgba(224, 123, 57, 0.15);
  border: 1px solid rgba(224, 123, 57, 0.4);
  border-radius: 50%;
  color: var(--menu-orange);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  z-index: 2;
  transition: all .2s ease;
}

.news-modal-close:hover {
  background: rgba(224, 123, 57, 0.3);
  transform: scale(1.1);
}

.news-modal-img-wrap {
  width: 100%;
  padding: 14px 14px 0;
}

.news-modal-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 3px solid var(--tibia-border);
  box-shadow: 0 10px 40px var(--shadow-gold);
}

.news-modal-body {
  padding: 20px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-modal-title {
  color: #f0e4b8;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.news-modal-text {
  color: var(--news-text);
  font-size: .93rem;
  line-height: 1.72;
  margin-top: 6px;
}

.news-bullet {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 3px 0;
}

.news-bullet-icon {
  color: var(--tibia-gold);
  font-size: .7rem;
  margin-top: 4px;
  flex-shrink: 0;
}

.news-link {
  color: var(--tibia-gold);
  text-decoration: underline;
  word-break: break-all;
  transition: color .2s;
}
.news-link:hover { color: var(--menu-orange); }

.news-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.news-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--tibia-gold);
  font-size: .9rem;
  text-decoration: none;
  transition: all .2s ease;
  flex-shrink: 0;
}
.news-link-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--tibia-gold);
  color: var(--tibia-gold);
  transform: scale(1.08);
}

.news-modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  color: var(--tibia-gold);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  align-self: flex-start;
  margin-top: 6px;
}
.news-modal-link-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--tibia-gold);
  color: var(--tibia-gold);
}

/* ==========================================================
   HOMEPAGE WIDGET — index.html
   ========================================================== */
.news-widget-section {
  padding: 60px 0;
  position: relative;
  background: var(--news-dark);
}

#news-widget {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  overflow: hidden;
  background: rgba(15, 11, 4, 0.7);
  max-width: 960px;
  margin: 0 auto;
}

/* ---- Featured item — horizontal layout ---- */
.nw-item--featured {
  border-bottom: 1px solid var(--news-border);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 200px;
  position: relative;
  background: linear-gradient(135deg, #1a1005 0%, #0d0900 100%);
  cursor: pointer;
}

.nw-featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.nw-featured-img {
  width: 400px;
  flex-shrink: 0;
  padding: 12px 0 12px 12px;
}

.nw-featured-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 3px solid var(--tibia-border);
  transition: transform .6s ease, border-color .3s ease, box-shadow .3s ease;
}

.nw-item--featured:hover .nw-featured-img img {
  transform: scale(1.03);
  border-color: var(--tibia-gold);
  box-shadow: 0 10px 40px var(--shadow-gold);
}

.nw-featured-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nw-featured-title {
  color: #fff8e8;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  cursor: pointer;
  transition: color .2s ease;
}

.nw-featured-title:hover {
  color: var(--tibia-gold);
}

.nw-featured-date {
  font-size: .85rem;
  font-weight: 400;
  color: var(--news-sub);
}

.nw-featured-text {
  color: rgba(215, 195, 150, 0.92);
  font-size: .85rem;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Compact items (older news) ---- */
.nw-item--compact {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.07);
  transition: background .2s ease;
  cursor: pointer;
}

.nw-item--compact:hover {
  background: rgba(212, 175, 55, 0.05);
}

.nw-item--compact:last-of-type {
  border-bottom: none;
}

.nw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nw-compact-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nw-compact-title {
  background: none;
  border: none;
  color: #d4c89a;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  padding: 0;
  text-align: left;
  line-height: 1.3;
  transition: color .18s ease;
  width: 100%;
}

.nw-compact-title:hover {
  color: var(--tibia-gold);
}

.nw-compact-summary {
  color: var(--news-text);
  font-size: .80rem;
  line-height: 1.45;
  margin: 2px 0 0;
  opacity: .8;
}

.nw-compact-date {
  font-size: .80rem;
  color: var(--news-sub);
  font-weight: 400;
}

.nw-compact-badge {
  flex-shrink: 0;
  font-size: .68rem;
  padding: 2px 7px;
}

.nw-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px;
  background: rgba(212, 175, 55, 0.05);
  border-top: 1px solid var(--news-border);
  color: var(--tibia-gold);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .03em;
  transition: background .2s ease, color .2s ease;
}

.nw-view-all:hover {
  background: rgba(212, 175, 55, 0.12);
  color: #f5e070;
}

a.nw-readmore-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.nw-skeleton {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nw-skel-bar {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  animation: skelPulse 1.4s ease-in-out infinite;
}

@keyframes skelPulse {

  0%,
  100% {
    opacity: .5;
  }

  50% {
    opacity: 1;
  }
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-modal-body {
    padding: 16px 18px 22px;
  }

  .nw-compact-badge {
    display: none;
  }

  .nw-featured-body {
    padding: 14px 16px 16px;
  }

  .nw-featured-title {
    font-size: .97rem;
  }

  .nw-featured-text {
    -webkit-line-clamp: 2;
  }
}