/* =========================================================
   Waitemata Endoscopy – Patient Article Styling
   Designed for Joomla / Helix Ultimate
   Add to: /templates/YOUR_TEMPLATE/css/custom.css
   ========================================================= */

/* ---------- Article width and typography ---------- */

.com-content-article .article-details,
.view-article .article-details {
    max-width: 980px;
    margin: 0 auto;
}

.com-content-article .article-details .article-header,
.view-article .article-details .article-header {
    margin-bottom: 1.4rem;
}

.com-content-article .article-details .article-header h1,
.view-article .article-details .article-header h1,
.com-content-article .article-details > h1,
.view-article .article-details > h1 {
    margin: 0 0 0.65rem;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 750;
    color: #24365f;
}

.com-content-article .article-details h2,
.view-article .article-details h2 {
    position: relative;
    margin: 2.4rem 0 0.9rem;
    padding-bottom: 0.55rem;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: #24365f;
}

.com-content-article .article-details h2::after,
.view-article .article-details h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 0.5rem;
    border-radius: 999px;
    background: #2eb9c2;
}

.com-content-article .article-details h3,
.view-article .article-details h3 {
    margin: 1.45rem 0 0.45rem;
    font-size: 1.1rem;
    line-height: 1.35;
    font-weight: 700;
    color: #29416d;
}

.com-content-article .article-details p,
.com-content-article .article-details li,
.view-article .article-details p,
.view-article .article-details li {
    font-size: 1.02rem;
    line-height: 1.72;
    color: #46546a;
}

.com-content-article .article-details p,
.view-article .article-details p {
    margin: 0 0 1rem;
}

.com-content-article .article-details ul,
.com-content-article .article-details ol,
.view-article .article-details ul,
.view-article .article-details ol {
    margin: 0.7rem 0 1.4rem;
    padding-left: 1.3rem;
}

.com-content-article .article-details li,
.view-article .article-details li {
    margin-bottom: 0.45rem;
    padding-left: 0.25rem;
}

.com-content-article .article-details li::marker,
.view-article .article-details li::marker {
    color: #2eb9c2;
    font-weight: 700;
}

.com-content-article .article-details a,
.view-article .article-details a {
    color: #187f99;
    font-weight: 600;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.com-content-article .article-details a:hover,
.view-article .article-details a:hover {
    color: #24519a;
}

/* ---------- Breadcrumb / article info ---------- */

.com-content-article .article-info,
.view-article .article-info {
    margin-bottom: 1.7rem;
    color: #7a8798;
    font-size: 0.88rem;
}

.breadcrumb {
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

/* ---------- At-a-glance summary ---------- */

.patient-summary {
    position: relative;
    overflow: hidden;
    margin: 1.2rem 0 2rem;
    padding: 1.25rem 1.4rem 1.25rem 1.55rem;
    border: 1px solid #ccecef;
    border-left: 5px solid #2eb9c2;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(46, 185, 194, 0.11), rgba(42, 56, 144, 0.045)),
        #f8fcfd;
    box-shadow: 0 10px 26px rgba(28, 72, 96, 0.07);
}

.patient-summary::before {
    content: "";
    position: absolute;
    right: -34px;
    top: -42px;
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: rgba(46, 185, 194, 0.08);
}

.patient-summary p {
    position: relative;
    margin: 0 !important;
    color: #33445f !important;
    font-size: 1.04rem !important;
}

.patient-summary strong {
    color: #24365f;
}

/* ---------- Main content blocks ---------- */

.com-content-article .article-details > table,
.view-article .article-details > table {
    width: 100%;
    margin: 1.5rem 0 2rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #dde5ec;
    border-radius: 12px;
    background: #fff;
}

.com-content-article .article-details th,
.view-article .article-details th {
    padding: 0.9rem 1rem;
    background: #273c68;
    color: #fff;
    text-align: left;
}

.com-content-article .article-details td,
.view-article .article-details td {
    padding: 0.85rem 1rem;
    border-top: 1px solid #e6ebf0;
    vertical-align: top;
}

.com-content-article .article-details tr:nth-child(even) td,
.view-article .article-details tr:nth-child(even) td {
    background: #f7fafc;
}

/* ---------- FAQ card ---------- */

.patient-faq {
    margin: 2.7rem 0;
    padding: 1.6rem 1.7rem 1.2rem;
    border: 1px solid #dce6ee;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(29, 55, 88, 0.08);
}

.patient-faq > h2 {
    margin-top: 0 !important;
}

.patient-faq h3 {
    position: relative;
    margin: 0 !important;
    padding: 1.05rem 2.25rem 0.35rem 0;
    border-top: 1px solid #e8edf2;
    color: #24365f !important;
}

.patient-faq h3:first-of-type {
    border-top: 0;
}

.patient-faq h3::after {
    content: "?";
    position: absolute;
    top: 0.95rem;
    right: 0;
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border-radius: 50%;
    background: #e8f7f8;
    color: #1595a1;
    font-size: 0.9rem;
    font-weight: 800;
}

.patient-faq h3 + p {
    margin-bottom: 0.9rem !important;
    color: #58667a !important;
}

/* ---------- Safety / warning box ---------- */

.patient-safety {
    position: relative;
    margin: 2.4rem 0;
    padding: 1.35rem 1.5rem 1.2rem 4rem;
    border: 1px solid #f0d7a2;
    border-radius: 14px;
    background: #fffaf0;
    box-shadow: 0 10px 24px rgba(111, 83, 25, 0.06);
}

.patient-safety::before {
    content: "!";
    position: absolute;
    top: 1.25rem;
    left: 1.3rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    background: #e7a82f;
    color: #fff;
    font-weight: 800;
}

.patient-safety h2 {
    margin-top: 0 !important;
    color: #6d4a12 !important;
}

.patient-safety h2::after {
    background: #e7a82f !important;
}

.patient-safety p {
    color: #66583d !important;
}

/* ---------- Booking / referral CTA ---------- */

.article-cta {
    position: relative;
    overflow: hidden;
    margin: 2.8rem 0 1rem;
    padding: 1.8rem 2rem;
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(255,255,255,0.14) 0, rgba(255,255,255,0.14) 18%, transparent 19%),
        linear-gradient(135deg, #263b75, #235698 58%, #1ba7b3);
    box-shadow: 0 16px 40px rgba(34, 67, 123, 0.22);
}

.article-cta h2,
.article-cta p,
.article-cta a {
    position: relative;
    color: #fff !important;
}

.article-cta h2 {
    margin: 0 0 0.65rem !important;
}

.article-cta h2::after {
    background: rgba(255,255,255,0.75) !important;
}

.article-cta p {
    margin-bottom: 0 !important;
    color: rgba(255,255,255,0.92) !important;
}

.article-cta a {
    display: inline-block;
    margin-left: 0.1rem;
    padding: 0.38rem 0.8rem;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 999px;
    text-decoration: none !important;
    transition: transform 0.2s ease, background 0.2s ease;
}

.article-cta a:hover {
    background: #fff;
    color: #24519a !important;
    transform: translateY(-1px);
}

/* ---------- Images and media ---------- */

.com-content-article .article-details img,
.view-article .article-details img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.com-content-article .article-details iframe,
.view-article .article-details iframe {
    max-width: 100%;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(29, 55, 88, 0.12);
}

/* ---------- Subtle section rhythm ---------- */

.com-content-article .article-details > h2:not(:first-child),
.view-article .article-details > h2:not(:first-child) {
    scroll-margin-top: 110px;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .com-content-article .article-details,
    .view-article .article-details {
        max-width: 100%;
    }

    .com-content-article .article-details .article-header h1,
    .view-article .article-details .article-header h1,
    .com-content-article .article-details > h1,
    .view-article .article-details > h1 {
        font-size: 2rem;
    }

    .patient-summary,
    .patient-faq,
    .patient-safety,
    .article-cta {
        margin-left: -0.15rem;
        margin-right: -0.15rem;
        border-radius: 12px;
    }

    .patient-faq {
        padding: 1.2rem 1.15rem 0.9rem;
    }

    .patient-safety {
        padding: 1.15rem 1.15rem 1rem 3.5rem;
    }

    .article-cta {
        padding: 1.45rem 1.3rem;
    }

    .com-content-article .article-details p,
    .com-content-article .article-details li,
    .view-article .article-details p,
    .view-article .article-details li {
        font-size: 1rem;
        line-height: 1.65;
    }
}

/* ---------- Print ---------- */

@media print {
    .patient-summary,
    .patient-faq,
    .patient-safety,
    .article-cta {
        box-shadow: none;
        break-inside: avoid;
    }

    .article-cta {
        border: 1px solid #999;
        background: #fff !important;
    }

    .article-cta h2,
    .article-cta p,
    .article-cta a {
        color: #222 !important;
    }
}
/* =========================================================
   Waitemata Endoscopy – Article image sizing adjustment
   Append after the main article styling.
   ========================================================= */

/* Enlarge stand-alone article images while keeping them responsive. */
.com-content-article .article-details p > img:only-child,
.view-article .article-details p > img:only-child,
.com-content-article .article-details figure > img,
.view-article .article-details figure > img {
    display: block;
    width: min(100%, 760px) !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 1.4rem auto 1.8rem !important;
    object-fit: contain;
}

/* Wider diagrams, maps and procedure illustrations. */
.com-content-article .article-details .article-image-wide,
.view-article .article-details .article-image-wide {
    width: 100% !important;
    max-width: 920px !important;
}

/* Preserve genuinely small interface images, logos and icons. */
.com-content-article .article-details img.icon,
.com-content-article .article-details img.logo,
.com-content-article .article-details img.avatar,
.view-article .article-details img.icon,
.view-article .article-details img.logo,
.view-article .article-details img.avatar {
    width: auto !important;
    max-width: 180px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Avoid enlarging images placed inside links/buttons. */
.com-content-article .article-details a > img,
.view-article .article-details a > img {
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
}
/* =========================================================
   Waitemata Endoscopy – Images inside legacy article tables
   Append AFTER the earlier article CSS.
   ========================================================= */

/* Legacy articles often use a 2-column table with text on the left
   and an image on the right. Give the image column a useful width. */
.com-content-article .article-details table td:has(> img),
.view-article .article-details table td:has(> img) {
    width: 260px !important;
    min-width: 220px !important;
    padding-left: 1.25rem !important;
    vertical-align: middle !important;
    text-align: center !important;
}

/* Override old inline width/height attributes on those images. */
.com-content-article .article-details table td > img,
.view-article .article-details table td > img {
    display: block !important;
    width: 240px !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

/* Keep very wide diagrams from being constrained unnecessarily. */
.com-content-article .article-details table td[colspan] > img,
.view-article .article-details table td[colspan] > img {
    width: min(100%, 760px) !important;
}

/* Mobile: stack the table so the image can use the screen width. */
@media (max-width: 767px) {
    .com-content-article .article-details table,
    .com-content-article .article-details table tbody,
    .com-content-article .article-details table tr,
    .com-content-article .article-details table td,
    .view-article .article-details table,
    .view-article .article-details table tbody,
    .view-article .article-details table tr,
    .view-article .article-details table td {
        display: block !important;
        width: 100% !important;
    }

    .com-content-article .article-details table td:has(> img),
    .view-article .article-details table td:has(> img) {
        min-width: 0 !important;
        padding: 1rem 0 0 !important;
    }

    .com-content-article .article-details table td > img,
    .view-article .article-details table td > img {
        width: min(100%, 420px) !important;
    }
}
/* =========================================================
   Waitemata Endoscopy – article metadata and header spacing
   Append after the existing article CSS.
   ========================================================= */

/* Fallback: hide all Joomla article metadata and action icons. */
.view-article .article-info,
.view-article .article-can-edit,
.view-article .icons,
.view-article .article-info-term,
.view-article .createdby,
.view-article .published,
.view-article .modified,
.view-article .category-name,
.view-article .parent-category-name,
.view-article .hits,
.view-article .tags,
.view-article .content_rating,
.view-article .content_vote,
.com-content-article .article-info,
.com-content-article .article-can-edit,
.com-content-article .icons,
.com-content-article .article-info-term,
.com-content-article .createdby,
.com-content-article .published,
.com-content-article .modified,
.com-content-article .category-name,
.com-content-article .parent-category-name,
.com-content-article .hits,
.com-content-article .tags,
.com-content-article .content_rating,
.com-content-article .content_vote {
    display: none !important;
}

/* Add breathing room below the sticky header/menu. */
body.view-article #sp-main-body,
body.com-content.view-article #sp-main-body {
    padding-top: 52px !important;
}

/* Keep the article title and body visually connected. */
body.view-article #sp-main-body .article-details {
    margin-top: 0 !important;
}

/* Reduce the gap slightly on tablets and phones. */
@media (max-width: 991px) {
    body.view-article #sp-main-body,
    body.com-content.view-article #sp-main-body {
        padding-top: 32px !important;
    }
}

@media (max-width: 575px) {
    body.view-article #sp-main-body,
    body.com-content.view-article #sp-main-body {
        padding-top: 24px !important;
    }
}
/* =========================================================
   Waitemata Endoscopy – Specialist profile pages
   Append to the active Helix custom.css file.
   ========================================================= */

.specialist-profile-content {
    max-width: 920px;
    margin: 0 auto;
    color: #46546a;
}

.specialist-profile-intro {
    position: relative;
    overflow: hidden;
    margin: 1rem 0 2.2rem;
    padding: 1.45rem 1.65rem;
    border: 1px solid #ccecef;
    border-left: 5px solid #2eb9c2;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(46,185,194,.11), rgba(42,56,144,.045)), #f8fcfd;
    box-shadow: 0 12px 30px rgba(28,72,96,.08);
}

.specialist-profile-intro::after {
    content: "";
    position: absolute;
    right: -36px;
    top: -42px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(46,185,194,.08);
}

.specialist-profile-role {
    position: relative;
    margin: 0 0 .45rem !important;
    color: #24365f !important;
    font-size: 1.16rem !important;
    line-height: 1.4 !important;
    font-weight: 750;
}

.specialist-profile-summary {
    position: relative;
    margin: 0 !important;
    font-size: 1.04rem !important;
    line-height: 1.7 !important;
}

.specialist-profile-section {
    margin: 0 0 1rem;
    padding: 1.4rem 1.55rem;
    border: 1px solid #e1e8ee;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(29,55,88,.055);
}

.specialist-profile-section h2 {
    margin: 0 0 .85rem !important;
    padding-bottom: .55rem;
    color: #24365f;
    font-size: 1.45rem;
    font-weight: 750;
    letter-spacing: -.015em;
}

.specialist-profile-section h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 3px;
    margin-top: .48rem;
    border-radius: 999px;
    background: #2eb9c2;
}

.specialist-profile-section p,
.specialist-profile-section li {
    color: #4b5a6f;
    font-size: 1rem;
    line-height: 1.72;
}

.specialist-profile-section p:last-child {
    margin-bottom: 0;
}

.specialist-profile-section ul,
.specialist-profile-section ol {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.specialist-profile-section li {
    margin-bottom: .42rem;
}

.specialist-profile-section li::marker {
    color: #2eb9c2;
}

.specialist-clinical-interests,
.specialist-procedures {
    border-top: 4px solid #2eb9c2;
}

.specialist-qualifications,
.specialist-professional-memberships,
.specialist-vocational-scope,
.specialist-registration {
    background: #f8fafc;
}

.specialist-profile-content a {
    color: #187f99;
    font-weight: 650;
    text-underline-offset: 3px;
}

.specialist-profile-cta {
    position: relative;
    overflow: hidden;
    margin: 2rem 0 1rem;
    padding: 1.75rem 1.9rem;
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(255,255,255,.14) 0, rgba(255,255,255,.14) 18%, transparent 19%),
        linear-gradient(135deg, #263b75, #235698 58%, #1ba7b3);
    box-shadow: 0 16px 40px rgba(34,67,123,.22);
}

.specialist-profile-cta h2,
.specialist-profile-cta p,
.specialist-profile-cta a {
    position: relative;
    color: #fff !important;
}

.specialist-profile-cta h2 {
    margin: 0 0 .65rem !important;
    font-size: 1.5rem;
}

.specialist-profile-cta p {
    margin: 0 !important;
    color: rgba(255,255,255,.93) !important;
}

.specialist-profile-cta a {
    display: inline-block;
    padding: .25rem .65rem;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 999px;
    text-decoration: none;
}

.specialist-profile-cta a:hover {
    background: #fff;
    color: #24519a !important;
}

/* Give specialist pages comfortable space below the sticky header. */
body.view-specialist #sp-main-body,
body.com-spmedical.view-specialist #sp-main-body {
    padding-top: 48px !important;
}

@media (max-width: 767px) {
    .specialist-profile-intro,
    .specialist-profile-section,
    .specialist-profile-cta {
        border-radius: 12px;
    }

    .specialist-profile-intro,
    .specialist-profile-section {
        padding: 1.2rem 1.15rem;
    }

    .specialist-profile-cta {
        padding: 1.4rem 1.25rem;
    }

    body.view-specialist #sp-main-body,
    body.com-spmedical.view-specialist #sp-main-body {
        padding-top: 26px !important;
    }
}
