/* 
  PN Tarakan Official Website Stylesheet 
  Compliant with SK Dirjen Badilum No. 127/DJU/SK.HM1.1/III/2026
  Primary Brand Color: #9a2109 (Merah Badilum / Mahkamah Agung)
  W3C WCAG 2.1 AA Compliant (Min Contrast 4.5:1)
*/

:root {
  --primary-red: #9a2109;
  --primary-dark: #6f1403;
  --primary-light: #c03417;
  --gold-accent: #d4af37;
  --gold-hover: #b89628;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #4a5568;
  --border-color: #e2e8f0;
  --focus-ring: #2563eb;
  --high-contrast-bg: #000000;
  --high-contrast-text: #ffff00;
  --high-contrast-border: #ffffff;
  --font-base: 16px;
}

body.high-contrast {
  --bg-light: #121212;
  --bg-white: #000000;
  --text-dark: #ffffff;
  --text-muted: #e0e0e0;
  --border-color: #444444;
  background-color: var(--high-contrast-bg) !important;
  color: var(--high-contrast-text) !important;
}

body.high-contrast * {
  border-color: var(--high-contrast-border) !important;
}

body.high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.high-contrast .bg-primary-red,
body.high-contrast header,
body.high-contrast nav {
  background-color: #000000 !important;
  border-bottom: 2px solid #ffffff !important;
}

/* Base Accessibility Settings */
html {
  font-size: var(--font-base);
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Accessibility Focus States */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 10px;
  background: #000000;
  color: #ffffff;
  padding: 8px 16px;
  z-index: 9999;
  font-weight: bold;
  text-decoration: none;
  transition: top 0.2s ease;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus {
  top: 0;
}

/* Accessibility Toolbar */
.a11y-bar {
  background-color: #1f2937;
  color: #ffffff;
  font-size: 0.875rem;
  padding: 4px 1rem;
}

.a11y-btn {
  background: transparent;
  border: 1px solid #4b5563;
  color: #ffffff;
  padding: 2px 8px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.a11y-btn:hover, .a11y-btn:focus {
  background: #374151;
  border-color: #9ca3af;
}

/* Header Area */
.main-header {
  background-color: var(--bg-white);
  border-bottom: 3px solid var(--primary-red);
  padding: 12px 0;
}

.brand-title {
  color: var(--primary-red);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.badge-box {
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.badge-wbk {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge-wbbm {
  background-color: #fefce8;
  color: #a16207;
  border-color: #fef08a;
}

/* Navigation Bar */
.main-nav {
  background-color: var(--primary-red);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-link-custom {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 16px !important;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: block;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-link-custom:hover, .nav-link-custom:focus, .nav-link-custom.active {
  background-color: var(--primary-dark);
  color: var(--gold-accent) !important;
}

/* Dropdown Menu */
.dropdown-menu-custom {
  background-color: var(--primary-dark);
  border: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  padding: 8px 0;
  margin-top: 0;
}

.dropdown-item-custom {
  color: #ffffff !important;
  font-weight: 500;
  padding: 8px 20px;
  font-size: 0.9rem;
  text-decoration: none;
  display: block;
}

.dropdown-item-custom:hover, .dropdown-item-custom:focus {
  background-color: var(--primary-red);
  color: var(--gold-accent) !important;
}

/* Hero Slider */
.hero-slider-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.slide-item {
  display: none;
  position: relative;
}

.slide-item.active {
  display: block;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
  color: #ffffff;
  padding: 24px 20px 16px 20px;
}

/* Quick Access Icon Grid */
.quick-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 992px) {
  .quick-icon-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 576px) {
  .quick-icon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.quick-icon-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.quick-icon-card:hover, .quick-icon-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(154, 33, 9, 0.15);
  border-color: var(--primary-red);
  color: var(--primary-red);
}

.quick-icon-card.priority-sipp {
  border: 2px solid var(--primary-red);
  background-color: #fff8f6;
  position: relative;
}

.quick-icon-card.priority-sipp::after {
  content: 'UTAMA';
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--primary-red);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 4px;
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 1.4rem;
  color: var(--primary-red);
}

.quick-icon-card:hover .icon-wrapper {
  background: var(--primary-red);
  color: #ffffff;
}

/* Service Banner Bar */
.service-bar-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .service-bar-container {
    grid-template-columns: 1fr;
  }
}

.service-banner-box {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.service-banner-box:hover, .service-banner-box:focus {
  transform: scale(1.01);
  color: var(--gold-accent);
}

/* Section Cards */
.card-section {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-section-header {
  background-color: #f8fafc;
  border-bottom: 2px solid var(--primary-red);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-red);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-section-body {
  padding: 18px;
}

/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 992px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  transition: box-shadow 0.2s;
}

.news-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.news-img-box {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: #e2e8f0;
}

.news-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-badge-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.news-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-dark);

  /* Ellipsis max 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-title a {
  color: inherit;
  text-decoration: none;
}

.news-title a:hover, .news-title a:focus {
  color: var(--primary-red);
}

.news-excerpt {
  font-size: 0.825rem;
  color: var(--text-muted);

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Announcements List */
.announcement-item {
  padding: 10px 12px;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

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

.announcement-date-box {
  background-color: #fee2e2;
  color: var(--primary-red);
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  min-width: 55px;
}

.announcement-date-box .day {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.announcement-date-box .month {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: bold;
}

/* RSS Grid */
.rss-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 576px) {
  .rss-grid {
    grid-template-columns: 1fr;
  }
}

.rss-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-red);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-dark);
}

.rss-box:hover, .rss-box:focus {
  background: #f1f5f9;
  color: var(--primary-red);
}

/* Jadwal Sidang Widget */
.jadwal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.jadwal-table th {
  background-color: var(--primary-red);
  color: #ffffff;
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
}

.jadwal-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

.jadwal-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.badge-perkara {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: bold;
}

.badge-pidana {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-perdata {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Video Badge with JBI Sign Language Interpreter Tag */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.jbi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #065f46;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

/* Index Cards (IKM & IPAK) */
.index-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.index-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary-red);
  line-height: 1;
  margin: 6px 0;
}

.index-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
}

.index-meta {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}

.sidebar-widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-red);
  border-bottom: 2px solid var(--primary-red);
  padding-bottom: 6px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Footer */
footer {
  background-color: var(--primary-dark);
  color: #ffffff;
  font-size: 0.875rem;
  padding-top: 30px;
  padding-bottom: 20px;
  border-top: 4px solid var(--gold-accent);
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
}

footer a:hover, footer a:focus {
  color: var(--gold-accent);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 20px;
  padding-top: 16px;
  font-size: 0.8rem;
  color: #94a3b8;
}
