/*
Theme Name: RasaOren Theme v9
Theme URI: https://felda.gov.my
Author: Jabatan Komunikasi Strategik FELDA
Author URI: https://felda.gov.my
Description: Premium, custom-coded news portal theme for the RasaOren brand featuring modern UI/UX design, glassmorphism, responsive layouts, infinite carousel, and elegant comments.
Version: 9.0.0
License: Proprietary
Text Domain: felda-news
*/


:root {
  --felda-orange: #FF6600;
  --felda-orange-hover: #E65C00;
  --bg-color: #FAFAFA;
  --bg-surface: #FFFFFF;
  --footer-bg: #0F172A; /* Deep Navy for Footer */
  --footer-text: #F8FAFC;
  --footer-muted: #94A3B8;
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --border-color: #E5E7EB;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Container setup */
  --container-width: 1200px;
}

[data-theme="dark"] {
  --bg-color: #0F172A;
  --bg-surface: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(51, 65, 85, 0.5);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--felda-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--felda-orange-hover);
}

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

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.site-title span {
  color: var(--felda-orange);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.main-navigation a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-navigation a:hover {
  color: var(--felda-orange);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  background-color: var(--border-color);
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Typography Utility */
.heading-lg {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.heading-md {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  background-color: var(--felda-orange);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Hero Section */
.hero-section {
  padding: 4rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.hero-featured {
  position: relative;
  min-height: 500px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.hero-featured img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-featured::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 3rem;
  color: white;
}

.hero-content .heading-lg {
  color: white;
}

.hero-content .text-sm {
  color: rgba(255, 255, 255, 0.8);
}

.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-side-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.hero-side-item:last-child {
  border-bottom: none;
}
.hero-side-item img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
}

/* Article Grid */
.news-section {
  padding: 3rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -1rem; /* aligns with border-bottom of section-header */
  left: 0;
  height: 2px;
  width: 60px;
  background-color: var(--felda-orange);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.card-image {
  display: block;
  position: relative;
  width: 100%;
  padding-top: 60%;
  overflow: hidden;
  background-color: var(--border-color);
}

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

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

.card-content {
  padding: 1.5rem;
}

/* Single Post Layout */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.single-post-container {
  padding: 2.5rem;
}

.single-post-container.glass-card:hover,
.sidebar-news-inner.glass-card:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.single-post-header {
  margin-bottom: 2rem;
}

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.single-featured-image {
  border-radius: 16px;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
}

.entry-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-main);
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-content h2, .entry-content h3 {
  margin: 2rem 0 1rem;
  font-weight: 700;
}

/* Sidebar News */
.sidebar-news {
  position: sticky;
  top: 100px;
}

.sidebar-news-inner {
  padding: 1.5rem;
}

.sidebar-news-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-news-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-news-list {
  display: flex;
  flex-direction: column;
}

.sidebar-news-item {
  display: block;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  transition: background-color 0.15s;
}

.sidebar-news-item:last-child {
  border-bottom: none;
}

.sidebar-news-item:hover {
  color: var(--felda-orange);
}

.sidebar-news-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.sidebar-news-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-news-source {
  font-weight: 600;
  color: var(--felda-orange);
}

.sidebar-news-more {
  display: block;
  text-align: center;
  margin-top: 1rem;
  padding: 0.625rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--felda-orange);
  border: 1px solid var(--felda-orange);
  border-radius: 8px;
  transition: all 0.2s;
}

.sidebar-news-more:hover {
  background-color: var(--felda-orange);
  color: white;
}

/* Footer */
.site-footer {
  background-color: var(--footer-bg);
  border-top: none !important;
  padding: 4rem 0 2rem;
  margin-top: 0 !important;
  color: var(--footer-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .site-title {
  margin-bottom: 1rem;
  color: var(--footer-text);
}

.footer-brand .text-sm {
  color: var(--footer-muted);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
  background-color: var(--felda-orange);
  color: white;
  border-color: var(--felda-orange);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.footer-links h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--footer-text);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--footer-muted);
}

.footer-links a:hover {
  color: var(--felda-orange);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--footer-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-featured {
    min-height: 400px;
  }
  .single-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-news {
    position: static;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .main-navigation {
    display: none; /* In a full build, add mobile menu toggle */
  }
}

/* Comments Section */
#comments {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.comments-title, #reply-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  color: var(--text-main);
}

#reply-title a {
  font-size: 0.875rem;
  font-weight: 500;
  margin-left: 1rem;
}

.comment-list {
  list-style: none;
  margin-bottom: 3rem;
}

.comment-list li {
  margin-bottom: 1.5rem;
}

.comment-body {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-meta img.avatar {
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.comment-author b {
  font-size: 1.1rem;
  color: var(--text-main);
}

.comment-metadata a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.comment-content {
  color: var(--text-main);
  line-height: 1.6;
}

.reply {
  margin-top: 1rem;
}

.reply a {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--felda-orange);
  background: transparent;
  padding: 0.25rem 0;
  transition: all 0.2s;
}

.reply a:hover {
  text-decoration: underline;
}

/* Children Comments */
.children {
  list-style: none;
  margin-top: 1.5rem;
  padding-left: 2rem;
  border-left: 2px solid var(--border-color);
}

/* Comment Form */
#respond {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.comment-notes, .logged-in-as {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-form p {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.comment-form label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--felda-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.comment-form textarea {
  min-height: 150px;
  resize: vertical;
}

.comment-form-cookies-consent {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
}

.comment-form-cookies-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--felda-orange);
}

.comment-form-cookies-consent label {
  margin-bottom: 0;
  font-weight: 400;
}

.form-submit {
  margin-top: 1rem;
}

.form-submit .submit {
  background-color: var(--felda-orange);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.form-submit .submit:hover {
  background-color: var(--felda-orange-hover);
  transform: translateY(-2px);
}

.form-submit .submit:active {
  transform: translateY(0);
}

/* Loading Spinner */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--felda-orange);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 0 1rem;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  text-decoration: none;
}

.pagination .page-numbers:hover {
  border-color: var(--felda-orange);
  color: var(--felda-orange);
}

.pagination .page-numbers.current {
  background-color: var(--felda-orange);
  border-color: var(--felda-orange);
  color: white;
}

.pagination .prev,
.pagination .next {
  font-weight: 600;
}

.pagination .dots {
  border: none;
  background: transparent;
  color: var(--text-muted);
}

/* Subsidiaries Marquee */
.subsidiaries-marquee {
  background-color: #FFFFFF;
  padding: 4rem 0;
  overflow: hidden;
  margin: 0 !important;
  border: none !important;
}

[data-theme="dark"] .subsidiaries-marquee {
  background-color: #0F172A; /* Match Deep Navy Footer */
}

.marquee-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

[data-theme="dark"] .marquee-title {
  color: #F8FAFC;
}

.marquee-wrapper {
  position: relative;
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 3rem;
  padding: 0 1.5rem;
}

/* Fading edges */
.marquee-wrapper::before,
.marquee-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.marquee-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #FFFFFF, transparent);
}
.marquee-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #FFFFFF, transparent);
}

[data-theme="dark"] .marquee-wrapper::before {
  background: linear-gradient(to right, #0F172A, transparent);
}
[data-theme="dark"] .marquee-wrapper::after {
  background: linear-gradient(to left, #0F172A, transparent);
}

.marquee-content {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 3rem;
  min-width: 100%;
  animation: scroll 30s linear infinite;
}

.marquee-wrapper:hover .marquee-content {
  animation-play-state: paused;
}

.marquee-content img {
  height: 50px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.7);
  transition: filter 0.3s ease;
}

.marquee-content img:hover {
  filter: grayscale(0%) opacity(1);
}

@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 1.5rem));
  }
}

[data-theme="dark"] .marquee-content img {
  filter: grayscale(100%) brightness(2) opacity(0.7);
}
[data-theme="dark"] .marquee-content img:hover {
  filter: grayscale(0%) brightness(1) opacity(1);
}
