/* ==========================================================================
   Emergency.dk Template - Joomla 4+
   Based on tpl_hazmat, colours from the former JSN red scheme
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap");

/* ---------- CSS Custom Properties ---------- */
:root {
    --em-accent: #bf0000;
    --em-primary: #bf0000;
    --em-secondary: #731A1A;
    --em-text: #333333;
    --em-text-light: #666666;
    --em-heading: #333333;
    --em-border: #e5e5e5;
    --em-bg: #ffffff;
    --em-bg-light: #f8f9fa;
    --em-bg-dark: #731A1A;
    --em-link: #bf0000;
    --em-link-hover: #9B2626;
    --em-footer-bg: #f5f5f5;
    --em-footer-text: #333333;
    --em-font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--em-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--em-text);
    background-color: var(--em-bg);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

a {
    color: var(--em-link);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

a:hover,
a:focus {
    color: var(--em-link-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    color: var(--em-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.5em;
}

h1 { font-size: 33px; }
h2 { font-size: 28px; }
h3 { font-size: 23px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    margin-bottom: 1em;
}

/* ---------- Forms ---------- */
label {
    font-weight: normal;
}

label span.star {
    color: #F95050;
}

select,
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"] {
    height: 40px;
    line-height: 40px;
    padding: 0 20px;
    background-color: #fff;
    background-image: none;
    border: solid 1px var(--em-border);
    border-radius: 100px;
    transition: border-color ease-in-out 0.15s;
    outline: 0;
    box-shadow: none;
    font-family: var(--em-font);
    font-size: 14px;
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    border-color: var(--em-accent);
    box-shadow: 0 0 0 0.2rem rgba(191, 0, 0, 0.15);
}

textarea {
    height: auto;
    line-height: 1.6;
    border-radius: 10px;
    padding: 10px 20px;
}

/* ---------- Buttons ---------- */
.btn {
    padding: 9.5px 25px;
    line-height: 1.5;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease-in-out;
}

.btn-primary,
.readmore a.btn {
    background-color: var(--em-accent);
    border-color: var(--em-accent);
    color: #fff;
}

.btn-primary:hover,
.readmore a.btn:hover {
    background-color: var(--em-link-hover);
    border-color: var(--em-link-hover);
    color: #fff;
}

/* ---------- Topbar ---------- */
.topbar {
    background-color: var(--em-bg-dark);
    color: #fff;
    font-size: 12px;
    padding: 5px 0;
}

.topbar a {
    color: rgba(255, 255, 255, 0.8);
}

.topbar a:hover {
    color: #fff;
    text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
    background-color: var(--em-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    transition: all 0.3s ease;
}

.header-brand {
    padding: 14px 0;
}

.header-nav {
    background-color: var(--em-accent);
    border-bottom: 3px solid var(--em-secondary);
}

.site-header .container {
    position: relative;
}

.site-logo a {
    display: inline-block;
}

.site-logo a {
    display: block;
    max-width: 800px;
}

/* The logo is a wide banner (Region H mark and MEDIC SUPPORT) */
.site-logo .logo-img {
    display: block;
    width: 100%;
    height: auto;
}

.site-logo .site-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--em-heading);
}

.site-logo a:hover {
    text-decoration: none;
}

/* ---------- Navigation ---------- */
.site-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 48px;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0;
}

.main-navigation ul li {
    position: relative;
}

.main-navigation ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    transition: background-color 0.2s ease;
}

.main-navigation ul li a .fa,
.main-navigation ul li a .fas,
.main-navigation ul li a .far,
.main-navigation ul li a .fab,
.main-navigation ul li a [class*="fa-"] {
    font-size: 15px;
}

.main-navigation ul li a:hover,
.main-navigation ul li a:focus-visible,
.main-navigation ul li.active > a,
.main-navigation ul li.current > a {
    color: #fff;
    background-color: var(--em-link-hover);
    text-decoration: none;
}

.main-navigation ul > li.active > a,
.main-navigation ul > li.current > a {
    background-color: var(--em-secondary);
}

/* Dropdown items sit on white */
.main-navigation ul li ul li a {
    color: var(--em-text);
}

.main-navigation ul li ul li a:hover,
.main-navigation ul li ul li.active > a,
.main-navigation ul li ul li.current > a {
    color: var(--em-accent);
    background-color: var(--em-bg-light);
}

/* Dropdown caret for parent items */
.main-navigation ul li.deeper > a::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    margin-left: 2px;
    opacity: 0.6;
}

/* Dropdown */
.main-navigation ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 8px 0;
    z-index: 1050;
    flex-direction: column;
}

.main-navigation ul li:hover > ul {
    display: flex;
}

.main-navigation ul li ul li a {
    padding: 8px 20px;
    font-size: 13px;
    text-transform: none;
    font-weight: 400;
}

.main-navigation ul li ul li a:hover {
    background-color: var(--em-bg-light);
}

/* Sub-sub dropdown */
.main-navigation ul li ul li ul {
    top: 0;
    left: 100%;
}

/* Mobile toggle */
.navbar-toggler {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 6px 12px;
    margin-left: auto;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
}

.navbar-toggler:hover {
    border-color: #fff;
    color: #fff;
}

/* Offcanvas mobile menu */
.offcanvas {
    max-width: 320px;
}

.offcanvas .offcanvas-header {
    background-color: var(--em-bg-light);
    border-bottom: 1px solid var(--em-border);
    padding: 16px 20px;
}

.offcanvas .offcanvas-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--em-heading);
}

.offcanvas .offcanvas-body {
    padding: 0;
}

.offcanvas .offcanvas-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-direction: column;
}

.offcanvas .offcanvas-body > nav > ul > li {
    border-bottom: 1px solid var(--em-border);
}

.offcanvas .offcanvas-body ul li a {
    display: block;
    padding: 14px 20px;
    color: var(--em-text);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
}

.offcanvas .offcanvas-body ul li a .fa,
.offcanvas .offcanvas-body ul li a .fas,
.offcanvas .offcanvas-body ul li a .far,
.offcanvas .offcanvas-body ul li a .fab,
.offcanvas .offcanvas-body ul li a [class*="fa-"] {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: var(--em-accent);
}

.offcanvas .offcanvas-body ul li a:hover,
.offcanvas .offcanvas-body ul li a:active {
    color: var(--em-accent);
    text-decoration: none;
    background-color: var(--em-bg-light);
}

.offcanvas .offcanvas-body ul li.active > a,
.offcanvas .offcanvas-body ul li.current > a {
    color: var(--em-accent);
    background-color: rgba(191, 0, 0, 0.08);
}

/* Parent items with submenus (Joomla toggle button) */
.offcanvas .offcanvas-body ul li.deeper.parent {
    position: relative;
}

.offcanvas .offcanvas-body ul li.deeper.parent > .mod-menu__toggle-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--em-font);
}

.offcanvas .offcanvas-body ul li.deeper.parent > .mod-menu__toggle-sub .mod-menu__separator {
    font-weight: 600;
    font-size: 15px;
    color: var(--em-text);
}

.offcanvas .offcanvas-body ul li.deeper.parent > .mod-menu__toggle-sub .icon-chevron-down {
    font-size: 12px;
    color: var(--em-text-light);
    transition: transform 0.3s ease;
}

.offcanvas .offcanvas-body ul li.deeper.parent.submenu-open > .mod-menu__toggle-sub .icon-chevron-down {
    transform: rotate(180deg);
    color: var(--em-accent);
}

.offcanvas .offcanvas-body ul li.deeper.parent > .mod-menu__toggle-sub:hover,
.offcanvas .offcanvas-body ul li.deeper.parent > .mod-menu__toggle-sub:active {
    background-color: var(--em-bg-light);
}

.offcanvas .offcanvas-body ul li.deeper.parent > .mod-menu__toggle-sub:hover .mod-menu__separator {
    color: var(--em-accent);
}

/* Submenu items */
.offcanvas .offcanvas-body .mod-menu__sub {
    background-color: var(--em-bg-light);
    border-top: 1px solid var(--em-border);
    list-style: none;
    padding: 0;
    margin: 0;
}

.offcanvas .offcanvas-body .mod-menu__sub li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.offcanvas .offcanvas-body .mod-menu__sub li:last-child {
    border-bottom: none;
}

.offcanvas .offcanvas-body .mod-menu__sub li a {
    padding: 12px 20px 12px 36px;
    font-size: 14px;
    font-weight: 400;
    color: var(--em-text-light);
}

.offcanvas .offcanvas-body .mod-menu__sub li a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--em-accent);
    margin-right: 10px;
    vertical-align: middle;
    opacity: 0.6;
}

.offcanvas .offcanvas-body .mod-menu__sub li a:hover::before,
.offcanvas .offcanvas-body .mod-menu__sub li.active > a::before {
    opacity: 1;
}

/* ---------- Promo / Slider ---------- */
.promo-section {
    position: relative;
}

.promo-section .container {
    padding-top: 30px;
    padding-bottom: 30px;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs-section {
    padding: 25px 0;
    border-bottom: 1px solid var(--em-border);
    margin-bottom: 25px;
}

.breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.breadcrumb li a {
    color: var(--em-text-light);
}

.breadcrumb li a:hover {
    color: var(--em-accent);
}

.breadcrumb li + li::before {
    content: "/";
    color: #394a5c;
    padding: 0 8px;
}

/* ---------- Content Sections ---------- */
.content-top-section,
.content-top-below-section {
    padding: 20px 0;
}

.main-content-section {
    padding: 30px 0 0px;
   /* min-height: 400px; */
}

.content-bottom-section,
.content-bottom-below-section {
    padding: 30px 0;
}

/* ---------- Sidebar ---------- */
.sidebar {
    padding-bottom: 80px;
}

.sidebar .card {
    margin-bottom: 20px;
}

.sidebar-left .card {
    background-color: #2b2b2b;
    color: #c0c0c0;
    border-radius: 6px;
    padding: 20px;
}

.sidebar-left .card .card-header {
    border-bottom: none;
}

.sidebar-left .card .card-header h3,
.sidebar-left .card .card-header .module-title {
    color: var(--em-accent);
    font-size: 16px;
}

.sidebar-left .card .card-body {
    color: #c0c0c0;
    font-size: 22px;
}

/* ---------- Module Card Style ---------- */
.card {
    border: none;
    margin-bottom: 20px;
}

.card .card-header {
    background: transparent;
    border-bottom: 2px solid var(--em-accent);
    padding: 10px 0;
}

.card .card-header h3,
.card .card-header .module-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--em-heading);
}

.card .card-body {
    padding: 15px 0;
}

/* ---------- Joomla Component Styles ---------- */
.item-page .page-header h2,
.blog .page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--em-accent);
}

.readmore {
    margin-top: 15px;
}

.readmore a {
    display: inline-block;
}

/* Pagination */
.pagination {
    margin: 30px 0;
    justify-content: center;
}

.pagination .page-link {
    font-size: 16px;
    font-weight: 500;
    border: none;
    padding: 8px 12px;
    color: var(--em-accent);
    background: transparent;
}

.pagination .page-item.active .page-link {
    background-color: var(--em-accent);
    color: #fff;
    border-radius: 4px;
}

.pagination .page-link:hover {
    background-color: var(--em-bg-light);
    color: var(--em-link-hover);
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--em-footer-bg);
    color: var(--em-footer-text);
    border-top: 3px solid var(--em-accent);
}

.footer-top {
    padding: 50px 0 40px;
}

.footer-top h3,
.footer-top h4,
.footer-top .module-title {
    color: var(--em-heading);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-top a {
    color: var(--em-footer-text);
}

.footer-top a:hover {
    color: var(--em-accent);
    text-decoration: none;
}

.footer-top p {
    font-size: 13px;
    line-height: 1.8;
}

.footer-top ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-top ul li {
    margin-bottom: 8px;
}

.footer-top ul li a {
    font-size: 13px;
}

.footer-top img {
    max-width: 200px;
}

.footer-bottom {
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    text-align: center;
}

.footer-bottom a {
    color: var(--em-accent);
}

/* ---------- Joomla System Messages ---------- */
#system-message-container {
    margin-bottom: 20px;
}

.alert {
    border-radius: 4px;
    padding: 12px 20px;
}

/* ---------- Module Styles (for jdoc style="card") ---------- */
.mod-wrapper {
    margin-bottom: 20px;
}

/* ---------- Frontend editing (logged in editors) ---------- */
/* Joomla renders edit buttons with a tooltip that must stay hidden until hover */
[role="tooltip"]:not(.show) {
    display: none;
    z-index: 1070;
    max-width: 100%;
    margin: 0.5em;
    padding: 0.5em;
    color: #000;
    text-align: start;
    background: #fff;
    border: 1px solid #6d757e;
    border-radius: 0.25rem;
    box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.8);
    font-size: 13px;
    font-weight: 400;
    right: 5em;
}

[role="tooltip"]:not(.show)[id^="editarticle-"],
[role="tooltip"]:not(.show)[id^="editcontact-"] {
    margin-inline-start: -10em;
    right: auto;
}

:focus + [role="tooltip"],
:hover + [role="tooltip"] {
    display: block;
    position: absolute;
}

.jmoddiv {
    position: relative;
}

.btn.jmodedit {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    z-index: 900;
    padding: 2px 8px;
    color: var(--em-accent);
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid #58595a;
    border-radius: 0.25rem;
}

/* ---------- Emergency contact block (article content) ---------- */
.em-emergency {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 960px;
    margin: 10px auto 40px;
}

@media (min-width: 992px) {
    .em-emergency {
        grid-template-columns: 5fr 6fr;
        gap: 40px;
        align-items: start;
    }
}

.em-emergency__lead {
    margin: 0;
    padding: 24px 28px;
    font-size: 26px;
    line-height: 1.35;
    font-weight: 400;
    color: #fff;
    background-color: var(--em-accent);
    border-radius: 6px;
}

.em-emergency__lead strong {
    font-weight: 800;
}

.em-emergency__list {
    list-style: none;
    counter-reset: em-call;
    margin: 0;
    padding: 0;
}

.em-emergency__list li {
    counter-increment: em-call;
    position: relative;
    padding: 16px 20px 16px 72px;
    margin-bottom: 14px;
    background-color: var(--em-bg-light);
    border: 1px solid var(--em-border);
    border-radius: 6px;
}

.em-emergency__list li::before {
    content: counter(em-call);
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    background-color: var(--em-accent);
    border-radius: 50%;
}

.em-emergency__phone {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--em-heading);
    letter-spacing: 0.5px;
}

.em-emergency__phone:hover,
.em-emergency__phone:focus {
    color: var(--em-accent);
    text-decoration: none;
}

.em-emergency__name {
    display: block;
    margin-top: 2px;
    font-size: 17px;
    color: var(--em-text-light);
}

@media (max-width: 767.98px) {
    .em-emergency__lead {
        font-size: 20px;
        padding: 18px 20px;
    }

    .em-emergency__phone {
        font-size: 23px;
    }

    .em-emergency__list li {
        padding-left: 64px;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .header-brand {
        padding: 10px 0;
    }

    .main-content-section {
        padding: 20px 0 40px;
    }

    .sidebar {
        padding-bottom: 30px;
        margin-top: 30px;
    }

    .footer-top {
        padding: 30px 0;
    }

    .footer-top .col-12 {
        margin-bottom: 20px;
    }
}

@media (max-width: 767.98px) {
    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }

    body {
        font-size: 13px;
    }

    .main-navigation ul li a {
        padding: 10px 12px;
        font-size: 13px;
    }


    .footer-top .row > div {
        margin-bottom: 25px;
    }

    /* Footer module is a three column table; stack it on small screens */
    .footer-bottom table,
    .footer-bottom tbody,
    .footer-bottom tr,
    .footer-bottom td {
        display: block;
        width: 100% !important;
    }

    .footer-bottom td {
        padding: 8px 0;
    }

    .footer-bottom td,
    .footer-bottom td div {
        text-align: center !important;
    }

    .footer-bottom img {
        height: auto !important;
        max-width: 200px;
    }
}

/* ---------- Print ---------- */
@media print {
    .site-header,
    .topbar,
    .site-footer,
    .sidebar,
    .breadcrumbs-section,
    .promo-section {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
