/*
Theme Name: ObatApa Health
Theme URI: https://obatapa.com
Author: ObatApa
Description: High-performance, SEO/AIO optimized medical theme.
Version: 1.2
Text Domain: obatapa
*/

:root {
    --brand-cyan: #00B4D8; /* Brighter, vibrant cyan */
    --brand-cyan-light: #E0FBFC; /* Fresh, airy light cyan */
    --brand-cyan-hover: #0096C7; /* Slightly deeper shade for hover states */
    --text-dark: #1E293B; /* Softer, modern dark slate instead of harsh black */
    --text-gray: #64748B;
    --bg-white: #FFFFFF;
    --border-gray: #E2E8F0;
}

html {
    scroll-behavior: smooth; /* Enables smooth scrolling for the ToC links */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
}
a { text-decoration: none; color: var(--brand-cyan); }
a:hover { text-decoration: underline; }

/* --- Logo Styling --- */
.site-branding { display: flex; align-items: center; }
.site-branding img, .custom-logo, .site-logo img {
    max-height: 42px !important;
    width: auto !important;
    max-width: 200px !important;
    object-fit: contain;
    display: block;
}

/* --- Header Layout --- */
.site-header { border-bottom: 1px solid var(--border-gray); background: #fff; }
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    gap: 20px;
}
.site-logo { font-size: 24px; font-weight: bold; color: var(--brand-cyan); }

.header-search form { display: flex; width: 100%; }
.header-search input[type="text"] {
    padding: 9px 14px;
    border: 1px solid var(--border-gray);
    border-radius: 4px 0 0 4px;
    width: 280px;
    outline: none;
    font-size: 14px;
}
.header-search button {
    padding: 9px 18px;
    background-color: var(--brand-cyan);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

/* --- Navigation --- */
.header-nav { background-color: var(--brand-cyan-light); border-top: 1px solid var(--border-gray); }
.header-nav ul { list-style: none; display: flex; max-width: 1200px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap; }
.header-nav li a { display: block; padding: 10px 16px; color: var(--text-dark); font-weight: 600; font-size: 14px; }
.header-nav li a:hover { background-color: var(--brand-cyan); color: white; text-decoration: none; }

/* --- Content & Cards --- */
.section-title { font-size: 22px; margin: 30px 0 15px 0; border-left: 4px solid var(--brand-cyan); padding-left: 10px; color: var(--text-dark); }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }

.article-card {
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.article-thumbnail { width: 100%; height: 180px; overflow: hidden; background-color: #f7f7f7; }
.article-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-card-body { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; flex-grow: 1; }
.article-card h3 { font-size: 17px; margin-bottom: 10px; line-height: 1.4; }
.article-card h3 a { color: var(--text-dark); }
.article-card h3 a:hover { color: var(--brand-cyan); }
.article-excerpt { font-size: 13px; color: var(--text-gray); margin-bottom: 15px; }
.article-meta { font-size: 12px; color: #888; margin-top: auto; }

.techradar-article-container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.article-hero { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.article-category-badge a {
    background-color: var(--brand-cyan-light);
    color: var(--brand-cyan);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.article-main-title { font-size: 34px; line-height: 1.25; color: var(--text-dark); margin: 15px 0 10px 0; font-weight: 800; }
.article-byline { font-size: 13px; color: var(--text-gray); display: flex; align-items: center; gap: 8px; }
.meta-divider { color: #ccc; }

.article-body-grid { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.article-content-column { min-width: 0; }
.article-featured-image { width: 100%; margin-bottom: 25px; border-radius: 8px; overflow: hidden; }
.article-featured-image img { width: 100%; height: auto; display: block; object-fit: cover; }

.entry-content { font-size: 17px; line-height: 1.8; color: #2D3748; }
.entry-content h2 { font-size: 24px; color: var(--text-dark); margin: 35px 0 15px 0; }
.entry-content h3 { font-size: 20px; color: var(--text-dark); margin: 25px 0 12px 0; }
.entry-content p { margin-bottom: 22px; }
.entry-content ul, .entry-content ol { margin-bottom: 22px; padding-left: 20px; }
.entry-content li { margin-bottom: 8px; }

/* --- In-Content Image Captions --- */
.entry-content figcaption,
.entry-content .wp-caption-text {
    font-size: 13.5px;
    color: var(--text-gray);
    text-align: center;
    margin-top: 8px;
    margin-bottom: 24px;
    font-style: italic;
    line-height: 1.4;
    display: block;
}

/* Ensure images inside the content area are properly spaced and rounded */
.entry-content figure {
    margin: 30px 0;
}
.entry-content figure img {
    border-radius: 8px;
    width: 100%;
    height: auto;
}

/* Sidebar */
.article-sidebar { position: sticky; top: 20px; }
.sidebar-widget { border: 1px solid var(--border-gray); border-radius: 6px; padding: 20px; background: #FAFAFA; }
.widget-title { font-size: 16px; margin-bottom: 15px; color: var(--text-dark); border-left: 3px solid var(--brand-cyan); padding-left: 8px; text-transform: uppercase; }
.sidebar-articles-list { display: flex; flex-direction: column; gap: 15px; }
.sidebar-article-item { display: flex; gap: 12px; align-items: center; }
.sidebar-thumb { width: 70px; height: 70px; flex-shrink: 0; border-radius: 4px; overflow: hidden; }
.sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-info h4 { font-size: 13px; line-height: 1.35; margin-bottom: 4px; }
.sidebar-info h4 a { color: var(--text-dark); }
.sidebar-info h4 a:hover { color: var(--brand-cyan); }
.sidebar-date { font-size: 11px; color: #888; }

.article-disclaimer-box { background-color: #FFFBEB; border-left: 4px solid #F59E0B; padding: 16px 20px; margin-top: 40px; border-radius: 4px; font-size: 14px; color: #92400E; }
.article-disclaimer-box h4 { margin-bottom: 5px; font-size: 15px; }

/* Footer */
.site-footer { background: #1a202c; color: #a0aec0; padding: 40px 20px 20px; margin-top: 60px; font-size: 14px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.footer-col h4 { color: #fff; margin-bottom: 15px; font-size: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #a0aec0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 30px auto 0; padding-top: 20px; border-top: 1px solid #2d3748; text-align: center; font-size: 12px; }

/* Mobile Adaptations */
@media (max-width: 768px) {
    .header-top { flex-direction: column; align-items: stretch; padding: 10px 15px; gap: 10px; }
    .site-branding { justify-content: flex-start; }
    .site-branding img, .custom-logo { max-height: 32px !important; }
    .header-search input[type="text"] { width: 100%; }
    .header-nav ul { justify-content: flex-start; overflow-x: auto; white-space: nowrap; padding: 0 10px; }
    .header-nav li a { padding: 8px 12px; font-size: 13px; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-body-grid { grid-template-columns: 1fr; }
    .article-main-title { font-size: 26px; }
    .entry-content { font-size: 16px; }
}

/* --- Header & Breadcrumb --- */
.article-breadcrumb {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}
.article-breadcrumb a { color: var(--text-gray); }
.article-breadcrumb a:hover { color: var(--brand-cyan); }
.breadcrumb-divider { margin: 0 8px; color: #cbd5e1; }

/* --- Byline & Share Buttons Row --- */
.article-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.article-byline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-gray); }

.share-buttons { display: flex; gap: 10px; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-gray);
    color: var(--text-gray);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.share-btn:hover {
    border-color: var(--brand-cyan);
    color: var(--brand-cyan);
    background: var(--brand-cyan-light);
}
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* --- Table of Contents Widget (In This Article) --- */
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-item { margin-bottom: 10px; line-height: 1.4; }
.toc-item a { color: var(--brand-cyan); font-size: 14px; font-weight: 500; display: block; }
.toc-item a:hover { text-decoration: underline; }
.toc-h3 { padding-left: 15px; font-size: 13.5px; } /* Indents subheadings slightly */
.toc-h3 a { color: var(--text-gray); font-weight: 400; }

/* --- Collapsible References Section --- */
.article-references {
    margin-top: 40px;
    margin-bottom: 20px;
}
.article-references details summary {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none; /* Hides default triangle */
    display: inline-flex;
    align-items: center;
    outline: none;
}
/* Custom Chevron Arrow */
.article-references details summary::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-gray);
    border-bottom: 2px solid var(--text-gray);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 8px;
    margin-bottom: 4px;
}
/* Rotate arrow when open */
.article-references details[open] summary::after {
    transform: rotate(-135deg);
    margin-bottom: -4px;
}
/* Hide default webkit triangle for Safari/Chrome */
.article-references details summary::-webkit-details-marker {
    display: none;
}
/* The Bordered Content Box */
.article-references .references-content {
    background-color: #FAFAFA;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    padding: 20px;
    margin-top: 12px;
    font-size: 14.5px;
    color: var(--text-dark);
    line-height: 1.7;
}

/* Ringkasan Box List & Bold Formatting */
.ringkasan-content p {
    margin-bottom: 10px;
}
.ringkasan-content ul, .ringkasan-content ol {
    margin: 0;
    padding-left: 20px;
}
.ringkasan-content li {
    margin-bottom: 8px;
}
.ringkasan-content strong {
    font-weight: 700;
    color: var(--text-dark);
}