/* ============================================================
   detail-common.css - Shared Styles for All Detail Pages
   APHA (Asia Pacific Health Association)
   Classic Institutional Style
   ============================================================ */

/* --- Color Variables (CSS2 compatible - referenced directly) --- */
/* Primary: #1a2a4a (deep navy) */
/* Accent:  #c9a84c (gold) */
/* Brand:   #3c145f (deep purple) */
/* Text:    #2d3748 (dark slate) */
/* Muted:   #64748b (slate gray) */
/* Border:  #e2e8f0 (light gray) */
/* Page BG: #f8f9fa (off-white) */

/* --- Global box-sizing for Detail Pages --- */
.left .detail-item,
.left .detail-item * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* --- Breadcrumb Navigation --- */
.breadcrumb-nav {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    margin-bottom: 24px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    color: #64748b;
}

.breadcrumb-nav a {
    color: #1a2a4a;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-nav a:hover {
    color: #c9a84c;
    text-decoration: underline;
}

.breadcrumb-nav .separator {
    margin: 0 8px;
    color: #94a3b8;
}

.breadcrumb-nav .current {
    color: #64748b;
    font-weight: 400;
}

/* --- Detail Banner (Dark Header) --- */
.detail-banner {
    background: #1a2a4a;
    padding: 40px 48px;
    margin-bottom: 0;
    position: relative;
    border-radius: 4px 4px 0 0;
}

.detail-banner:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #c9a84c;
}

.detail-banner .detail-title {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    margin: 0 0 16px 0;
    padding: 0;
    background: none;
    -webkit-text-fill-color: initial;
    background-clip: initial;
    letter-spacing: 0.5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: left;
}

.detail-banner .detail-meta {
    display: block;
    margin-top: 12px;
    padding-top: 0;
    border-top: none;
}

.detail-banner .meta-item {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.detail-banner .meta-divider {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 12px;
    font-size: 14px;
}

/* --- Detail Item Container --- */
.detail-item {
    background: #ffffff;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
    border-top: none;
    overflow: hidden;
}

/* --- Detail Content Area --- */
.detail-content {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #2d3748;
    padding: 40px 48px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: justify;
}

/* --- Content Typography (inside newscontent) --- */
.detail-content p {
    margin-bottom: 1.2em;
    margin-top: 0;
    line-height: 1.8;
    text-align: justify;
}

.detail-content h1 {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 1.5em 0 0.8em 0;
    line-height: 1.3;
    padding-bottom: 8px;
    border-bottom: 2px solid #c9a84c;
    text-align: left;
    word-break: break-word;
}

.detail-content h2 {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 1.4em 0 0.7em 0;
    line-height: 1.3;
    padding-bottom: 6px;
    border-bottom: 2px solid #c9a84c;
    text-align: left;
    word-break: break-word;
}

.detail-content h3 {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 1.2em 0 0.6em 0;
    line-height: 1.4;
    text-align: left;
    word-break: break-word;
}

.detail-content h4 {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 1em 0 0.5em 0;
    line-height: 1.4;
    text-align: left;
    word-break: break-word;
}

.detail-content h5 {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1a2a4a;
    margin: 1em 0 0.5em 0;
    text-align: left;
    word-break: break-word;
}

.detail-content h6 {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #64748b;
    margin: 1em 0 0.5em 0;
    text-align: left;
    word-break: break-word;
}

.detail-content ul {
    margin: 0.8em 0 1.2em 0;
    padding-left: 1.8em;
    list-style-type: disc;
}

.detail-content ol {
    margin: 0.8em 0 1.2em 0;
    padding-left: 1.8em;
    list-style-type: decimal;
}

.detail-content li {
    margin-bottom: 0.4em;
    line-height: 1.7;
    text-align: justify;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 14px;
}

.detail-content table th {
    background: #1a2a4a;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border: 1px solid #1a2a4a;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.detail-content table td {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    color: #2d3748;
    vertical-align: top;
}

.detail-content table tr:nth-child(even) td {
    background: #f8f9fa;
}

.detail-content table tr:hover td {
    background: #f1f5f9;
}

.detail-content blockquote {
    margin: 1.2em 0;
    padding: 16px 20px 16px 24px;
    border-left: 4px solid #c9a84c;
    background: #f8f9fa;
    color: #475569;
    font-style: italic;
    font-size: 15px;
    line-height: 1.7;
    text-align: justify;
}

.detail-content blockquote p {
    margin-bottom: 0.5em;
}

.detail-content a {
    color: #1a2a4a;
    text-decoration: underline;
    -webkit-transition: color 0.2s;
    transition: color 0.2s;
}

.detail-content a:hover {
    color: #c9a84c;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    margin: 1em auto;
    display: block;
    cursor: pointer;
    -webkit-transition: opacity 0.2s, box-shadow 0.2s;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.detail-content img:hover {
    opacity: 0.9;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.detail-content strong,
.detail-content b {
    font-weight: 600;
    color: #1a2a4a;
}

.detail-content em,
.detail-content i {
    font-style: italic;
}

/* --- ColorBox image link wrapper - remove default link styling from content.css --- */
a.detail-img-link {
    border: none !important;
    outline: none !important;
    text-decoration: none !important;
    display: block;
    color: transparent;
}

a.detail-img-link:hover {
    border: none !important;
    outline: none !important;
}

a.detail-img-link img {
    border: none !important;
}

a:hover .detail-img-link img {
    border: none !important;
}

/* --- Bottom Navigation (Prev / Back / Next) --- */
.detail-nav {
    border-top: 1px solid #e2e8f0;
    padding: 24px 48px;
    display: table;
    width: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #fafbfc;
}

.detail-nav .nav-prev,
.detail-nav .nav-back,
.detail-nav .nav-next {
    display: table-cell;
    vertical-align: middle;
}

.detail-nav .nav-prev {
    text-align: left;
    width: 35%;
}

.detail-nav .nav-back {
    text-align: center;
    width: 30%;
}

.detail-nav .nav-next {
    text-align: right;
    width: 35%;
}

.detail-nav .nav-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: 600;
}

.detail-nav .nav-title {
    display: block;
    font-size: 14px;
    color: #1a2a4a;
    line-height: 1.4;
    max-width: 220px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-nav a {
    color: #1a2a4a;
    text-decoration: none;
    display: inline-block;
    -webkit-transition: color 0.2s;
    transition: color 0.2s;
}

.detail-nav a:hover {
    color: #c9a84c;
}

.detail-nav a:hover .nav-title {
    text-decoration: none;
    border-bottom: 1px solid #c9a84c;
}

.detail-nav .nav-back a {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    padding: 6px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
}

.detail-nav .nav-back a:hover {
    color: #1a2a4a;
    border-color: #1a2a4a;
    background: #ffffff;
}

.detail-nav .nav-disabled {
    font-size: 13px;
    color: #cbd5e1;
    font-style: italic;
}

/* --- Sidebar Formal Redesign --- */
/* These styles override the existing .sideLinks styles from layout.css */
/* by using higher specificity with .left/.right parent context */

.right .sideLinks {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.right .sideLinks .join {
    background: #1a2a4a !important;
    border: none !important;
    border-radius: 3px;
    padding: 20px;
    margin-bottom: 20px;
}

.right .sideLinks .join h3.ribbon {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    color: #ffffff !important;
    margin: 0 0 12px 0;
    padding: 0;
    background: none !important;
    border: none !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    width: auto;
    height: auto;
    line-height: normal;
    position: static;
    text-align: left;
}

.right .sideLinks .join a {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 2px;
    text-decoration: none;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    margin-right: 8px;
}

.right .sideLinks .join a:first-of-type {
    background: #c9a84c;
    color: #1a2a4a;
}

.right .sideLinks .join a:first-of-type:hover {
    background: #d4b65e;
}

.right .sideLinks .join a:last-of-type {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.right .sideLinks .join a:last-of-type:hover {
    border-color: #c9a84c;
    color: #c9a84c;
}

.right .sideLinks .item {
    display: block;
    border: 1px solid #e2e8f0 !important;
    border-radius: 3px;
    padding: 16px;
    margin-bottom: 16px;
    text-decoration: none;
    -webkit-transition: border-color 0.2s, box-shadow 0.2s;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff !important;
    overflow: hidden;
    box-shadow: none !important;
    width: auto;
    min-height: 0;
    color: #2d3748;
}

.right .sideLinks .item:hover {
    border-color: #c9a84c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.right .sideLinks .item .stripes {
    display: none;
}

.right .sideLinks .item img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    margin-bottom: 10px;
    max-width: 150px;
    float: right;
    margin-left: 12px;
    margin-bottom: 6px;
}

.right .sideLinks .item h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    color: #1a2a4a !important;
    margin: 0 0 6px 0;
    font-weight: 700;
    padding: 0;
    background: none !important;
    border: none !important;
    position: static;
    z-index: auto;
    float: none;
    clear: none;
    width: auto;
}

.right .sideLinks .item p {
    font-size: 12px;
    color: #64748b !important;
    margin: 0;
    line-height: 1.4;
    position: static;
    z-index: auto;
    float: none;
    clear: none;
    width: auto;
}

/* Featured Doctor section */
.right .sideLinks .featuredDoc {
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 0;
    margin-bottom: 16px;
    background: #ffffff;
    overflow: hidden;
}

.right .sideLinks .featuredDoc .stripes {
    display: none;
}

.right .sideLinks .featuredDoc h3.ribbon {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    color: #1a2a4a !important;
    margin: 0;
    padding: 14px 16px;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid #c9a84c;
    font-weight: 700;
    letter-spacing: 0.3px;
    width: auto;
    height: auto;
    line-height: normal;
    position: static;
    text-align: left;
}

.right .sideLinks .featuredDoc h3.ribbon a {
    color: #1a2a4a;
    text-decoration: none;
}

.right .sideLinks .featuredDoc h3.ribbon a:hover {
    color: #c9a84c;
}

.right .sideLinks .featuredDoc .bgLinkList {
    padding: 8px 0;
}

.right .sideLinks .featuredDoc .bgLinkList a {
    display: block;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
}

.right .sideLinks .featuredDoc .bgLinkList a:last-child {
    border-bottom: none;
}

.right .sideLinks .featuredDoc .bgLinkList a:hover {
    background: #f8f9fa;
}

.right .sideLinks .featuredDoc .dblock {
    display: table;
    width: 100%;
}

.right .sideLinks .featuredDoc .dbleft {
    display: table-cell;
    vertical-align: middle;
    width: 80%;
    padding-right: 8px;
}

.right .sideLinks .featuredDoc .dbright {
    display: table-cell;
    vertical-align: middle;
    width: 20%;
    text-align: right;
}

.right .sideLinks .featuredDoc .name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a2a4a;
    margin-bottom: 2px;
}

.right .sideLinks .featuredDoc .desc {
    display: block;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

.right .sideLinks .featuredDoc .desc .arrow {
    display: none;
}

.right .sideLinks .featuredDoc .dbright img {
    width: 40px !important;
    height: 40px;
    border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
}

/* --- Responsive Design --- */

/* Tablet: sidebar below content */
@media (max-width: 979px) {
    .detail-banner {
        padding: 32px 32px;
    }

    .detail-banner .detail-title {
        font-size: 24px;
    }

    .detail-content {
        padding: 32px;
    }

    .detail-nav {
        padding: 20px 32px;
    }

    .detail-nav .nav-title {
        max-width: 180px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .breadcrumb-nav {
        font-size: 12px;
        padding: 8px 0;
    }

    .detail-banner {
        padding: 24px 20px;
        border-radius: 0;
    }

    .detail-banner .detail-title {
        font-size: 20px;
        line-height: 1.3;
        text-align: left;
    }

    .detail-banner .meta-item {
        font-size: 13px;
    }

    .detail-banner .meta-divider {
        display: none;
    }

    .detail-banner .detail-meta .meta-item {
        display: block;
        margin-bottom: 4px;
    }

    .detail-content {
        padding: 24px 20px;
        font-size: 15px;
    }

    .detail-content h1 {
        font-size: 20px;
        text-align: left;
    }

    .detail-content h2 {
        font-size: 17px;
        text-align: left;
    }

    .detail-content h3 {
        font-size: 15px;
        text-align: left;
    }

    .detail-content h4,
    .detail-content h5,
    .detail-content h6 {
        text-align: left;
    }

    .detail-content table {
        font-size: 13px;
    }

    .detail-content table th,
    .detail-content table td {
        padding: 8px 10px;
    }

    /* Bottom nav: stack vertically */
    .detail-nav {
        display: block;
        padding: 16px 20px;
    }

    .detail-nav .nav-prev,
    .detail-nav .nav-back,
    .detail-nav .nav-next {
        display: block;
        width: 100%;
        text-align: left;
        padding: 10px 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .detail-nav .nav-back {
        text-align: center;
    }

    .detail-nav .nav-next {
        text-align: right;
        border-bottom: none;
    }

    .detail-nav .nav-title {
        max-width: none;
    }

    /* Sidebar adjustments */
    .right .sideLinks .join {
        padding: 16px;
    }

    .right .sideLinks .item {
        padding: 12px;
    }

    .right .sideLinks .featuredDoc .dbright img {
        width: 36px !important;
        height: 36px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .detail-banner {
        padding: 20px 16px;
    }

    .detail-banner .detail-title {
        font-size: 16px;
        text-align: left;
    }

    .detail-content {
        padding: 20px 16px;
        font-size: 14px;
    }

    .detail-content h1 {
        font-size: 17px;
        text-align: left;
    }

    .detail-content h2 {
        font-size: 15px;
        text-align: left;
    }

    .detail-content h3 {
        font-size: 14px;
        text-align: left;
    }

    .detail-content h4,
    .detail-content h5,
    .detail-content h6 {
        text-align: left;
    }

    .detail-nav {
        padding: 12px 16px;
    }

    .detail-nav .nav-label {
        font-size: 10px;
    }

    .detail-nav .nav-title {
        font-size: 13px;
    }
}

/* --- Override layout.css conflicting styles --- */

/* Remove gradient ::before decoration from layout.css */
.detail-title:before,
.detail-title::before,
.detail-title:hover:before,
.detail-title:hover::before {
    display: none !important;
    content: none !important;
}

/* Remove hover animation from layout.css */
.detail-item:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transform: none !important;
}

/* Remove fadeInUp animation from layout.css */
.detail-item {
    animation: none !important;
}

/* Remove focus outline from layout.css */
.detail-title:focus,
.detail-meta-item:focus {
    outline: none !important;
}

/* Force override title styles from layout.css */
.left .detail-item h1,
.left h1.detail-title,
h1.detail-title {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
    letter-spacing: 0.5px !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    text-align: left !important;
    text-rendering: optimizeLegibility !important;
    display: block !important;
    max-width: 100% !important;
    position: static !important;
}

/* IE/old browser fallback */
.no-cssgradients .detail-title,
.no-cssgradients .left .detail-item h1,
.no-cssgradients .left h1.detail-title,
.no-cssgradients h1.detail-title {
    background: none !important;
    color: #ffffff !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Force override any inline style on detail-title */
.detail-title[style] {
    font-size: 28px !important;
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Keep .join visible on mobile (layout.css hides it at 767px) */
@media (max-width: 767px) {
    .right .sideLinks .join {
        display: block !important;
    }
}

/* Override layout.css very small screen title sizes */
@media (max-width: 360px) {
    .detail-banner .detail-title {
        font-size: 16px !important;
    }
}
