/**
 * MS Banda Aceh Modern - Custom CSS
 * Additional styles and overrides
 */

/* ============================================
   SKIP LINK (Accessibility)
   ============================================ */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
    left: 0;
    top: 0;
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

/* ============================================
   CUSTOM CONTAINER
   ============================================ */
.container {
    max-width: 1280px;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* ============================================
   POST ARCHIVE ITEMS
   ============================================ */
.post-archive-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    text-decoration: none !important;
    color: inherit;
    transition: all var(--transition-fast);
}

.post-archive-item:hover {
    padding-left: var(--spacing-sm);
}

.post-archive-item h6 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    transition: color var(--transition-fast);
}

.post-archive-item:hover h6 {
    color: var(--primary);
}

.post-archive-item h6 a {
    color: inherit;
    text-decoration: none;
}

.post-archive-item h6 a:hover {
    color: var(--primary);
}

.post-meta a {
    color: var(--primary);
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

/* ============================================
   FEATURED IMAGE
   ============================================ */
.featured-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ============================================
   POST CONTENT
   ============================================ */
.post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-800);
}

.post-content h2, .post-content h3, .post-content h4 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 4px solid var(--secondary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--gray-100);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

.post-content iframe {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content table th,
.post-content table td {
    border: 1px solid var(--gray-300);
    padding: 0.75rem;
    text-align: left;
}

.post-content table th {
    background: var(--gray-100);
    font-weight: 600;
}

.post-content table tr:nth-child(even) {
    background: var(--gray-100);
}

/* ============================================
   COMMENTS
   ============================================ */
.comment-form p {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--gray-700);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,74,26,0.1);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .form-submit input[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-xl);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.comment-form .form-submit input[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Comment list */
.comments-area ol.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comments-area li.comment {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 0;
}

.comments-area li.comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-dark);
}

.comment-author .fn {
    font-family: var(--font-body);
}

.comment-author img.avatar {
    border-radius: 50%;
    margin-right: 0.5rem;
}

.comment-metadata {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.comment-metadata a {
    color: var(--gray-600);
    text-decoration: none;
}

.comment-metadata a:hover {
    color: var(--primary);
}

.reply a.comment-reply-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--primary);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.reply a.comment-reply-link:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   WIDGET STYLES
   ============================================ */
.widget {
    margin-bottom: 1.5rem;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: block;
}

.widget ul li a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form {
    width: 100%;
}

.search-form .input-group {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.search-form .form-control {
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    border: 1px solid var(--gray-300);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,74,26,0.1);
}

.search-form .btn {
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   CALENDAR WIDGET
   ============================================ */
.widget_calendar table {
    width: 100%;
    font-size: 0.875rem;
}

.widget_calendar th {
    background: var(--primary);
    color: white;
    padding: 0.5rem;
    text-align: center;
}

.widget_calendar td {
    padding: 0.25rem;
    text-align: center;
}

.widget_calendar td a {
    display: block;
    padding: 0.25rem;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--primary);
    text-decoration: none;
}

.widget_calendar td a:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   TAG CLOUD
   ============================================ */
.tagcloud a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-xl);
    font-size: 0.875rem !important;
    text-decoration: none;
    margin: 0.25rem;
    transition: all var(--transition-fast);
}

.tagcloud a:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   PAGINATION
   ============================================ */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.nav-links .page-numbers:hover,
.nav-links .page-numbers.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nav-links .page-numbers.dots {
    background: transparent;
    border: none;
    color: var(--gray-500);
}

/* ============================================
   FOOTER MOBILE
   ============================================ */
.site-footer .rolemodel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.site-footer .rolemodel img {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease;
}

.site-footer .rolemodel img:hover {
    transform: scale(1.1);
    border-color: var(--secondary);
}

.site-footer .footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-menu li {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.site-footer .footer-menu li:last-child {
    border-bottom: none;
}

.site-footer .footer-menu a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.site-footer .footer-menu a:hover {
    color: var(--secondary-light);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 991.98px) {
    .navbar-custom .navbar-nav {
        background: var(--primary-dark);
        padding: 1rem;
        border-radius: var(--radius);
        margin-top: 0.5rem;
    }

    .navbar-custom .nav-link {
        color: rgba(255,255,255,0.9) !important;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .navbar-custom .nav-link:last-child {
        border-bottom: none;
    }

    .navbar-custom .nav-link::after {
        display: none;
    }

    .navbar-custom .dropdown-menu {
        background: rgba(255,255,255,0.05);
        box-shadow: none;
        border: none;
        padding-left: 1rem;
    }

    .navbar-custom .dropdown-item {
        color: rgba(255,255,255,0.9);
    }

    .navbar-custom .dropdown-item:hover {
        background: transparent;
        color: var(--secondary-light);
    }

    .quick-access-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .brand-text {
        display: none;
    }

    .navbar-brand img {
        height: 48px;
    }

    .sticky-top {
        position: static !important;
    }
}

@media (max-width: 767.98px) {
    /* Container spacing */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Navbar mobile */
    .navbar-custom {
        padding: 0.5rem 0;
    }

    .navbar-brand img {
        height: 40px;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }

    .navbar-toggler-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Quick access */
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .quick-access-item {
        padding: 0.5rem;
    }

    .quick-access-item img {
        height: 32px;
    }

    .quick-access-item strong {
        font-size: 0.6875rem;
    }

    /* Jadwal sidang */
    .jadwal-sidang iframe {
        height: 200px;
    }

    /* Video grid */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Hero */
    .hero-section {
        padding: 1rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    /* Main layout - full width columns */
    .col-lg-9,
    .col-lg-3 {
        width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Cards mobile */
    .card {
        margin-bottom: 0.75rem;
        border-radius: var(--radius);
    }

    .card-header {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Post archive */
    .post-archive-item {
        padding: 0.75rem 0;
    }

    .post-archive-item h6 {
        font-size: 0.9rem;
    }

    /* Widget grid */
    .zi .row {
        flex-direction: column;
    }

    .zi .col-sm-6 {
        margin-bottom: 1rem;
    }

    /* Weblink */
    .weblink {
        padding: 1rem;
    }

    .weblink .col-md-6 {
        text-align: center !important;
        margin-bottom: 1rem;
    }

    .weblink .d-flex {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .weblink img {
        height: 32px !important;
        width: auto !important;
    }

    /* Social grid */
    .social-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .social-grid img {
        height: 36px;
    }

    /* Footer */
    .site-footer .col-md-4 {
        margin-top: 1.5rem;
        text-align: center;
    }

    .site-footer .col-md-4:first-child {
        margin-top: 0;
    }

    /* Back to top */
    #backToTop {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    /* Pagination */
    .paginate {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 1rem 0;
    }

    .paginate a {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    /* Announcement bar */
    .announce-bar .container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .announce-label {
        width: 100%;
        text-align: center;
    }

    .announce-text span {
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    /* Compact quick access */
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.375rem;
    }

    .quick-access-item {
        padding: 0.375rem 0.25rem;
    }

    .quick-access-item img {
        height: 28px;
    }

    .quick-access-item strong {
        font-size: 0.625rem;
    }

    /* Compact hero */
    .hero-section {
        padding: 0.75rem 0;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-subtitle {
        font-size: 0.875rem;
    }

    /* Compact jadwal sidang */
    .jadwal-sidang iframe {
        height: 160px;
    }

    /* Vertical post archive */
    .post-archive-item {
        flex-direction: column;
    }

    .post-archive-item .flex-shrink-0 {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Compact footer */
    .rolemodel img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ============================================
   DARK MODE — custom.css overrides
   ============================================ */
[data-theme="dark"] .btn-success {
  background: var(--primary);
  border-color: var(--primary);
  color: #0a1a0f;
}

[data-theme="dark"] .btn-success:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

[data-theme="dark"] .btn-warning {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #1a1200;
}

[data-theme="dark"] .btn-warning:hover {
  background: var(--secondary-light);
  border-color: var(--secondary-light);
}

[data-theme="dark"] .card-footer.bg-white {
  background: var(--gray-100) !important;
  border-top-color: var(--gray-300);
}

[data-theme="dark"] .text-primary {
  color: var(--primary) !important;
}

[data-theme="dark"] .text-success {
  color: var(--primary) !important;
}

[data-theme="dark"] .text-warning {
  color: var(--secondary) !important;
}

[data-theme="dark"] .text-muted {
  color: var(--gray-500) !important;
}

[data-theme="dark"] .list-group-item-action:hover {
  background: var(--gray-200);
}

[data-theme="dark"] .placeholder {
  background: var(--gray-300) !important;
}

/* ============================================
   ORIENTATION-BASED ADJUSTMENTS
   ============================================ */
/* Landscape mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .jadwal-sidang iframe {
        height: 180px;
    }

    .hero-section {
        padding: 0.75rem 0;
    }

    .quick-access {
        padding: 0.75rem 0;
    }

    .quick-access-title {
        margin-bottom: 0.75rem;
    }
}

/* Tall/narrow mobile */
@media (max-height: 500px) and (orientation: portrait) {
    .announce-bar {
        display: none;
    }

    .hero-section {
        padding: 0.75rem 0;
    }

    .jadwal-sidang iframe {
        height: 150px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .quick-access-item {
        padding: 0.75rem 0.5rem;
    }

    .quick-access-item:active {
        transform: scale(0.98);
    }

    .post-archive-item {
        padding: 1rem 0;
    }

    .card {
        touch-action: manipulation;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .navbar-custom,
    .announce-bar,
    .site-footer,
    #backToTop,
    .weblink,
    .sidebar,
    .comments-area,
    .nav-links,
    .social-grid {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    a {
        text-decoration: underline;
        color: black !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .post-content img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   HIGH CONTRAST
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --primary: #000000;
        --secondary: #000000;
    }

    a {
        text-decoration: underline !important;
    }

    .card {
        border: 2px solid currentColor !important;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   FOCUS VISIBLE (Accessibility)
   ============================================ */
*:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
    border-radius: var(--radius);
}
