/* ============= Nairy Machinery — News Pages Styles ============= */

/* ---- Active nav ---- */
.nav-active { color: var(--primary) !important; }
.nav-active::after { width: 100% !important; }

/* ---- Header solid ---- */
.header-solid {
  position: sticky; top: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: rgba(255,255,255,0.6); margin-bottom: 24px;
}
.breadcrumb a { color: rgba(255,255,255,0.6); transition: color .25s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: rgba(255,255,255,0.9); }
.breadcrumb svg { opacity: 0.5; }

/* ============= Page Hero ============= */
.page-hero {
  position: relative; min-height: 40vh;
  background: var(--steel-deep); color: #fff;
  display: flex; align-items: center; flex-direction: column; justify-content: flex-end;
}
.page-hero-bg { position: absolute; inset: 0; overflow: hidden; }
.page-hero-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.page-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(22,25,31,0.9) 40%, rgba(22,25,31,0.55) 100%);
}
.page-hero-content {
  position: relative; z-index: 10;
  padding-top: 120px; padding-bottom: 60px; width: 100%;
}
.accent { color: var(--primary); }

/* ============= News Main Layout ============= */
.news-main { padding: 64px 0 80px; }
.news-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px; align-items: start;
}
@media(max-width:1024px){
  .news-layout { grid-template-columns: 1fr; }
  .news-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media(max-width:640px){
  .news-sidebar { grid-template-columns: 1fr; }
}

/* ============= News Cards ============= */

/* Featured Card */
.news-card-featured {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--card); border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 32px;
  transition: box-shadow .3s, transform .3s;
}
.news-card-featured:hover {
  box-shadow: var(--shadow-industrial);
  transform: translateY(-4px);
}
@media(max-width:768px){ .news-card-featured { grid-template-columns: 1fr; } }

.news-card-featured .news-card-img-wrap { aspect-ratio: 4/3; overflow: hidden; position: relative; display: block; }
.news-card-featured .news-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.news-card-featured:hover .news-card-img { transform: scale(1.04); }
.news-card-featured .news-card-body { padding: 40px 36px; display: flex; flex-direction: column; justify-content: center; }
.news-card-featured .news-card-title a { font-size: 1.35rem; color: var(--foreground); transition: color .25s; line-height: 1.3; }
.news-card-featured .news-card-title a:hover { color: var(--primary); }
.news-card-featured .news-card-excerpt { margin-top: 14px; font-size: 0.92rem; color: var(--muted-foreground); line-height: 1.75; }

/* Standard Grid */
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.news-card {
  background: #fff; border: 1px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .3s, transform .3s;
}
.news-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}
.news-card-img-wrap {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16/9;
}
.news-card-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.news-card:hover .news-card-img,
.news-card-featured:hover .news-card-img { transform: scale(1.05); }

.news-tag {
  position: absolute; top: 14px; left: 14px;
  background: var(--primary); color: #fff;
  font-family: var(--font-display); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.15em;
  padding: 4px 10px;
}
.news-tag-alt { background: var(--steel); }

.news-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.news-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--muted-foreground);
  margin-bottom: 12px;
}
.news-read-time::before { content: "·"; margin-right: 6px; }
.news-card-title { margin-bottom: 10px; }
.news-card-title a {
  font-size: 1rem; color: var(--foreground);
  font-family: var(--font-display); line-height: 1.3;
  transition: color .25s; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card:hover .news-card-title a{ color: #c8262c; }
.news-card-excerpt {
  font-size: 0.875rem; color: var(--muted-foreground);
  line-height: 1.7; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--primary); margin-top: 16px; transition: gap .25s;
}
.news-card-link:hover { gap: 10px; }

/* ============= Pagination ============= */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 48px;
}
.page-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); font-family: var(--font-display); font-size: 13px;
  color: var(--foreground); transition: all .25s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.page-prev, .page-btn.page-next { background: var(--muted); }
.page-ellipsis { color: var(--muted-foreground); font-size: 14px; }

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

.sidebar-widget {
  background: var(--card); border: 1px solid var(--border);
  padding: 28px;
}
.sidebar-widget-title {
  font-family: var(--font-display); font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--foreground); margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* Recent Posts */
.recent-posts { display: flex; flex-direction: column; gap: 16px; }
.recent-post { display: flex; gap: 14px; }
.recent-post-img-wrap { flex-shrink: 0; width: 72px; height: 56px; overflow: hidden; display: block; }
.recent-post-img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.recent-post:hover .recent-post-img { transform: scale(1.08); }
.recent-post-info { display: flex; flex-direction: column; gap: 4px; }
.recent-post-date { font-size: 11px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.06em; }
.recent-post-title { font-size: 13px; color: var(--foreground); line-height: 1.4; transition: color .25s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recent-post-title:hover { color: var(--primary); }

/* Tag Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  font-family: var(--font-display); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 12px; border: 1px solid var(--border);
  color: var(--muted-foreground); transition: all .25s;
}
.tag-item:hover {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}

/* Sidebar CTA */
.sidebar-cta { background: var(--steel-deep); border-color: var(--steel); }
.sidebar-cta-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: #fff; }
.sidebar-cta-inner svg { color: var(--primary); }
.sidebar-cta-inner h4 { font-family: var(--font-display); font-size: 1.1rem; color: #fff; }
.sidebar-cta-inner p { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.6; }

/* ============= Footer ============= */
.footer {
  background: var(--steel-deep); color: #fff;
  padding: 64px 0 0; border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px; padding-bottom: 48px;
}
@media(max-width:768px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media(max-width:480px){ .footer-grid{ grid-template-columns: 1fr; } }

.footer-heading {
  font-family: var(--font-display); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4); margin-bottom: 20px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,0.6); transition: color .25s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,0.3);
}

/* ============= Animations ============= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   NEWS DETAIL PAGE
   ===================================================================== */

/* Hero for detail */
.detail-hero {
  position: relative; min-height: 40vh;
  background: var(--steel-deep); color: #fff;
  display: flex; align-items: flex-end;
}
.detail-hero-content { padding-bottom: 56px; padding-top: 120px; }
.detail-hero-meta {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.detail-hero-title {
  font-size: clamp(1.6rem, 4vw, 3rem); max-width: 820px; line-height: 1.15;
}
.detail-hero-excerpt {
  color: rgba(255,255,255,0.7); font-size: 1.05rem;
  max-width: 700px; line-height: 1.7; margin-top: 16px;
}

/* ---- Article Layout ---- */
.article-layout {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 56px; align-items: start;
  padding: 64px 0 80px;
}
@media(max-width:1024px){
  .article-layout { grid-template-columns: 1fr; }
}

/* ---- Article Body ---- */
.article-body { min-width: 0; }
.article-cover {
  width: 100%; aspect-ratio: 16/7; object-fit: cover;
  margin-bottom: 40px;
}
.article-content { font-size: 1rem; line-height: 1.85; color: #374151; }
.article-content h2 {
  font-size: 1.5rem; color: var(--foreground);
  margin: 40px 0 16px; padding-left: 16px;
  border-left: 4px solid var(--primary);
}
.article-content h3 { font-size: 1.15rem; color: var(--foreground); margin: 32px 0 12px; }
.article-content p { margin-bottom: 20px; }
.article-content ul, .article-content ol {
  margin: 0 0 20px 24px; display: flex; flex-direction: column; gap: 8px;
}
.article-content li { list-style: disc; }
.article-content ol li { list-style: decimal; }
.article-content blockquote {
  border-left: 4px solid var(--primary); margin: 32px 0;
  padding: 20px 28px; background: var(--muted);
  font-style: italic; color: var(--muted-foreground);
}
.article-content img {
  width: 100%; margin: 28px 0;
  border: 1px solid var(--border);
}
.article-content .img-caption {
  text-align: center; font-size: 13px;
  color: var(--muted-foreground); margin-top: -20px; margin-bottom: 28px;
}
.article-content .highlight-box {
  background: rgba(200,38,44,0.06);
  border: 1px solid rgba(200,38,44,0.2);
  padding: 24px 28px; margin: 28px 0;
}
.article-content .highlight-box strong { color: var(--primary); }

/* Article Tags */
.article-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.article-tags-label { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }

/* Article Share */
.article-share {
  display: flex; align-items: center; gap: 12px;
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border);
}
.article-share-label { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.share-btn {
  width: 36px; height: 36px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-foreground); transition: all .25s;
}
.share-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Prev/Next Navigation ---- */
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--border);
}
@media(max-width:640px){ .article-nav{ grid-template-columns: 1fr; } }

.article-nav-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px; background: var(--card); border: 1px solid var(--border);
  transition: box-shadow .3s, transform .3s;
}
.article-nav-item:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.article-nav-item.next { align-items: flex-end; text-align: right; }

.nav-item-dir {
  font-family: var(--font-display); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--primary); display: flex; align-items: center; gap: 6px;
}
.nav-item-title { font-family: var(--font-display); font-size: 0.95rem; color: var(--foreground); line-height: 1.3; transition: color .25s; }
.article-nav-item:hover .nav-item-title { color: var(--primary); }
.nav-item-date { font-size: 12px; color: var(--muted-foreground); }

/* ---- Related Articles ---- */
.related-section { margin-top: 64px; padding-top: 48px; border-top: 2px solid var(--border); }
.related-section .section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.related-section .section-header h2 { font-size: 1.4rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media(max-width:768px){ .related-grid{ grid-template-columns: 1fr 1fr; } }
@media(max-width:480px){ .related-grid{ grid-template-columns: 1fr; } }

/* ---- Article Sidebar ---- */
.article-sidebar { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 100px; }

/* Author / Source Card */
.author-card {
  background: var(--steel-deep); color: #fff;
  padding: 28px; border: 1px solid var(--steel);
}
.author-card-icon {
  width: 52px; height: 52px; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: #fff; margin-bottom: 16px;
}
.author-card h4 { font-family: var(--font-display); color: #fff; font-size: 1rem; margin-bottom: 6px; }
.author-card p { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.6; }
.pagination .page-num{border: 1px solid #ddd; display: block; padding: 7px 15px;}
.page-num-current{background: #c00; color: #fff;}